5 ms·
> the pow and log methods they call run loops anyway. That's actually not true (as somebody mentioned on reddit) https://github.com/openjdk-mirror/jdk/blob/jdk
by Recursing 7y ago
> the pow and log methods they call run loops anyway.
That's actually not true (as somebody mentioned on reddit) https://github.com/openjdk-mirror/jdk/blob/jdk8u/jdk8u/master/src/share/native/java/lang/fdlibm/src/e_log.c https://github.com/openjdk-mirror/jdk/blob/jdk8u/jdk8u/maste...
It is probably slower anyway, but I was surprised to see no loops
- rand_r 7y agoThey kind of cheated because they used a hard-coded polynomial approximation of log(x). So there is an implicit unrolled loop going over A_i*x^i.