@@ -54,25 +54,17 @@ LIBC_INLINE void sincospif16_eval(float xf, float &sin_k, float &cos_k,
5454 sin_k = SIN_K_PI_OVER_32[k & 63 ];
5555 cos_k = SIN_K_PI_OVER_32[(k + 16 ) & 63 ];
5656
57- // Recall;
58- // sin(x * pi/32) = sin((k + y) * pi/32)
59- // = sin(y * pi/32) * cos(k * pi/32) +
60- // cos(y * pi/32) * sin(k * pi/32)
6157 // Recall, after range reduction, -0.5 <= y <= 0.5. For very small values of
6258 // y, calculating sin(y * p/32) can be inaccurate. Generating a polynomial for
6359 // sin(y * p/32)/y instead significantly reduces the relative errors.
6460 float ysq = y * y;
6561
6662 // Degree-6 minimax even polynomial for sin(y*pi/32)/y generated by Sollya
67- // with: > Q = fpminimax(sin(y*pi/32)/y, [|0, 2, 4, 6|], [|SG...|], [0, 0.5]);
63+ // with:
64+ // > Q = fpminimax(sin(y * pi/32)/y, [|0, 2, 4, 6|], [|SG...|], [0, 0.5]);
6865 sin_y = y * fputil::polyeval (ysq, 0x1 .921fb6p-4f , -0x1 .4aeabcp-13f ,
6966 0x1 .a03354p -21f , -0x1 .ad02d2p -20f );
7067
71- // Note that cosm1_y = cos(y*pi/32) - 1 = cos_y - 1
72- // Derivation:
73- // sin(x * pi) = sin((k + y) * pi/32)
74- // = sin_y * cos_k + cos_y * sin_k
75- // = cos_k * sin_y + sin_k * (1 + cos_y - 1)
7668 // Degree-6 minimax even polynomial for cos(y*pi/32) generated by Sollya with:
7769 // > P = fpminimax(cos(y * pi/32), [|0, 2, 4, 6|],[|1, SG...|], [0, 0.5]);
7870 cosm1_y = ysq * fputil::polyeval (ysq, -0x1 .3bd3ccp-8f , 0x1 .03a61ap-18f ,
0 commit comments