Whisket icon

Fast atan Lookup

Whisket | PRO | 05/23/20 03:37:58 AM UTC | 0 ⭐ | 1969 👁️ | Never ⏰ | []
C |

290 B

|

None

|

0 👍

/

0 👎

/*
    Taken from here;
    https://stackoverflow.com/questions/42537957/fast-accurate-atan-arctan-approximation-algorithm
*/
#define A 0.0776509570923569
#define B -0.287434475393028
#define C (M_PI_4 - A - B)
 
double FastArcTan(double x) {
    double xx = x * x;
    return ((A*xx + B)*xx + C)*x;
}

Comments