You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instance (Ord a, TrigField a, ExpField a) => ExpField (EuclideanPair a) where
...
log (EuclideanPair (x, y)) = EuclideanPair (log (sqrt (x * x + y * y)), atan2' y x)
where
atan2' y x
| ...
| (x P.<= zero P.&& y P.< zero) || (x P.< zero) =
negate (atan2' (negate y) x)
| ...
A clause before in atan2' is | x P.< one P.&& y P.> one = ..., it seems to have a typo - there should be zeros instead of ones. I have fixed that, but it still loops with log (EuclideanPair (-1, 0)), so there must be something more. There are many tricky cases, I'm not sure how to fix it properly.
The text was updated successfully, but these errors were encountered:
Sqrt enters infinite loop for some complex numbers, for example:
I have traced it to
log
fromEuclideanPair
here:A clause before in
atan2'
is| x P.< one P.&& y P.> one = ...
, it seems to have a typo - there should bezero
s instead ofone
s. I have fixed that, but it still loops withlog (EuclideanPair (-1, 0))
, so there must be something more. There are many tricky cases, I'm not sure how to fix it properly.The text was updated successfully, but these errors were encountered: