commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Hain (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-901) FastMath.sin is slow
Date Wed, 21 Nov 2012 19:01:59 GMT

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

Jeff Hain commented on MATH-901:
--------------------------------

>Do you have something in mind where this assumption breaks?

I just said that because I'm picky :)

I agree that if it has the same spec than Math,
i.e. allows for some slight variations on the result,
the replacement should be safe.

But I wouldn't speak about safety, I would just say that
it has similar (or better) accuracy, which would warn
the user that the result might be different.
You never know what false assumptions people do when
they build software, and some people might have
used Math, and now use FastMath, in place where they
should rather have used StrictMath (for example if
needing result consistency across versions of their
software, to allow for comparisons with past results,
or if they use doubles as keys, etc.).

-Jeff

                
> 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