b_log.c (92887) | b_log.c (93211) |
---|---|
1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35static char sccsid[] = "@(#)log.c 8.2 (Berkeley) 11/30/93"; 36#endif /* not lint */ 37#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35static char sccsid[] = "@(#)log.c 8.2 (Berkeley) 11/30/93"; 36#endif /* not lint */ 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/lib/msun/bsdsrc/b_log.c 92887 2002-03-21 18:06:09Z obrien $"); | 38__FBSDID("$FreeBSD: head/lib/msun/bsdsrc/b_log.c 93211 2002-03-26 11:59:29Z bde $"); |
39 40#include <math.h> 41#include <errno.h> 42 43#include "mathimpl.h" 44 45/* Table-driven natural logarithm. 46 * --- 315 unchanged lines hidden (view full) --- 362 -.00000000000018372084495629058, 363 .00000000000088606689813494916, 364 .00000000000066486268071468700, 365 .00000000000063831615170646519, 366 .00000000000025144230728376072, 367 -.00000000000017239444525614834 368}; 369 | 39 40#include <math.h> 41#include <errno.h> 42 43#include "mathimpl.h" 44 45/* Table-driven natural logarithm. 46 * --- 315 unchanged lines hidden (view full) --- 362 -.00000000000018372084495629058, 363 .00000000000088606689813494916, 364 .00000000000066486268071468700, 365 .00000000000063831615170646519, 366 .00000000000025144230728376072, 367 -.00000000000017239444525614834 368}; 369 |
370#if 0 |
|
370double 371#ifdef _ANSI_SOURCE 372log(double x) 373#else 374log(x) double x; 375#endif 376{ 377 int m, j; --- 54 unchanged lines hidden (view full) --- 432 /* (m*log2_hi+logF_head[j]+u1) + (m*log2_lo+logF_tail[j]+q); */ 433 /* (exact) + (tiny) */ 434 435 u1 += m*logF_head[N] + logF_head[j]; /* exact */ 436 u2 = (u2 + logF_tail[j]) + q; /* tiny */ 437 u2 += logF_tail[N]*m; 438 return (u1 + u2); 439} | 371double 372#ifdef _ANSI_SOURCE 373log(double x) 374#else 375log(x) double x; 376#endif 377{ 378 int m, j; --- 54 unchanged lines hidden (view full) --- 433 /* (m*log2_hi+logF_head[j]+u1) + (m*log2_lo+logF_tail[j]+q); */ 434 /* (exact) + (tiny) */ 435 436 u1 += m*logF_head[N] + logF_head[j]; /* exact */ 437 u2 = (u2 + logF_tail[j]) + q; /* tiny */ 438 u2 += logF_tail[N]*m; 439 return (u1 + u2); 440} |
441#endif |
|
440 441/* 442 * Extra precision variant, returning struct {double a, b;}; 443 * log(x) = a+b to 63 bits, with a is rounded to 26 bits. 444 */ 445struct Double 446#ifdef _ANSI_SOURCE 447__log__D(double x) --- 41 unchanged lines hidden --- | 442 443/* 444 * Extra precision variant, returning struct {double a, b;}; 445 * log(x) = a+b to 63 bits, with a is rounded to 26 bits. 446 */ 447struct Double 448#ifdef _ANSI_SOURCE 449__log__D(double x) --- 41 unchanged lines hidden --- |