Even faster asin() was staring right at me
1–10 of 68 posts
Re: Even faster asin() was staring right at me
#2Re: Even faster asin() was staring right at me
#3I think it is `atan` function. Sin is almost a lookup query.
Re: Even faster asin() was staring right at me
#4Re: Even faster asin() was staring right at me
#5I think it is `atan` function. Sin is almost a lookup query.
On modern machines, looking things up can be slower than recomputing it, when the computation is simple. This is because the memory is much slower than the CPU, which means you can often compute something many times over before the answer from memory arrives.
Sin/cos must be borders of sqrt(x²+y²). It is also cached indeed.
Re: Even faster asin() was staring right at me
#6Re: Even faster asin() was staring right at me
#7Earlier quoted context omitted.
On modern machines, looking things up can be slower than recomputing it, when the computation is simple. This is because the memory is much slower than the CPU, which means you can often compute something many times over before the answer from memory arrives.
It may be, especially when it comes to unnecessary cache. But I think `atan` is almost a brute force. Lookup is nothing comparing to that. Sin/cos must be borders of sqrt(x²+y²). It is also cached indeed.
Re: Even faster asin() was staring right at me
#8Earlier quoted context omitted.
It may be, especially when it comes to unnecessary cache. But I think `atan` is almost a brute force. Lookup is nothing comparing to that. Sin/cos must be borders of sqrt(x²+y²). It is also cached indeed.
atan(x) = asin(x / sqrt(1+x*x))
It looks like there is a reasonable explanation when it is written math form but there is no.
Re: Even faster asin() was staring right at me
#9This is a followup of a different post from the same domain. 5 days ago, 134 comments https://news.ycombinator.com/item?id=47336111
Re: Even faster asin() was staring right at me
#10Did you try polynomial preprocessing methods, like Knuth's and Estrin's methods? https://en.wikipedia.org/wiki/Polynomial_evaluation#Evaluati... they let you compute polynomials with half the multiplications of Horner's method, and I used them in the past to improve the speed of the exponential function in Boost.