You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2011/01/14 23:44:45 UTC

[jira] Created: (MATH-478) FastMath is not an exact replacement for StrictMath

FastMath is not an exact replacement for StrictMath
---------------------------------------------------

                 Key: MATH-478
                 URL: https://issues.apache.org/jira/browse/MATH-478
             Project: Commons Math
          Issue Type: Improvement
            Reporter: Sebb


FastMath Javadoc says:

"Faster, more accurate, portable alternative to StrictMath."

However, it does not implement the following StrictMath methods:

hypot(double, double)
IEEEremainder(double, double)

Nor the following, though it probably should:
signum(float)
ulp(float)

FastMath implements the following additional methods:

acosh(double)
asinh(double)
atanh(double)
nextAfter(double, double)
nextUp(double)

I think this should be documented.

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


[jira] Commented: (MATH-478) FastMath is not an exact replacement for StrictMath

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984918#action_12984918 ] 

Sebb commented on MATH-478:
---------------------------

Java 1.6 introduces the following to StrictMath

double java.lang.StrictMath.scalb(double,int)
float java.lang.StrictMath.scalb(float,int)
int java.lang.StrictMath.getExponent(float)
int java.lang.StrictMath.getExponent(double)
double java.lang.StrictMath.copySign(double,double)
float java.lang.StrictMath.copySign(float,float)

Also
float java.lang.StrictMath.nextAfter(float,double)
which seems to have been introduced instead of one taking two float parameters.
Given that the widening the direction does not really affect the behaviour, we should probably change to the same signature.



> FastMath is not an exact replacement for StrictMath
> ---------------------------------------------------
>
>                 Key: MATH-478
>                 URL: https://issues.apache.org/jira/browse/MATH-478
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Sebb
>
> FastMath Javadoc says:
> "Faster, more accurate, portable alternative to StrictMath."
> However, it does not implement the following StrictMath methods:
> hypot(double, double)
> IEEEremainder(double, double)
> Nor the following, though it probably should:
> signum(float)
> ulp(float)
> FastMath implements the following additional methods:
> acosh(double)
> asinh(double)
> atanh(double)
> nextAfter(double, double)
> nextUp(double)
> I think this should be documented.

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


[jira] Commented: (MATH-478) FastMath is not an exact replacement for StrictMath

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984923#action_12984923 ] 

Luc Maisonobe commented on MATH-478:
------------------------------------

OK, I'll fix the nextAfter(float, double) signature and I'll take care of implementing the missing functions.

I will also try to set up a proper implementation for hypot.

> FastMath is not an exact replacement for StrictMath
> ---------------------------------------------------
>
>                 Key: MATH-478
>                 URL: https://issues.apache.org/jira/browse/MATH-478
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Sebb
>
> FastMath Javadoc says:
> "Faster, more accurate, portable alternative to StrictMath."
> However, it does not implement the following StrictMath methods:
> hypot(double, double)
> IEEEremainder(double, double)
> Nor the following, though it probably should:
> signum(float)
> ulp(float)
> FastMath implements the following additional methods:
> acosh(double)
> asinh(double)
> atanh(double)
> nextAfter(double, double)
> nextUp(double)
> I think this should be documented.

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


[jira] Commented: (MATH-478) FastMath is not an exact replacement for StrictMath

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983852#action_12983852 ] 

Sebb commented on MATH-478:
---------------------------

ulp(float) added as part of MATH-478

> FastMath is not an exact replacement for StrictMath
> ---------------------------------------------------
>
>                 Key: MATH-478
>                 URL: https://issues.apache.org/jira/browse/MATH-478
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Sebb
>
> FastMath Javadoc says:
> "Faster, more accurate, portable alternative to StrictMath."
> However, it does not implement the following StrictMath methods:
> hypot(double, double)
> IEEEremainder(double, double)
> Nor the following, though it probably should:
> signum(float)
> ulp(float)
> FastMath implements the following additional methods:
> acosh(double)
> asinh(double)
> atanh(double)
> nextAfter(double, double)
> nextUp(double)
> I think this should be documented.

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


[jira] Commented: (MATH-478) FastMath is not an exact replacement for StrictMath

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984440#action_12984440 ] 

Luc Maisonobe commented on MATH-478:
------------------------------------

The nextAfter(double, double) and nextUp(double) methods were added for consistency with StrictMath on Java 1.6. Despite we do target 1.5, some users may depend on these 1.6 methods so we provided them too.

The hyperbolic functions were added ... because I needed them. In fact, people have asked them to be added in Java since years.

When we run the automated test you have added for mapping StrictMath vs. FastMath in a java 1.6 environment, the test also identifies nextAfter(float, float) and nextUp(float) as missing. I have added them. I have also fixed the wrong behaviour of nextAfter(Double.NEGATIVE_INFINITY, 0) which was wrong.

I agree ALL StrictMathMethods should be available.

