32 #ifdef POK_NEEDS_LIBMATH
34 #include "math_private.h"
39 invsqrtpi= 5.6418961287e-01,
41 two = 2.0000000000e+00,
42 one = 1.0000000000e+00;
44 static const float zero = 0.0000000000e+00;
47 __ieee754_jnf(
int n,
float x)
59 if(ix>0x7f800000)
return x+x;
65 if(n==0)
return(__ieee754_j0f(x));
66 if(n==1)
return(__ieee754_j1f(x));
69 if(ix==0||ix>=0x7f800000)
71 else if((
float)n<=x) {
77 b = b*((float)(i+i)/x) - a;
88 temp = x*(float)0.5; b = temp;
89 for (a=one,i=2;i<=n;i++) {
126 float q0,q1,h,tmp; int32_t k,m;
127 w = (n+n)/(
float)x; h = (float)2.0/(
float)x;
128 q0 = w; z = w+h; q1 = w*z - (float)1.0; k=1;
129 while(q1<(
float)1.0e9) {
136 for(t=zero, i = 2*(n+k); i>=m; i -= 2) t = one/(i/x-t);
149 tmp = tmp*__ieee754_logf(fabsf(v*tmp));
150 if(tmp<(
float)8.8721679688e+01) {
151 for(i=n-1,di=(
float)(i+i);i>0;i--){
159 for(i=n-1,di=(
float)(i+i);i>0;i--){
173 b = (t*__ieee754_j0f(x)/b);
176 if(sgn==1)
return -b;
else return b;
180 __ieee754_ynf(
int n,
float x)
186 GET_FLOAT_WORD(hx,x);
189 if(ix>0x7f800000)
return x+x;
190 if(ix==0)
return -one/zero;
191 if(hx<0)
return zero/zero;
195 sign = 1 - ((n&1)<<1);
197 if(n==0)
return(__ieee754_y0f(x));
198 if(n==1)
return(sign*__ieee754_y1f(x));
199 if(ix==0x7f800000)
return zero;
201 a = __ieee754_y0f(x);
202 b = __ieee754_y1f(x);
204 GET_FLOAT_WORD(ib,b);
205 for(i=1;i<n&&(uint32_t)ib!=0xff800000;i++){
207 b = ((float)(i+i)/x)*b - a;
208 GET_FLOAT_WORD(ib,b);
211 if(sign>0)
return b;
else return -b;