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 279493 2015-03-01 20:32:47Z 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 |
227static __inline float 228pzerof(float x) |
229{ 230 const float *p,*q; 231 float z,r,s; 232 int32_t ix; 233 GET_FLOAT_WORD(ix,x); 234 ix &= 0x7fffffff; 235 if(ix>=0x41000000) {p = pR8; q= pS8;} 236 else if(ix>=0x409173eb){p = pR5; q= pS5;} --- 78 unchanged lines hidden (view full) --- 315 3.0365585327e+01, /* 0x41f2ecb8 */ 316 2.6934811401e+02, /* 0x4386ac8f */ 317 8.4478375244e+02, /* 0x44533229 */ 318 8.8293585205e+02, /* 0x445cbbe5 */ 319 2.1266638184e+02, /* 0x4354aa98 */ 320 -5.3109550476e+00, /* 0xc0a9f358 */ 321}; 322 |
323static __inline float 324qzerof(float x) |
325{ 326 const float *p,*q; 327 float s,r,z; 328 int32_t ix; 329 GET_FLOAT_WORD(ix,x); 330 ix &= 0x7fffffff; 331 if(ix>=0x41000000) {p = qR8; q= qS8;} 332 else if(ix>=0x409173eb){p = qR5; q= qS5;} 333 else if(ix>=0x4036d917){p = qR3; q= qS3;} 334 else {p = qR2; q= qS2;} /* ix>=0x40000000 */ 335 z = one/(x*x); 336 r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5])))); 337 s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5]))))); 338 return (-(float).125 + r/s)/x; 339} |