Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2013 10:37:09 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        freebsd-numerics@freebsd.org
Subject:   Re: Patches for s_expl.c
Message-ID:  <20130528173709.GA51603@troutmask.apl.washington.edu>
In-Reply-To: <20130528172242.GA51485@troutmask.apl.washington.edu>
References:  <20130528172242.GA51485@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 28, 2013 at 10:22:42AM -0700, Steve Kargl wrote:
> Here are two patches for ld80/s_expl.c and ld128/s_expl.c.
> Instead of committing the one large patch that I have spent
> hours testing, I have split it into two.  One patch fixes/updates
> expl().  The other patch is the implementation of expm1l().  

I forgot to send the 3rd patch, which updates documentations,
deals with 53-bit long double targets, and math.h.  Yes, there
is some cruft in the diff, which I'll disentangle when I do
the commit.

-- 
steve

Index: Symbol.map
===================================================================
--- Symbol.map	(revision 251062)
+++ Symbol.map	(working copy)
@@ -250,4 +250,7 @@
 	ctanh;
 	ctanhf;
 	expl;
+	expm1l;
+	logl;
+	sincos;
 };
Index: man/exp.3
===================================================================
--- man/exp.3	(revision 251062)
+++ man/exp.3	(working copy)
@@ -41,6 +41,7 @@
 .Nm exp2l ,
 .Nm expm1 ,
 .Nm expm1f ,
+.Nm expm1l ,
 .Nm pow ,
 .Nm powf
 .Nd exponential and power functions
@@ -64,6 +65,8 @@
 .Fn expm1 "double x"
 .Ft float
 .Fn expm1f "float x"
+.Ft long double
+.Fn expm1l "long double x"
 .Ft double
 .Fn pow "double x" "double y"
 .Ft float
@@ -88,9 +91,10 @@
 .Fa x .
 .Pp
 The
-.Fn expm1
-and the
-.Fn expm1f
+.Fn expm1 ,
+.Fn expm1f ,
+and
+.Fn expm1l
 functions compute the value exp(x)\-1 accurately even for tiny argument
 .Fa x .
 .Pp
Index: src/math.h
===================================================================
--- src/math.h	(revision 251062)
+++ src/math.h	(working copy)
@@ -405,6 +405,7 @@
 long double	cosl(long double);
 long double	exp2l(long double);
 long double	expl(long double);
+long double	expm1l(long double);
 long double	fabsl(long double) __pure2;
 long double	fdiml(long double, long double);
 long double	floorl(long double);
@@ -419,6 +420,7 @@
 long long	llrintl(long double);
 long long	llroundl(long double);
 long double	logbl(long double);
+long double	logl(long double);
 long		lrintl(long double);
 long		lroundl(long double);
 long double	modfl(long double, long double *); /* fundamentally !__pure2 */
@@ -440,6 +442,11 @@
 long double	truncl(long double);
 
 #endif /* __ISO_C_VISIBLE >= 1999 */
+
+#if __BSD_VISIBLE
+void	sincos(double, double *, double *);
+#endif	/* __BSD_VISIBLE */
+
 __END_DECLS
 
 #endif /* !_MATH_H_ */
@@ -462,12 +469,10 @@
 long double	coshl(long double);
 long double	erfcl(long double);
 long double	erfl(long double);
-long double	expm1l(long double);
 long double	lgammal(long double);
 long double	log10l(long double);
 long double	log1pl(long double);
 long double	log2l(long double);
-long double	logl(long double);
 long double	powl(long double, long double);
 long double	sinhl(long double);
 long double	tanhl(long double);
Index: src/s_expm1.c
===================================================================
--- src/s_expm1.c	(revision 251062)
+++ src/s_expm1.c	(working copy)
@@ -216,3 +216,7 @@
 	}
 	return y;
 }
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(expm1, expm1l);
+#endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130528173709.GA51603>