commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Hain (JIRA)" <>
Subject [jira] [Commented] (MATH-901) FastMath.sin is slow
Date Tue, 20 Nov 2012 19:20:58 GMT


Jeff Hain commented on MATH-901:

>>So it's normal you can't just replace one with another
>Ideally, that should be feasible; especially useful if
>the trade-off is large and some applications have different
>requirements (speed vs accuracy).

All depends on what you want FastMath to be.
Up to you.

>Someone should definitely put forward some real-life benchmarks
>(or application) that show significant speed differences, as we
>already had heated discussions for what I considered an utterly
>insignificant speed gain (a few milliseconds over an application's
>whole life)...

In practice you only see improvements for applications doing
intensive math computations.
The only "real-life" example I had was for a 3D GUI displaying
tens of thousands of mobile objects, geographically located,
using various kinds of Earth models (ellipsoids) and projections
(like transverse mercator), and with a screen update every 100ms.
That was like 300000 objects drawings per second, each involving
multiple trigonometric computations, let say 10, so 3 millions
trigonometric computations per second (and no parallelization,
even though the problem is embarrassingly parallel).
===> With FastMath it was smoother.

>>Meanwhile, there are a few methods from JODK's FastMath
>>that might fulfill commons-math requirements, and be faster, [...]
>That would be really nice.
>Could you provide a patch?

I prefer let you or another usual contributor take care of that
(and all eventual related implications, choices, details, etc.).
I'm more or less busy on something and prefer not to start get
involved somewhere else, other than mails from time to time.


> FastMath.sin is slow
> --------------------
>                 Key: MATH-901
>                 URL:
>             Project: Commons Math
>          Issue Type: Sub-task
>    Affects Versions: 3.0
>         Environment: Mac OS 10.8.2, Java 7
>            Reporter: Konstantin Berlin
>         Attachments:
> The FastMath.sin (maybe other functions too) are not nearly as fast as some other libraries
that can be found on the internet.
> The *much* faster code can be found here
> Max Absolute Error Apache vs JDK: 1.1102230246251565E-16
> Max Absolute Error Alternative vs JDK: 5.551115123125783E-16
> JDK Time: 0.698
> Apache Time: 0.491
> Alternative Time: 0.18
> I will add my test code as soon as I figure out how.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message