Utilities for 'exact' floating point calculatation.
By 'exact' floating point operation, I mean a function that takes
double
(or float
)
inputs and returns a double
(or float
)
value,
where the value is what you would get if you could convert all
the double
inputs to true real numbers,
do the calculation in real arithmetic,
and then round the real value to double
at the end.
IEEE 754-1985 and java.lang.Math
guarantee this for
+
, -
, *
, /
,
and sqrt
(and Math.fma
).
IEEE 754-2008 recommends it for a collection of
elementary functions, in addition to the 5 basic operations.
java.lang.Math
only offers within 1 ulp
accuracy for those functions.)
Any non-trivial floating calculation will compose multiple basic operations, often returning a value far from the 'exact' ideal of 'real arithmetic rounded at the end'.
An easy, but expensive fix is to
Available from (TODO repository).
Maven:
<dependency>
<groupId>palisades-lakes</groupId>
<artifactId>xfp</artifactId>
<version>0.0.x</version>
</dependency>
YourKit is kindly supporting open source projects with its full-featured Java Profiler.
YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: