Re:Why doesn't GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)? ...
by mark-r on Thursday March 27, 2014 @09:17AM
(#7480151)
I've always thought it would be helpful to have floating point values that tracked the upper and lower bounds of the possible error. That would make analysis of the results much easier.
[ Parent
| on HN ]
Re:Why doesn't GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)? ...
by jordigh on Thursday March 27, 2014 @09:23AM
(#7480186)
That exists and is called interval arithmetic:
Re:Why doesn't GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)? ...
by wbl on Thursday March 27, 2014 @09:23AM
(#7480188)
That's called ball arithmetic, and there are many libraries for it, such as arb. http://fredrikj.net/arb/ It's useful in mathematical calculation, but usually with floating point calculations you have some error bounds coming from your algorithm which are "good enough" if the result is going to be the value of something with 5% tolerance.
Re:Why doesn't GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)? ...
by robzyb on Thursday March 27, 2014 @09:22AM
(#7480176)
But what about the accuracy of the error bounds?
Re:Why doesn't GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)? ...
by pascal_cuoq on Thursday March 27, 2014 @10:04AM
(#7480421)
It is easy to track the real result of the computation with floating-point intervals: round down when computing the lower bound, and up when computing the upper bound of each interval.