commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <>
Subject [jira] Commented: (MATH-375) Elementary functions in JDK are slower than necessary and not as accurate as they could be.
Date Fri, 27 Aug 2010 23:57:55 GMT


Luc Maisonobe commented on MATH-375:

We finally get the grant, thanks.
I have started integrating the patch in our current code base (not committed yet).
I added all missing functions with default implementations (either simple delegates to java.util.Math
or basic implementations).
The code has also been edited to comply to our standard code style (indentation, braces, trailing
spaces, variables naming, this kind of stuff).

Concerning the unit tests, I cannot commit them due to the external libraries and their license.
I will start a discussion on the dev list about it.
Using the existing tests with all their dependencies on my machine, I had to slightly increase
the threshold from 0.502 ULP to 0.504 ULP as the initial value lead to random failures. The
tests were done on a 64 bits linux computer with Java 6. Are suche random failure expected

> Elementary functions in JDK are slower than necessary and not as accurate as they could
> -------------------------------------------------------------------------------------------
>                 Key: MATH-375
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: JDK 1.4 - 1.6
>            Reporter: William Rossi
>             Fix For: 2.2
>         Attachments: atanpatch.txt.gz, FastMath.tar.gz
> I would like to contribute improved versions on exp(), log(), pow(), etc.  to the project.
 Please refer to this discussion thread
> I have developed over the past year a set of elementary functions similar to those in
java.lang.Math, but with the following characteristics:
> * Higher performance.
> * Better accuracy.  Results are accurate to slightly more that +/- 0.5 ULP.
> * Pure Java.  The standard Math class is impleneted via JNI, and thus takes a performance
> Note that some functions such as exp are nearly twice as fast in my implementation.  
I've seen it 3 times faster on different processors.   The preformance varies by the relative
speed of calculation vs memory lookups.
> The functions are implemented as tables of values in extra precision (approx 70 bits),
and then interpolated with a minimax polynomial.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message