on-internet
← Community

Did I beat Remez in sine approximation?

Stack Overflow ·

First, it is the most compact sine approximation ever. It seems I can do better than Remez in terms of precision/performance. Here the [0,pi/2] approximation range. double p[] = -0.0020836519336891552, -0.016434778826652056, -0.14814815034514656; double P1(double x, double a) { return x + (a * x) * (x * x); } //err Inf: 7.415237313068701e-9 double sine_approximate(double x) { return P1(P1(P1(x,p[0]),p[1]),p[2]); } And the same practical solution for float32 looks like: //maxErrULP=2.49524, maxErrInf=9.88345e-08 float p[] = -0.0020836557, -0.016434766, -0.14814815; Practical double64, // Error

Comments

Sign in or sign up to comment and upvote.

No comments yet.