Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-15 Thread Dmitry Nadezhin
I think that the final webrev http://cr.openjdk.java.net/~darcy/4851642.2/ is good. Thanks. On Fri, Apr 15, 2016 at 8:00 AM, joe darcy wrote: > Hi Dmitry, > > On 4/14/2016 7:43 PM, Dmitry Nadezhin wrote: > > Hi Joe, > > It looks good except a guard expression in the line Math:1550 > (tmp == 0.0

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-15 Thread Brian Burkhalter
Hi Joe, Dmitry, On Apr 14, 2016, at 10:00 PM, joe darcy wrote: > Thank you for the careful review. I second that. > Final webrev with minor adjustments at > > http://cr.openjdk.java.net/~darcy/4851642.2/ I think this looks good. Brian

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-14 Thread joe darcy
Hi Dmitry, On 4/14/2016 7:43 PM, Dmitry Nadezhin wrote: Hi Joe, It looks good except a guard expression in the line Math:1550 (tmp == 0.0 && a == 0.0 || b == 0.0) Variables a and b occur asymmetrically in this expression. A symmetrical expression would be either (a == 0.0 || b == 0.0) or (produ

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-14 Thread Dmitry Nadezhin
Hi Joe, It looks good except a guard expression in the line Math:1550 (tmp == 0.0 && a == 0.0 || b == 0.0) Variables a and b occur asymmetrically in this expression. A symmetrical expression would be either (a == 0.0 || b == 0.0) or (product.signum() == 0) On Fri, Apr 15, 2016 at 3:14 AM, joe dar

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-14 Thread Joseph D. Darcy
Hi Brian, On 4/14/2016 5:55 PM, Brian Burkhalter wrote: Hi Joe, This all looks good aside from the “@code fusedMac” in the javadoc of which I believe you are aware. Doh! s/fusedMac/fma in my working copy. Thanks for the review, -Joe

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-14 Thread Brian Burkhalter
Hi Joe, This all looks good aside from the “@code fusedMac” in the javadoc of which I believe you are aware. Brian On Apr 14, 2016, at 5:14 PM, joe darcy wrote: > In response to the review comments from Dmitry and Brian, I've prepared > another iteration of the webrev: > >http://cr.open

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-14 Thread joe darcy
Hello, In response to the review comments from Dmitry and Brian, I've prepared another iteration of the webrev: http://cr.openjdk.java.net/~darcy/4851642.1/ Summary of the changes: * Renamed the method to "fma" to follow the precedent of the C library. * Added API note citing IEEE 754 op

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-13 Thread Brian Burkhalter
Hi Joe, On Apr 13, 2016, at 3:02 PM, Joseph D. Darcy wrote: > On 4/13/2016 12:43 PM, Brian Burkhalter wrote: >> >> A couple of points of curiosity. Firstly, is this not “fused multiply-add” >> rather than “fused multiply-accumulate?” Secondly, why the choice of name >> “fusedMac()” instead of

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-13 Thread Joseph D. Darcy
Hi Brian and Dmitry, On 4/13/2016 12:43 PM, Brian Burkhalter wrote: Joe / Dmitry, On Apr 12, 2016, at 5:21 PM, joe darcy > wrote: Please review the changes for JDK-4851642: Add fused mac to Java math library http://cr.openjdk.java.net/~darcy/4851642.0/

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-13 Thread Brian Burkhalter
Joe / Dmitry, On Apr 12, 2016, at 5:21 PM, joe darcy wrote: > Please review the changes for > >JDK-4851642: Add fused mac to Java math library >http://cr.openjdk.java.net/~darcy/4851642.0/ > > Fused mac (multiply-accumulate) is a ternary floating-point operation which > accepts three

Re: JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-13 Thread Dmitry Nadezhin
Joe, Here are my comments. 1) Probably in lines StrictMath:1171, StrictMath:1220, Math:1487, Math:1593 you meant {@code -0.0 * +0.0} {@code -0.0f * +0.0f} 2) Lines Math:1508-1525 could be simpler: double result = a * b + c; return Double.isNaN(result) && Double.isFinite(a) && Doub

JDK 9 RFR of JDK-4851642: Add fused mac to Java math library

2016-04-12 Thread joe darcy
Hello, Please review the changes for JDK-4851642: Add fused mac to Java math library http://cr.openjdk.java.net/~darcy/4851642.0/ Fused mac (multiply-accumulate) is a ternary floating-point operation which accepts three inputs, a, b, c, and computes a * b + c with a single round