> FastMath is not an exact replacement for StrictMath
> ---------------------------------------------------
>
>                 Key: MATH-478
>                 URL: https://issues.apache.org/jira/browse/MATH-478
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Sebb
>
> FastMath Javadoc says:
> "Faster, more accurate, portable alternative to StrictMath."
> However, it does not implement the following StrictMath methods:
> hypot(double, double)
> IEEEremainder(double, double)
> Nor the following, though it probably should:
> signum(float)
> ulp(float)
> FastMath implements the following additional methods:
> acosh(double)
> asinh(double)
> atanh(double)
> nextAfter(double, double)
> nextUp(double)
> I think this should be documented.

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


[jira] [Closed] (MATH-478) FastMath is not an exact replacement for StrictMath

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luc Maisonobe closed MATH-478.
------------------------------


Closing issue as it was included in version 2.2, which has been released

> FastMath is not an exact replacement for StrictMath
> ---------------------------------------------------
>
>                 Key: MATH-478
>                 URL: https://issues.apache.org/jira/browse/MATH-478
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 2.2, 3.0
>            Reporter: Sebb
>             Fix For: 2.2, 3.0
>
>
> FastMath Javadoc says:
> "Faster, more accurate, portable alternative to StrictMath."
> However, it does not implement the following StrictMath methods:
> hypot(double, double)
> IEEEremainder(double, double)
> Nor the following, though it probably should:
> signum(float)
> ulp(float)
> FastMath implements the following additional methods:
> acosh(double)
> asinh(double)
> atanh(double)
> nextAfter(double, double)
> nextUp(double)
> I think this should be documented.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (MATH-478) FastMath is not an exact replacement for StrictMath

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985293#action_12985293 ] 

Luc Maisonobe commented on MATH-478:
------------------------------------

nextAfter part fixed in subversion repository as of r1062385 for branch 2.X and as of r1062387 for trunk


> FastMath is not an exact replacement for StrictMath
> ---------------------------------------------------
>
>                 Key: MATH-478
>                 URL: https://issues.apache.org/jira/browse/MATH-478
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Sebb
>
> FastMath Javadoc says:
> "Faster, more accurate, portable alternative to StrictMath."
> However, it does not implement the following StrictMath methods:
> hypot(double, double)
> IEEEremainder(double, double)
> Nor the following, though it probably should:
> signum(float)
> ulp(float)
> FastMath implements the following additional methods:
> acosh(double)
> asinh(double)
> atanh(double)
> nextAfter(double, double)
> nextUp(double)
> I think this should be documented.

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


[jira] Updated: (MATH-478) FastMath is not an exact replacement for StrictMath

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated MATH-478:
----------------------

    Affects Version/s: 3.0
                       2.2
        Fix Version/s: 3.0
                       2.2

> FastMath is not an exact replacement for StrictMath
> ---------------------------------------------------
>
>                 Key: MATH-478
>                 URL: https://issues.apache.org/jira/browse/MATH-478
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 2.2, 3.0
>            Reporter: Sebb
>             Fix For: 2.2, 3.0
>
>
> FastMath Javadoc says:
> "Faster, more accurate, portable alternative to StrictMath."
> However, it does not implement the following StrictMath methods:
> hypot(double, double)
> IEEEremainder(double, double)
> Nor the following, though it probably should:
> signum(float)
> ulp(float)
> FastMath implements the following additional methods:
> acosh(double)
> asinh(double)
> atanh(double)
> nextAfter(double, double)
> nextUp(double)
> I think this should be documented.

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


[jira] Resolved: (MATH-478) FastMath is not an exact replacement for StrictMath

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved MATH-478.
-----------------------

    Resolution: Fixed

All now implemented (or delegated)

> FastMath is not an exact replacement for StrictMath
> ---------------------------------------------------
>
>                 Key: MATH-478
>                 URL: https://issues.apache.org/jira/browse/MATH-478
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 2.2, 3.0
>            Reporter: Sebb
>             Fix For: 2.2, 3.0
>
>
> FastMath Javadoc says:
> "Faster, more accurate, portable alternative to StrictMath."
> However, it does not implement the following StrictMath methods:
> hypot(double, double)
> IEEEremainder(double, double)
> Nor the following, though it probably should:
> signum(float)
> ulp(float)
> FastMath implements the following additional methods:
> acosh(double)
> asinh(double)
> atanh(double)
> nextAfter(double, double)
> nextUp(double)
> I think this should be documented.

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


[jira] Commented: (MATH-478) FastMath is not an exact replacement for StrictMath

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985445#action_12985445 ] 

Luc Maisonobe commented on MATH-478:
------------------------------------

hypot part fixed in subversion repository as of r1062558 for branch 2.X and as of r1062559 for trunk


> FastMath is not an exact replacement for StrictMath
> ---------------------------------------------------
>
>                 Key: MATH-478
>                 URL: https://issues.apache.org/jira/browse/MATH-478
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Sebb
>
> FastMath Javadoc says:
> "Faster, more accurate, portable alternative to StrictMath."
> However, it does not implement the following StrictMath methods:
> hypot(double, double)
> IEEEremainder(double, double)
> Nor the following, though it probably should:
> signum(float)
> ulp(float)
> FastMath implements the following additional methods:
> acosh(double)
> asinh(double)
> atanh(double)
> nextAfter(double, double)
> nextUp(double)
> I think this should be documented.

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