Skip to content

Erroneous results in trigonometric functions for > double-precision values

For large inputs, sin, cos and tan return the input value:

GHCi, version 6.8.1: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> sin 1e20
1.0e20
Prelude> cos 1e20
1.0e20
Prelude> cos 1e19
1.0e19
Prelude> cos 1e18
0.11965025504785125
Prelude> tan 1e19
1.0e19
Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information