davjam / HaskellNumericsTestsFixes

Tests, fixes and illustrations for Haskell floating point (real & complex) functions. The intention is to integrate the fixes back into core Haskell.
0 stars 0 forks source link

exp (huge :+ 0) #5

Open davjam opened 3 years ago

davjam commented 3 years ago

is currently Infinity :+ NaN, hence not matching real function exp huge. Should it be Infinity :+ 0.

(and should exp (Inf :+ 0) be Infinity :+ NaN?)

The imag part is calculated as exp huge * sin 0.

Whether this is "correct" depends on whether 0 is really zero, or if it's underflow, and there's no way to tell.

The issue also impacts sin, cos, sinh, cosh.

Suggest leaving it as is for now, given the change is at least debatable.