s_log1pf.c (175494) | s_log1pf.c (175534) |
---|---|
1/* s_log1pf.c -- float version of s_log1p.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> | 1/* s_log1pf.c -- float version of s_log1p.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/s_log1pf.c 175494 2008-01-19 18:13:21Z bde $"); | 17__FBSDID("$FreeBSD: head/lib/msun/src/s_log1pf.c 175534 2008-01-21 13:46:21Z bde $"); |
18 19#include <float.h> 20 21#include "math.h" 22#include "math_private.h" 23 24static const float 25ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ --- 19 unchanged lines hidden (view full) --- 45 ax = hx&0x7fffffff; 46 47 k = 1; 48 if (hx < 0x3ed413d0) { /* 1+x < sqrt(2)+ */ 49 if(ax>=0x3f800000) { /* x <= -1.0 */ 50 if(x==(float)-1.0) return -two25/zero; /* log1p(-1)=+inf */ 51 else return (x-x)/(x-x); /* log1p(x<-1)=NaN */ 52 } | 18 19#include <float.h> 20 21#include "math.h" 22#include "math_private.h" 23 24static const float 25ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ --- 19 unchanged lines hidden (view full) --- 45 ax = hx&0x7fffffff; 46 47 k = 1; 48 if (hx < 0x3ed413d0) { /* 1+x < sqrt(2)+ */ 49 if(ax>=0x3f800000) { /* x <= -1.0 */ 50 if(x==(float)-1.0) return -two25/zero; /* log1p(-1)=+inf */ 51 else return (x-x)/(x-x); /* log1p(x<-1)=NaN */ 52 } |
53 if(ax<0x31000000) { /* |x| < 2**-29 */ | 53 if(ax<0x38000000) { /* |x| < 2**-15 */ |
54 if(two25+x>zero /* raise inexact */ | 54 if(two25+x>zero /* raise inexact */ |
55 &&ax<0x24800000) /* |x| < 2**-54 */ | 55 &&ax<0x33800000) /* |x| < 2**-24 */ |
56 return x; 57 else 58 return x - x*x*(float)0.5; 59 } 60 if(hx>0||hx<=((int32_t)0xbe95f619)) { 61 k=0;f=x;hu=1;} /* sqrt(2)/2- <= 1+x < sqrt(2)+ */ 62 } 63 if (hx >= 0x7f800000) return x+x; --- 45 unchanged lines hidden --- | 56 return x; 57 else 58 return x - x*x*(float)0.5; 59 } 60 if(hx>0||hx<=((int32_t)0xbe95f619)) { 61 k=0;f=x;hu=1;} /* sqrt(2)/2- <= 1+x < sqrt(2)+ */ 62 } 63 if (hx >= 0x7f800000) return x+x; --- 45 unchanged lines hidden --- |