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

Alex Herbert commented on MATH-1591:
------------------------------------

Most of these should be easy to implement and useful.

The FMA method requires extended precision computation. In JDK 9 this is done 
using BigDecimal when the FMA instruction is not available on the architecture. 
There are examples of doing this computation in C and Go with primitive double 
arithmetic (i.e. without using an unlimited precision library such as 
BigDecimal). Unfortunately they are not under the Apache licence and so if you 
look for them and copy/adapt the implementation they either cannot be included 
in CM, or would bring in licence requirements that currently the library is 
free from (see [licensing how 
to|https://infra.apache.org/licensing-howto.html]). So ideally it would be a 
new implementation. Do you propose to implement this using primitive double 
arithmetic; BigDecimal; or avoid the extended precision and do a standard 
precision computation?

A fast (relative to BigDecimal) extended precision version of FMA would be very 
useful to Java programmers using Java 8 with the intention of moving to Java 9+ 
with the FMA support.

 

> Add missing methods for FastMath to bring FastMath up to JDK9 level
> -------------------------------------------------------------------
>
>                 Key: MATH-1591
>                 URL: https://issues.apache.org/jira/browse/MATH-1591
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 4.0
>            Reporter: Erik Svensson
>            Priority: Major
>
> With JDK9, 6 new methods were added to java.lang.Math which do not exist in 
> FastMath, which means that FastMath is not a drop-in replacement for jlM. 
> I propose to add them 
> The new methods are : 
> fma 
> ([https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#fma(double,double,double)])
> multiplyFull 
> ([https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#multiplyFull(int,int)])
> multiplyHigh 
> ([https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#multiplyHigh(long,long)])
> negateExact 
> ([https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#negateExact(int)])
> toDegrees 
> ([https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#toDegrees(double)])
> toRadians 
> ([https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#toRadians(double)])
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to