The Taylor expansion of the arcsine is usually given by $$ \arcsin(x) = x+ \frac{1}{6} x^3 + \frac{3}{40} x^5 + \frac{5}{112} x^7 + \ldots $$
This (https://github.com/simonbyrne/apple-libm/blob/master/Source/Intel/asin.c) implementation of the arcsine in libm
uses constants that are very close to the above but slightly different. I understand that they can use better constants given the fact they know what taylor expansion they will stop at and to reduce the error over the fixed range they are interested in. My question is how do they determine those constants? How could I duplicate it if I wanted to use a different taylor expansion or a taylor expansion of different order?