4 ms·
And the pow and log methods they call run loops anyway. What is wrong with loops anyway?
by Ragib_Zaman 7y ago
And the pow and log methods they call run loops anyway. What is wrong with loops anyway?
- JacksCracked 7y agoEven more worrisome is that the OP came up with a clever way to solve the problem but didn't bother to leave a comment on the code explaining how it works. As a result, everyone that copied the code, did so without any comments as well.
- 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.