Félix
(replying to Saagar Jha)
@saagar this is kind of an unfortunate example because IEEE-754 guarantees sin(±0), sin(±inf), sin(NaN) and pretty much nothing else
2 replies
Saagar Jha
(replying to Félix)
Saagar Jha
(replying to Saagar Jha)
> If you tested maybe 4 or 5 digits of precision, ok. But all 15 / 17 digits? That is bound to fail, if not guaranteed to fail.
> IEEE-745 double precision binary floating point provides no more than 15 decimal significant digits of precision.
I Can't Believe It's Not Zero!
(replying to Félix)
@fay59 @saagar Right, but the actual answer here is "because different math libraries make different implementation choices," not "because floating-point is black fucking magic"
(Also IEEE 754 guarantees _nothing_ about sin, it only recommends)
1 replies
I Can't Believe It's Not Zero!
(replying to I Can't Believe It's Not Zero!)
@fay59 @saagar also, for anyone who does want to get the same answer everywhere: https://core-math.gitlabpages.inria.fr
Philip Trettner
(replying to I Can't Believe It's Not Zero!)
@steve @fay59 @saagar "these implementations were tested on x86_64-linux, with and without the use of fma (fused multiply add)." Ok I'm impressed.
I know this thread is about facing the unknown but I was bitten by fma one time too many. Last personal highlight was non-determinism because the same function was inlined in two different places leading to two different fma substitutions and thus different results.