float sinx(float x)
{
static const float a[] = {-.1666666664,.0083333315,-.0001984090,.0000027526,-.0000000239};
float xsq = x*x;
float temp = x*(1 + a[0]*xsq + a[1]*xsq*xsq + a[2]* xsq*xsq*xsq+a[3]*xsq*xsq*xsq*xsq+ a[4]*xsq*xsq*xsq*xsq*xsq);
return temp;
}
How are those constants calculated? How to calculate cos and tan using this method?
Can I extend this to get more precision? I guess I need to add more constants?

Plot of the error of the “fast” sine described above against a Taylor polynomial of equal degree.
They are
-1/6,1/120,-1/5040.. and so on.Or rather:
-1/3!,1/5!,-1/7!,1/9!… etcLook at the taylor series for sin x in here:
It has cos x right below it:
For cos x, as seen from the picture above, the constants are
-1/2!, 1/4!, -1/6!, 1/8!…tan x is slightly different:
So to adjust this for cosx: