5 ms·
Great catch! I assumed the JIT would identify f32 arithmetic but I guess that isn't really valid numerically. I wonder if there's a way to use Math.fround[1]
by brrrrrm 5y ago
Great catch! I assumed the JIT would identify f32 arithmetic but I guess that isn't really valid numerically. I wonder if there's a way to use Math.fround[1] on your benchmark to get expected speedups?
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- olliej 5y agoYup, the spec requires computation to be as doubles and so any computation must be done that way as the end result is observable. I didn’t know about fround but I suspect its primary use case is for trying to catch floating point overflow during double arithmetic, because again precision difference is observable.