Deleted Added
full compact
s_log1p.c (251024) s_log1p.c (251292)
1/* @(#)s_log1p.c 5.1 93/09/24 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#include <sys/cdefs.h>
1/* @(#)s_log1p.c 5.1 93/09/24 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#include <sys/cdefs.h>
14__FBSDID("$FreeBSD: head/lib/msun/src/s_log1p.c 251024 2013-05-27 08:50:10Z das $");
14__FBSDID("$FreeBSD: head/lib/msun/src/s_log1p.c 251292 2013-06-03 09:14:31Z das $");
15
16/* double log1p(double x)
17 *
18 * Method :
19 * 1. Argument Reduction: find k and f such that
20 * 1+x = 2^k * (1+f),
21 * where sqrt(2)/2 < 1+f < sqrt(2) .
22 *

--- 146 unchanged lines hidden (view full) ---

169 return k*ln2_hi-((R-(k*ln2_lo+c))-f);
170 }
171 s = f/(2.0+f);
172 z = s*s;
173 R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
174 if(k==0) return f-(hfsq-s*(hfsq+R)); else
175 return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f);
176}
15
16/* double log1p(double x)
17 *
18 * Method :
19 * 1. Argument Reduction: find k and f such that
20 * 1+x = 2^k * (1+f),
21 * where sqrt(2)/2 < 1+f < sqrt(2) .
22 *

--- 146 unchanged lines hidden (view full) ---

169 return k*ln2_hi-((R-(k*ln2_lo+c))-f);
170 }
171 s = f/(2.0+f);
172 z = s*s;
173 R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
174 if(k==0) return f-(hfsq-s*(hfsq+R)); else
175 return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f);
176}
177
178#if (LDBL_MANT_DIG == 53)
179__weak_reference(log1p, log1pl);
180#endif