If I add RealFloat, there will be runtime exceptions on most members of that class but atan2 would work. Another way would to make an Arctan2 typeclass with only an arctan2 function.
My current workaround is
atan2' :: Floating a => a -> a -> a
atan2' y x = 2 * atan (y / (sqrt(x*x + y*y + 1e-15) + x) )
If I add RealFloat, there will be runtime exceptions on most members of that class but
atan2
would work. Another way would to make anArctan2
typeclass with only anarctan2
function.My current workaround is