Skip to content

Instantly share code, notes, and snippets.

@rogarg
rogarg / vectorized-atan2f.cpp
Created August 18, 2021 02:38 — forked from bitonic/vectorized-atan2f.cpp
Vectorized & branchless atan2f
// Branchless, vectorized `atan2f`. Various functions of increasing
// performance are presented. The fastest version is 50~ faster than libc
// on batch workloads, outputing a result every ~2 clock cycles, compared to
// ~110 for libc. The functions all use the same `atan` approximation, and their
// max error is around ~1/10000 of a degree.
//
// They also do not handle inf / -inf
// and the origin as an input as they should -- in our case these are a sign
// that something is wrong anyway. Moreover, manual_2 does not handle NaN
// correctly (it drops them silently), and all the auto_ functions do not
@rogarg
rogarg / .gitignore
Created March 6, 2019 22:06 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #