Better HN
topnewbestaskshowjobs
Log inSign up

jvz01

7 karma · joined Aug 17, 2021 (5y ago) · 4 submissions

Submissions

comment 5y ago · link · parent

Another good hint is the classical half-angle formulas. You can often avoid calling sin() and cos() altogether!

comment 5y ago · link · parent

Little side-note: algorithm as given is scalar; however, its branch-free, and defined entirely in the header file. So, compilers will typically be able to vectorize it, and thus achieve speed up directly based on the vector size. I see potential [but architecture-dependent] optimization using Estrin scheme for evaluating the polynomial.

comment 5y ago · link · parent

Yes, aim was to be acurate down to 1 lsb while significantly faster. Feel free to drop terms from the polynomial if you can live with less accurate results!

The coefficients were generated by a package called Sollya, I've used it a few times to develop accurate chebyshev approximations for functions.

Abramowitz & Stegun is another good reference.

comment 5y ago · link · parent

I have developed very fast, accurate, and vectorizable atan() and atan2() implementations, leveraging AVX/SSE capabilities. You can find them here [warning: self-signed SSL-Cert].

https://fox-toolkit.org/wordpress/?p=219