Print this page




 131                 y##N = (y##N - z##N * pio2_1) - z##N * pio2_t;          \
 132         }                                                               \
 133         z##N = y##N * y##N;                                             \
 134         if (n##N & 1) { /* compute cos y */                         \
 135                 f##N = (float)(one + z##N * (mhalf + z##N * (C0 +       \
 136                     z##N * (C1 + z##N * C2))));                         \
 137         } else { /* compute sin y */                                    \
 138                 f##N = (float)(y##N + y##N * z##N * (S0 + z##N * (S1 +  \
 139                     z##N * S2)));                                       \
 140         }                                                               \
 141         *y = (n##N & 2)? -f##N : f##N;                                      \
 142         y += stridey
 143 
 144 void
 145 __vcosf(int n, float *restrict x, int stridex, float *restrict y,
 146     int stridey)
 147 {
 148         double          y0, y1, y2, y3;
 149         double          z0, z1, z2, z3;
 150         float           f0, f1, f2, f3, t;
 151         int             n0, n1, n2, n3, hx, ix, medium;
 152 
 153         y -= stridey;
 154 
 155         for (;;) {
 156 begin:
 157                 y += stridey;
 158 
 159                 if (--n < 0)
 160                         break;
 161 
 162                 medium = 0;
 163                 PREPROCESS(0, 0, begin);
 164 
 165                 if (--n < 0)
 166                         goto process1;
 167 
 168                 PREPROCESS(1, stridey, process1);
 169 
 170                 if (--n < 0)
 171                         goto process2;




 131                 y##N = (y##N - z##N * pio2_1) - z##N * pio2_t;          \
 132         }                                                               \
 133         z##N = y##N * y##N;                                             \
 134         if (n##N & 1) { /* compute cos y */                         \
 135                 f##N = (float)(one + z##N * (mhalf + z##N * (C0 +       \
 136                     z##N * (C1 + z##N * C2))));                         \
 137         } else { /* compute sin y */                                    \
 138                 f##N = (float)(y##N + y##N * z##N * (S0 + z##N * (S1 +  \
 139                     z##N * S2)));                                       \
 140         }                                                               \
 141         *y = (n##N & 2)? -f##N : f##N;                                      \
 142         y += stridey
 143 
 144 void
 145 __vcosf(int n, float *restrict x, int stridex, float *restrict y,
 146     int stridey)
 147 {
 148         double          y0, y1, y2, y3;
 149         double          z0, z1, z2, z3;
 150         float           f0, f1, f2, f3, t;
 151         int             n0 = 0, n1 = 0, n2 = 0, n3, hx, ix, medium;
 152 
 153         y -= stridey;
 154 
 155         for (;;) {
 156 begin:
 157                 y += stridey;
 158 
 159                 if (--n < 0)
 160                         break;
 161 
 162                 medium = 0;
 163                 PREPROCESS(0, 0, begin);
 164 
 165                 if (--n < 0)
 166                         goto process1;
 167 
 168                 PREPROCESS(1, stridey, process1);
 169 
 170                 if (--n < 0)
 171                         goto process2;