commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-901) FastMath.sin is slow
Date Tue, 20 Nov 2012 13:54:58 GMT

    [ https://issues.apache.org/jira/browse/MATH-901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501191#comment-13501191
] 

Gilles commented on MATH-901:
-----------------------------

{quote}
commons-math:
[...]
* no big tables (it seems)
{quote}

Tables are used by "FastMath" ("FastMathLiteralArrays").

bq. 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).

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)...

{quote}
Meanwhile, there are a few methods from JODK's FastMath
that might fulfill commons-math requirements, and be faster, [...]
{quote}

That would be really nice.
Could you provide a patch?

bq.  several methods are noticeably slower, like log/log10/log1p/atan/atan2

Yes, that was already noticed (MATH-740).

bq. for some values all hell breaks loose:

We should definitely track these bugs in their own tickets. Thanks!

                
> FastMath.sin is slow
> --------------------
>
>                 Key: MATH-901
>                 URL: https://issues.apache.org/jira/browse/MATH-901
>             Project: Commons Math
>          Issue Type: Sub-task
>    Affects Versions: 3.0
>         Environment: Mac OS 10.8.2, Java 7
>            Reporter: Konstantin Berlin
>         Attachments: SineTest.java
>
>
> 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 http://www.oliford.co.uk/phys/code/AlgorithmRepository/src/jafama/.
> 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: http://www.atlassian.com/software/jira

Mime
View raw message