In code below, why is Pi divided in three constants P1, P2 and P3? Is there 
some related math theory? If it is for improve the compute accuracy for r, I 
run the code on higher precision but without any improve than just Pi.(The code 
from gsl/specfunc/trig.c:576)

  const double P1 = 4 * 7.85398125648498535156e-01;
  const double P2 = 4 * 3.77489470793079817668e-08;
  const double P3 = 4 * 2.69515142907905952645e-15;
  const double TwoPi = 2*(P1 + P2 + P3);

  const double y = 2*floor(theta/TwoPi);

  double r = ((theta - y*P1) - y*P2) - y*P3;

Reply via email to