![]() |
![]() |
Collaboration diagram for DSPF_sp_vecrecip:
![]() |
void | DSPF_sp_vecrecip (const float *x, float *restrict y, const int nx) |
void DSPF_sp_vecrecip | ( | const float * | x, | |
float *restrict | y, | |||
const int | nx | |||
) |
The sp_vecrecip module calculates the reciprocal of each element in the array x and returns the output in array r. It uses 2 iterations of the Newton-Raphson method to improve the accuracy of the output generated by the RCPSP instruction generated by RCPSP is 8 bits. So after the first iteration it is 16 bits and after the second it is the full 23 bits. The formula used is:
r[n+1] = r[n](2 - v*r[n])
where v = the number whose reciprocal is to be found.
x[0], the seed value for the algorithm, is given by RCPSP.
x | Pointer to input array. | |
y | Pointer to output array. | |
nx | Number of elements in arrays. |