1/* e_j0f.c -- float version of e_j0.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3 */
4
5/*
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8 *
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
12 * is preserved.
13 * ====================================================
14 */
15
16#include <sys/cdefs.h>
17__FBSDID("$FreeBSD: head/lib/msun/src/e_j0f.c 279491 2015-03-01 20:26:03Z kargl $");
18
19#include "math.h"
20#include "math_private.h"
21
22static float pzerof(float), qzerof(float);
23
24static const float
25huge = 1e30,
--- 193 unchanged lines hidden (view full) ---
219static const float pS2[5] = {
220 2.2220300674e+01, /* 0x41b1c32d */
221 1.3620678711e+02, /* 0x430834f0 */
222 2.7047027588e+02, /* 0x43873c32 */
223 1.5387539673e+02, /* 0x4319e01a */
224 1.4657617569e+01, /* 0x416a859a */
225};
226
227 static float pzerof(float x)
228{
229 const float *p,*q;
230 float z,r,s;
231 int32_t ix;
232 GET_FLOAT_WORD(ix,x);
233 ix &= 0x7fffffff;
234 if(ix>=0x41000000) {p = pR8; q= pS8;}
235 else if(ix>=0x409173eb){p = pR5; q= pS5;}
--- 78 unchanged lines hidden (view full) ---
314 3.0365585327e+01, /* 0x41f2ecb8 */
315 2.6934811401e+02, /* 0x4386ac8f */
316 8.4478375244e+02, /* 0x44533229 */
317 8.8293585205e+02, /* 0x445cbbe5 */
318 2.1266638184e+02, /* 0x4354aa98 */
319 -5.3109550476e+00, /* 0xc0a9f358 */
320};
321
322 static float qzerof(float x)
323{
324 const float *p,*q;
325 float s,r,z;
326 int32_t ix;
327 GET_FLOAT_WORD(ix,x);
328 ix &= 0x7fffffff;
329 if(ix>=0x41000000) {p = qR8; q= qS8;}
330 else if(ix>=0x409173eb){p = qR5; q= qS5;}
331 else if(ix>=0x4036d917){p = qR3; q= qS3;}
332 else {p = qR2; q= qS2;} /* ix>=0x40000000 */
333 z = one/(x*x);
334 r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
335 s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
336 return (-(float).125 + r/s)/x;
337}
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3 */
4
5/*
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8 *
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
12 * is preserved.
13 * ====================================================
14 */
15
16#include <sys/cdefs.h>
17__FBSDID("$FreeBSD: head/lib/msun/src/e_j0f.c 279491 2015-03-01 20:26:03Z kargl $");
18
19#include "math.h"
20#include "math_private.h"
21
22static float pzerof(float), qzerof(float);
23
24static const float
25huge = 1e30,
--- 193 unchanged lines hidden (view full) ---
219static const float pS2[5] = {
220 2.2220300674e+01, /* 0x41b1c32d */
221 1.3620678711e+02, /* 0x430834f0 */
222 2.7047027588e+02, /* 0x43873c32 */
223 1.5387539673e+02, /* 0x4319e01a */
224 1.4657617569e+01, /* 0x416a859a */
225};
226
227 static float pzerof(float x)
228{
229 const float *p,*q;
230 float z,r,s;
231 int32_t ix;
232 GET_FLOAT_WORD(ix,x);
233 ix &= 0x7fffffff;
234 if(ix>=0x41000000) {p = pR8; q= pS8;}
235 else if(ix>=0x409173eb){p = pR5; q= pS5;}
--- 78 unchanged lines hidden (view full) ---
314 3.0365585327e+01, /* 0x41f2ecb8 */
315 2.6934811401e+02, /* 0x4386ac8f */
316 8.4478375244e+02, /* 0x44533229 */
317 8.8293585205e+02, /* 0x445cbbe5 */
318 2.1266638184e+02, /* 0x4354aa98 */
319 -5.3109550476e+00, /* 0xc0a9f358 */
320};
321
322 static float qzerof(float x)
323{
324 const float *p,*q;
325 float s,r,z;
326 int32_t ix;
327 GET_FLOAT_WORD(ix,x);
328 ix &= 0x7fffffff;
329 if(ix>=0x41000000) {p = qR8; q= qS8;}
330 else if(ix>=0x409173eb){p = qR5; q= qS5;}
331 else if(ix>=0x4036d917){p = qR3; q= qS3;}
332 else {p = qR2; q= qS2;} /* ix>=0x40000000 */
333 z = one/(x*x);
334 r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
335 s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
336 return (-(float).125 + r/s)/x;
337}