See e_asin.c:
https://github.com/openjdk/jdk/blob/1abf971b93222f422c0026cee944a6db214f955a/src/java.base/share/native/libfdlibm/e_asin.c#L100-L105
if(ix<0x3e400000) { /* if |x| < 2**-27 */
if(huge+x>one) return x;/* return x with inexact if x!=0*/
} else
t = x*x;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
w = p/q;
return x+x*w;
Note that "else" branch only covers "t = x*x". So, if we pass `ix<0x3e400000` and fail `huge+x>one`, we fall through to `p = ...` and probably return `x`, since `t` is still `0`, then p is `0`, then w is `0`, then `x + x*w` is `x`.
I am not sure if this leads to a calculation/precision bug or not. It is probably okay since we are dealing with very small `x` and `asin(0)` is `0`.
We would have noticed it earlier if we did not ignore -Wmisleading-indentation:JDK-8294456.
https://github.com/openjdk/jdk/blob/1abf971b93222f422c0026cee944a6db214f955a/src/java.base/share/native/libfdlibm/e_asin.c#L100-L105
if(ix<0x3e400000) { /* if |x| < 2**-27 */
if(huge+x>one) return x;/* return x with inexact if x!=0*/
} else
t = x*x;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
w = p/q;
return x+x*w;
Note that "else" branch only covers "t = x*x". So, if we pass `ix<0x3e400000` and fail `huge+x>one`, we fall through to `p = ...` and probably return `x`, since `t` is still `0`, then p is `0`, then w is `0`, then `x + x*w` is `x`.
I am not sure if this leads to a calculation/precision bug or not. It is probably okay since we are dealing with very small `x` and `asin(0)` is `0`.
We would have noticed it earlier if we did not ignore -Wmisleading-indentation:
- blocks
-
JDK-8294456 Fix misleading-indentation warnings in core JDK libraries
- Resolved