CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: mrg Date: Mon Feb 4 03:30:20 UTC 2019 Modified Files: src/lib/libm/noieee_src: n_lgamma.c Log Message: add some fallthru comments. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libm/noieee_src/n_lgamma.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_lgamma.c diff -u src/lib/libm/noieee_src/n_lgamma.c:1.6 src/lib/libm/noieee_src/n_lgamma.c:1.7 --- src/lib/libm/noieee_src/n_lgamma.c:1.6 Fri Nov 24 21:15:54 2006 +++ src/lib/libm/noieee_src/n_lgamma.c Mon Feb 4 03:30:20 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: n_lgamma.c,v 1.6 2006/11/24 21:15:54 wiz Exp $ */ +/* $NetBSD: n_lgamma.c,v 1.7 2019/02/04 03:30:20 mrg Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -221,15 +221,15 @@ CONTINUE: t = .5*t*t; z = 1.0; switch (x_int) { - case 6: z = (y + 5); - case 5: z *= (y + 4); - case 4: z *= (y + 3); + case 6: z = (y + 5); /* FALLTHROUGH */ + case 5: z *= (y + 4); /* FALLTHROUGH */ + case 4: z *= (y + 3); /* FALLTHROUGH */ case 3: z *= (y + 2); rr = __log__D(z); rr.b += a0_lo; rr.a += a0_hi; return(((r+rr.b)+t+rr.a)); case 2: return(((r+a0_lo)+t)+a0_hi); - case 0: r -= log1p(x); + case 0: r -= log1p(x); /* FALLTHROUGH */ default: rr = __log__D(x); rr.a -= a0_hi; rr.b -= a0_lo; return(((r - rr.b) + t) - rr.a); @@ -246,9 +246,9 @@ CONTINUE: q = hi*t; z = 1.0; switch (x_int) { - case 6: z = (y + 5); - case 5: z *= (y + 4); - case 4: z *= (y + 3); + case 6: z = (y + 5); /* FALLTHROUGH */ + case 5: z *= (y + 4); /* FALLTHROUGH */ + case 4: z *= (y + 3); /* FALLTHROUGH */ case 3: z *= (y + 2); rr = __log__D(z); r += rr.b; r += q;
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Fri Nov 9 10:19:47 UTC 2018 Modified Files: src/lib/libm/noieee_src: n_fmod.c Log Message: Add modfl alias. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libm/noieee_src/n_fmod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_fmod.c diff -u src/lib/libm/noieee_src/n_fmod.c:1.10 src/lib/libm/noieee_src/n_fmod.c:1.11 --- src/lib/libm/noieee_src/n_fmod.c:1.10 Sat Jan 16 21:31:38 2016 +++ src/lib/libm/noieee_src/n_fmod.c Fri Nov 9 10:19:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: n_fmod.c,v 1.10 2016/01/16 21:31:38 christos Exp $ */ +/* $NetBSD: n_fmod.c,v 1.11 2018/11/09 10:19:47 martin Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -70,6 +70,7 @@ extern int isnan(),finite(); && DBL_MIN_EXP == LDBL_MIN_EXP #ifdef __weak_alias __weak_alias(fmodl, fmod); +__weak_alias(modfl, fmod); #endif #endif
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: christos Date: Tue Mar 6 01:14:41 UTC 2018 Modified Files: src/lib/libm/noieee_src: n_exp2.c Log Message: avoid negative shift To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libm/noieee_src/n_exp2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_exp2.c diff -u src/lib/libm/noieee_src/n_exp2.c:1.3 src/lib/libm/noieee_src/n_exp2.c:1.4 --- src/lib/libm/noieee_src/n_exp2.c:1.3 Sun Mar 23 11:26:47 2014 +++ src/lib/libm/noieee_src/n_exp2.c Mon Mar 5 20:14:41 2018 @@ -25,7 +25,7 @@ */ #include -__RCSID("$NetBSD: n_exp2.c,v 1.3 2014/03/23 15:26:47 martin Exp $"); +__RCSID("$NetBSD: n_exp2.c,v 1.4 2018/03/06 01:14:41 christos Exp $"); #ifdef __FBSDID __FBSDID("$FreeBSD: src/lib/msun/src/s_exp2.c,v 1.7 2008/02/22 02:27:34 das Exp $"); #endif @@ -372,7 +372,8 @@ exp2(double x) /* Compute r = exp2(y) = exp2t[i0] * p(z - eps[i]). */ t = tbl[i0]; /* exp2t[i0] */ z -= tbl[i0 + 1]; /* eps[i0] */ - big = k >= -1021 << 20; + /* -1021 << 20 == 3075 << 20 */ + big = k >= 3075 << 20; if (big) { temp = 0x3ff0+k; twopk = 0.0;
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: christos Date: Mon Mar 5 23:00:55 UTC 2018 Modified Files: src/lib/libm/noieee_src: n_jn.c Log Message: comment out unused variable. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_jn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_jn.c diff -u src/lib/libm/noieee_src/n_jn.c:1.7 src/lib/libm/noieee_src/n_jn.c:1.8 --- src/lib/libm/noieee_src/n_jn.c:1.7 Tue Nov 1 22:34:56 2011 +++ src/lib/libm/noieee_src/n_jn.c Mon Mar 5 18:00:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: n_jn.c,v 1.7 2011/11/02 02:34:56 christos Exp $ */ +/* $NetBSD: n_jn.c,v 1.8 2018/03/05 23:00:55 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -102,7 +102,9 @@ static char sccsid[] = "@(#)jn.c 8.2 (Be #endif static const double +#if _IEEE invsqrtpi= 5.641895835477562869480794515607725858441e-0001, +#endif two = 2.0, zero = 0.0, one = 1.0;
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: christos Date: Wed Aug 24 09:08:50 UTC 2016 Added Files: src/lib/libm/noieee_src: n_ilogb.c Log Message: ilogb for the vax To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/libm/noieee_src/n_ilogb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/libm/noieee_src/n_ilogb.c diff -u /dev/null src/lib/libm/noieee_src/n_ilogb.c:1.1 --- /dev/null Wed Aug 24 05:08:50 2016 +++ src/lib/libm/noieee_src/n_ilogb.c Wed Aug 24 05:08:50 2016 @@ -0,0 +1,54 @@ +/* $NetBSD: n_ilogb.c,v 1.1 2016/08/24 09:08:50 christos Exp $ */ + +/*- + * Copyright (c) 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#if defined(LIBM_SCCS) && !defined(lint) +__RCSID("$NetBSD: n_ilogb.c,v 1.1 2016/08/24 09:08:50 christos Exp $"); +#endif + +#include "math.h" + +int +ilogb(double x) +{ + if (x == 0) + return FP_ILOGB0; + if (x != x) + return FP_ILOGBNAN; + if (!finite(x)) + return INT_MAX; + return (int)logb(x); +} + +int +ilogbf(float x) +{ + return ilogb(x); +}
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: christos Date: Sat Jan 16 21:29:33 UTC 2016 Modified Files: src/lib/libm/noieee_src: n_fmod.c Log Message: fix typo To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libm/noieee_src/n_fmod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_fmod.c diff -u src/lib/libm/noieee_src/n_fmod.c:1.8 src/lib/libm/noieee_src/n_fmod.c:1.9 --- src/lib/libm/noieee_src/n_fmod.c:1.8 Sat Jan 16 14:44:05 2016 +++ src/lib/libm/noieee_src/n_fmod.c Sat Jan 16 16:29:33 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: n_fmod.c,v 1.8 2016/01/16 19:44:05 christos Exp $ */ +/* $NetBSD: n_fmod.c,v 1.9 2016/01/16 21:29:33 christos Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -124,7 +124,7 @@ prf(const char *s, double d) unsigned long long u; } x; x.d = d; - printf("%s = %#016.16llx (%24.16e)\n:, s, x.u, x.d); + printf("%s = %#016.16llx (%24.16e)\n", s, x.u, x.d); } static void
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: christos Date: Sat Jan 16 19:44:05 UTC 2016 Modified Files: src/lib/libm/noieee_src: n_fmod.c Log Message: PR/50660: David Binderman: bad calls to printf, in test part To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_fmod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_fmod.c diff -u src/lib/libm/noieee_src/n_fmod.c:1.7 src/lib/libm/noieee_src/n_fmod.c:1.8 --- src/lib/libm/noieee_src/n_fmod.c:1.7 Fri Nov 22 05:59:31 2013 +++ src/lib/libm/noieee_src/n_fmod.c Sat Jan 16 14:44:05 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: n_fmod.c,v 1.7 2013/11/22 10:59:31 martin Exp $ */ +/* $NetBSD: n_fmod.c,v 1.8 2016/01/16 19:44:05 christos Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -116,16 +116,26 @@ extern double fmod(); #define NCASES 3 static int nfail = 0; +static void +prf(const char *s, double d) +{ + union { + double d; + unsigned long long u; + } x; + x.d = d; + printf("%s = %#016.16llx (%24.16e)\n:, s, x.u, x.d); +} static void doit(double x, double y) { double ro = fmod(x,y),rn = _fmod(x,y); if (ro != rn) { - (void)printf(" x= 0x%08.8x %08.8x (%24.16e)\n",x,x); - (void)printf(" y= 0x%08.8x %08.8x (%24.16e)\n",y,y); - (void)printf(" fmod = 0x%08.8x %08.8x (%24.16e)\n",ro,ro); - (void)printf("_fmod = 0x%08.8x %08.8x (%24.16e)\n",rn,rn); + prf(" x ", x); + prf(" y ", y); + prf(" fmod", ro); + prf("_fmod", rn); (void)printf("\n"); } }
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: christos Date: Sat Jan 16 21:31:38 UTC 2016 Modified Files: src/lib/libm/noieee_src: n_fmod.c Log Message: modernize. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libm/noieee_src/n_fmod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_fmod.c diff -u src/lib/libm/noieee_src/n_fmod.c:1.9 src/lib/libm/noieee_src/n_fmod.c:1.10 --- src/lib/libm/noieee_src/n_fmod.c:1.9 Sat Jan 16 16:29:33 2016 +++ src/lib/libm/noieee_src/n_fmod.c Sat Jan 16 16:31:38 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: n_fmod.c,v 1.9 2016/01/16 21:29:33 christos Exp $ */ +/* $NetBSD: n_fmod.c,v 1.10 2016/01/16 21:31:38 christos Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -109,8 +109,9 @@ fmodf(float x, float y) } #ifdef TEST_FMOD -extern long random(); -extern double fmod(); +#include +#include +#include #define NTEST 1 #define NCASES 3
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Sat Oct 11 07:19:27 UTC 2014 Modified Files: src/lib/libm/noieee_src: n_pow.c Log Message: Need powl as alias as well To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libm/noieee_src/n_pow.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_pow.c diff -u src/lib/libm/noieee_src/n_pow.c:1.10 src/lib/libm/noieee_src/n_pow.c:1.11 --- src/lib/libm/noieee_src/n_pow.c:1.10 Fri Oct 10 20:58:09 2014 +++ src/lib/libm/noieee_src/n_pow.c Sat Oct 11 07:19:27 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: n_pow.c,v 1.10 2014/10/10 20:58:09 martin Exp $ */ +/* $NetBSD: n_pow.c,v 1.11 2014/10/11 07:19:27 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -126,6 +126,7 @@ static double pow_P (double, double); __weak_alias(_powf, powf); __weak_alias(_pow, pow); __weak_alias(_powl, pow); +__weak_alias(powl, pow); #endif float
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Sun Mar 23 15:26:47 UTC 2014 Modified Files: src/lib/libm/noieee_src: n_exp2.c n_exp2f.c Log Message: Avoid strict aliasing problems To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libm/noieee_src/n_exp2.c cvs rdiff -u -r1.1 -r1.2 src/lib/libm/noieee_src/n_exp2f.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_exp2.c diff -u src/lib/libm/noieee_src/n_exp2.c:1.2 src/lib/libm/noieee_src/n_exp2.c:1.3 --- src/lib/libm/noieee_src/n_exp2.c:1.2 Wed Mar 12 19:42:18 2014 +++ src/lib/libm/noieee_src/n_exp2.c Sun Mar 23 15:26:47 2014 @@ -25,13 +25,14 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: n_exp2.c,v 1.2 2014/03/12 19:42:18 martin Exp $); +__RCSID($NetBSD: n_exp2.c,v 1.3 2014/03/23 15:26:47 martin Exp $); #ifdef __FBSDID __FBSDID($FreeBSD: src/lib/msun/src/s_exp2.c,v 1.7 2008/02/22 02:27:34 das Exp $); #endif #include stdint.h #include float.h +#include string.h #include math.h @@ -344,11 +345,11 @@ double exp2(double x) { double r, t, twopk, z; - uint32_t hx, ix, i0; + uint32_t hx, ix, i0, temp; int k, big; /* Filter out exceptional cases. */ - hx = ((uint32_t*)x)[0]; + memcpy(hx, x, sizeof(hx)); ix = hx 0x7fff; /* high word of |x| */ if(ix = 0x4090) { /* |x| = 1024 */ if(x = 0x1.0p10) @@ -373,11 +374,13 @@ exp2(double x) z -= tbl[i0 + 1]; /* eps[i0] */ big = k = -1021 20; if (big) { - ((uint32_t*)twopk)[0] = 0x3ff0+k; - ((uint32_t*)twopk)[1] = 0; + temp = 0x3ff0+k; + twopk = 0.0; + memcpy(twopk, temp, sizeof(temp)); } else { - ((uint32_t*)twopk)[0] = 0x3ff0+k + (1000 20); - ((uint32_t*)twopk)[1] = 0; + temp = 0x3ff0+k + (1000 20); + twopk = 0.0; + memcpy(twopk, temp, sizeof(temp)); } r = t + t * z * (P1 + z * (P2 + z * (P3 + z * (P4 + z * P5; Index: src/lib/libm/noieee_src/n_exp2f.c diff -u src/lib/libm/noieee_src/n_exp2f.c:1.1 src/lib/libm/noieee_src/n_exp2f.c:1.2 --- src/lib/libm/noieee_src/n_exp2f.c:1.1 Thu Mar 6 10:55:57 2014 +++ src/lib/libm/noieee_src/n_exp2f.c Sun Mar 23 15:26:47 2014 @@ -25,13 +25,14 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: n_exp2f.c,v 1.1 2014/03/06 10:55:57 martin Exp $); +__RCSID($NetBSD: n_exp2f.c,v 1.2 2014/03/23 15:26:47 martin Exp $); #ifdef __FBSDID __FBSDID($FreeBSD: src/lib/msun/src/s_exp2f.c,v 1.9 2008/02/22 02:27:34 das Exp $); #endif #include stdint.h #include float.h +#include string.h #include math.h @@ -99,10 +100,10 @@ exp2f(float x) double tv, twopk, u, z; float t; uint32_t hx, ix, i0; - int32_t k; + int32_t k, temp; /* Filter out exceptional cases. */ - hx = *((uint32_t*)x); + memcpy(hx, x, sizeof(hx)); ix = hx 0x7fff; /* high word of |x| */ if(ix = 0x4300) { /* |x| = 128 */ if(x = 0x1.0p7f) @@ -114,15 +115,16 @@ exp2f(float x) } /* Reduce x, computing z, i0, and k. */ - *((volatile float*)t) = x + redux; - i0 = *((uint32_t*)t); + i0 = x + redux; + memcpy(t, i0, sizeof(t)); i0 += TBLSIZE / 2; k = (i0 TBLBITS) 20; i0 = TBLSIZE - 1; t -= redux; z = x - t; - ((uint32_t*)twopk)[0] = 0x3ff0+k; - ((uint32_t*)twopk)[1] = 0; + temp = 0x3ff0+k; + twopk = 0.0; + memcpy(twopk, temp, sizeof(temp)); /* Compute r = exp2(y) = exp2ft[i0] * p(z). */ tv = exp2ft[i0];
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Sun Mar 16 09:51:39 UTC 2014 Modified Files: src/lib/libm/noieee_src: n_floor.c Log Message: Provide all missing variants of trunc/floor/ceil. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_floor.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_floor.c diff -u src/lib/libm/noieee_src/n_floor.c:1.7 src/lib/libm/noieee_src/n_floor.c:1.8 --- src/lib/libm/noieee_src/n_floor.c:1.7 Thu Dec 9 22:52:59 2010 +++ src/lib/libm/noieee_src/n_floor.c Sun Mar 16 09:51:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: n_floor.c,v 1.7 2010/12/09 22:52:59 abs Exp $ */ +/* $NetBSD: n_floor.c,v 1.8 2014/03/16 09:51:39 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -45,6 +45,12 @@ ic(L, 4503599627370496.0E0, 52, 1.0) #define L vccast(L) #endif +#ifdef __weak_alias +__weak_alias(ceill, ceil); +__weak_alias(floorl, floor); +__weak_alias(truncl, trunc); +#endif + /* * floor(x) := the largest integer no larger than x; * ceil(x) := -floor(-x), for all real x. @@ -216,3 +222,15 @@ llrintf(float x) t = x + s;/* x+s rounded to integer */ return (t - s); } + +double +trunc(double x) +{ + return x 0 ? ceil(x) : floor(x); +} + +float +truncf(float x) +{ + return x 0 ? ceilf(x) : floorf(x); +}
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Sun Mar 16 10:02:27 UTC 2014 Modified Files: src/lib/libm/noieee_src: n_round.c Log Message: Add roundl() To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libm/noieee_src/n_round.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_round.c diff -u src/lib/libm/noieee_src/n_round.c:1.1 src/lib/libm/noieee_src/n_round.c:1.2 --- src/lib/libm/noieee_src/n_round.c:1.1 Tue Jan 17 13:16:08 2006 +++ src/lib/libm/noieee_src/n_round.c Sun Mar 16 10:02:27 2014 @@ -26,7 +26,7 @@ #include sys/cdefs.h #if defined(LIBM_SCCS) !defined(lint) -__RCSID($NetBSD: n_round.c,v 1.1 2006/01/17 13:16:08 is Exp $); +__RCSID($NetBSD: n_round.c,v 1.2 2014/03/16 10:02:27 martin Exp $); #if 0 __FBSDID($FreeBSD: src/lib/msun/src/s_round.c,v 1.1 2004/06/07 08:05:36 das Exp $); #endif @@ -34,6 +34,10 @@ __FBSDID($FreeBSD: src/lib/msun/src/s_r #include math.h +#ifdef __weak_alias +__weak_alias(roundl, round); +#endif + double round(double x) {
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Wed Mar 12 19:42:18 UTC 2014 Modified Files: src/lib/libm/noieee_src: n_exp2.c Log Message: XXX This is all wrong and needs new tables and constants - but at least use constants in the VAX double range for now, so it is compilable with newer gcc. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libm/noieee_src/n_exp2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_exp2.c diff -u src/lib/libm/noieee_src/n_exp2.c:1.1 src/lib/libm/noieee_src/n_exp2.c:1.2 --- src/lib/libm/noieee_src/n_exp2.c:1.1 Thu Mar 6 10:55:57 2014 +++ src/lib/libm/noieee_src/n_exp2.c Wed Mar 12 19:42:18 2014 @@ -25,7 +25,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: n_exp2.c,v 1.1 2014/03/06 10:55:57 martin Exp $); +__RCSID($NetBSD: n_exp2.c,v 1.2 2014/03/12 19:42:18 martin Exp $); #ifdef __FBSDID __FBSDID($FreeBSD: src/lib/msun/src/s_exp2.c,v 1.7 2008/02/22 02:27:34 das Exp $); #endif @@ -39,7 +39,7 @@ __FBSDID($FreeBSD: src/lib/msun/src/s_e #define TBLSIZE (1 TBLBITS) static const double -huge = 0x1p1000, +huge = 0x1p126, redux= 0x1.8p52 / TBLSIZE, P1 = 0x1.62e42fefa39efp-1, P2 = 0x1.ebfbdff82c575p-3, @@ -47,7 +47,7 @@ static const double P4 = 0x1.3b2ab88f70400p-7, P5 = 0x1.5d88003875c74p-10; -static volatile double twom1000 = 0x1p-1000; +static volatile double twom1000 = 0x1p-100; static const double tbl[TBLSIZE * 2] = { /* exp2(z + eps) eps */ @@ -383,8 +383,8 @@ exp2(double x) /* Scale by 2**(k20). */ if (big) { - if (k == 1024 20) - return (r * 2.0 * 0x1p1023); + /*if (k == 1024 20) + return (r * 2.0 * 0x1p1023); */ return (r * twopk); } else { return (r * twopk * twom1000);
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Thu Mar 6 10:55:57 UTC 2014 Added Files: src/lib/libm/noieee_src: n_exp2.c n_exp2f.c Log Message: Add brute-force adaptions of the ieee version of exp2() and exp2f for vax. Needs some polishing (and table adaption), but should get the build going for now. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/libm/noieee_src/n_exp2.c \ src/lib/libm/noieee_src/n_exp2f.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/libm/noieee_src/n_exp2.c diff -u /dev/null src/lib/libm/noieee_src/n_exp2.c:1.1 --- /dev/null Thu Mar 6 10:55:57 2014 +++ src/lib/libm/noieee_src/n_exp2.c Thu Mar 6 10:55:57 2014 @@ -0,0 +1,392 @@ +/*- + * Copyright (c) 2005 David Schultz d...@freebsd.org + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include sys/cdefs.h +__RCSID($NetBSD: n_exp2.c,v 1.1 2014/03/06 10:55:57 martin Exp $); +#ifdef __FBSDID +__FBSDID($FreeBSD: src/lib/msun/src/s_exp2.c,v 1.7 2008/02/22 02:27:34 das Exp $); +#endif + +#include stdint.h +#include float.h + +#include math.h + +#define TBLBITS 8 +#define TBLSIZE (1 TBLBITS) + +static const double +huge = 0x1p1000, +redux= 0x1.8p52 / TBLSIZE, +P1 = 0x1.62e42fefa39efp-1, +P2 = 0x1.ebfbdff82c575p-3, +P3 = 0x1.c6b08d704a0a6p-5, +P4 = 0x1.3b2ab88f70400p-7, +P5 = 0x1.5d88003875c74p-10; + +static volatile double twom1000 = 0x1p-1000; + +static const double tbl[TBLSIZE * 2] = { +/* exp2(z + eps) eps */ + 0x1.6a09e667f3d5dp-1, 0x1.9880p-44, + 0x1.6b052fa751744p-1, 0x1.8000p-50, + 0x1.6c012750bd9fep-1, -0x1.8780p-45, + 0x1.6cfdcddd476bfp-1, 0x1.ec00p-46, + 0x1.6dfb23c651a29p-1, -0x1.8000p-50, + 0x1.6ef9298593ae3p-1, -0x1.c000p-52, + 0x1.6ff7df9519386p-1, -0x1.fd80p-45, + 0x1.70f7466f42da3p-1, -0x1.c880p-45, + 0x1.71f75e8ec5fc3p-1, 0x1.3c00p-46, + 0x1.72f8286eacf05p-1, -0x1.8300p-44, + 0x1.73f9a48a58152p-1, -0x1.0c00p-47, + 0x1.74fbd35d7ccfcp-1, 0x1.f880p-45, + 0x1.75feb564267f1p-1, 0x1.3e00p-47, + 0x1.77024b1ab6d48p-1, -0x1.7d00p-45, + 0x1.780694fde5d38p-1, -0x1.d000p-50, + 0x1.790b938ac1d00p-1, 0x1.3000p-49, + 0x1.7a11473eb0178p-1, -0x1.d000p-49, + 0x1.7b17b0976d060p-1, 0x1.0400p-45, + 0x1.7c1ed0130c133p-1, 0x1.p-53, + 0x1.7d26a62ff8636p-1, -0x1.6900p-45, + 0x1.7e2f336cf4e3bp-1, -0x1.2e00p-47, + 0x1.7f3878491c3e8p-1, -0x1.4580p-45, + 0x1.80427543e1b4ep-1, 0x1.3000p-44, + 0x1.814d2add1071ap-1, 0x1.f000p-47, + 0x1.82589994ccd7ep-1, -0x1.1c00p-45, + 0x1.8364c1eb942d0p-1, 0x1.9d00p-45, + 0x1.8471a4623cab5p-1, 0x1.7100p-43, + 0x1.857f4179f5bbcp-1, 0x1.2600p-45, + 0x1.868d99b4491afp-1, -0x1.2c40p-44, + 0x1.879cad931a395p-1, -0x1.3000p-45, + 0x1.88ac7d98a65b8p-1, -0x1.a800p-45, + 0x1.89bd0a4785800p-1, -0x1.d000p-49, + 0x1.8ace5422aa223p-1, 0x1.3280p-44, + 0x1.8be05bad619fap-1, 0x1.2b40p-43, + 0x1.8cf3216b54383p-1, -0x1.ed00p-45, + 0x1.8e06a5e08664cp-1, -0x1.0500p-45, + 0x1.8f1ae99157807p-1, 0x1.8280p-45, + 0x1.902fed0282c0ep-1, -0x1.cb00p-46, + 0x1.9145b0b91ff96p-1, -0x1.5e00p-47, + 0x1.925c353aa2ff9p-1, 0x1.5400p-48, + 0x1.93737b0cdc64ap-1, 0x1.7200p-46, + 0x1.948b82b5f98aep-1, -0x1.9000p-47, + 0x1.95a44cbc852cbp-1, 0x1.5680p-45, + 0x1.96bdd9a766f21p-1, -0x1.6d00p-44, + 0x1.97d829fde4e2ap-1, -0x1.1000p-47, + 0x1.98f33e47a23a3p-1, 0x1.d000p-45, + 0x1.9a0f170ca0604p-1, -0x1.8a40p-44, + 0x1.9b2bb4d53ff89p-1, 0x1.55c0p-44, + 0x1.9c49182a3f15bp-1, 0x1.6b80p-45, + 0x1.9d674194bb8c5p-1, -0x1.c000p-49, + 0x1.9e86319e3238ep-1, 0x1.7d00p-46, + 0x1.9fa5e8d07f302p-1, 0x1.6400p-46, + 0x1.a0c667b5de54dp-1, -0x1.5000p-48, + 0x1.a1e7aed8eb8f6p-1,
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Thu Mar 6 10:57:01 UTC 2014 Added Files: src/lib/libm/noieee_src: n_log2.c Log Message: log2() for vax To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/libm/noieee_src/n_log2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/libm/noieee_src/n_log2.c diff -u /dev/null src/lib/libm/noieee_src/n_log2.c:1.1 --- /dev/null Thu Mar 6 10:57:01 2014 +++ src/lib/libm/noieee_src/n_log2.c Thu Mar 6 10:57:01 2014 @@ -0,0 +1,59 @@ +/* $NetBSD: n_log2.c,v 1.1 2014/03/06 10:57:01 martin Exp $ */ +/*- + * Copyright (c) 2014 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Martin Husemann mar...@netbsd.org. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* LOG2(X) + * RETURN THE BASE 10 LOGARITHM OF x + * + * Required kernel function: + * log(x) + * + * Method : + * log(x) + * log2(x) = - + * log(2) + */ + +#define _LIBM_STATIC +#include mathimpl.h + + +static const double ln2 = .6931471805599453094172321214581765680755; + +double +log2(double x) +{ + return log(x)/ln2; +} + +float +log2f(float x) +{ + return logf(x)/ln2; +}
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Thu Mar 6 10:57:44 UTC 2014 Modified Files: src/lib/libm/noieee_src: n_log10.c Log Message: log10f() for vax To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libm/noieee_src/n_log10.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_log10.c diff -u src/lib/libm/noieee_src/n_log10.c:1.6 src/lib/libm/noieee_src/n_log10.c:1.7 --- src/lib/libm/noieee_src/n_log10.c:1.6 Thu Aug 7 16:44:52 2003 +++ src/lib/libm/noieee_src/n_log10.c Thu Mar 6 10:57:44 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: n_log10.c,v 1.6 2003/08/07 16:44:52 agc Exp $ */ +/* $NetBSD: n_log10.c,v 1.7 2014/03/06 10:57:44 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -93,3 +93,13 @@ log10(double x) return(ivln10*log(x)); #endif /* defined(__vax__)||defined(tahoe) */ } + +float +log10f(float x) +{ +#if defined(__vax__)||defined(tahoe) + return(logf(x)/ln10hi); +#else /* defined(__vax__)||defined(tahoe) */ + return(ivln10*log(x)); +#endif /* defined(__vax__)||defined(tahoe) */ +}
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Thu Mar 6 10:59:00 UTC 2014 Modified Files: src/lib/libm/noieee_src: n_tanh.c Log Message: Simplistic tanhf() for vax To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libm/noieee_src/n_tanh.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_tanh.c diff -u src/lib/libm/noieee_src/n_tanh.c:1.6 src/lib/libm/noieee_src/n_tanh.c:1.7 --- src/lib/libm/noieee_src/n_tanh.c:1.6 Thu Aug 7 16:44:52 2003 +++ src/lib/libm/noieee_src/n_tanh.c Thu Mar 6 10:59:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: n_tanh.c,v 1.6 2003/08/07 16:44:52 agc Exp $ */ +/* $NetBSD: n_tanh.c,v 1.7 2014/03/06 10:59:00 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -97,3 +97,9 @@ tanh(double x) else return(sign); /* x is +- INF */ } + +float +tanhf(float x) +{ + return tanh(x); +}
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Thu Mar 6 10:58:26 UTC 2014 Modified Files: src/lib/libm/noieee_src: n_log1p.c Log Message: Simplistic log1pf() for vax To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_log1p.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_log1p.c diff -u src/lib/libm/noieee_src/n_log1p.c:1.7 src/lib/libm/noieee_src/n_log1p.c:1.8 --- src/lib/libm/noieee_src/n_log1p.c:1.7 Tue Apr 29 15:10:02 2008 +++ src/lib/libm/noieee_src/n_log1p.c Thu Mar 6 10:58:26 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: n_log1p.c,v 1.7 2008/04/29 15:10:02 uwe Exp $ */ +/* $NetBSD: n_log1p.c,v 1.8 2014/03/06 10:58:26 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -168,3 +168,9 @@ log1p(double x) /* log(+INF) is INF */ else return(x); } + +float +log1pf(float x) +{ + return log1p(x); +}
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Sun Nov 24 14:41:54 UTC 2013 Modified Files: src/lib/libm/noieee_src: n_asincos.c n_atan.c Log Message: Provide (very stupid) versions of atanf(), asinf() and acosf() To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_asincos.c cvs rdiff -u -r1.5 -r1.6 src/lib/libm/noieee_src/n_atan.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_asincos.c diff -u src/lib/libm/noieee_src/n_asincos.c:1.7 src/lib/libm/noieee_src/n_asincos.c:1.8 --- src/lib/libm/noieee_src/n_asincos.c:1.7 Thu Aug 7 16:44:50 2003 +++ src/lib/libm/noieee_src/n_asincos.c Sun Nov 24 14:41:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: n_asincos.c,v 1.7 2003/08/07 16:44:50 agc Exp $ */ +/* $NetBSD: n_asincos.c,v 1.8 2013/11/24 14:41:53 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -103,6 +103,12 @@ asin(double x) } +float +asinf(float x) +{ + return (float)asin(x); +} + /* ACOS(X) * RETURNS ARC COS OF X * DOUBLE PRECISION (IEEE DOUBLE 53 bits, VAX D FORMAT 56 bits) @@ -168,3 +174,9 @@ acos(double x) t=atan2(one,0.0); /* t = PI/2 */ return(t+t); } + +float +acosf(float x) +{ + return (float)acos(x); +} Index: src/lib/libm/noieee_src/n_atan.c diff -u src/lib/libm/noieee_src/n_atan.c:1.5 src/lib/libm/noieee_src/n_atan.c:1.6 --- src/lib/libm/noieee_src/n_atan.c:1.5 Thu Aug 7 16:44:50 2003 +++ src/lib/libm/noieee_src/n_atan.c Sun Nov 24 14:41:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: n_atan.c,v 1.5 2003/08/07 16:44:50 agc Exp $ */ +/* $NetBSD: n_atan.c,v 1.6 2013/11/24 14:41:53 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -85,3 +85,11 @@ atan(double x) double one=1.0; return(atan2(x,one)); } + +float +atanf(float x) +{ + float one=1.0; + return (float)atan2(x,one); +} +
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Sun Nov 24 14:46:18 UTC 2013 Modified Files: src/lib/libm/noieee_src: n_pow.c Log Message: Provide powl() To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libm/noieee_src/n_pow.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_pow.c diff -u src/lib/libm/noieee_src/n_pow.c:1.8 src/lib/libm/noieee_src/n_pow.c:1.9 --- src/lib/libm/noieee_src/n_pow.c:1.8 Wed Nov 2 02:34:56 2011 +++ src/lib/libm/noieee_src/n_pow.c Sun Nov 24 14:46:18 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: n_pow.c,v 1.8 2011/11/02 02:34:56 christos Exp $ */ +/* $NetBSD: n_pow.c,v 1.9 2013/11/24 14:46:18 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -128,6 +128,12 @@ powf(float x, float y) return pow((double) x, (double) (y)); } +long double +powl(long double x, long double y) +{ + return pow((double) x, (double) (y)); +} + double pow(double x, double y) {
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Sun Nov 24 14:49:00 UTC 2013 Modified Files: src/lib/libm/noieee_src: n_cbrt.c Log Message: Provide cbrtf() and cbrtl() To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libm/noieee_src/n_cbrt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_cbrt.c diff -u src/lib/libm/noieee_src/n_cbrt.c:1.5 src/lib/libm/noieee_src/n_cbrt.c:1.6 --- src/lib/libm/noieee_src/n_cbrt.c:1.5 Thu Aug 7 16:44:50 2003 +++ src/lib/libm/noieee_src/n_cbrt.c Sun Nov 24 14:49:00 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: n_cbrt.c,v 1.5 2003/08/07 16:44:50 agc Exp $ */ +/* $NetBSD: n_cbrt.c,v 1.6 2013/11/24 14:49:00 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -62,6 +62,18 @@ static const double F= 45./28., G= 5./14.; +float +cbrtf(float x) +{ + return (float)cbrt(x); +} + +long double +cbrtl(long double x) +{ + return cbrt((double)x); +} + double cbrt(double x) {
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Sun Nov 24 15:16:49 UTC 2013 Modified Files: src/lib/libm/noieee_src: n_erf.c Log Message: Provide erff() and erfcf(). To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libm/noieee_src/n_erf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_erf.c diff -u src/lib/libm/noieee_src/n_erf.c:1.8 src/lib/libm/noieee_src/n_erf.c:1.9 --- src/lib/libm/noieee_src/n_erf.c:1.8 Wed Nov 2 02:34:56 2011 +++ src/lib/libm/noieee_src/n_erf.c Sun Nov 24 15:16:49 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: n_erf.c,v 1.8 2011/11/02 02:34:56 christos Exp $ */ +/* $NetBSD: n_erf.c,v 1.9 2013/11/24 15:16:49 martin Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -320,6 +320,12 @@ erf(double x) return (z-one); } +float +erff(float x) +{ + return (float)erf(x); +} + double erfc(double x) { @@ -396,3 +402,11 @@ erfc(double x) else return two-r; } + +float +erfcf(float x) +{ + return (float)erfc(x); +} + +
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Sun Nov 24 18:50:58 UTC 2013 Modified Files: src/lib/libm/noieee_src: n_expm1.c Log Message: Provide expm1f() To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_expm1.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_expm1.c diff -u src/lib/libm/noieee_src/n_expm1.c:1.7 src/lib/libm/noieee_src/n_expm1.c:1.8 --- src/lib/libm/noieee_src/n_expm1.c:1.7 Tue Apr 29 15:10:02 2008 +++ src/lib/libm/noieee_src/n_expm1.c Sun Nov 24 18:50:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: n_expm1.c,v 1.7 2008/04/29 15:10:02 uwe Exp $ */ +/* $NetBSD: n_expm1.c,v 1.8 2013/11/24 18:50:58 martin Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. @@ -111,6 +111,12 @@ ic(invln2, 1.4426950408889633870E0, #define PREC 53 #endif /* defined(__vax__)||defined(tahoe) */ +float +expm1f(float x) +{ + return (float)expm1(x); +} + double expm1(double x) {
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Fri Nov 22 10:59:31 UTC 2013 Modified Files: src/lib/libm/noieee_src: n_fmod.c Log Message: Fix stupid bug in previous (fixing fmodf) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libm/noieee_src/n_fmod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_fmod.c diff -u src/lib/libm/noieee_src/n_fmod.c:1.6 src/lib/libm/noieee_src/n_fmod.c:1.7 --- src/lib/libm/noieee_src/n_fmod.c:1.6 Thu Nov 21 10:48:11 2013 +++ src/lib/libm/noieee_src/n_fmod.c Fri Nov 22 10:59:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: n_fmod.c,v 1.6 2013/11/21 10:48:11 martin Exp $ */ +/* $NetBSD: n_fmod.c,v 1.7 2013/11/22 10:59:31 martin Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -103,9 +103,9 @@ fmod(double x, double y) } float -fmodf(float x) +fmodf(float x, float y) { - return fmod(x); + return fmod(x, y); } #ifdef TEST_FMOD
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: martin Date: Thu Nov 21 10:48:11 UTC 2013 Modified Files: src/lib/libm/noieee_src: n_fmod.c Log Message: Add fmodf and fmodl To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libm/noieee_src/n_fmod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_fmod.c diff -u src/lib/libm/noieee_src/n_fmod.c:1.5 src/lib/libm/noieee_src/n_fmod.c:1.6 --- src/lib/libm/noieee_src/n_fmod.c:1.5 Thu Aug 7 16:44:51 2003 +++ src/lib/libm/noieee_src/n_fmod.c Thu Nov 21 10:48:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: n_fmod.c,v 1.5 2003/08/07 16:44:51 agc Exp $ */ +/* $NetBSD: n_fmod.c,v 1.6 2013/11/21 10:48:11 martin Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -66,6 +66,13 @@ static char sccsid[] = @(#)fmod.c 8.1 ( extern int isnan(),finite(); #endif /* !defined(__vax__) !defined(tahoe) */ +#if DBL_MANT_DIG == LDBL_MANT_DIG DBL_MIN_EXP == LDBL_MIN_EXP \ + DBL_MIN_EXP == LDBL_MIN_EXP +#ifdef __weak_alias +__weak_alias(fmodl, fmod); +#endif +#endif + #ifdef TEST_FMOD static double _fmod(double x, double y) @@ -95,6 +102,12 @@ fmod(double x, double y) return x = (double)0 ? r : -r; } +float +fmodf(float x) +{ + return fmod(x); +} + #ifdef TEST_FMOD extern long random(); extern double fmod();
CVS commit: src/lib/libm/noieee_src
Module Name:src Committed By: abs Date: Fri Jun 8 11:13:33 UTC 2012 Modified Files: src/lib/libm/noieee_src: n_gamma.c Log Message: ANSI prototypes To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_gamma.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/noieee_src/n_gamma.c diff -u src/lib/libm/noieee_src/n_gamma.c:1.7 src/lib/libm/noieee_src/n_gamma.c:1.8 --- src/lib/libm/noieee_src/n_gamma.c:1.7 Wed Nov 2 02:34:56 2011 +++ src/lib/libm/noieee_src/n_gamma.c Fri Jun 8 11:13:33 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: n_gamma.c,v 1.7 2011/11/02 02:34:56 christos Exp $ */ +/* $NetBSD: n_gamma.c,v 1.8 2012/06/08 11:13:33 abs Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -135,8 +135,7 @@ static int endian; #endif double -gamma(x) - double x; +gamma(double x) { double b; struct Double u;