revert between 56095 -> 55830 in arch
[AROS.git] / compiler / stdc / math / k_logf.h
blobe7270e35f0e107bd8be54d53caf0e2ced7112bea
1 /*
2 * ====================================================
3 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 * Developed at SunPro, a Sun Microsystems, Inc. business.
6 * Permission to use, copy, modify, and distribute this
7 * software is freely granted, provided that this notice
8 * is preserved.
9 * ====================================================
12 #ifndef lint
13 static char rcsid[] = "$FreeBSD: src/lib/msun/src/k_logf.h,v 1.3 2011/10/15 05:23:28 das Exp $");
14 #endif
17 * Float version of k_log.h. See the latter for most comments.
20 static const float
21 /* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */
22 Lg1 = 0xaaaaaa.0p-24, /* 0.66666662693 */
23 Lg2 = 0xccce13.0p-25, /* 0.40000972152 */
24 Lg3 = 0x91e9ee.0p-25, /* 0.28498786688 */
25 Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */
27 static inline float
28 k_log1pf(float f)
30 float hfsq,s,z,R,w,t1,t2;
32 s = f/((float)2.0+f);
33 z = s*s;
34 w = z*z;
35 t1= w*(Lg2+w*Lg4);
36 t2= z*(Lg1+w*Lg3);
37 R = t2+t1;
38 hfsq=(float)0.5*f*f;
39 return s*(hfsq+R);