[4/6] ldbl-128: Rename 'long double' to 'ldouble_t'
diff mbox

Message ID 5781fbefbf4690f85037eff0f0fee6aef8ee0d7c.1471365825.git.murphyp@linux.vnet.ibm.com
State New
Headers show

Commit Message

Paul E. Murphy Aug. 16, 2016, 5:02 p.m. UTC
Add a layer of macro indirection for long double files
which need to be built using another typename.  Likewise,
add the L(num) macro used in a later patch to override
real constants.

These changes produce identical binaries for s390x and
aarch64.

	* sysdeps/generic/math_private.h:
	[!__LDOUBLE_T_OVERRIDDEN] (ldouble_t): New default macro
	alias for long double.
	[!__LDOUBLE_T_OVERRIDDEN] (L): New default macro to apply
	long double literal suffix.

	* sysdeps/ieee754/ldbl-128/e_acoshl.c: Rename long double
	ldouble_t and ensure math_private.h gets added as needed.

	* sysdeps/ieee754/ldbl-128/e_acosl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_atan2l.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_atanhl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_coshl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_exp10l.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_expl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_fmodl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_gammal_r.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_hypotl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_ilogbl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_j0l.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_j1l.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_lgammal_r.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_log10l.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_log2l.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_logl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_powl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_rem_pio2l.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_remainderl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_sinhl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/gamma_productl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/k_cosl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/k_sincosl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/k_sinl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/k_tanl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/lgamma_negl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/lgamma_productl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/mul_splitl.h: Likewise.
	* sysdeps/ieee754/ldbl-128/s_asinhl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_atanl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_cbrtl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_ceill.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_copysignl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_cosl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_erfl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_expm1l.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fabsl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_finitel.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_floorl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fmal.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fpclassifyl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_frexpl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_issignalingl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_llrintl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_llroundl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_log1pl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_logbl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_lrintl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_lroundl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_modfl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_nearbyintl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_nextafterl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_nextupl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_remquol.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_rintl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_roundl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_scalblnl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_scalbnl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_signbitl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_sincosl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_sinl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_tanhl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_tanl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_truncl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/t_expl.h: Likewise.
	* sysdeps/ieee754/ldbl-128/t_sincosl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/x2y2m1l.c: Likewise.
	* sysdeps/ieee754/ldbl-128/e_asinl.c: Likewise.
---
 sysdeps/generic/math_private.h             |   7 ++
 sysdeps/ieee754/ldbl-128/e_acoshl.c        |   8 +-
 sysdeps/ieee754/ldbl-128/e_acosl.c         |   8 +-
 sysdeps/ieee754/ldbl-128/e_asinl.c         |  10 +-
 sysdeps/ieee754/ldbl-128/e_atan2l.c        |   8 +-
 sysdeps/ieee754/ldbl-128/e_atanhl.c        |  10 +-
 sysdeps/ieee754/ldbl-128/e_coshl.c         |   8 +-
 sysdeps/ieee754/ldbl-128/e_exp10l.c        |  12 +-
 sysdeps/ieee754/ldbl-128/e_expl.c          |   8 +-
 sysdeps/ieee754/ldbl-128/e_fmodl.c         |   6 +-
 sysdeps/ieee754/ldbl-128/e_gammal_r.c      |  50 ++++-----
 sysdeps/ieee754/ldbl-128/e_hypotl.c        |   6 +-
 sysdeps/ieee754/ldbl-128/e_ilogbl.c        |   2 +-
 sysdeps/ieee754/ldbl-128/e_j0l.c           | 104 +++++++++---------
 sysdeps/ieee754/ldbl-128/e_j1l.c           | 104 +++++++++---------
 sysdeps/ieee754/ldbl-128/e_jnl.c           |  44 ++++----
 sysdeps/ieee754/ldbl-128/e_lgammal_r.c     | 170 ++++++++++++++---------------
 sysdeps/ieee754/ldbl-128/e_log10l.c        |  30 ++---
 sysdeps/ieee754/ldbl-128/e_log2l.c         |  30 ++---
 sysdeps/ieee754/ldbl-128/e_logl.c          |  12 +-
 sysdeps/ieee754/ldbl-128/e_powl.c          |  32 +++---
 sysdeps/ieee754/ldbl-128/e_rem_pio2l.c     |  10 +-
 sysdeps/ieee754/ldbl-128/e_remainderl.c    |   8 +-
 sysdeps/ieee754/ldbl-128/e_sinhl.c         |   8 +-
 sysdeps/ieee754/ldbl-128/gamma_productl.c  |   8 +-
 sysdeps/ieee754/ldbl-128/k_cosl.c          |  10 +-
 sysdeps/ieee754/ldbl-128/k_sincosl.c       |   8 +-
 sysdeps/ieee754/ldbl-128/k_sinl.c          |  10 +-
 sysdeps/ieee754/ldbl-128/k_tanl.c          |  10 +-
 sysdeps/ieee754/ldbl-128/lgamma_negl.c     |  82 +++++++-------
 sysdeps/ieee754/ldbl-128/lgamma_productl.c |  24 ++--
 sysdeps/ieee754/ldbl-128/mul_splitl.h      |  10 +-
 sysdeps/ieee754/ldbl-128/s_asinhl.c        |   8 +-
 sysdeps/ieee754/ldbl-128/s_atanl.c         |  12 +-
 sysdeps/ieee754/ldbl-128/s_cbrtl.c         |  14 +--
 sysdeps/ieee754/ldbl-128/s_ceill.c         |   2 +-
 sysdeps/ieee754/ldbl-128/s_copysignl.c     |   8 +-
 sysdeps/ieee754/ldbl-128/s_cosl.c          |   4 +-
 sysdeps/ieee754/ldbl-128/s_erfl.c          | 140 ++++++++++++------------
 sysdeps/ieee754/ldbl-128/s_expm1l.c        |   8 +-
 sysdeps/ieee754/ldbl-128/s_fabsl.c         |   2 +-
 sysdeps/ieee754/ldbl-128/s_finitel.c       |   2 +-
 sysdeps/ieee754/ldbl-128/s_floorl.c        |   2 +-
 sysdeps/ieee754/ldbl-128/s_fmal.c          |  28 ++---
 sysdeps/ieee754/ldbl-128/s_fpclassifyl.c   |   2 +-
 sysdeps/ieee754/ldbl-128/s_frexpl.c        |   6 +-
 sysdeps/ieee754/ldbl-128/s_isinfl.c        |   2 +-
 sysdeps/ieee754/ldbl-128/s_isnanl.c        |   2 +-
 sysdeps/ieee754/ldbl-128/s_issignalingl.c  |   2 +-
 sysdeps/ieee754/ldbl-128/s_llrintl.c       |  16 +--
 sysdeps/ieee754/ldbl-128/s_llroundl.c      |   6 +-
 sysdeps/ieee754/ldbl-128/s_log1pl.c        |  18 +--
 sysdeps/ieee754/ldbl-128/s_logbl.c         |   6 +-
 sysdeps/ieee754/ldbl-128/s_lrintl.c        |  18 +--
 sysdeps/ieee754/ldbl-128/s_lroundl.c       |   6 +-
 sysdeps/ieee754/ldbl-128/s_modfl.c         |   4 +-
 sysdeps/ieee754/ldbl-128/s_nearbyintl.c    |   6 +-
 sysdeps/ieee754/ldbl-128/s_nextafterl.c    |   8 +-
 sysdeps/ieee754/ldbl-128/s_nextupl.c       |   4 +-
 sysdeps/ieee754/ldbl-128/s_remquol.c       |   8 +-
 sysdeps/ieee754/ldbl-128/s_rintl.c         |   6 +-
 sysdeps/ieee754/ldbl-128/s_roundl.c        |   4 +-
 sysdeps/ieee754/ldbl-128/s_scalblnl.c      |   6 +-
 sysdeps/ieee754/ldbl-128/s_scalbnl.c       |   4 +-
 sysdeps/ieee754/ldbl-128/s_signbitl.c      |   3 +-
 sysdeps/ieee754/ldbl-128/s_sincosl.c       |   4 +-
 sysdeps/ieee754/ldbl-128/s_sinl.c          |   4 +-
 sysdeps/ieee754/ldbl-128/s_tanhl.c         |   8 +-
 sysdeps/ieee754/ldbl-128/s_tanl.c          |   4 +-
 sysdeps/ieee754/ldbl-128/s_truncl.c        |   4 +-
 sysdeps/ieee754/ldbl-128/t_expl.h          |   2 +-
 sysdeps/ieee754/ldbl-128/t_sincosl.c       |   5 +-
 sysdeps/ieee754/ldbl-128/x2y2m1l.c         |  16 +--
 73 files changed, 641 insertions(+), 630 deletions(-)

Comments

Joseph Myers Aug. 16, 2016, 6:10 p.m. UTC | #1
On Tue, 16 Aug 2016, Paul E. Murphy wrote:

> Add a layer of macro indirection for long double files
> which need to be built using another typename.  Likewise,
> add the L(num) macro used in a later patch to override
> real constants.
> 
> These changes produce identical binaries for s390x and
> aarch64.
> 
> 	* sysdeps/generic/math_private.h:
> 	[!__LDOUBLE_T_OVERRIDDEN] (ldouble_t): New default macro
> 	alias for long double.
> 	[!__LDOUBLE_T_OVERRIDDEN] (L): New default macro to apply
> 	long double literal suffix.

I don't think ldouble_t is the right name here; it could be confused with 
long_double_t, the type name added by TS 18661-3 for a type with the 
evaluation format used for long double.

I think the right name to use is _Float128; that name unambiguously 
relates to the format these functions are written for.  (When we can 
assume a compiler with _FloatN / _FloatNx support, the ideal would be that 
these functions always define the associated _Float128 function names, use 
*f128 constants directly, etc., and may or may not, depending on the glibc 
configuration, also have aliases with the long double names, with 
_Float64x names or with both sets of names.  This series is of course only 
achieving an interim step towards such a goal which isn't possible yet, 
but there should be no problem using the _Float128 name for the macro 
now.)

> diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
> index 08b04e0..15f1efc 100644
> --- a/sysdeps/generic/math_private.h
> +++ b/sysdeps/generic/math_private.h
> @@ -185,6 +185,13 @@ do {								\
>     ldbl-128 files as another type (e.g _Float128).  */
>  #define mathx_hidden_def(name) hidden_def(name)
>  
> +/* These hooks let us override certain long double files using
> +   a different type (e.g building ldbl-128 as _Float128).  */
> +#ifndef __LDOUBLE_T_OVERRIDDEN
> +# define ldouble_t long double
> +# define L(x) x##L
> +#endif

I don't think this header is the right place for something entirely 
specific to the ldbl-128 function implementations.
Paul E. Murphy Aug. 16, 2016, 6:50 p.m. UTC | #2
On 08/16/2016 01:10 PM, Joseph Myers wrote:
> On Tue, 16 Aug 2016, Paul E. Murphy wrote:
> 
>> Add a layer of macro indirection for long double files
>> which need to be built using another typename.  Likewise,
>> add the L(num) macro used in a later patch to override
>> real constants.
>>
>> These changes produce identical binaries for s390x and
>> aarch64.
>>
>> 	* sysdeps/generic/math_private.h:
>> 	[!__LDOUBLE_T_OVERRIDDEN] (ldouble_t): New default macro
>> 	alias for long double.
>> 	[!__LDOUBLE_T_OVERRIDDEN] (L): New default macro to apply
>> 	long double literal suffix.
> 
> I don't think ldouble_t is the right name here; it could be confused with 
> long_double_t, the type name added by TS 18661-3 for a type with the 
> evaluation format used for long double.
> 
> I think the right name to use is _Float128; that name unambiguously 
> relates to the format these functions are written for.  (When we can 
> assume a compiler with _FloatN / _FloatNx support, the ideal would be that 
> these functions always define the associated _Float128 function names, use 
> *f128 constants directly, etc., and may or may not, depending on the glibc 
> configuration, also have aliases with the long double names, with 
> _Float64x names or with both sets of names.  This series is of course only 
> achieving an interim step towards such a goal which isn't possible yet, 
> but there should be no problem using the _Float128 name for the macro 
> now.)

That was my original thought, but it begs the question of why the
implementation should reside in ldbl-128 folder.

Likewise, other long double formats do include some ldbl-128 files
with the intent of building them using the native long double format
(e.g ldbl-128ibm e_j0l.c).  Thus, calling such a macro _Float128 is
misleading, or wrong, in those circumstances.

I have no objection to calling it another name maybe m_ldouble, or
LONG_DOUBLE.

> 
>> diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
>> index 08b04e0..15f1efc 100644
>> --- a/sysdeps/generic/math_private.h
>> +++ b/sysdeps/generic/math_private.h
>> @@ -185,6 +185,13 @@ do {								\
>>     ldbl-128 files as another type (e.g _Float128).  */
>>  #define mathx_hidden_def(name) hidden_def(name)
>>  
>> +/* These hooks let us override certain long double files using
>> +   a different type (e.g building ldbl-128 as _Float128).  */
>> +#ifndef __LDOUBLE_T_OVERRIDDEN
>> +# define ldouble_t long double
>> +# define L(x) x##L
>> +#endif
> 
> I don't think this header is the right place for something entirely 
> specific to the ldbl-128 function implementations.

Ultimately, this will be needed to build the ldbl-128ibm under whatever
typename emerges when transitioning the ppc64le long double format.
Joseph Myers Aug. 16, 2016, 8:50 p.m. UTC | #3
On Tue, 16 Aug 2016, Paul E. Murphy wrote:

> > I think the right name to use is _Float128; that name unambiguously 
> > relates to the format these functions are written for.  (When we can 
> > assume a compiler with _FloatN / _FloatNx support, the ideal would be that 
> > these functions always define the associated _Float128 function names, use 
> > *f128 constants directly, etc., and may or may not, depending on the glibc 
> > configuration, also have aliases with the long double names, with 
> > _Float64x names or with both sets of names.  This series is of course only 
> > achieving an interim step towards such a goal which isn't possible yet, 
> > but there should be no problem using the _Float128 name for the macro 
> > now.)
> 
> That was my original thought, but it begs the question of why the
> implementation should reside in ldbl-128 folder.

My answer is that ideally it wouldn't; see the sort of directory structure 
I suggested in 
<https://sourceware.org/ml/libc-alpha/2016-05/msg00092.html>.  But that's 
what things would look like ideally, eventually, not something necessarily 
required to achieve support for _Float128 as an additional type.

> Likewise, other long double formats do include some ldbl-128 files
> with the intent of building them using the native long double format
> (e.g ldbl-128ibm e_j0l.c).  Thus, calling such a macro _Float128 is
> misleading, or wrong, in those circumstances.

And maybe just those few files, written for this format but also used for 
ldbl-128ibm, would use another layer of indirection for their types.  
_Float128 is logically correct for the vast bulk of the ldbl-128 
functions.

(Strictly, of course, _Float128 is a separate type from long double on 
platforms where they have the same representation.  Juggling the types and 
function names to avoid issues declaring a long double function with the 
wrong type is something that would need to be done by whoever adds support 
for *f128 aliases for *l functions on such platforms, but that's not part 
of what you need to do here.)

> >> diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
> >> index 08b04e0..15f1efc 100644
> >> --- a/sysdeps/generic/math_private.h
> >> +++ b/sysdeps/generic/math_private.h
> >> @@ -185,6 +185,13 @@ do {								\
> >>     ldbl-128 files as another type (e.g _Float128).  */
> >>  #define mathx_hidden_def(name) hidden_def(name)
> >>  
> >> +/* These hooks let us override certain long double files using
> >> +   a different type (e.g building ldbl-128 as _Float128).  */
> >> +#ifndef __LDOUBLE_T_OVERRIDDEN
> >> +# define ldouble_t long double
> >> +# define L(x) x##L
> >> +#endif
> > 
> > I don't think this header is the right place for something entirely 
> > specific to the ldbl-128 function implementations.
> 
> Ultimately, this will be needed to build the ldbl-128ibm under whatever
> typename emerges when transitioning the ppc64le long double format.

I don't see that as needed (in a generic header, anyway; no doubt 
something will be needed in a header specific to ldbl-128ibm).  
ldbl-128ibm could always be built with an appropriate -mabi option to 
select IBM long double, or using __ibm128 and any constant suffix you add 
for the purpose.

Patch
diff mbox

diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index 08b04e0..15f1efc 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -185,6 +185,13 @@  do {								\
    ldbl-128 files as another type (e.g _Float128).  */
 #define mathx_hidden_def(name) hidden_def(name)
 
+/* These hooks let us override certain long double files using
+   a different type (e.g building ldbl-128 as _Float128).  */
+#ifndef __LDOUBLE_T_OVERRIDDEN
+# define ldouble_t long double
+# define L(x) x##L
+#endif
+
 /* Get long double macros from a separate header.  */
 #include <math_ldbl.h>
 
diff --git a/sysdeps/ieee754/ldbl-128/e_acoshl.c b/sysdeps/ieee754/ldbl-128/e_acoshl.c
index 6234289..a71bb5a 100644
--- a/sysdeps/ieee754/ldbl-128/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128/e_acoshl.c
@@ -30,14 +30,14 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
 one	= 1.0,
 ln2	= 0.6931471805599453094172321214581766L;
 
-long double
-__ieee754_acoshl(long double x)
+ldouble_t
+__ieee754_acoshl(ldouble_t x)
 {
-	long double t;
+	ldouble_t t;
 	u_int64_t lx;
 	int64_t hx;
 	GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/e_acosl.c b/sysdeps/ieee754/ldbl-128/e_acosl.c
index 8c8ec93..a1f031d 100644
--- a/sysdeps/ieee754/ldbl-128/e_acosl.c
+++ b/sysdeps/ieee754/ldbl-128/e_acosl.c
@@ -57,7 +57,7 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
   one = 1.0L,
   pio2_hi = 1.5707963267948966192313216916397514420986L,
   pio2_lo = 4.3359050650618905123985220130216759843812E-35L,
@@ -148,10 +148,10 @@  static const long double
   qS8 = -4.175375777334867025769346564600396877176E1L;
   /* 1.000000000000000000000000000000000000000E0 */
 
-long double
-__ieee754_acosl (long double x)
+ldouble_t
+__ieee754_acosl (ldouble_t x)
 {
-  long double z, r, w, p, q, s, t, f2;
+  ldouble_t z, r, w, p, q, s, t, f2;
   int32_t ix, sign;
   ieee854_long_double_shape_type u;
 
diff --git a/sysdeps/ieee754/ldbl-128/e_asinl.c b/sysdeps/ieee754/ldbl-128/e_asinl.c
index 4a8ed4c..0909acc 100644
--- a/sysdeps/ieee754/ldbl-128/e_asinl.c
+++ b/sysdeps/ieee754/ldbl-128/e_asinl.c
@@ -63,7 +63,7 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
   one = 1.0L,
   huge = 1.0e+4932L,
   pio2_hi = 1.5707963267948966192313216916397514420986L,
@@ -128,10 +128,10 @@  static const long double
 
 
 
-long double
-__ieee754_asinl (long double x)
+ldouble_t
+__ieee754_asinl (ldouble_t x)
 {
-  long double t, w, p, q, c, r, s;
+  ldouble_t t, w, p, q, c, r, s;
   int32_t ix, sign, flag;
   ieee854_long_double_shape_type u;
 
@@ -153,7 +153,7 @@  __ieee754_asinl (long double x)
       if (ix < 0x3fc60000) /* |x| < 2**-57 */
 	{
 	  math_check_force_underflow (x);
-	  long double force_inexact = huge + x;
+	  ldouble_t force_inexact = huge + x;
 	  math_force_eval (force_inexact);
 	  return x;		/* return x with inexact if x!=0 */
 	}
diff --git a/sysdeps/ieee754/ldbl-128/e_atan2l.c b/sysdeps/ieee754/ldbl-128/e_atan2l.c
index d31ee70..6a9eb26 100644
--- a/sysdeps/ieee754/ldbl-128/e_atan2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_atan2l.c
@@ -43,7 +43,7 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
 tiny  = 1.0e-4900L,
 zero  = 0.0,
 pi_o_4  = 7.85398163397448309615660845819875699e-01L, /* 3ffe921fb54442d18469898cc51701b8 */
@@ -51,10 +51,10 @@  pi_o_2  = 1.57079632679489661923132169163975140e+00L, /* 3fff921fb54442d18469898
 pi      = 3.14159265358979323846264338327950280e+00L, /* 4000921fb54442d18469898cc51701b8 */
 pi_lo   = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74020bbea64 */
 
-long double
-__ieee754_atan2l(long double y, long double x)
+ldouble_t
+__ieee754_atan2l(ldouble_t y, ldouble_t x)
 {
-	long double z;
+	ldouble_t z;
 	int64_t k,m,hx,hy,ix,iy;
 	u_int64_t lx,ly;
 
diff --git a/sysdeps/ieee754/ldbl-128/e_atanhl.c b/sysdeps/ieee754/ldbl-128/e_atanhl.c
index 7fa53ef..20a4604 100644
--- a/sysdeps/ieee754/ldbl-128/e_atanhl.c
+++ b/sysdeps/ieee754/ldbl-128/e_atanhl.c
@@ -36,14 +36,14 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double one = 1.0L, huge = 1e4900L;
+static const ldouble_t one = 1.0L, huge = 1e4900L;
 
-static const long double zero = 0.0L;
+static const ldouble_t zero = 0.0L;
 
-long double
-__ieee754_atanhl(long double x)
+ldouble_t
+__ieee754_atanhl(ldouble_t x)
 {
-	long double t;
+	ldouble_t t;
 	u_int32_t jx, ix;
 	ieee854_long_double_shape_type u;
 
diff --git a/sysdeps/ieee754/ldbl-128/e_coshl.c b/sysdeps/ieee754/ldbl-128/e_coshl.c
index 488c318..5eb08c5 100644
--- a/sysdeps/ieee754/ldbl-128/e_coshl.c
+++ b/sysdeps/ieee754/ldbl-128/e_coshl.c
@@ -54,13 +54,13 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double one = 1.0, half = 0.5, huge = 1.0e4900L,
+static const ldouble_t one = 1.0, half = 0.5, huge = 1.0e4900L,
 ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
 
-long double
-__ieee754_coshl (long double x)
+ldouble_t
+__ieee754_coshl (ldouble_t x)
 {
-  long double t, w;
+  ldouble_t t, w;
   int32_t ex;
   ieee854_long_double_shape_type u;
 
diff --git a/sysdeps/ieee754/ldbl-128/e_exp10l.c b/sysdeps/ieee754/ldbl-128/e_exp10l.c
index 9870025..5d4f69a 100644
--- a/sysdeps/ieee754/ldbl-128/e_exp10l.c
+++ b/sysdeps/ieee754/ldbl-128/e_exp10l.c
@@ -19,15 +19,15 @@ 
 #include <math_private.h>
 #include <float.h>
 
-static const long double log10_high = 0x2.4d763776aaa2bp0L;
-static const long double log10_low = 0x5.ba95b58ae0b4c28a38a3fb3e7698p-60L;
+static const ldouble_t log10_high = 0x2.4d763776aaa2bp0L;
+static const ldouble_t log10_low = 0x5.ba95b58ae0b4c28a38a3fb3e7698p-60L;
 
-long double
-__ieee754_exp10l (long double arg)
+ldouble_t
+__ieee754_exp10l (ldouble_t arg)
 {
   ieee854_long_double_shape_type u;
-  long double arg_high, arg_low;
-  long double exp_high, exp_low;
+  ldouble_t arg_high, arg_low;
+  ldouble_t exp_high, exp_low;
 
   if (!isfinite (arg))
     return __ieee754_expl (arg);
diff --git a/sysdeps/ieee754/ldbl-128/e_expl.c b/sysdeps/ieee754/ldbl-128/e_expl.c
index 7b71e64..0427021 100644
--- a/sysdeps/ieee754/ldbl-128/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128/e_expl.c
@@ -68,7 +68,7 @@ 
 #include <stdlib.h>
 #include "t_expl.h"
 
-static const long double C[] = {
+static const ldouble_t C[] = {
 /* Smallest integer x for which e^x overflows.  */
 #define himark C[0]
  11356.523406294143949491931077970765L,
@@ -132,14 +132,14 @@  static const long double C[] = {
  1.98412698413981650382436541785404286E-04L,
 };
 
-long double
-__ieee754_expl (long double x)
+ldouble_t
+__ieee754_expl (ldouble_t x)
 {
   /* Check for usual case.  */
   if (isless (x, himark) && isgreater (x, lomark))
     {
       int tval1, tval2, unsafe, n_i;
-      long double x22, n, t, result, xl;
+      ldouble_t x22, n, t, result, xl;
       union ieee854_long_double ex2_u, scale_u;
       fenv_t oldenv;
 
diff --git a/sysdeps/ieee754/ldbl-128/e_fmodl.c b/sysdeps/ieee754/ldbl-128/e_fmodl.c
index 3328003..63f5e1d 100644
--- a/sysdeps/ieee754/ldbl-128/e_fmodl.c
+++ b/sysdeps/ieee754/ldbl-128/e_fmodl.c
@@ -21,10 +21,10 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double one = 1.0, Zero[] = {0.0, -0.0,};
+static const ldouble_t one = 1.0, Zero[] = {0.0, -0.0,};
 
-long double
-__ieee754_fmodl (long double x, long double y)
+ldouble_t
+__ieee754_fmodl (ldouble_t x, ldouble_t y)
 {
 	int64_t n,hx,hy,hz,ix,iy,sx,i;
 	u_int64_t lx,ly,lz;
diff --git a/sysdeps/ieee754/ldbl-128/e_gammal_r.c b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
index d0286e3..e9e4c4f 100644
--- a/sysdeps/ieee754/ldbl-128/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
@@ -25,7 +25,7 @@ 
 /* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
    approximation to gamma function.  */
 
-static const long double gamma_coeff[] =
+static const ldouble_t gamma_coeff[] =
   {
     0x1.5555555555555555555555555555p-4L,
     -0xb.60b60b60b60b60b60b60b60b60b8p-12L,
@@ -49,8 +49,8 @@  static const long double gamma_coeff[] =
    2^(*EXP2_ADJ), where R is the return value and *EXP2_ADJ is set to
    avoid overflow or underflow in intermediate calculations.  */
 
-static long double
-gammal_positive (long double x, int *exp2_adj)
+static ldouble_t
+gammal_positive (ldouble_t x, int *exp2_adj)
 {
   int local_signgam;
   if (x < 0.5L)
@@ -67,24 +67,24 @@  gammal_positive (long double x, int *exp2_adj)
     {
       /* Adjust into the range for using exp (lgamma).  */
       *exp2_adj = 0;
-      long double n = __ceill (x - 1.5L);
-      long double x_adj = x - n;
-      long double eps;
-      long double prod = __gamma_productl (x_adj, 0, n, &eps);
+      ldouble_t n = __ceill (x - 1.5L);
+      ldouble_t x_adj = x - n;
+      ldouble_t eps;
+      ldouble_t prod = __gamma_productl (x_adj, 0, n, &eps);
       return (__ieee754_expl (__ieee754_lgammal_r (x_adj, &local_signgam))
 	      * prod * (1.0L + eps));
     }
   else
     {
-      long double eps = 0;
-      long double x_eps = 0;
-      long double x_adj = x;
-      long double prod = 1;
+      ldouble_t eps = 0;
+      ldouble_t x_eps = 0;
+      ldouble_t x_adj = x;
+      ldouble_t prod = 1;
       if (x < 24.0L)
 	{
 	  /* Adjust into the range for applying Stirling's
 	     approximation.  */
-	  long double n = __ceill (24.0L - x);
+	  ldouble_t n = __ceill (24.0L - x);
 	  x_adj = x + n;
 	  x_eps = (x - (x_adj - n));
 	  prod = __gamma_productl (x_adj - n, x_eps, n, &eps);
@@ -93,25 +93,25 @@  gammal_positive (long double x, int *exp2_adj)
 	 Compute gamma (X_ADJ + X_EPS) using Stirling's approximation,
 	 starting by computing pow (X_ADJ, X_ADJ) with a power of 2
 	 factored out.  */
-      long double exp_adj = -eps;
-      long double x_adj_int = __roundl (x_adj);
-      long double x_adj_frac = x_adj - x_adj_int;
+      ldouble_t exp_adj = -eps;
+      ldouble_t x_adj_int = __roundl (x_adj);
+      ldouble_t x_adj_frac = x_adj - x_adj_int;
       int x_adj_log2;
-      long double x_adj_mant = __frexpl (x_adj, &x_adj_log2);
+      ldouble_t x_adj_mant = __frexpl (x_adj, &x_adj_log2);
       if (x_adj_mant < M_SQRT1_2l)
 	{
 	  x_adj_log2--;
 	  x_adj_mant *= 2.0L;
 	}
       *exp2_adj = x_adj_log2 * (int) x_adj_int;
-      long double ret = (__ieee754_powl (x_adj_mant, x_adj)
+      ldouble_t ret = (__ieee754_powl (x_adj_mant, x_adj)
 			 * __ieee754_exp2l (x_adj_log2 * x_adj_frac)
 			 * __ieee754_expl (-x_adj)
 			 * __ieee754_sqrtl (2 * M_PIl / x_adj)
 			 / prod);
       exp_adj += x_eps * __ieee754_logl (x_adj);
-      long double bsum = gamma_coeff[NCOEFF - 1];
-      long double x_adj2 = x_adj * x_adj;
+      ldouble_t bsum = gamma_coeff[NCOEFF - 1];
+      ldouble_t x_adj2 = x_adj * x_adj;
       for (size_t i = 1; i <= NCOEFF - 1; i++)
 	bsum = bsum / x_adj2 + gamma_coeff[NCOEFF - 1 - i];
       exp_adj += bsum / x_adj;
@@ -119,12 +119,12 @@  gammal_positive (long double x, int *exp2_adj)
     }
 }
 
-long double
-__ieee754_gammal_r (long double x, int *signgamp)
+ldouble_t
+__ieee754_gammal_r (ldouble_t x, int *signgamp)
 {
   int64_t hx;
   u_int64_t lx;
-  long double ret;
+  ldouble_t ret;
 
   GET_LDOUBLE_WORDS64 (hx, lx, x);
 
@@ -177,17 +177,17 @@  __ieee754_gammal_r (long double x, int *signgamp)
 	}
       else
 	{
-	  long double tx = __truncl (x);
+	  ldouble_t tx = __truncl (x);
 	  *signgamp = (tx == 2.0L * __truncl (tx / 2.0L)) ? -1 : 1;
 	  if (x <= -1775.0L)
 	    /* Underflow.  */
 	    ret = LDBL_MIN * LDBL_MIN;
 	  else
 	    {
-	      long double frac = tx - x;
+	      ldouble_t frac = tx - x;
 	      if (frac > 0.5L)
 		frac = 1.0L - frac;
-	      long double sinpix = (frac <= 0.25L
+	      ldouble_t sinpix = (frac <= 0.25L
 				    ? __sinl (M_PIl * frac)
 				    : __cosl (M_PIl * (0.5L - frac)));
 	      int exp2_adj;
diff --git a/sysdeps/ieee754/ldbl-128/e_hypotl.c b/sysdeps/ieee754/ldbl-128/e_hypotl.c
index 80e5e38..fb3d2ab 100644
--- a/sysdeps/ieee754/ldbl-128/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-128/e_hypotl.c
@@ -48,10 +48,10 @@ 
 #include <math.h>
 #include <math_private.h>
 
-long double
-__ieee754_hypotl(long double x, long double y)
+ldouble_t
+__ieee754_hypotl(ldouble_t x, ldouble_t y)
 {
-	long double a,b,t1,t2,y1,y2,w;
+	ldouble_t a,b,t1,t2,y1,y2,w;
 	int64_t j,k,ha,hb;
 
 	GET_LDOUBLE_MSW64(ha,x);
diff --git a/sysdeps/ieee754/ldbl-128/e_ilogbl.c b/sysdeps/ieee754/ldbl-128/e_ilogbl.c
index 0a47649..7512b28 100644
--- a/sysdeps/ieee754/ldbl-128/e_ilogbl.c
+++ b/sysdeps/ieee754/ldbl-128/e_ilogbl.c
@@ -28,7 +28,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-int __ieee754_ilogbl (long double x)
+int __ieee754_ilogbl (ldouble_t x)
 {
 	int64_t hx,lx;
 	int ix;
diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c
index ddc8214..e437a83 100644
--- a/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -96,16 +96,16 @@ 
 #include <float.h>
 
 /* 1 / sqrt(pi) */
-static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+static const ldouble_t ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
 /* 2 / pi */
-static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
-static const long double zero = 0.0L;
+static const ldouble_t TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const ldouble_t zero = 0.0L;
 
 /* J0(x) = 1 - x^2/4 + x^2 x^2 R(x^2)
    Peak relative error 3.4e-37
    0 <= x <= 2  */
 #define NJ0_2N 6
-static const long double J0_2N[NJ0_2N + 1] = {
+static const ldouble_t J0_2N[NJ0_2N + 1] = {
   3.133239376997663645548490085151484674892E16L,
  -5.479944965767990821079467311839107722107E14L,
   6.290828903904724265980249871997551894090E12L,
@@ -115,7 +115,7 @@  static const long double J0_2N[NJ0_2N + 1] = {
   1.562826808020631846245296572935547005859E2L,
 };
 #define NJ0_2D 6
-static const long double J0_2D[NJ0_2D + 1] = {
+static const ldouble_t J0_2D[NJ0_2D + 1] = {
   2.005273201278504733151033654496928968261E18L,
   2.063038558793221244373123294054149790864E16L,
   1.053350447931127971406896594022010524994E14L,
@@ -130,7 +130,7 @@  static const long double J0_2D[NJ0_2D + 1] = {
    0 <= 1/x <= .0625
    Peak relative error 3.3e-36  */
 #define NP16_IN 9
-static const long double P16_IN[NP16_IN + 1] = {
+static const ldouble_t P16_IN[NP16_IN + 1] = {
   -1.901689868258117463979611259731176301065E-16L,
   -1.798743043824071514483008340803573980931E-13L,
   -6.481746687115262291873324132944647438959E-11L,
@@ -143,7 +143,7 @@  static const long double P16_IN[NP16_IN + 1] = {
   -1.271468546258855781530458854476627766233E-1L,
 };
 #define NP16_ID 9
-static const long double P16_ID[NP16_ID + 1] = {
+static const ldouble_t P16_ID[NP16_ID + 1] = {
   2.704625590411544837659891569420764475007E-15L,
   2.562526347676857624104306349421985403573E-12L,
   9.259137589952741054108665570122085036246E-10L,
@@ -161,7 +161,7 @@  static const long double P16_ID[NP16_ID + 1] = {
     0.0625 <= 1/x <= 0.125
     Peak relative error 2.4e-35  */
 #define NP8_16N 10
-static const long double P8_16N[NP8_16N + 1] = {
+static const ldouble_t P8_16N[NP8_16N + 1] = {
   -2.335166846111159458466553806683579003632E-15L,
   -1.382763674252402720401020004169367089975E-12L,
   -3.192160804534716696058987967592784857907E-10L,
@@ -175,7 +175,7 @@  static const long double P8_16N[NP8_16N + 1] = {
   -1.670703190068873186016102289227646035035E-1L,
 };
 #define NP8_16D 10
-static const long double P8_16D[NP8_16D + 1] = {
+static const ldouble_t P8_16D[NP8_16D + 1] = {
   3.321126181135871232648331450082662856743E-14L,
   1.971894594837650840586859228510007703641E-11L,
   4.571144364787008285981633719513897281690E-9L,
@@ -194,7 +194,7 @@  static const long double P8_16D[NP8_16D + 1] = {
   0.125 <= 1/x <= 0.1875
   Peak relative error 2.7e-35  */
 #define NP5_8N 10
-static const long double P5_8N[NP5_8N + 1] = {
+static const ldouble_t P5_8N[NP5_8N + 1] = {
   -1.270478335089770355749591358934012019596E-12L,
   -4.007588712145412921057254992155810347245E-10L,
   -4.815187822989597568124520080486652009281E-8L,
@@ -208,7 +208,7 @@  static const long double P5_8N[NP5_8N + 1] = {
   -8.920026499909994671248893388013790366712E-3L,
 };
 #define NP5_8D 9
-static const long double P5_8D[NP5_8D + 1] = {
+static const ldouble_t P5_8D[NP5_8D + 1] = {
   1.806902521016705225778045904631543990314E-11L,
   5.728502760243502431663549179135868966031E-9L,
   6.938168504826004255287618819550667978450E-7L,
@@ -226,7 +226,7 @@  static const long double P5_8D[NP5_8D + 1] = {
    Peak relative error 3.5e-35
    0.1875 <= 1/x <= 0.25  */
 #define NP4_5N 9
-static const long double P4_5N[NP4_5N + 1] = {
+static const ldouble_t P4_5N[NP4_5N + 1] = {
   -9.791405771694098960254468859195175708252E-10L,
   -1.917193059944531970421626610188102836352E-7L,
   -1.393597539508855262243816152893982002084E-5L,
@@ -239,7 +239,7 @@  static const long double P4_5N[NP4_5N + 1] = {
   -2.251804386252969656586810309252357233320E-1L,
 };
 #define NP4_5D 9
-static const long double P4_5D[NP4_5D + 1] = {
+static const ldouble_t P4_5D[NP4_5D + 1] = {
   1.392555487577717669739688337895791213139E-8L,
   2.748886559120659027172816051276451376854E-6L,
   2.024717710644378047477189849678576659290E-4L,
@@ -257,7 +257,7 @@  static const long double P4_5D[NP4_5D + 1] = {
    Peak relative error 2.3e-36
    0.25 <= 1/x <= 0.3125  */
 #define NP3r2_4N 9
-static const long double P3r2_4N[NP3r2_4N + 1] = {
+static const ldouble_t P3r2_4N[NP3r2_4N + 1] = {
   -2.589155123706348361249809342508270121788E-8L,
   -3.746254369796115441118148490849195516593E-6L,
   -1.985595497390808544622893738135529701062E-4L,
@@ -270,7 +270,7 @@  static const long double P3r2_4N[NP3r2_4N + 1] = {
   -2.518966692256192789269859830255724429375E-1L,
 };
 #define NP3r2_4D 9
-static const long double P3r2_4D[NP3r2_4D + 1] = {
+static const ldouble_t P3r2_4D[NP3r2_4D + 1] = {
   3.682353957237979993646169732962573930237E-7L,
   5.386741661883067824698973455566332102029E-5L,
   2.906881154171822780345134853794241037053E-3L,
@@ -288,7 +288,7 @@  static const long double P3r2_4D[NP3r2_4D + 1] = {
    Peak relative error 1.0e-35
    0.3125 <= 1/x <= 0.375  */
 #define NP2r7_3r2N 9
-static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
+static const ldouble_t P2r7_3r2N[NP2r7_3r2N + 1] = {
   -1.917322340814391131073820537027234322550E-7L,
   -1.966595744473227183846019639723259011906E-5L,
   -7.177081163619679403212623526632690465290E-4L,
@@ -301,7 +301,7 @@  static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
   -4.098025357743657347681137871388402849581E-3L,
 };
 #define NP2r7_3r2D 8
-static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
+static const ldouble_t P2r7_3r2D[NP2r7_3r2D + 1] = {
   2.726858489303036441686496086962545034018E-6L,
   2.840430827557109238386808968234848081424E-4L,
   1.063826772041781947891481054529454088832E-2L,
@@ -318,7 +318,7 @@  static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
    Peak relative error 1.3e-36
    0.3125 <= 1/x <= 0.4375  */
 #define NP2r3_2r7N 9
-static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
+static const ldouble_t P2r3_2r7N[NP2r3_2r7N + 1] = {
   -1.594642785584856746358609622003310312622E-6L,
   -1.323238196302221554194031733595194539794E-4L,
   -3.856087818696874802689922536987100372345E-3L,
@@ -331,7 +331,7 @@  static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
   -3.246859189246653459359775001466924610236E-3L,
 };
 #define NP2r3_2r7D 8
-static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
+static const ldouble_t P2r3_2r7D[NP2r3_2r7D + 1] = {
   2.267936634217251403663034189684284173018E-5L,
   1.918112982168673386858072491437971732237E-3L,
   5.771704085468423159125856786653868219522E-2L,
@@ -348,7 +348,7 @@  static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
    Peak relative error 1.2e-35
    0.4375 <= 1/x <= 0.5  */
 #define NP2_2r3N 8
-static const long double P2_2r3N[NP2_2r3N + 1] = {
+static const ldouble_t P2_2r3N[NP2_2r3N + 1] = {
   -1.001042324337684297465071506097365389123E-4L,
   -6.289034524673365824853547252689991418981E-3L,
   -1.346527918018624234373664526930736205806E-1L,
@@ -360,7 +360,7 @@  static const long double P2_2r3N[NP2_2r3N + 1] = {
   -3.000348318524471807839934764596331810608E-1L,
 };
 #define NP2_2r3D 8
-static const long double P2_2r3D[NP2_2r3D + 1] = {
+static const ldouble_t P2_2r3D[NP2_2r3D + 1] = {
   1.423705538269770974803901422532055612980E-3L,
   9.171476630091439978533535167485230575894E-2L,
   2.049776318166637248868444600215942828537E0L,
@@ -378,7 +378,7 @@  static const long double P2_2r3D[NP2_2r3D + 1] = {
    Peak relative error 2.2e-35
    0 <= 1/x <= .0625  */
 #define NQ16_IN 10
-static const long double Q16_IN[NQ16_IN + 1] = {
+static const ldouble_t Q16_IN[NQ16_IN + 1] = {
   2.343640834407975740545326632205999437469E-18L,
   2.667978112927811452221176781536278257448E-15L,
   1.178415018484555397390098879501969116536E-12L,
@@ -392,7 +392,7 @@  static const long double Q16_IN[NQ16_IN + 1] = {
   1.107891967702173292405380993183694932208E-2L,
 };
 #define NQ16_ID 9
-static const long double Q16_ID[NQ16_ID + 1] = {
+static const ldouble_t Q16_ID[NQ16_ID + 1] = {
   3.199850952578356211091219295199301766718E-17L,
   3.652601488020654842194486058637953363918E-14L,
   1.620179741394865258354608590461839031281E-11L,
@@ -411,7 +411,7 @@  static const long double Q16_ID[NQ16_ID + 1] = {
    Peak relative error 5.1e-36
    0.0625 <= 1/x <= 0.125  */
 #define NQ8_16N 11
-static const long double Q8_16N[NQ8_16N + 1] = {
+static const ldouble_t Q8_16N[NQ8_16N + 1] = {
   1.001954266485599464105669390693597125904E-17L,
   7.545499865295034556206475956620160007849E-15L,
   2.267838684785673931024792538193202559922E-12L,
@@ -426,7 +426,7 @@  static const long double Q8_16N[NQ8_16N + 1] = {
   7.598886310387075708640370806458926458301E-2L,
 };
 #define NQ8_16D 11
-static const long double Q8_16D[NQ8_16D + 1] = {
+static const ldouble_t Q8_16D[NQ8_16D + 1] = {
   1.368001558508338469503329967729951830843E-16L,
   1.034454121857542147020549303317348297289E-13L,
   3.128109209247090744354764050629381674436E-11L,
@@ -447,7 +447,7 @@  static const long double Q8_16D[NQ8_16D + 1] = {
    Peak relative error 3.9e-35
    0.125 <= 1/x <= 0.1875  */
 #define NQ5_8N 10
-static const long double Q5_8N[NQ5_8N + 1] = {
+static const ldouble_t Q5_8N[NQ5_8N + 1] = {
   1.750399094021293722243426623211733898747E-13L,
   6.483426211748008735242909236490115050294E-11L,
   9.279430665656575457141747875716899958373E-9L,
@@ -461,7 +461,7 @@  static const long double Q5_8N[NQ5_8N + 1] = {
   8.383984859679804095463699702165659216831E-2L,
 };
 #define NQ5_8D 10
-static const long double Q5_8D[NQ5_8D + 1] = {
+static const ldouble_t Q5_8D[NQ5_8D + 1] = {
   2.389878229704327939008104855942987615715E-12L,
   8.926142817142546018703814194987786425099E-10L,
   1.294065862406745901206588525833274399038E-7L,
@@ -481,7 +481,7 @@  static const long double Q5_8D[NQ5_8D + 1] = {
    Peak relative error 3.2e-35
    0.1875 <= 1/x <= 0.25  */
 #define NQ4_5N 10
-static const long double Q4_5N[NQ4_5N + 1] = {
+static const ldouble_t Q4_5N[NQ4_5N + 1] = {
   2.233870042925895644234072357400122854086E-11L,
   5.146223225761993222808463878999151699792E-9L,
   4.459114531468296461688753521109797474523E-7L,
@@ -495,7 +495,7 @@  static const long double Q4_5N[NQ4_5N + 1] = {
   1.941595365256460232175236758506411486667E-3L,
 };
 #define NQ4_5D 9
-static const long double Q4_5D[NQ4_5D + 1] = {
+static const ldouble_t Q4_5D[NQ4_5D + 1] = {
   3.049977232266999249626430127217988047453E-10L,
   7.120883230531035857746096928889676144099E-8L,
   6.301786064753734446784637919554359588859E-6L,
@@ -514,7 +514,7 @@  static const long double Q4_5D[NQ4_5D + 1] = {
    Peak relative error 1.4e-36
    0.25 <= 1/x <= 0.3125  */
 #define NQ3r2_4N 10
-static const long double Q3r2_4N[NQ3r2_4N + 1] = {
+static const ldouble_t Q3r2_4N[NQ3r2_4N + 1] = {
   6.126167301024815034423262653066023684411E-10L,
   1.043969327113173261820028225053598975128E-7L,
   6.592927270288697027757438170153763220190E-6L,
@@ -528,7 +528,7 @@  static const long double Q3r2_4N[NQ3r2_4N + 1] = {
   1.229509543620976530030153018986910810747E-3L,
 };
 #define NQ3r2_4D 9
-static const long double Q3r2_4D[NQ3r2_4D + 1] = {
+static const ldouble_t Q3r2_4D[NQ3r2_4D + 1] = {
   8.364260446128475461539941389210166156568E-9L,
   1.451301850638956578622154585560759862764E-6L,
   9.431830010924603664244578867057141839463E-5L,
@@ -547,7 +547,7 @@  static const long double Q3r2_4D[NQ3r2_4D + 1] = {
    Peak relative error 3.8e-36
    0.3125 <= 1/x <= 0.375  */
 #define NQ2r7_3r2N 9
-static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+static const ldouble_t Q2r7_3r2N[NQ2r7_3r2N + 1] = {
   7.584861620402450302063691901886141875454E-8L,
   9.300939338814216296064659459966041794591E-6L,
   4.112108906197521696032158235392604947895E-4L,
@@ -560,7 +560,7 @@  static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
   9.805848115375053300608712721986235900715E-2L,
 };
 #define NQ2r7_3r2D 9
-static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+static const ldouble_t Q2r7_3r2D[NQ2r7_3r2D + 1] = {
   1.035586492113036586458163971239438078160E-6L,
   1.301999337731768381683593636500979713689E-4L,
   5.993695702564527062553071126719088859654E-3L,
@@ -579,7 +579,7 @@  static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
    Peak relative error 2.2e-35
    0.375 <= 1/x <= 0.4375  */
 #define NQ2r3_2r7N 9
-static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+static const ldouble_t Q2r3_2r7N[NQ2r3_2r7N + 1] = {
   4.455027774980750211349941766420190722088E-7L,
   4.031998274578520170631601850866780366466E-5L,
   1.273987274325947007856695677491340636339E-3L,
@@ -592,7 +592,7 @@  static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
   7.261345286655345047417257611469066147561E-4L,
 };
 #define NQ2r3_2r7D 8
-static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+static const ldouble_t Q2r3_2r7D[NQ2r3_2r7D + 1] = {
   6.082600739680555266312417978064954793142E-6L,
   5.693622538165494742945717226571441747567E-4L,
   1.901625907009092204458328768129666975975E-2L,
@@ -610,7 +610,7 @@  static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
    Peak relative error 3.1e-36
    0.4375 <= 1/x <= 0.5  */
 #define NQ2_2r3N 9
-static const long double Q2_2r3N[NQ2_2r3N + 1] = {
+static const ldouble_t Q2_2r3N[NQ2_2r3N + 1] = {
   2.817566786579768804844367382809101929314E-6L,
   2.122772176396691634147024348373539744935E-4L,
   5.501378031780457828919593905395747517585E-3L,
@@ -623,7 +623,7 @@  static const long double Q2_2r3N[NQ2_2r3N + 1] = {
   5.317668723070450235320878117210807236375E-4L,
 };
 #define NQ2_2r3D 8
-static const long double Q2_2r3D[NQ2_2r3D + 1] = {
+static const ldouble_t Q2_2r3D[NQ2_2r3D + 1] = {
   3.846924354014260866793741072933159380158E-5L,
   3.017562820057704325510067178327449946763E-3L,
   8.356305620686867949798885808540444210935E-2L,
@@ -639,10 +639,10 @@  static const long double Q2_2r3D[NQ2_2r3D + 1] = {
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-neval (long double x, const long double *p, int n)
+static ldouble_t
+neval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = *p--;
@@ -657,10 +657,10 @@  neval (long double x, const long double *p, int n)
 
 /* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-deval (long double x, const long double *p, int n)
+static ldouble_t
+deval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = x + *p--;
@@ -675,10 +675,10 @@  deval (long double x, const long double *p, int n)
 
 /* Bessel function of the first kind, order zero.  */
 
-long double
-__ieee754_j0l (long double x)
+ldouble_t
+__ieee754_j0l (ldouble_t x)
 {
-  long double xx, xinv, z, p, q, c, s, cc, ss;
+  ldouble_t xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
     {
@@ -796,7 +796,7 @@  strong_alias (__ieee754_j0l, __j0l_finite)
    Peak absolute error 1.7e-36 (relative where Y0 > 1)
    0 <= x <= 2   */
 #define NY0_2N 7
-static long double Y0_2N[NY0_2N + 1] = {
+static ldouble_t Y0_2N[NY0_2N + 1] = {
  -1.062023609591350692692296993537002558155E19L,
   2.542000883190248639104127452714966858866E19L,
  -1.984190771278515324281415820316054696545E18L,
@@ -807,7 +807,7 @@  static long double Y0_2N[NY0_2N + 1] = {
   8.230845651379566339707130644134372793322E6L,
 };
 #define NY0_2D 7
-static long double Y0_2D[NY0_2D + 1] = {
+static ldouble_t Y0_2D[NY0_2D + 1] = {
   1.438972634353286978700329883122253752192E20L,
   1.856409101981569254247700169486907405500E18L,
   1.219693352678218589553725579802986255614E16L,
@@ -819,14 +819,14 @@  static long double Y0_2D[NY0_2D + 1] = {
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
-static const long double U0 = -7.3804295108687225274343927948483016310862e-02L;
+static const ldouble_t U0 = -7.3804295108687225274343927948483016310862e-02L;
 
 /* Bessel function of the second kind, order zero.  */
 
-long double
- __ieee754_y0l(long double x)
+ldouble_t
+ __ieee754_y0l(ldouble_t x)
 {
-  long double xx, xinv, z, p, q, c, s, cc, ss;
+  ldouble_t xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
     {
diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
index 3265204..8f9e219 100644
--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -101,16 +101,16 @@ 
 #include <float.h>
 
 /* 1 / sqrt(pi) */
-static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+static const ldouble_t ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
 /* 2 / pi */
-static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
-static const long double zero = 0.0L;
+static const ldouble_t TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const ldouble_t zero = 0.0L;
 
 /* J1(x) = .5x + x x^2 R(x^2)
    Peak relative error 1.9e-35
    0 <= x <= 2  */
 #define NJ0_2N 6
-static const long double J0_2N[NJ0_2N + 1] = {
+static const ldouble_t J0_2N[NJ0_2N + 1] = {
  -5.943799577386942855938508697619735179660E16L,
   1.812087021305009192259946997014044074711E15L,
  -2.761698314264509665075127515729146460895E13L,
@@ -120,7 +120,7 @@  static const long double J0_2N[NJ0_2N + 1] = {
  -1.559552840946694171346552770008812083969E3L
 };
 #define NJ0_2D 6
-static const long double J0_2D[NJ0_2D + 1] = {
+static const ldouble_t J0_2D[NJ0_2D + 1] = {
   9.510079323819108569501613916191477479397E17L,
   1.063193817503280529676423936545854693915E16L,
   5.934143516050192600795972192791775226920E13L,
@@ -135,7 +135,7 @@  static const long double J0_2D[NJ0_2D + 1] = {
    0 <= 1/x <= .0625
    Peak relative error 3.6e-36  */
 #define NP16_IN 9
-static const long double P16_IN[NP16_IN + 1] = {
+static const ldouble_t P16_IN[NP16_IN + 1] = {
   5.143674369359646114999545149085139822905E-16L,
   4.836645664124562546056389268546233577376E-13L,
   1.730945562285804805325011561498453013673E-10L,
@@ -148,7 +148,7 @@  static const long double P16_IN[NP16_IN + 1] = {
   3.032580002220628812728954785118117124520E-1L,
 };
 #define NP16_ID 9
-static const long double P16_ID[NP16_ID + 1] = {
+static const ldouble_t P16_ID[NP16_ID + 1] = {
   4.389268795186898018132945193912677177553E-15L,
   4.132671824807454334388868363256830961655E-12L,
   1.482133328179508835835963635130894413136E-9L,
@@ -166,7 +166,7 @@  static const long double P16_ID[NP16_ID + 1] = {
     0.0625 <= 1/x <= 0.125
     Peak relative error 1.9e-36  */
 #define NP8_16N 11
-static const long double P8_16N[NP8_16N + 1] = {
+static const ldouble_t P8_16N[NP8_16N + 1] = {
   2.984612480763362345647303274082071598135E-16L,
   1.923651877544126103941232173085475682334E-13L,
   4.881258879388869396043760693256024307743E-11L,
@@ -181,7 +181,7 @@  static const long double P8_16N[NP8_16N + 1] = {
   2.991314703282528370270179989044994319374E-2L,
 };
 #define NP8_16D 10
-static const long double P8_16D[NP8_16D + 1] = {
+static const ldouble_t P8_16D[NP8_16D + 1] = {
   2.546869316918069202079580939942463010937E-15L,
   1.644650111942455804019788382157745229955E-12L,
   4.185430770291694079925607420808011147173E-10L,
@@ -200,7 +200,7 @@  static const long double P8_16D[NP8_16D + 1] = {
   0.125 <= 1/x <= 0.1875
   Peak relative error 1.3e-36  */
 #define NP5_8N 10
-static const long double P5_8N[NP5_8N + 1] = {
+static const ldouble_t P5_8N[NP5_8N + 1] = {
   2.837678373978003452653763806968237227234E-12L,
   9.726641165590364928442128579282742354806E-10L,
   1.284408003604131382028112171490633956539E-7L,
@@ -214,7 +214,7 @@  static const long double P5_8N[NP5_8N + 1] = {
   5.465927698800862172307352821870223855365E-1L
 };
 #define NP5_8D 10
-static const long double P5_8D[NP5_8D + 1] = {
+static const ldouble_t P5_8D[NP5_8D + 1] = {
   2.421485545794616609951168511612060482715E-11L,
   8.329862750896452929030058039752327232310E-9L,
   1.106137992233383429630592081375289010720E-6L,
@@ -233,7 +233,7 @@  static const long double P5_8D[NP5_8D + 1] = {
    Peak relative error 1.4e-36
    0.1875 <= 1/x <= 0.25  */
 #define NP4_5N 10
-static const long double P4_5N[NP4_5N + 1] = {
+static const ldouble_t P4_5N[NP4_5N + 1] = {
   1.846029078268368685834261260420933914621E-10L,
   3.916295939611376119377869680335444207768E-8L,
   3.122158792018920627984597530935323997312E-6L,
@@ -247,7 +247,7 @@  static const long double P4_5N[NP4_5N + 1] = {
   1.804473805689725610052078464951722064757E-2L,
 };
 #define NP4_5D 9
-static const long double P4_5D[NP4_5D + 1] = {
+static const ldouble_t P4_5D[NP4_5D + 1] = {
   1.575278146806816970152174364308980863569E-9L,
   3.361289173657099516191331123405675054321E-7L,
   2.704692281550877810424745289838790693708E-5L,
@@ -265,7 +265,7 @@  static const long double P4_5D[NP4_5D + 1] = {
    Peak relative error 3.0e-36
    0.25 <= 1/x <= 0.3125  */
 #define NP3r2_4N 9
-static const long double P3r2_4N[NP3r2_4N + 1] = {
+static const ldouble_t P3r2_4N[NP3r2_4N + 1] = {
   8.240803130988044478595580300846665863782E-8L,
   1.179418958381961224222969866406483744580E-5L,
   6.179787320956386624336959112503824397755E-4L,
@@ -278,7 +278,7 @@  static const long double P3r2_4N[NP3r2_4N + 1] = {
   7.299530852495776936690976966995187714739E-1L,
 };
 #define NP3r2_4D 9
-static const long double P3r2_4D[NP3r2_4D + 1] = {
+static const ldouble_t P3r2_4D[NP3r2_4D + 1] = {
   7.032152009675729604487575753279187576521E-7L,
   1.015090352324577615777511269928856742848E-4L,
   5.394262184808448484302067955186308730620E-3L,
@@ -296,7 +296,7 @@  static const long double P3r2_4D[NP3r2_4D + 1] = {
    Peak relative error 1.0e-35
    0.3125 <= 1/x <= 0.375  */
 #define NP2r7_3r2N 9
-static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
+static const ldouble_t P2r7_3r2N[NP2r7_3r2N + 1] = {
   4.599033469240421554219816935160627085991E-7L,
   4.665724440345003914596647144630893997284E-5L,
   1.684348845667764271596142716944374892756E-3L,
@@ -309,7 +309,7 @@  static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
   1.316470424456061252962568223251247207325E-2L,
 };
 #define NP2r7_3r2D 8
-static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
+static const ldouble_t P2r7_3r2D[NP2r7_3r2D + 1] = {
   3.924508608545520758883457108453520099610E-6L,
   4.029707889408829273226495756222078039823E-4L,
   1.484629715787703260797886463307469600219E-2L,
@@ -326,7 +326,7 @@  static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
    Peak relative error 1.7e-36
    0.3125 <= 1/x <= 0.4375  */
 #define NP2r3_2r7N 9
-static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
+static const ldouble_t P2r3_2r7N[NP2r3_2r7N + 1] = {
   3.916766777108274628543759603786857387402E-6L,
   3.212176636756546217390661984304645137013E-4L,
   9.255768488524816445220126081207248947118E-3L,
@@ -339,7 +339,7 @@  static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
   1.109902737860249670981355149101343427885E-2L,
 };
 #define NP2r3_2r7D 8
-static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
+static const ldouble_t P2r3_2r7D[NP2r3_2r7D + 1] = {
   3.342307880794065640312646341190547184461E-5L,
   2.782182891138893201544978009012096558265E-3L,
   8.221304931614200702142049236141249929207E-2L,
@@ -356,7 +356,7 @@  static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
    Peak relative error 1.7e-35
    0.4375 <= 1/x <= 0.5  */
 #define NP2_2r3N 8
-static const long double P2_2r3N[NP2_2r3N + 1] = {
+static const ldouble_t P2_2r3N[NP2_2r3N + 1] = {
   3.397930802851248553545191160608731940751E-4L,
   2.104020902735482418784312825637833698217E-2L,
   4.442291771608095963935342749477836181939E-1L,
@@ -368,7 +368,7 @@  static const long double P2_2r3N[NP2_2r3N + 1] = {
   9.455702270242780642835086549285560316461E-1L,
 };
 #define NP2_2r3D 8
-static const long double P2_2r3D[NP2_2r3D + 1] = {
+static const ldouble_t P2_2r3D[NP2_2r3D + 1] = {
   2.899568897241432883079888249845707400614E-3L,
   1.831107138190848460767699919531132426356E-1L,
   3.999350044057883839080258832758908825165E0L,
@@ -386,7 +386,7 @@  static const long double P2_2r3D[NP2_2r3D + 1] = {
    Peak relative error 8.0e-36
    0 <= 1/x <= .0625  */
 #define NQ16_IN 10
-static const long double Q16_IN[NQ16_IN + 1] = {
+static const ldouble_t Q16_IN[NQ16_IN + 1] = {
   -3.917420835712508001321875734030357393421E-18L,
   -4.440311387483014485304387406538069930457E-15L,
   -1.951635424076926487780929645954007139616E-12L,
@@ -400,7 +400,7 @@  static const long double Q16_IN[NQ16_IN + 1] = {
   -1.922298704033332356899546792898156493887E-2L,
 };
 #define NQ16_ID 9
-static const long double Q16_ID[NQ16_ID + 1] = {
+static const ldouble_t Q16_ID[NQ16_ID + 1] = {
   3.820418034066293517479619763498400162314E-17L,
   4.340702810799239909648911373329149354911E-14L,
   1.914985356383416140706179933075303538524E-11L,
@@ -419,7 +419,7 @@  static const long double Q16_ID[NQ16_ID + 1] = {
    Peak relative error 1.9e-36
    0.0625 <= 1/x <= 0.125  */
 #define NQ8_16N 11
-static const long double Q8_16N[NQ8_16N + 1] = {
+static const ldouble_t Q8_16N[NQ8_16N + 1] = {
   -2.028630366670228670781362543615221542291E-17L,
   -1.519634620380959966438130374006858864624E-14L,
   -4.540596528116104986388796594639405114524E-12L,
@@ -434,7 +434,7 @@  static const long double Q8_16N[NQ8_16N + 1] = {
   -1.365364204556573800719985118029601401323E-1L,
 };
 #define NQ8_16D 11
-static const long double Q8_16D[NQ8_16D + 1] = {
+static const ldouble_t Q8_16D[NQ8_16D + 1] = {
   1.978397614733632533581207058069628242280E-16L,
   1.487361156806202736877009608336766720560E-13L,
   4.468041406888412086042576067133365913456E-11L,
@@ -455,7 +455,7 @@  static const long double Q8_16D[NQ8_16D + 1] = {
    Peak relative error 1.5e-35
    0.125 <= 1/x <= 0.1875  */
 #define NQ5_8N 10
-static const long double Q5_8N[NQ5_8N + 1] = {
+static const ldouble_t Q5_8N[NQ5_8N + 1] = {
   -3.656082407740970534915918390488336879763E-13L,
   -1.344660308497244804752334556734121771023E-10L,
   -1.909765035234071738548629788698150760791E-8L,
@@ -469,7 +469,7 @@  static const long double Q5_8N[NQ5_8N + 1] = {
   -1.549000892545288676809660828213589804884E-1L,
 };
 #define NQ5_8D 10
-static const long double Q5_8D[NQ5_8D + 1] = {
+static const ldouble_t Q5_8D[NQ5_8D + 1] = {
   3.565550843359501079050699598913828460036E-12L,
   1.321016015556560621591847454285330528045E-9L,
   1.897542728662346479999969679234270605975E-7L,
@@ -489,7 +489,7 @@  static const long double Q5_8D[NQ5_8D + 1] = {
    Peak relative error 1.3e-35
    0.1875 <= 1/x <= 0.25  */
 #define NQ4_5N 10
-static const long double Q4_5N[NQ4_5N + 1] = {
+static const ldouble_t Q4_5N[NQ4_5N + 1] = {
   -4.079513568708891749424783046520200903755E-11L,
   -9.326548104106791766891812583019664893311E-9L,
   -8.016795121318423066292906123815687003356E-7L,
@@ -503,7 +503,7 @@  static const long double Q4_5N[NQ4_5N + 1] = {
   -4.320429862021265463213168186061696944062E-3L,
 };
 #define NQ4_5D 9
-static const long double Q4_5D[NQ4_5D + 1] = {
+static const ldouble_t Q4_5D[NQ4_5D + 1] = {
   3.978497042580921479003851216297330701056E-10L,
   9.203304163828145809278568906420772246666E-8L,
   8.059685467088175644915010485174545743798E-6L,
@@ -522,7 +522,7 @@  static const long double Q4_5D[NQ4_5D + 1] = {
    Peak relative error 2.1e-35
    0.25 <= 1/x <= 0.3125  */
 #define NQ3r2_4N 9
-static const long double Q3r2_4N[NQ3r2_4N + 1] = {
+static const ldouble_t Q3r2_4N[NQ3r2_4N + 1] = {
   -1.087480809271383885936921889040388133627E-8L,
   -1.690067828697463740906962973479310170932E-6L,
   -9.608064416995105532790745641974762550982E-5L,
@@ -535,7 +535,7 @@  static const long double Q3r2_4N[NQ3r2_4N + 1] = {
   -1.812932453006641348145049323713469043328E-1L,
 };
 #define NQ3r2_4D 9
-static const long double Q3r2_4D[NQ3r2_4D + 1] = {
+static const ldouble_t Q3r2_4D[NQ3r2_4D + 1] = {
   1.060552717496912381388763753841473407026E-7L,
   1.676928002024920520786883649102388708024E-5L,
   9.803481712245420839301400601140812255737E-4L,
@@ -554,7 +554,7 @@  static const long double Q3r2_4D[NQ3r2_4D + 1] = {
    Peak relative error 1.6e-36
    0.3125 <= 1/x <= 0.375  */
 #define NQ2r7_3r2N 9
-static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+static const ldouble_t Q2r7_3r2N[NQ2r7_3r2N + 1] = {
   -1.723405393982209853244278760171643219530E-7L,
   -2.090508758514655456365709712333460087442E-5L,
   -9.140104013370974823232873472192719263019E-4L,
@@ -567,7 +567,7 @@  static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
   -1.930796319299022954013840684651016077770E-1L,
 };
 #define NQ2r7_3r2D 9
-static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+static const ldouble_t Q2r7_3r2D[NQ2r7_3r2D + 1] = {
   1.680730662300831976234547482334347983474E-6L,
   2.084241442440551016475972218719621841120E-4L,
   9.445316642108367479043541702688736295579E-3L,
@@ -586,7 +586,7 @@  static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
    Peak relative error 9.5e-36
    0.375 <= 1/x <= 0.4375  */
 #define NQ2r3_2r7N 9
-static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+static const ldouble_t Q2r3_2r7N[NQ2r3_2r7N + 1] = {
   -8.603042076329122085722385914954878953775E-7L,
   -7.701746260451647874214968882605186675720E-5L,
   -2.407932004380727587382493696877569654271E-3L,
@@ -599,7 +599,7 @@  static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
   -1.890595651683552228232308756569450822905E-3L,
 };
 #define NQ2r3_2r7D 8
-static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+static const ldouble_t Q2r3_2r7D[NQ2r3_2r7D + 1] = {
   8.390017524798316921170710533381568175665E-6L,
   7.738148683730826286477254659973968763659E-4L,
   2.541480810958665794368759558791634341779E-2L,
@@ -617,7 +617,7 @@  static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
    Peak relative error 1.4e-36
    0.4375 <= 1/x <= 0.5  */
 #define NQ2_2r3N 9
-static const long double Q2_2r3N[NQ2_2r3N + 1] = {
+static const ldouble_t Q2_2r3N[NQ2_2r3N + 1] = {
   -5.552507516089087822166822364590806076174E-6L,
   -4.135067659799500521040944087433752970297E-4L,
   -1.059928728869218962607068840646564457980E-2L,
@@ -630,7 +630,7 @@  static const long double Q2_2r3N[NQ2_2r3N + 1] = {
   -1.458550613639093752909985189067233504148E-3L,
 };
 #define NQ2_2r3D 8
-static const long double Q2_2r3D[NQ2_2r3D + 1] = {
+static const ldouble_t Q2_2r3D[NQ2_2r3D + 1] = {
   5.415024336507980465169023996403597916115E-5L,
   4.179246497380453022046357404266022870788E-3L,
   1.136306384261959483095442402929502368598E-1L,
@@ -646,10 +646,10 @@  static const long double Q2_2r3D[NQ2_2r3D + 1] = {
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-neval (long double x, const long double *p, int n)
+static ldouble_t
+neval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = *p--;
@@ -664,10 +664,10 @@  neval (long double x, const long double *p, int n)
 
 /* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-deval (long double x, const long double *p, int n)
+static ldouble_t
+deval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = x + *p--;
@@ -682,10 +682,10 @@  deval (long double x, const long double *p, int n)
 
 /* Bessel function of the first kind, order one.  */
 
-long double
-__ieee754_j1l (long double x)
+ldouble_t
+__ieee754_j1l (ldouble_t x)
 {
-  long double xx, xinv, z, p, q, c, s, cc, ss;
+  ldouble_t xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
     {
@@ -699,7 +699,7 @@  __ieee754_j1l (long double x)
   xx = fabsl (x);
   if (xx <= 0x1p-58L)
     {
-      long double ret = x * 0.5L;
+      ldouble_t ret = x * 0.5L;
       math_check_force_underflow (ret);
       if (ret == 0)
 	__set_errno (ERANGE);
@@ -815,7 +815,7 @@  strong_alias (__ieee754_j1l, __j1l_finite)
    Peak relative error 6.2e-38
    0 <= x <= 2   */
 #define NY0_2N 7
-static long double Y0_2N[NY0_2N + 1] = {
+static ldouble_t Y0_2N[NY0_2N + 1] = {
   -6.804415404830253804408698161694720833249E19L,
   1.805450517967019908027153056150465849237E19L,
   -8.065747497063694098810419456383006737312E17L,
@@ -826,7 +826,7 @@  static long double Y0_2N[NY0_2N + 1] = {
   9.541172044989995856117187515882879304461E5L,
 };
 #define NY0_2D 7
-static long double Y0_2D[NY0_2D + 1] = {
+static ldouble_t Y0_2D[NY0_2D + 1] = {
   3.470629591820267059538637461549677594549E20L,
   4.120796439009916326855848107545425217219E18L,
   2.477653371652018249749350657387030814542E16L,
@@ -841,10 +841,10 @@  static long double Y0_2D[NY0_2D + 1] = {
 
 /* Bessel function of the second kind, order one.  */
 
-long double
-__ieee754_y1l (long double x)
+ldouble_t
+__ieee754_y1l (ldouble_t x)
 {
-  long double xx, xinv, z, p, q, c, s, cc, ss;
+  ldouble_t xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
     {
diff --git a/sysdeps/ieee754/ldbl-128/e_jnl.c b/sysdeps/ieee754/ldbl-128/e_jnl.c
index 98669e6..51f5a7f 100644
--- a/sysdeps/ieee754/ldbl-128/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128/e_jnl.c
@@ -61,20 +61,20 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
   invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
   two = 2.0e0L,
   one = 1.0e0L,
   zero = 0.0L;
 
 
-long double
-__ieee754_jnl (int n, long double x)
+ldouble_t
+__ieee754_jnl (int n, ldouble_t x)
 {
   u_int32_t se;
   int32_t i, ix, sgn;
-  long double a, b, temp, di, ret;
-  long double z, w;
+  ldouble_t a, b, temp, di, ret;
+  ldouble_t z, w;
   ieee854_long_double_shape_type u;
 
 
@@ -110,7 +110,7 @@  __ieee754_jnl (int n, long double x)
     SET_RESTORE_ROUNDL (FE_TONEAREST);
     if (x == 0.0L || ix >= 0x7fff0000)	/* if x is 0 or inf */
       return sgn == 1 ? -zero : zero;
-    else if ((long double) n <= x)
+    else if ((ldouble_t) n <= x)
       {
 	/* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */
 	if (ix >= 0x412D0000)
@@ -131,8 +131,8 @@  __ieee754_jnl (int n, long double x)
 	     *             2    -s+c            -c-s
 	     *             3     s+c             c-s
 	     */
-	    long double s;
-	    long double c;
+	    ldouble_t s;
+	    ldouble_t c;
 	    __sincosl (x, &s, &c);
 	    switch (n & 3)
 	      {
@@ -158,7 +158,7 @@  __ieee754_jnl (int n, long double x)
 	    for (i = 1; i < n; i++)
 	      {
 		temp = b;
-		b = b * ((long double) (i + i) / x) - a;	/* avoid underflow */
+		b = b * ((ldouble_t) (i + i) / x) - a;	/* avoid underflow */
 		a = temp;
 	      }
 	  }
@@ -178,7 +178,7 @@  __ieee754_jnl (int n, long double x)
 		b = temp;
 		for (a = one, i = 2; i <= n; i++)
 		  {
-		    a *= (long double) i;	/* a = n! */
+		    a *= (ldouble_t) i;	/* a = n! */
 		    b *= temp;	/* b = (x/2)^n */
 		  }
 		b = b / a;
@@ -215,11 +215,11 @@  __ieee754_jnl (int n, long double x)
 	     * When Q(k) > 1e17     good for quadruple
 	     */
 	    /* determine k */
-	    long double t, v;
-	    long double q0, q1, h, tmp;
+	    ldouble_t t, v;
+	    ldouble_t q0, q1, h, tmp;
 	    int32_t k, m;
-	    w = (n + n) / (long double) x;
-	    h = 2.0L / (long double) x;
+	    w = (n + n) / (ldouble_t) x;
+	    h = 2.0L / (ldouble_t) x;
 	    q0 = w;
 	    z = w + h;
 	    q1 = w * z - 1.0L;
@@ -251,7 +251,7 @@  __ieee754_jnl (int n, long double x)
 
 	    if (tmp < 1.1356523406294143949491931077970765006170e+04L)
 	      {
-		for (i = n - 1, di = (long double) (i + i); i > 0; i--)
+		for (i = n - 1, di = (ldouble_t) (i + i); i > 0; i--)
 		  {
 		    temp = b;
 		    b *= di;
@@ -262,7 +262,7 @@  __ieee754_jnl (int n, long double x)
 	      }
 	    else
 	      {
-		for (i = n - 1, di = (long double) (i + i); i > 0; i--)
+		for (i = n - 1, di = (ldouble_t) (i + i); i > 0; i--)
 		  {
 		    temp = b;
 		    b *= di;
@@ -306,13 +306,13 @@  __ieee754_jnl (int n, long double x)
 }
 strong_alias (__ieee754_jnl, __jnl_finite)
 
-long double
-__ieee754_ynl (int n, long double x)
+ldouble_t
+__ieee754_ynl (int n, ldouble_t x)
 {
   u_int32_t se;
   int32_t i, ix;
   int32_t sign;
-  long double a, b, temp, ret;
+  ldouble_t a, b, temp, ret;
   ieee854_long_double_shape_type u;
 
   u.value = x;
@@ -367,8 +367,8 @@  __ieee754_ynl (int n, long double x)
 	 *             2    -s+c            -c-s
 	 *             3     s+c             c-s
 	 */
-	long double s;
-	long double c;
+	ldouble_t s;
+	ldouble_t c;
 	__sincosl (x, &s, &c);
 	switch (n & 3)
 	  {
@@ -397,7 +397,7 @@  __ieee754_ynl (int n, long double x)
 	for (i = 1; i < n && se != 0xffff0000; i++)
 	  {
 	    temp = b;
-	    b = ((long double) (i + i) / x) * b - a;
+	    b = ((ldouble_t) (i + i) / x) * b - a;
 	    u.value = b;
 	    se = u.parts32.w0 & 0xffff0000;
 	    a = temp;
diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
index 5b513ea..22e8dc2 100644
--- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
@@ -72,21 +72,21 @@ 
 #include <math_private.h>
 #include <float.h>
 
-static const long double PIL = 3.1415926535897932384626433832795028841972E0L;
+static const ldouble_t PIL = 3.1415926535897932384626433832795028841972E0L;
 #if LDBL_MANT_DIG == 106
-static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
+static const ldouble_t MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
 #else
-static const long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L;
+static const ldouble_t MAXLGM = 1.0485738685148938358098967157129705071571E4928L;
 #endif
-static const long double one = 1.0L;
-static const long double huge = LDBL_MAX;
+static const ldouble_t one = 1.0L;
+static const ldouble_t huge = LDBL_MAX;
 
 /* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x P(1/x^2)
    1/x <= 0.0741 (x >= 13.495...)
    Peak relative error 1.5e-36  */
-static const long double ls2pi = 9.1893853320467274178032973640561763986140E-1L;
+static const ldouble_t ls2pi = 9.1893853320467274178032973640561763986140E-1L;
 #define NRASY 12
-static const long double RASY[NRASY + 1] =
+static const ldouble_t RASY[NRASY + 1] =
 {
   8.333333333333333333333333333310437112111E-2L,
  -2.777777777777777777777774789556228296902E-3L,
@@ -108,10 +108,10 @@  static const long double RASY[NRASY + 1] =
    -0.5 <= x <= 0.5
    12.5 <= x+13 <= 13.5
    Peak relative error 1.1e-36  */
-static const long double lgam13a = 1.9987213134765625E1L;
-static const long double lgam13b = 1.3608962611495173623870550785125024484248E-6L;
+static const ldouble_t lgam13a = 1.9987213134765625E1L;
+static const ldouble_t lgam13b = 1.3608962611495173623870550785125024484248E-6L;
 #define NRN13 7
-static const long double RN13[NRN13 + 1] =
+static const ldouble_t RN13[NRN13 + 1] =
 {
   8.591478354823578150238226576156275285700E11L,
   2.347931159756482741018258864137297157668E11L,
@@ -123,7 +123,7 @@  static const long double RN13[NRN13 + 1] =
   6.850783280018706668924952057996075215223E0L
 };
 #define NRD13 6
-static const long double RD13[NRD13 + 1] =
+static const ldouble_t RD13[NRD13 + 1] =
 {
   3.401225382297342302296607039352935541669E11L,
   8.756765276918037910363513243563234551784E10L,
@@ -140,10 +140,10 @@  static const long double RD13[NRD13 + 1] =
    -0.5 <= x <= 0.5
    11.5 <= x+12 <= 12.5
    Peak relative error 4.1e-36  */
-static const long double lgam12a = 1.75023040771484375E1L;
-static const long double lgam12b = 3.7687254483392876529072161996717039575982E-6L;
+static const ldouble_t lgam12a = 1.75023040771484375E1L;
+static const ldouble_t lgam12b = 3.7687254483392876529072161996717039575982E-6L;
 #define NRN12 7
-static const long double RN12[NRN12 + 1] =
+static const ldouble_t RN12[NRN12 + 1] =
 {
   4.709859662695606986110997348630997559137E11L,
   1.398713878079497115037857470168777995230E11L,
@@ -155,7 +155,7 @@  static const long double RN12[NRN12 + 1] =
   6.769610657004672719224614163196946862747E0L
 };
 #define NRD12 6
-static const long double RD12[NRD12 + 1] =
+static const ldouble_t RD12[NRD12 + 1] =
 {
   1.928167007860968063912467318985802726613E11L,
   5.383198282277806237247492369072266389233E10L,
@@ -172,10 +172,10 @@  static const long double RD12[NRD12 + 1] =
    -0.5 <= x <= 0.5
    10.5 <= x+11 <= 11.5
    Peak relative error 1.8e-35  */
-static const long double lgam11a = 1.5104400634765625E1L;
-static const long double lgam11b = 1.1938309890295225709329251070371882250744E-5L;
+static const ldouble_t lgam11a = 1.5104400634765625E1L;
+static const ldouble_t lgam11b = 1.1938309890295225709329251070371882250744E-5L;
 #define NRN11 7
-static const long double RN11[NRN11 + 1] =
+static const ldouble_t RN11[NRN11 + 1] =
 {
   2.446960438029415837384622675816736622795E11L,
   7.955444974446413315803799763901729640350E10L,
@@ -187,7 +187,7 @@  static const long double RN11[NRN11 + 1] =
   6.681356101133728289358838690666225691363E0L
 };
 #define NRD11 6
-static const long double RD11[NRD11 + 1] =
+static const ldouble_t RD11[NRD11 + 1] =
 {
   1.040483786179428590683912396379079477432E11L,
   3.172251138489229497223696648369823779729E10L,
@@ -204,10 +204,10 @@  static const long double RD11[NRD11 + 1] =
    -0.5 <= x <= 0.5
    9.5 <= x+10 <= 10.5
    Peak relative error 5.4e-37  */
-static const long double lgam10a = 1.280181884765625E1L;
-static const long double lgam10b = 8.6324252196112077178745667061642811492557E-6L;
+static const ldouble_t lgam10a = 1.280181884765625E1L;
+static const ldouble_t lgam10b = 8.6324252196112077178745667061642811492557E-6L;
 #define NRN10 7
-static const long double RN10[NRN10 + 1] =
+static const ldouble_t RN10[NRN10 + 1] =
 {
   -1.239059737177249934158597996648808363783E14L,
   -4.725899566371458992365624673357356908719E13L,
@@ -219,7 +219,7 @@  static const long double RN10[NRN10 + 1] =
   -2.350975266781548931856017239843273049384E4L
 };
 #define NRD10 7
-static const long double RD10[NRD10 + 1] =
+static const ldouble_t RD10[NRD10 + 1] =
 {
   -5.502645997581822567468347817182347679552E13L,
   -1.970266640239849804162284805400136473801E13L,
@@ -237,10 +237,10 @@  static const long double RD10[NRD10 + 1] =
    -0.5 <= x <= 0.5
    8.5 <= x+9 <= 9.5
    Peak relative error 3.6e-36  */
-static const long double lgam9a = 1.06045989990234375E1L;
-static const long double lgam9b = 3.9037218127284172274007216547549861681400E-6L;
+static const ldouble_t lgam9a = 1.06045989990234375E1L;
+static const ldouble_t lgam9b = 3.9037218127284172274007216547549861681400E-6L;
 #define NRN9 7
-static const long double RN9[NRN9 + 1] =
+static const ldouble_t RN9[NRN9 + 1] =
 {
   -4.936332264202687973364500998984608306189E13L,
   -2.101372682623700967335206138517766274855E13L,
@@ -252,7 +252,7 @@  static const long double RN9[NRN9 + 1] =
   -2.036280038903695980912289722995505277253E4L
 };
 #define NRD9 7
-static const long double RD9[NRD9 + 1] =
+static const ldouble_t RD9[NRD9 + 1] =
 {
   -2.306006080437656357167128541231915480393E13L,
   -9.183606842453274924895648863832233799950E12L,
@@ -270,10 +270,10 @@  static const long double RD9[NRD9 + 1] =
    -0.5 <= x <= 0.5
    7.5 <= x+8 <= 8.5
    Peak relative error 2.4e-37  */
-static const long double lgam8a = 8.525146484375E0L;
-static const long double lgam8b = 1.4876690414300165531036347125050759667737E-5L;
+static const ldouble_t lgam8a = 8.525146484375E0L;
+static const ldouble_t lgam8b = 1.4876690414300165531036347125050759667737E-5L;
 #define NRN8 8
-static const long double RN8[NRN8 + 1] =
+static const ldouble_t RN8[NRN8 + 1] =
 {
   6.600775438203423546565361176829139703289E11L,
   3.406361267593790705240802723914281025800E11L,
@@ -286,7 +286,7 @@  static const long double RN8[NRN8 + 1] =
   6.596977510622195827183948478627058738034E0L
 };
 #define NRD8 7
-static const long double RD8[NRD8 + 1] =
+static const ldouble_t RD8[NRD8 + 1] =
 {
   3.274776546520735414638114828622673016920E11L,
   1.581811207929065544043963828487733970107E11L,
@@ -304,10 +304,10 @@  static const long double RD8[NRD8 + 1] =
    -0.5 <= x <= 0.5
    6.5 <= x+7 <= 7.5
    Peak relative error 3.2e-36  */
-static const long double lgam7a = 6.5792388916015625E0L;
-static const long double lgam7b = 1.2320408538495060178292903945321122583007E-5L;
+static const ldouble_t lgam7a = 6.5792388916015625E0L;
+static const ldouble_t lgam7b = 1.2320408538495060178292903945321122583007E-5L;
 #define NRN7 8
-static const long double RN7[NRN7 + 1] =
+static const ldouble_t RN7[NRN7 + 1] =
 {
   2.065019306969459407636744543358209942213E11L,
   1.226919919023736909889724951708796532847E11L,
@@ -320,7 +320,7 @@  static const long double RN7[NRN7 + 1] =
   6.460280377802030953041566617300902020435E0L
 };
 #define NRD7 7
-static const long double RD7[NRD7 + 1] =
+static const ldouble_t RD7[NRD7 + 1] =
 {
   1.102646614598516998880874785339049304483E11L,
   6.099297512712715445879759589407189290040E10L,
@@ -338,10 +338,10 @@  static const long double RD7[NRD7 + 1] =
    -0.5 <= x <= 0.5
    5.5 <= x+6 <= 6.5
    Peak relative error 6.2e-37  */
-static const long double lgam6a = 4.7874908447265625E0L;
-static const long double lgam6b = 8.9805548349424770093452324304839959231517E-7L;
+static const ldouble_t lgam6a = 4.7874908447265625E0L;
+static const ldouble_t lgam6b = 8.9805548349424770093452324304839959231517E-7L;
 #define NRN6 8
-static const long double RN6[NRN6 + 1] =
+static const ldouble_t RN6[NRN6 + 1] =
 {
   -3.538412754670746879119162116819571823643E13L,
   -2.613432593406849155765698121483394257148E13L,
@@ -354,7 +354,7 @@  static const long double RN6[NRN6 + 1] =
   -1.576834867378554185210279285358586385266E4L
 };
 #define NRD6 8
-static const long double RD6[NRD6 + 1] =
+static const ldouble_t RD6[NRD6 + 1] =
 {
   -2.073955870771283609792355579558899389085E13L,
   -1.421592856111673959642750863283919318175E13L,
@@ -373,10 +373,10 @@  static const long double RD6[NRD6 + 1] =
    -0.5 <= x <= 0.5
    4.5 <= x+5 <= 5.5
    Peak relative error 3.4e-37  */
-static const long double lgam5a = 3.17803955078125E0L;
-static const long double lgam5b = 1.4279566695619646941601297055408873990961E-5L;
+static const ldouble_t lgam5a = 3.17803955078125E0L;
+static const ldouble_t lgam5b = 1.4279566695619646941601297055408873990961E-5L;
 #define NRN5 9
-static const long double RN5[NRN5 + 1] =
+static const ldouble_t RN5[NRN5 + 1] =
 {
   2.010952885441805899580403215533972172098E11L,
   1.916132681242540921354921906708215338584E11L,
@@ -390,7 +390,7 @@  static const long double RN5[NRN5 + 1] =
   6.330318119566998299106803922739066556550E0L
 };
 #define NRD5 8
-static const long double RD5[NRD5 + 1] =
+static const ldouble_t RD5[NRD5 + 1] =
 {
   1.335189758138651840605141370223112376176E11L,
   1.174130445739492885895466097516530211283E11L,
@@ -409,10 +409,10 @@  static const long double RD5[NRD5 + 1] =
    -0.5 <= x <= 0.5
    3.5 <= x+4 <= 4.5
    Peak relative error 6.7e-37  */
-static const long double lgam4a = 1.791748046875E0L;
-static const long double lgam4b = 1.1422353055000812477358380702272722990692E-5L;
+static const ldouble_t lgam4a = 1.791748046875E0L;
+static const ldouble_t lgam4b = 1.1422353055000812477358380702272722990692E-5L;
 #define NRN4 9
-static const long double RN4[NRN4 + 1] =
+static const ldouble_t RN4[NRN4 + 1] =
 {
   -1.026583408246155508572442242188887829208E13L,
   -1.306476685384622809290193031208776258809E13L,
@@ -426,7 +426,7 @@  static const long double RN4[NRN4 + 1] =
   -1.180509051468390914200720003907727988201E4L
 };
 #define NRD4 9
-static const long double RD4[NRD4 + 1] =
+static const ldouble_t RD4[NRD4 + 1] =
 {
   -8.172669122056002077809119378047536240889E12L,
   -9.477592426087986751343695251801814226960E12L,
@@ -446,11 +446,11 @@  static const long double RD4[NRD4 + 1] =
    -0.25 <= x <= 0.5
    2.75 <= x+3 <= 3.5
    Peak relative error 6.0e-37  */
-static const long double lgam3a = 6.93145751953125E-1L;
-static const long double lgam3b = 1.4286068203094172321214581765680755001344E-6L;
+static const ldouble_t lgam3a = 6.93145751953125E-1L;
+static const ldouble_t lgam3b = 1.4286068203094172321214581765680755001344E-6L;
 
 #define NRN3 9
-static const long double RN3[NRN3 + 1] =
+static const ldouble_t RN3[NRN3 + 1] =
 {
   -4.813901815114776281494823863935820876670E11L,
   -8.425592975288250400493910291066881992620E11L,
@@ -464,7 +464,7 @@  static const long double RN3[NRN3 + 1] =
   -8.333374463411801009783402800801201603736E3L
 };
 #define NRD3 9
-static const long double RD3[NRD3 + 1] =
+static const ldouble_t RD3[NRD3 + 1] =
 {
   -5.216713843111675050627304523368029262450E11L,
   -8.014292925418308759369583419234079164391E11L,
@@ -483,10 +483,10 @@  static const long double RD3[NRD3 + 1] =
 /* log gamma(x+2.5) = log gamma(2.5) +  x P(x)/Q(x)
    -0.125 <= x <= 0.25
    2.375 <= x+2.5 <= 2.75  */
-static const long double lgam2r5a = 2.8466796875E-1L;
-static const long double lgam2r5b = 1.4901722919159632494669682701924320137696E-5L;
+static const ldouble_t lgam2r5a = 2.8466796875E-1L;
+static const ldouble_t lgam2r5b = 1.4901722919159632494669682701924320137696E-5L;
 #define NRN2r5 8
-static const long double RN2r5[NRN2r5 + 1] =
+static const ldouble_t RN2r5[NRN2r5 + 1] =
 {
   -4.676454313888335499356699817678862233205E9L,
   -9.361888347911187924389905984624216340639E9L,
@@ -499,7 +499,7 @@  static const long double RN2r5[NRN2r5 + 1] =
   -4.717341584067827676530426007495274711306E3L
 };
 #define NRD2r5 8
-static const long double RD2r5[NRD2r5 + 1] =
+static const ldouble_t RD2r5[NRD2r5 + 1] =
 {
   -6.650657966618993679456019224416926875619E9L,
   -1.099511409330635807899718829033488771623E10L,
@@ -519,7 +519,7 @@  static const long double RD2r5[NRD2r5 + 1] =
    1.875 <= x+2 <= 2.375
    Peak relative error 4.6e-36  */
 #define NRN2 9
-static const long double RN2[NRN2 + 1] =
+static const ldouble_t RN2[NRN2 + 1] =
 {
   -3.716661929737318153526921358113793421524E9L,
   -1.138816715030710406922819131397532331321E10L,
@@ -533,7 +533,7 @@  static const long double RN2[NRN2 + 1] =
   -4.778761333044147141559311805999540765612E3L
 };
 #define NRD2 9
-static const long double RD2[NRD2 + 1] =
+static const ldouble_t RD2[NRD2 + 1] =
 {
   -8.790916836764308497770359421351673950111E9L,
   -2.023108608053212516399197678553737477486E10L,
@@ -553,10 +553,10 @@  static const long double RD2[NRD2 + 1] =
    -0.125 <= x <= +0.125
    1.625 <= x+1.75 <= 1.875
    Peak relative error 9.2e-37 */
-static const long double lgam1r75a = -8.441162109375E-2L;
-static const long double lgam1r75b = 1.0500073264444042213965868602268256157604E-5L;
+static const ldouble_t lgam1r75a = -8.441162109375E-2L;
+static const ldouble_t lgam1r75b = 1.0500073264444042213965868602268256157604E-5L;
 #define NRN1r75 8
-static const long double RN1r75[NRN1r75 + 1] =
+static const ldouble_t RN1r75[NRN1r75 + 1] =
 {
   -5.221061693929833937710891646275798251513E7L,
   -2.052466337474314812817883030472496436993E8L,
@@ -569,7 +569,7 @@  static const long double RN1r75[NRN1r75 + 1] =
   -2.698453601378319296159355612094598695530E3L
 };
 #define NRD1r75 8
-static const long double RD1r75[NRD1r75 + 1] =
+static const ldouble_t RD1r75[NRD1r75 + 1] =
 {
   -2.109754689501705828789976311354395393605E8L,
   -5.036651829232895725959911504899241062286E8L,
@@ -588,12 +588,12 @@  static const long double RD1r75[NRD1r75 + 1] =
    -0.0867 <= x <= +0.1634
    1.374932... <= x+x0 <= 1.625032...
    Peak relative error 4.0e-36  */
-static const long double x0a = 1.4616241455078125L;
-static const long double x0b = 7.9994605498412626595423257213002588621246E-6L;
-static const long double y0a = -1.21490478515625E-1L;
-static const long double y0b = 4.1879797753919044854428223084178486438269E-6L;
+static const ldouble_t x0a = 1.4616241455078125L;
+static const ldouble_t x0b = 7.9994605498412626595423257213002588621246E-6L;
+static const ldouble_t y0a = -1.21490478515625E-1L;
+static const ldouble_t y0b = 4.1879797753919044854428223084178486438269E-6L;
 #define NRN1r5 8
-static const long double RN1r5[NRN1r5 + 1] =
+static const ldouble_t RN1r5[NRN1r5 + 1] =
 {
   6.827103657233705798067415468881313128066E5L,
   1.910041815932269464714909706705242148108E6L,
@@ -606,7 +606,7 @@  static const long double RN1r5[NRN1r5 + 1] =
   5.040631576303952022968949605613514584950E0L
 };
 #define NRD1r5 8
-static const long double RD1r5[NRD1r5 + 1] =
+static const ldouble_t RD1r5[NRD1r5 + 1] =
 {
   1.411036368843183477558773688484699813355E6L,
   4.378121767236251950226362443134306184849E6L,
@@ -625,10 +625,10 @@  static const long double RD1r5[NRD1r5 + 1] =
    -.125 <= x <= +.125
    1.125 <= x+1.25 <= 1.375
    Peak relative error = 4.9e-36 */
-static const long double lgam1r25a = -9.82818603515625E-2L;
-static const long double lgam1r25b = 1.0023929749338536146197303364159774377296E-5L;
+static const ldouble_t lgam1r25a = -9.82818603515625E-2L;
+static const ldouble_t lgam1r25b = 1.0023929749338536146197303364159774377296E-5L;
 #define NRN1r25 9
-static const long double RN1r25[NRN1r25 + 1] =
+static const ldouble_t RN1r25[NRN1r25 + 1] =
 {
   -9.054787275312026472896002240379580536760E4L,
   -8.685076892989927640126560802094680794471E4L,
@@ -642,7 +642,7 @@  static const long double RN1r25[NRN1r25 + 1] =
   4.907821957946273805080625052510832015792E0L
 };
 #define NRD1r25 8
-static const long double RD1r25[NRD1r25 + 1] =
+static const ldouble_t RD1r25[NRD1r25 + 1] =
 {
   3.980939377333448005389084785896660309000E5L,
   1.429634893085231519692365775184490465542E6L,
@@ -662,7 +662,7 @@  static const long double RD1r25[NRD1r25 + 1] =
    1.0 <= x+1 <= 1.125
    Peak relative error 1.1e-35  */
 #define NRN1 8
-static const long double RN1[NRN1 + 1] =
+static const ldouble_t RN1[NRN1 + 1] =
 {
   -9.987560186094800756471055681088744738818E3L,
   -2.506039379419574361949680225279376329742E4L,
@@ -675,7 +675,7 @@  static const long double RN1[NRN1 + 1] =
   4.516830313569454663374271993200291219855E0L
 };
 #define NRD1 7
-static const long double RD1[NRD1 + 1] =
+static const ldouble_t RD1[NRD1 + 1] =
 {
   1.730299573175751778863269333703788214547E4L,
   6.807080914851328611903744668028014678148E4L,
@@ -694,7 +694,7 @@  static const long double RD1[NRD1 + 1] =
    0.875 <= x+1 <= 1.0
    Peak relative error 7.0e-37  */
 #define NRNr9 8
-static const long double RNr9[NRNr9 + 1] =
+static const ldouble_t RNr9[NRNr9 + 1] =
 {
   4.441379198241760069548832023257571176884E5L,
   1.273072988367176540909122090089580368732E6L,
@@ -707,7 +707,7 @@  static const long double RNr9[NRNr9 + 1] =
   -1.032901669542994124131223797515913955938E3L,
 };
 #define NRDr9 8
-static const long double RDr9[NRDr9 + 1] =
+static const ldouble_t RDr9[NRDr9 + 1] =
 {
   -7.694488331323118759486182246005193998007E5L,
   -3.301918855321234414232308938454112213751E6L,
@@ -724,10 +724,10 @@  static const long double RDr9[NRDr9 + 1] =
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-neval (long double x, const long double *p, int n)
+static ldouble_t
+neval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = *p--;
@@ -742,10 +742,10 @@  neval (long double x, const long double *p, int n)
 
 /* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-deval (long double x, const long double *p, int n)
+static ldouble_t
+deval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = x + *p--;
@@ -758,10 +758,10 @@  deval (long double x, const long double *p, int n)
 }
 
 
-long double
-__ieee754_lgammal_r (long double x, int *signgamp)
+ldouble_t
+__ieee754_lgammal_r (ldouble_t x, int *signgamp)
 {
-  long double p, q, w, z, nx;
+  ldouble_t p, q, w, z, nx;
   int i, nn;
 
   *signgamp = 1;
@@ -783,7 +783,7 @@  __ieee754_lgammal_r (long double x, int *signgamp)
       p = __floorl (q);
       if (p == q)
 	return (one / (p - p));
-      long double halfp = p * 0.5L;
+      ldouble_t halfp = p * 0.5L;
       if (halfp == __floorl (halfp))
 	*signgamp = -1;
       else
diff --git a/sysdeps/ieee754/ldbl-128/e_log10l.c b/sysdeps/ieee754/ldbl-128/e_log10l.c
index 618255f..fbc7c4c 100644
--- a/sysdeps/ieee754/ldbl-128/e_log10l.c
+++ b/sysdeps/ieee754/ldbl-128/e_log10l.c
@@ -68,7 +68,7 @@ 
  * Theoretical peak relative error = 5.3e-37,
  * relative peak error spread = 2.3e-14
  */
-static const long double P[13] =
+static const ldouble_t P[13] =
 {
   1.313572404063446165910279910527789794488E4L,
   7.771154681358524243729929227226708890930E4L,
@@ -84,7 +84,7 @@  static const long double P[13] =
   4.998469661968096229986658302195402690910E-1L,
   1.538612243596254322971797716843006400388E-6L
 };
-static const long double Q[12] =
+static const ldouble_t Q[12] =
 {
   3.940717212190338497730839731583397586124E4L,
   2.626900195321832660448791748036714883242E5L,
@@ -107,7 +107,7 @@  static const long double Q[12] =
  * Theoretical peak relative error = 1.1e-35,
  * relative peak error spread 1.1e-9
  */
-static const long double R[6] =
+static const ldouble_t R[6] =
 {
   1.418134209872192732479751274970992665513E5L,
  -8.977257995689735303686582344659576526998E4L,
@@ -116,7 +116,7 @@  static const long double R[6] =
   8.057002716646055371965756206836056074715E1L,
  -8.828896441624934385266096344596648080902E-1L
 };
-static const long double S[6] =
+static const ldouble_t S[6] =
 {
   1.701761051846631278975701529965589676574E6L,
  -1.332535117259762928288745111081235577029E6L,
@@ -127,7 +127,7 @@  static const long double S[6] =
 /* 1.000000000000000000000000000000000000000E0L, */
 };
 
-static const long double
+static const ldouble_t
 /* log10(2) */
 L102A = 0.3125L,
 L102B = -1.14700043360188047862611052755069732318101185E-2L,
@@ -141,10 +141,10 @@  SQRTH = 7.071067811865475244008443621048490392848359E-1L;
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-neval (long double x, const long double *p, int n)
+static ldouble_t
+neval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = *p--;
@@ -159,10 +159,10 @@  neval (long double x, const long double *p, int n)
 
 /* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-deval (long double x, const long double *p, int n)
+static ldouble_t
+deval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = x + *p--;
@@ -176,11 +176,11 @@  deval (long double x, const long double *p, int n)
 
 
 
-long double
-__ieee754_log10l (long double x)
+ldouble_t
+__ieee754_log10l (ldouble_t x)
 {
-  long double z;
-  long double y;
+  ldouble_t z;
+  ldouble_t y;
   int e;
   int64_t hx, lx;
 
diff --git a/sysdeps/ieee754/ldbl-128/e_log2l.c b/sysdeps/ieee754/ldbl-128/e_log2l.c
index 6b1faa0..8685b76 100644
--- a/sysdeps/ieee754/ldbl-128/e_log2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_log2l.c
@@ -67,7 +67,7 @@ 
  * Theoretical peak relative error = 5.3e-37,
  * relative peak error spread = 2.3e-14
  */
-static const long double P[13] =
+static const ldouble_t P[13] =
 {
   1.313572404063446165910279910527789794488E4L,
   7.771154681358524243729929227226708890930E4L,
@@ -83,7 +83,7 @@  static const long double P[13] =
   4.998469661968096229986658302195402690910E-1L,
   1.538612243596254322971797716843006400388E-6L
 };
-static const long double Q[12] =
+static const ldouble_t Q[12] =
 {
   3.940717212190338497730839731583397586124E4L,
   2.626900195321832660448791748036714883242E5L,
@@ -106,7 +106,7 @@  static const long double Q[12] =
  * Theoretical peak relative error = 1.1e-35,
  * relative peak error spread 1.1e-9
  */
-static const long double R[6] =
+static const ldouble_t R[6] =
 {
   1.418134209872192732479751274970992665513E5L,
  -8.977257995689735303686582344659576526998E4L,
@@ -115,7 +115,7 @@  static const long double R[6] =
   8.057002716646055371965756206836056074715E1L,
  -8.828896441624934385266096344596648080902E-1L
 };
-static const long double S[6] =
+static const ldouble_t S[6] =
 {
   1.701761051846631278975701529965589676574E6L,
  -1.332535117259762928288745111081235577029E6L,
@@ -126,7 +126,7 @@  static const long double S[6] =
 /* 1.000000000000000000000000000000000000000E0L, */
 };
 
-static const long double
+static const ldouble_t
 /* log2(e) - 1 */
 LOG2EA = 4.4269504088896340735992468100189213742664595E-1L,
 /* sqrt(2)/2 */
@@ -135,10 +135,10 @@  SQRTH = 7.071067811865475244008443621048490392848359E-1L;
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-neval (long double x, const long double *p, int n)
+static ldouble_t
+neval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = *p--;
@@ -153,10 +153,10 @@  neval (long double x, const long double *p, int n)
 
 /* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-deval (long double x, const long double *p, int n)
+static ldouble_t
+deval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = x + *p--;
@@ -170,11 +170,11 @@  deval (long double x, const long double *p, int n)
 
 
 
-long double
-__ieee754_log2l (long double x)
+ldouble_t
+__ieee754_log2l (ldouble_t x)
 {
-  long double z;
-  long double y;
+  ldouble_t z;
+  ldouble_t y;
   int e;
   int64_t hx, lx;
 
diff --git a/sysdeps/ieee754/ldbl-128/e_logl.c b/sysdeps/ieee754/ldbl-128/e_logl.c
index cb43816..7a51917 100644
--- a/sysdeps/ieee754/ldbl-128/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128/e_logl.c
@@ -63,7 +63,7 @@ 
 /* log(1+x) = x - .5 x^2 + x^3 l(x)
    -.0078125 <= x <= +.0078125
    peak relative error 1.2e-37 */
-static const long double
+static const ldouble_t
 l3 =   3.333333333333333333333333333333336096926E-1L,
 l4 =  -2.499999999999999999999999999486853077002E-1L,
 l5 =   1.999999999999999999999999998515277861905E-1L,
@@ -81,7 +81,7 @@  l15 =  6.668057591071739754844678883223432347481E-2L;
 /* Lookup table of ln(t) - (t-1)
     t = 0.5 + (k+26)/128)
     k = 0, ..., 91   */
-static const long double logtbl[92] = {
+static const ldouble_t logtbl[92] = {
 -5.5345593589352099112142921677820359632418E-2L,
 -5.2108257402767124761784665198737642086148E-2L,
 -4.8991686870576856279407775480686721935120E-2L,
@@ -178,14 +178,14 @@  static const long double logtbl[92] = {
 };
 
 /* ln(2) = ln2a + ln2b with extended precision. */
-static const long double
+static const ldouble_t
   ln2a = 6.93145751953125e-1L,
   ln2b = 1.4286068203094172321214581765680755001344E-6L;
 
-long double
-__ieee754_logl(long double x)
+ldouble_t
+__ieee754_logl(ldouble_t x)
 {
-  long double z, y, w;
+  ldouble_t z, y, w;
   ieee854_long_double_shape_type u, t;
   unsigned int m;
   int k, e;
diff --git a/sysdeps/ieee754/ldbl-128/e_powl.c b/sysdeps/ieee754/ldbl-128/e_powl.c
index 7f3037f..53316ef 100644
--- a/sysdeps/ieee754/ldbl-128/e_powl.c
+++ b/sysdeps/ieee754/ldbl-128/e_powl.c
@@ -67,24 +67,24 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double bp[] = {
+static const ldouble_t bp[] = {
   1.0L,
   1.5L,
 };
 
 /* log_2(1.5) */
-static const long double dp_h[] = {
+static const ldouble_t dp_h[] = {
   0.0,
   5.8496250072115607565592654282227158546448E-1L
 };
 
 /* Low part of log_2(1.5) */
-static const long double dp_l[] = {
+static const ldouble_t dp_l[] = {
   0.0,
   1.0579781240112554492329533686862998106046E-16L
 };
 
-static const long double zero = 0.0L,
+static const ldouble_t zero = 0.0L,
   one = 1.0L,
   two = 2.0L,
   two113 = 1.0384593717069655257060992658440192E34L,
@@ -95,7 +95,7 @@  static const long double zero = 0.0L,
    z = (x-1)/(x+1)
    1 <= x <= 1.25
    Peak relative error 2.3e-37 */
-static const long double LN[] =
+static const ldouble_t LN[] =
 {
  -3.0779177200290054398792536829702930623200E1L,
   6.5135778082209159921251824580292116201640E1L,
@@ -103,7 +103,7 @@  static const long double LN[] =
   1.2510208195629420304615674658258363295208E1L,
  -9.9266909031921425609179910128531667336670E-1L
 };
-static const long double LD[] =
+static const ldouble_t LD[] =
 {
  -5.129862866715009066465422805058933131960E1L,
   1.452015077564081884387441590064272782044E2L,
@@ -116,7 +116,7 @@  static const long double LD[] =
 /* exp(x) = 1 + x - x / (1 - 2 / (x - x^2 R(x^2)))
    0 <= x <= 0.5
    Peak relative error 5.7e-38  */
-static const long double PN[] =
+static const ldouble_t PN[] =
 {
   5.081801691915377692446852383385968225675E8L,
   9.360895299872484512023336636427675327355E6L,
@@ -124,7 +124,7 @@  static const long double PN[] =
   5.201006511142748908655720086041570288182E1L,
   9.088368420359444263703202925095675982530E-3L,
 };
-static const long double PD[] =
+static const ldouble_t PD[] =
 {
   3.049081015149226615468111430031590411682E9L,
   1.069833887183886839966085436512368982758E8L,
@@ -133,7 +133,7 @@  static const long double PD[] =
   /* 1.0E0 */
 };
 
-static const long double
+static const ldouble_t
   /* ln 2 */
   lg2 = 6.9314718055994530941723212145817656807550E-1L,
   lg2_h = 6.9314718055994528622676398299518041312695E-1L,
@@ -144,12 +144,12 @@  static const long double
   cp_h = 9.6179669392597555432899980587535537779331E-1L,
   cp_l = 5.0577616648125906047157785230014751039424E-17L;
 
-long double
-__ieee754_powl (long double x, long double y)
+ldouble_t
+__ieee754_powl (ldouble_t x, ldouble_t y)
 {
-  long double z, ax, z_h, z_l, p_h, p_l;
-  long double y1, t1, t2, r, s, sgn, t, u, v, w;
-  long double s2, s_h, s_l, t_h, t_l, ay;
+  ldouble_t z, ax, z_h, z_l, p_h, p_l;
+  ldouble_t y1, t1, t2, r, s, sgn, t, u, v, w;
+  ldouble_t s2, s_h, s_l, t_h, t_l, ay;
   int32_t i, j, k, yisint, n;
   u_int32_t ix, iy;
   int32_t hx, hy;
@@ -363,7 +363,7 @@  __ieee754_powl (long double x, long double y)
   z_h = cp_h * p_h;		/* cp_h+cp_l = 2/(3*log2) */
   z_l = cp_l * p_h + p_l * cp + dp_l[k];
   /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */
-  t = (long double) n;
+  t = (ldouble_t) n;
   t1 = (((z_h + z_l) + dp_h[k]) + t);
   o.value = t1;
   o.parts32.w3 = 0;
@@ -437,7 +437,7 @@  __ieee754_powl (long double x, long double y)
   if ((j >> 16) <= 0)
     {
       z = __scalbnl (z, n);	/* subnormal output */
-      long double force_underflow = z * z;
+      ldouble_t force_underflow = z * z;
       math_force_eval (force_underflow);
     }
   else
diff --git a/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
index 101a4c9..d19894f 100644
--- a/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
@@ -183,7 +183,7 @@  static const int32_t two_over_pi[] = {
 0x7b7b89, 0x483d38,
 };
 
-static const long double c[] = {
+static const ldouble_t c[] = {
 /* 113 bits of pi/2 */
 #define PI_2_1 c[0]
  0x1.921fb54442d18469898cc51701b8p+0L,
@@ -193,9 +193,9 @@  static const long double c[] = {
  0x3.9a252049c1114cf98e804177d4c8p-116L,
 };
 
-int32_t __ieee754_rem_pio2l(long double x, long double *y)
+int32_t __ieee754_rem_pio2l(ldouble_t x, ldouble_t *y)
 {
-  long double z, w, t;
+  ldouble_t z, w, t;
   double tx[8];
   int64_t exp, n, ix, hx;
   u_int64_t lx;
@@ -255,8 +255,8 @@  int32_t __ieee754_rem_pio2l(long double x, long double *y)
 
   /* The result is now stored in 3 double values, we need to convert it into
      two long double values.  */
-  t = (long double) tx [6] + (long double) tx [7];
-  w = (long double) tx [5];
+  t = (ldouble_t) tx [6] + (ldouble_t) tx [7];
+  w = (ldouble_t) tx [5];
 
   if (hx >= 0)
     {
diff --git a/sysdeps/ieee754/ldbl-128/e_remainderl.c b/sysdeps/ieee754/ldbl-128/e_remainderl.c
index 88df6f5..3bb4cbe 100644
--- a/sysdeps/ieee754/ldbl-128/e_remainderl.c
+++ b/sysdeps/ieee754/ldbl-128/e_remainderl.c
@@ -24,15 +24,15 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double zero = 0.0L;
+static const ldouble_t zero = 0.0L;
 
 
-long double
-__ieee754_remainderl(long double x, long double p)
+ldouble_t
+__ieee754_remainderl(ldouble_t x, ldouble_t p)
 {
 	int64_t hx,hp;
 	u_int64_t sx,lx,lp;
-	long double p_half;
+	ldouble_t p_half;
 
 	GET_LDOUBLE_WORDS64(hx,lx,x);
 	GET_LDOUBLE_WORDS64(hp,lp,p);
diff --git a/sysdeps/ieee754/ldbl-128/e_sinhl.c b/sysdeps/ieee754/ldbl-128/e_sinhl.c
index 11974a3..09ef4c9 100644
--- a/sysdeps/ieee754/ldbl-128/e_sinhl.c
+++ b/sysdeps/ieee754/ldbl-128/e_sinhl.c
@@ -57,13 +57,13 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double one = 1.0, shuge = 1.0e4931L,
+static const ldouble_t one = 1.0, shuge = 1.0e4931L,
 ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
 
-long double
-__ieee754_sinhl (long double x)
+ldouble_t
+__ieee754_sinhl (ldouble_t x)
 {
-  long double t, w, h;
+  ldouble_t t, w, h;
   u_int32_t jx, ix;
   ieee854_long_double_shape_type u;
 
diff --git a/sysdeps/ieee754/ldbl-128/gamma_productl.c b/sysdeps/ieee754/ldbl-128/gamma_productl.c
index 6f3f05e..9cf8399 100644
--- a/sysdeps/ieee754/ldbl-128/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128/gamma_productl.c
@@ -30,16 +30,16 @@ 
    X is small enough that factors quadratic in it can be
    neglected.  */
 
-long double
-__gamma_productl (long double x, long double x_eps, int n, long double *eps)
+ldouble_t
+__gamma_productl (ldouble_t x, ldouble_t x_eps, int n, ldouble_t *eps)
 {
   SET_RESTORE_ROUNDL (FE_TONEAREST);
-  long double ret = x;
+  ldouble_t ret = x;
   *eps = x_eps / x;
   for (int i = 1; i < n; i++)
     {
       *eps += x_eps / (x + i);
-      long double lo;
+      ldouble_t lo;
       mul_split (&ret, &lo, ret, x + i);
       *eps += lo / ret;
     }
diff --git a/sysdeps/ieee754/ldbl-128/k_cosl.c b/sysdeps/ieee754/ldbl-128/k_cosl.c
index 3985b12..db66040 100644
--- a/sysdeps/ieee754/ldbl-128/k_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/k_cosl.c
@@ -20,7 +20,7 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double c[] = {
+static const ldouble_t c[] = {
 #define ONE c[0]
  1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
 
@@ -74,12 +74,12 @@  static const long double c[] = {
 #define SINCOSL_COS_LO 1
 #define SINCOSL_SIN_HI 2
 #define SINCOSL_SIN_LO 3
-extern const long double __sincosl_table[];
+extern const ldouble_t __sincosl_table[];
 
-long double
-__kernel_cosl(long double x, long double y)
+ldouble_t
+__kernel_cosl(ldouble_t x, ldouble_t y)
 {
-  long double h, l, z, sin_l, cos_l_m1;
+  ldouble_t h, l, z, sin_l, cos_l_m1;
   int64_t ix;
   u_int32_t tix, hix, index;
   GET_LDOUBLE_MSW64 (ix, x);
diff --git a/sysdeps/ieee754/ldbl-128/k_sincosl.c b/sysdeps/ieee754/ldbl-128/k_sincosl.c
index 404df35..bc90590 100644
--- a/sysdeps/ieee754/ldbl-128/k_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/k_sincosl.c
@@ -21,7 +21,7 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double c[] = {
+static const ldouble_t c[] = {
 #define ONE c[0]
  1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
 
@@ -94,12 +94,12 @@  static const long double c[] = {
 #define SINCOSL_COS_LO 1
 #define SINCOSL_SIN_HI 2
 #define SINCOSL_SIN_LO 3
-extern const long double __sincosl_table[];
+extern const ldouble_t __sincosl_table[];
 
 void
-__kernel_sincosl(long double x, long double y, long double *sinx, long double *cosx, int iy)
+__kernel_sincosl(ldouble_t x, ldouble_t y, ldouble_t *sinx, ldouble_t *cosx, int iy)
 {
-  long double h, l, z, sin_l, cos_l_m1;
+  ldouble_t h, l, z, sin_l, cos_l_m1;
   int64_t ix;
   u_int32_t tix, hix, index;
   GET_LDOUBLE_MSW64 (ix, x);
diff --git a/sysdeps/ieee754/ldbl-128/k_sinl.c b/sysdeps/ieee754/ldbl-128/k_sinl.c
index 6290b17..5d34c81 100644
--- a/sysdeps/ieee754/ldbl-128/k_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/k_sinl.c
@@ -21,7 +21,7 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double c[] = {
+static const ldouble_t c[] = {
 #define ONE c[0]
  1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
 
@@ -75,12 +75,12 @@  static const long double c[] = {
 #define SINCOSL_COS_LO 1
 #define SINCOSL_SIN_HI 2
 #define SINCOSL_SIN_LO 3
-extern const long double __sincosl_table[];
+extern const ldouble_t __sincosl_table[];
 
-long double
-__kernel_sinl(long double x, long double y, int iy)
+ldouble_t
+__kernel_sinl(ldouble_t x, ldouble_t y, int iy)
 {
-  long double h, l, z, sin_l, cos_l_m1;
+  ldouble_t h, l, z, sin_l, cos_l_m1;
   int64_t ix;
   u_int32_t tix, hix, index;
   GET_LDOUBLE_MSW64 (ix, x);
diff --git a/sysdeps/ieee754/ldbl-128/k_tanl.c b/sysdeps/ieee754/ldbl-128/k_tanl.c
index cd2bbf5..564e9f9 100644
--- a/sysdeps/ieee754/ldbl-128/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/k_tanl.c
@@ -60,7 +60,7 @@ 
 #include <libc-internal.h>
 #include <math.h>
 #include <math_private.h>
-static const long double
+static const ldouble_t
   one = 1.0L,
   pio4hi = 7.8539816339744830961566084581987569936977E-1L,
   pio4lo = 2.1679525325309452561992610065108379921906E-35L,
@@ -83,10 +83,10 @@  static const long double
   /* 1.000000000000000000000000000000000000000E0 */
 
 
-long double
-__kernel_tanl (long double x, long double y, int iy)
+ldouble_t
+__kernel_tanl (ldouble_t x, ldouble_t y, int iy)
 {
-  long double z, r, v, w, s;
+  ldouble_t z, r, v, w, s;
   int32_t ix, sign;
   ieee854_long_double_shape_type u, u1;
 
@@ -134,7 +134,7 @@  __kernel_tanl (long double x, long double y, int iy)
   w = x + r;
   if (ix >= 0x3ffe5942)
     {
-      v = (long double) iy;
+      v = (ldouble_t) iy;
       w = (v - 2.0 * (x - (w * w / (w + v) - r)));
       /* SIGN is set for arguments that reach this code, but not
 	 otherwise, resulting in warnings that it may be used
diff --git a/sysdeps/ieee754/ldbl-128/lgamma_negl.c b/sysdeps/ieee754/ldbl-128/lgamma_negl.c
index df46199..b94062b 100644
--- a/sysdeps/ieee754/ldbl-128/lgamma_negl.c
+++ b/sysdeps/ieee754/ldbl-128/lgamma_negl.c
@@ -20,7 +20,7 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double lgamma_zeros[][2] =
+static const ldouble_t lgamma_zeros[][2] =
   {
     { -0x2.74ff92c01f0d82abec9f315f1a08p+0L, 0xe.d3ccb7fb2658634a2b9f6b2ba81p-116L },
     { -0x2.bf6821437b20197995a4b4641eaep+0L, -0xb.f4b00b4829f961e428533e6ad048p-116L },
@@ -120,14 +120,14 @@  static const long double lgamma_zeros[][2] =
     { -0x3.2p+4L, 0x3.766dedc259af040be140a68a6c04p-216L },
   };
 
-static const long double e_hi = 0x2.b7e151628aed2a6abf7158809cf4p+0L;
-static const long double e_lo = 0xf.3c762e7160f38b4da56a784d9048p-116L;
+static const ldouble_t e_hi = 0x2.b7e151628aed2a6abf7158809cf4p+0L;
+static const ldouble_t e_lo = 0xf.3c762e7160f38b4da56a784d9048p-116L;
 
 
 /* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) in Stirling's
    approximation to lgamma function.  */
 
-static const long double lgamma_coeff[] =
+static const ldouble_t lgamma_coeff[] =
   {
     0x1.5555555555555555555555555555p-4L,
     -0xb.60b60b60b60b60b60b60b60b60b8p-12L,
@@ -166,7 +166,7 @@  static const long double lgamma_coeff[] =
    polynomial is expressed in terms of x-xm, where xm is the midpoint
    of the interval for which the polynomial applies.  */
 
-static const long double poly_coeff[] =
+static const ldouble_t poly_coeff[] =
   {
     /* Interval [-2.125, -2] (polynomial degree 23).  */
     -0x1.0b71c5c54d42eb6c17f30b7aa8f5p+0L,
@@ -412,8 +412,8 @@  static const size_t poly_end[] =
 
 /* Compute sin (pi * X) for -0.25 <= X <= 0.5.  */
 
-static long double
-lg_sinpi (long double x)
+static ldouble_t
+lg_sinpi (ldouble_t x)
 {
   if (x <= 0.25L)
     return __sinl (M_PIl * x);
@@ -423,8 +423,8 @@  lg_sinpi (long double x)
 
 /* Compute cos (pi * X) for -0.25 <= X <= 0.5.  */
 
-static long double
-lg_cospi (long double x)
+static ldouble_t
+lg_cospi (ldouble_t x)
 {
   if (x <= 0.25L)
     return __cosl (M_PIl * x);
@@ -434,8 +434,8 @@  lg_cospi (long double x)
 
 /* Compute cot (pi * X) for -0.25 <= X <= 0.5.  */
 
-static long double
-lg_cotpi (long double x)
+static ldouble_t
+lg_cotpi (ldouble_t x)
 {
   return lg_cospi (x) / lg_sinpi (x);
 }
@@ -443,34 +443,34 @@  lg_cotpi (long double x)
 /* Compute lgamma of a negative argument -50 < X < -2, setting
    *SIGNGAMP accordingly.  */
 
-long double
-__lgamma_negl (long double x, int *signgamp)
+ldouble_t
+__lgamma_negl (ldouble_t x, int *signgamp)
 {
   /* Determine the half-integer region X lies in, handle exact
      integers and determine the sign of the result.  */
   int i = __floorl (-2 * x);
   if ((i & 1) == 0 && i == -2 * x)
     return 1.0L / 0.0L;
-  long double xn = ((i & 1) == 0 ? -i / 2 : (-i - 1) / 2);
+  ldouble_t xn = ((i & 1) == 0 ? -i / 2 : (-i - 1) / 2);
   i -= 4;
   *signgamp = ((i & 2) == 0 ? -1 : 1);
 
   SET_RESTORE_ROUNDL (FE_TONEAREST);
 
   /* Expand around the zero X0 = X0_HI + X0_LO.  */
-  long double x0_hi = lgamma_zeros[i][0], x0_lo = lgamma_zeros[i][1];
-  long double xdiff = x - x0_hi - x0_lo;
+  ldouble_t x0_hi = lgamma_zeros[i][0], x0_lo = lgamma_zeros[i][1];
+  ldouble_t xdiff = x - x0_hi - x0_lo;
 
   /* For arguments in the range -3 to -2, use polynomial
      approximations to an adjusted version of the gamma function.  */
   if (i < 2)
     {
       int j = __floorl (-8 * x) - 16;
-      long double xm = (-33 - 2 * j) * 0.0625L;
-      long double x_adj = x - xm;
+      ldouble_t xm = (-33 - 2 * j) * 0.0625L;
+      ldouble_t x_adj = x - xm;
       size_t deg = poly_deg[j];
       size_t end = poly_end[j];
-      long double g = poly_coeff[end];
+      ldouble_t g = poly_coeff[end];
       for (size_t j = 1; j <= deg; j++)
 	g = g * x_adj + poly_coeff[end - j];
       return __log1pl (g * xdiff / (x - xn));
@@ -478,8 +478,8 @@  __lgamma_negl (long double x, int *signgamp)
 
   /* The result we want is log (sinpi (X0) / sinpi (X))
      + log (gamma (1 - X0) / gamma (1 - X)).  */
-  long double x_idiff = fabsl (xn - x), x0_idiff = fabsl (xn - x0_hi - x0_lo);
-  long double log_sinpi_ratio;
+  ldouble_t x_idiff = fabsl (xn - x), x0_idiff = fabsl (xn - x0_hi - x0_lo);
+  ldouble_t log_sinpi_ratio;
   if (x0_idiff < x_idiff * 0.5L)
     /* Use log not log1p to avoid inaccuracy from log1p of arguments
        close to -1.  */
@@ -490,29 +490,29 @@  __lgamma_negl (long double x, int *signgamp)
       /* Use log1p not log to avoid inaccuracy from log of arguments
 	 close to 1.  X0DIFF2 has positive sign if X0 is further from
 	 XN than X is from XN, negative sign otherwise.  */
-      long double x0diff2 = ((i & 1) == 0 ? xdiff : -xdiff) * 0.5L;
-      long double sx0d2 = lg_sinpi (x0diff2);
-      long double cx0d2 = lg_cospi (x0diff2);
+      ldouble_t x0diff2 = ((i & 1) == 0 ? xdiff : -xdiff) * 0.5L;
+      ldouble_t sx0d2 = lg_sinpi (x0diff2);
+      ldouble_t cx0d2 = lg_cospi (x0diff2);
       log_sinpi_ratio = __log1pl (2 * sx0d2
 				  * (-sx0d2 + cx0d2 * lg_cotpi (x_idiff)));
     }
 
-  long double log_gamma_ratio;
-  long double y0 = 1 - x0_hi;
-  long double y0_eps = -x0_hi + (1 - y0) - x0_lo;
-  long double y = 1 - x;
-  long double y_eps = -x + (1 - y);
+  ldouble_t log_gamma_ratio;
+  ldouble_t y0 = 1 - x0_hi;
+  ldouble_t y0_eps = -x0_hi + (1 - y0) - x0_lo;
+  ldouble_t y = 1 - x;
+  ldouble_t y_eps = -x + (1 - y);
   /* We now wish to compute LOG_GAMMA_RATIO
      = log (gamma (Y0 + Y0_EPS) / gamma (Y + Y_EPS)).  XDIFF
      accurately approximates the difference Y0 + Y0_EPS - Y -
      Y_EPS.  Use Stirling's approximation.  First, we may need to
      adjust into the range where Stirling's approximation is
      sufficiently accurate.  */
-  long double log_gamma_adj = 0;
+  ldouble_t log_gamma_adj = 0;
   if (i < 20)
     {
       int n_up = (21 - i) / 2;
-      long double ny0, ny0_eps, ny, ny_eps;
+      ldouble_t ny0, ny0_eps, ny, ny_eps;
       ny0 = y0 + n_up;
       ny0_eps = y0 - (ny0 - n_up) + y0_eps;
       y0 = ny0;
@@ -521,28 +521,28 @@  __lgamma_negl (long double x, int *signgamp)
       ny_eps = y - (ny - n_up) + y_eps;
       y = ny;
       y_eps = ny_eps;
-      long double prodm1 = __lgamma_productl (xdiff, y - n_up, y_eps, n_up);
+      ldouble_t prodm1 = __lgamma_productl (xdiff, y - n_up, y_eps, n_up);
       log_gamma_adj = -__log1pl (prodm1);
     }
-  long double log_gamma_high
+  ldouble_t log_gamma_high
     = (xdiff * __log1pl ((y0 - e_hi - e_lo + y0_eps) / e_hi)
        + (y - 0.5L + y_eps) * __log1pl (xdiff / y) + log_gamma_adj);
   /* Compute the sum of (B_2k / 2k(2k-1))(Y0^-(2k-1) - Y^-(2k-1)).  */
-  long double y0r = 1 / y0, yr = 1 / y;
-  long double y0r2 = y0r * y0r, yr2 = yr * yr;
-  long double rdiff = -xdiff / (y * y0);
-  long double bterm[NCOEFF];
-  long double dlast = rdiff, elast = rdiff * yr * (yr + y0r);
+  ldouble_t y0r = 1 / y0, yr = 1 / y;
+  ldouble_t y0r2 = y0r * y0r, yr2 = yr * yr;
+  ldouble_t rdiff = -xdiff / (y * y0);
+  ldouble_t bterm[NCOEFF];
+  ldouble_t dlast = rdiff, elast = rdiff * yr * (yr + y0r);
   bterm[0] = dlast * lgamma_coeff[0];
   for (size_t j = 1; j < NCOEFF; j++)
     {
-      long double dnext = dlast * y0r2 + elast;
-      long double enext = elast * yr2;
+      ldouble_t dnext = dlast * y0r2 + elast;
+      ldouble_t enext = elast * yr2;
       bterm[j] = dnext * lgamma_coeff[j];
       dlast = dnext;
       elast = enext;
     }
-  long double log_gamma_low = 0;
+  ldouble_t log_gamma_low = 0;
   for (size_t j = 0; j < NCOEFF; j++)
     log_gamma_low += bterm[NCOEFF - 1 - j];
   log_gamma_ratio = log_gamma_high + log_gamma_low;
diff --git a/sysdeps/ieee754/ldbl-128/lgamma_productl.c b/sysdeps/ieee754/ldbl-128/lgamma_productl.c
index 625e54c..6dcad1e 100644
--- a/sysdeps/ieee754/ldbl-128/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128/lgamma_productl.c
@@ -28,24 +28,24 @@ 
    X_EPS / X is small enough that factors quadratic in it can be
    neglected.  */
 
-long double
-__lgamma_productl (long double t, long double x, long double x_eps, int n)
+ldouble_t
+__lgamma_productl (ldouble_t t, ldouble_t x, ldouble_t x_eps, int n)
 {
-  long double ret = 0, ret_eps = 0;
+  ldouble_t ret = 0, ret_eps = 0;
   for (int i = 0; i < n; i++)
     {
-      long double xi = x + i;
-      long double quot = t / xi;
-      long double mhi, mlo;
+      ldouble_t xi = x + i;
+      ldouble_t quot = t / xi;
+      ldouble_t mhi, mlo;
       mul_split (&mhi, &mlo, quot, xi);
-      long double quot_lo = (t - mhi - mlo) / xi - t * x_eps / (xi * xi);
+      ldouble_t quot_lo = (t - mhi - mlo) / xi - t * x_eps / (xi * xi);
       /* We want (1 + RET + RET_EPS) * (1 + QUOT + QUOT_LO) - 1.  */
-      long double rhi, rlo;
+      ldouble_t rhi, rlo;
       mul_split (&rhi, &rlo, ret, quot);
-      long double rpq = ret + quot;
-      long double rpq_eps = (ret - rpq) + quot;
-      long double nret = rpq + rhi;
-      long double nret_eps = (rpq - nret) + rhi;
+      ldouble_t rpq = ret + quot;
+      ldouble_t rpq_eps = (ret - rpq) + quot;
+      ldouble_t nret = rpq + rhi;
+      ldouble_t nret_eps = (rpq - nret) + rhi;
       ret_eps += (rpq_eps + nret_eps + rlo + ret_eps * quot
 		  + quot_lo + quot_lo * (ret + ret_eps));
       ret = nret;
diff --git a/sysdeps/ieee754/ldbl-128/mul_splitl.h b/sysdeps/ieee754/ldbl-128/mul_splitl.h
index dee572d..eb79b42 100644
--- a/sysdeps/ieee754/ldbl-128/mul_splitl.h
+++ b/sysdeps/ieee754/ldbl-128/mul_splitl.h
@@ -31,7 +31,7 @@ 
    large enough (or zero) that no underflow occurs.  */
 
 static inline void
-mul_split (long double *hi, long double *lo, long double x, long double y)
+mul_split (ldouble_t *hi, ldouble_t *lo, ldouble_t x, ldouble_t y)
 {
 #ifdef __FMAL
   /* Fast library fused multiply-add, if supported.  */
@@ -41,13 +41,13 @@  mul_split (long double *hi, long double *lo, long double x, long double y)
   /* Apply Dekker's algorithm.  */
   *hi = x * y;
 # define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
-  long double x1 = x * C;
-  long double y1 = y * C;
+  ldouble_t x1 = x * C;
+  ldouble_t y1 = y * C;
 # undef C
   x1 = (x - x1) + x1;
   y1 = (y - y1) + y1;
-  long double x2 = x - x1;
-  long double y2 = y - y1;
+  ldouble_t x2 = x - x1;
+  ldouble_t y2 = y - y1;
   *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
 #endif
 }
diff --git a/sysdeps/ieee754/ldbl-128/s_asinhl.c b/sysdeps/ieee754/ldbl-128/s_asinhl.c
index 5f3b9f2..91e29d0 100644
--- a/sysdeps/ieee754/ldbl-128/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_asinhl.c
@@ -33,15 +33,15 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
   one = 1.0L,
   ln2 = 6.931471805599453094172321214581765681e-1L,
   huge = 1.0e+4900L;
 
-long double
-__asinhl (long double x)
+ldouble_t
+__asinhl (ldouble_t x)
 {
-  long double t, w;
+  ldouble_t t, w;
   int32_t ix, sign;
   ieee854_long_double_shape_type u;
 
diff --git a/sysdeps/ieee754/ldbl-128/s_atanl.c b/sysdeps/ieee754/ldbl-128/s_atanl.c
index 35577a8..747031e 100644
--- a/sysdeps/ieee754/ldbl-128/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_atanl.c
@@ -64,7 +64,7 @@ 
 #include <math_private.h>
 
 /* arctan(k/8), k = 0, ..., 82 */
-static const long double atantbl[84] = {
+static const ldouble_t atantbl[84] = {
   0.0000000000000000000000000000000000000000E0L,
   1.2435499454676143503135484916387102557317E-1L, /* arctan(0.125)  */
   2.4497866312686415417208248121127581091414E-1L,
@@ -156,7 +156,7 @@  static const long double atantbl[84] = {
    |t| <= 0.09375
    peak relative error 5.3e-37 */
 
-static const long double
+static const ldouble_t
   p0 = -4.283708356338736809269381409828726405572E1L,
   p1 = -8.636132499244548540964557273544599863825E1L,
   p2 = -5.713554848244551350855604111031839613216E1L,
@@ -169,13 +169,13 @@  static const long double
   q4 = 2.173623741810414221251136181221172551416E1L;
   /* q5 = 1.000000000000000000000000000000000000000E0 */
 
-static const long double huge = 1.0e4930L;
+static const ldouble_t huge = 1.0e4930L;
 
-long double
-__atanl (long double x)
+ldouble_t
+__atanl (ldouble_t x)
 {
   int k, sign;
-  long double t, u, p, q;
+  ldouble_t t, u, p, q;
   ieee854_long_double_shape_type s;
 
   s.value = x;
diff --git a/sysdeps/ieee754/ldbl-128/s_cbrtl.c b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
index c3ae968..b876c6e 100644
--- a/sysdeps/ieee754/ldbl-128/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
@@ -57,17 +57,17 @@  Adapted for glibc October, 2001.
 #include <math.h>
 #include <math_private.h>
 
-static const long double CBRT2 = 1.259921049894873164767210607278228350570251L;
-static const long double CBRT4 = 1.587401051968199474751705639272308260391493L;
-static const long double CBRT2I = 0.7937005259840997373758528196361541301957467L;
-static const long double CBRT4I = 0.6299605249474365823836053036391141752851257L;
+static const ldouble_t CBRT2 = 1.259921049894873164767210607278228350570251L;
+static const ldouble_t CBRT4 = 1.587401051968199474751705639272308260391493L;
+static const ldouble_t CBRT2I = 0.7937005259840997373758528196361541301957467L;
+static const ldouble_t CBRT4I = 0.6299605249474365823836053036391141752851257L;
 
 
-long double
-__cbrtl (long double x)
+ldouble_t
+__cbrtl (ldouble_t x)
 {
   int e, rem, sign;
-  long double z;
+  ldouble_t z;
 
   if (!isfinite (x))
     return x + x;
diff --git a/sysdeps/ieee754/ldbl-128/s_ceill.c b/sysdeps/ieee754/ldbl-128/s_ceill.c
index 6b73673..044cf81 100644
--- a/sysdeps/ieee754/ldbl-128/s_ceill.c
+++ b/sysdeps/ieee754/ldbl-128/s_ceill.c
@@ -27,7 +27,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-long double __ceill(long double x)
+ldouble_t __ceill(ldouble_t x)
 {
 	int64_t i0,i1,j0;
 	u_int64_t i,j;
diff --git a/sysdeps/ieee754/ldbl-128/s_copysignl.c b/sysdeps/ieee754/ldbl-128/s_copysignl.c
index 19b6880..2d1f6f4 100644
--- a/sysdeps/ieee754/ldbl-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-128/s_copysignl.c
@@ -1,5 +1,5 @@ 
-/* s_copysignl.c -- long double version of s_copysign.c.
- * Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
+/* s_copysignl.c -- ldouble_t version of s_copysign.c.
+ * Conversion to ldouble_t by Jakub Jelinek, jj@ultra.linux.cz.
  */
 
 /*
@@ -18,7 +18,7 @@  static char rcsid[] = "$NetBSD: $";
 #endif
 
 /*
- * copysignl(long double x, long double y)
+ * copysignl(ldouble_t x, ldouble_t y)
  * copysignl(x,y) returns a value with the magnitude of x and
  * with the sign bit of y.
  */
@@ -26,7 +26,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-long double __copysignl(long double x, long double y)
+ldouble_t __copysignl(ldouble_t x, ldouble_t y)
 {
 	u_int64_t hx,hy;
 	GET_LDOUBLE_MSW64(hx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_cosl.c b/sysdeps/ieee754/ldbl-128/s_cosl.c
index 2c3bff6..b3a96c1 100644
--- a/sysdeps/ieee754/ldbl-128/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cosl.c
@@ -48,9 +48,9 @@ 
 #include <math.h>
 #include <math_private.h>
 
-long double __cosl(long double x)
+ldouble_t __cosl(ldouble_t x)
 {
-	long double y[2],z=0.0L;
+	ldouble_t y[2],z=0.0L;
 	int64_t n, ix;
 
     /* High word of x. */
diff --git a/sysdeps/ieee754/ldbl-128/s_erfl.c b/sysdeps/ieee754/ldbl-128/s_erfl.c
index dd275a7..26e9cda 100644
--- a/sysdeps/ieee754/ldbl-128/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_erfl.c
@@ -103,10 +103,10 @@ 
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-neval (long double x, const long double *p, int n)
+static ldouble_t
+neval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = *p--;
@@ -121,10 +121,10 @@  neval (long double x, const long double *p, int n)
 
 /* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static long double
-deval (long double x, const long double *p, int n)
+static ldouble_t
+deval (ldouble_t x, const ldouble_t *p, int n)
 {
-  long double y;
+  ldouble_t y;
 
   p += n;
   y = x + *p--;
@@ -138,7 +138,7 @@  deval (long double x, const long double *p, int n)
 
 
 
-static const long double
+static const ldouble_t
 tiny = 1e-4931L,
   one = 1.0L,
   two = 2.0L,
@@ -150,7 +150,7 @@  tiny = 1e-4931L,
    0 <= x <= 7/8
    Peak relative error 1.8e-35  */
 #define NTN1 8
-static const long double TN1[NTN1 + 1] =
+static const ldouble_t TN1[NTN1 + 1] =
 {
  -3.858252324254637124543172907442106422373E10L,
   9.580319248590464682316366876952214879858E10L,
@@ -163,7 +163,7 @@  static const long double TN1[NTN1 + 1] =
   3.390868480059991640235675479463287886081E1L
 };
 #define NTD1 8
-static const long double TD1[NTD1 + 1] =
+static const ldouble_t TD1[NTD1 + 1] =
 {
   -3.005357030696532927149885530689529032152E11L,
   -1.342602283126282827411658673839982164042E11L,
@@ -181,9 +181,9 @@  static const long double TD1[NTD1 + 1] =
 /* erf(z+1)  = erf_const + P(z)/Q(z)
    -.125 <= z <= 0
    Peak relative error 7.3e-36  */
-static const long double erf_const = 0.845062911510467529296875L;
+static const ldouble_t erf_const = 0.845062911510467529296875L;
 #define NTN2 8
-static const long double TN2[NTN2 + 1] =
+static const ldouble_t TN2[NTN2 + 1] =
 {
  -4.088889697077485301010486931817357000235E1L,
   7.157046430681808553842307502826960051036E3L,
@@ -196,7 +196,7 @@  static const long double TN2[NTN2 + 1] =
   5.127662277706787664956025545897050896203E-1L
 };
 #define NTD2 8
-static const long double TD2[NTD2 + 1] =
+static const ldouble_t TD2[NTD2 + 1] =
 {
   1.731026445926834008273768924015161048885E4L,
   1.209682239007990370796112604286048173750E4L,
@@ -215,7 +215,7 @@  static const long double TD2[NTD2 + 1] =
    0 <= x < 0.125
    Peak relative error 1.4e-35  */
 #define NRNr13 8
-static const long double RNr13[NRNr13 + 1] =
+static const ldouble_t RNr13[NRNr13 + 1] =
 {
  -2.353707097641280550282633036456457014829E3L,
   3.871159656228743599994116143079870279866E2L,
@@ -228,7 +228,7 @@  static const long double RNr13[NRNr13 + 1] =
  -8.098602878463854789780108161581050357814E-2L
 };
 #define NRDr13 7
-static const long double RDr13[NRDr13 + 1] =
+static const ldouble_t RDr13[NRDr13 + 1] =
 {
   2.220448796306693503549505450626652881752E3L,
   1.899133258779578688791041599040951431383E2L,
@@ -241,15 +241,15 @@  static const long double RDr13[NRDr13 + 1] =
  /* 1.0E0 */
 };
 /* erfc(0.25) = C13a + C13b to extra precision.  */
-static const long double C13a = 0.723663330078125L;
-static const long double C13b = 1.0279753638067014931732235184287934646022E-5L;
+static const ldouble_t C13a = 0.723663330078125L;
+static const ldouble_t C13b = 1.0279753638067014931732235184287934646022E-5L;
 
 
 /* erfc(x + 0.375) = erfc(0.375) + x R(x)
    0 <= x < 0.125
    Peak relative error 1.2e-35  */
 #define NRNr14 8
-static const long double RNr14[NRNr14 + 1] =
+static const ldouble_t RNr14[NRNr14 + 1] =
 {
  -2.446164016404426277577283038988918202456E3L,
   6.718753324496563913392217011618096698140E2L,
@@ -262,7 +262,7 @@  static const long double RNr14[NRNr14 + 1] =
  -2.230395570574153963203348263549700967918E-2L
 };
 #define NRDr14 7
-static const long double RDr14[NRDr14 + 1] =
+static const ldouble_t RDr14[NRDr14 + 1] =
 {
   2.495187439241869732696223349840963702875E3L,
   2.503549449872925580011284635695738412162E2L,
@@ -275,14 +275,14 @@  static const long double RDr14[NRDr14 + 1] =
  /* 1.0E0 */
 };
 /* erfc(0.375) = C14a + C14b to extra precision.  */
-static const long double C14a = 0.5958709716796875L;
-static const long double C14b = 1.2118885490201676174914080878232469565953E-5L;
+static const ldouble_t C14a = 0.5958709716796875L;
+static const ldouble_t C14b = 1.2118885490201676174914080878232469565953E-5L;
 
 /* erfc(x + 0.5) = erfc(0.5) + x R(x)
    0 <= x < 0.125
    Peak relative error 4.7e-36  */
 #define NRNr15 8
-static const long double RNr15[NRNr15 + 1] =
+static const ldouble_t RNr15[NRNr15 + 1] =
 {
  -2.624212418011181487924855581955853461925E3L,
   8.473828904647825181073831556439301342756E2L,
@@ -295,7 +295,7 @@  static const long double RNr15[NRNr15 + 1] =
   1.990253655948179713415957791776180406812E-2L
 };
 #define NRDr15 7
-static const long double RDr15[NRDr15 + 1] =
+static const ldouble_t RDr15[NRDr15 + 1] =
 {
   2.986190760847974943034021764693341524962E3L,
   5.288262758961073066335410218650047725985E2L,
@@ -308,14 +308,14 @@  static const long double RDr15[NRDr15 + 1] =
   /* 1.0E0 */
 };
 /* erfc(0.5) = C15a + C15b to extra precision.  */
-static const long double C15a = 0.4794921875L;
-static const long double C15b = 7.9346869534623172533461080354712635484242E-6L;
+static const ldouble_t C15a = 0.4794921875L;
+static const ldouble_t C15b = 7.9346869534623172533461080354712635484242E-6L;
 
 /* erfc(x + 0.625) = erfc(0.625) + x R(x)
    0 <= x < 0.125
    Peak relative error 5.1e-36  */
 #define NRNr16 8
-static const long double RNr16[NRNr16 + 1] =
+static const ldouble_t RNr16[NRNr16 + 1] =
 {
  -2.347887943200680563784690094002722906820E3L,
   8.008590660692105004780722726421020136482E2L,
@@ -328,7 +328,7 @@  static const long double RNr16[NRNr16 + 1] =
   2.022958279982138755020825717073966576670E-2L,
 };
 #define NRDr16 7
-static const long double RDr16[NRDr16 + 1] =
+static const ldouble_t RDr16[NRDr16 + 1] =
 {
   3.075166170024837215399323264868308087281E3L,
   8.730468942160798031608053127270430036627E2L,
@@ -341,14 +341,14 @@  static const long double RDr16[NRDr16 + 1] =
   /* 1.0E0 */
 };
 /* erfc(0.625) = C16a + C16b to extra precision.  */
-static const long double C16a = 0.3767547607421875L;
-static const long double C16b = 4.3570693945275513594941232097252997287766E-6L;
+static const ldouble_t C16a = 0.3767547607421875L;
+static const ldouble_t C16b = 4.3570693945275513594941232097252997287766E-6L;
 
 /* erfc(x + 0.75) = erfc(0.75) + x R(x)
    0 <= x < 0.125
    Peak relative error 1.7e-35  */
 #define NRNr17 8
-static const long double RNr17[NRNr17 + 1] =
+static const ldouble_t RNr17[NRNr17 + 1] =
 {
   -1.767068734220277728233364375724380366826E3L,
   6.693746645665242832426891888805363898707E2L,
@@ -361,7 +361,7 @@  static const long double RNr17[NRNr17 + 1] =
   -1.488945487149634820537348176770282391202E-2L
 };
 #define NRDr17 7
-static const long double RDr17[NRDr17 + 1] =
+static const ldouble_t RDr17[NRDr17 + 1] =
 {
   2.748457523498150741964464942246913394647E3L,
   1.020213390713477686776037331757871252652E3L,
@@ -374,15 +374,15 @@  static const long double RDr17[NRDr17 + 1] =
   /* 1.0E0 */
 };
 /* erfc(0.75) = C17a + C17b to extra precision.  */
-static const long double C17a = 0.2888336181640625L;
-static const long double C17b = 1.0748182422368401062165408589222625794046E-5L;
+static const ldouble_t C17a = 0.2888336181640625L;
+static const ldouble_t C17b = 1.0748182422368401062165408589222625794046E-5L;
 
 
 /* erfc(x + 0.875) = erfc(0.875) + x R(x)
    0 <= x < 0.125
    Peak relative error 2.2e-35  */
 #define NRNr18 8
-static const long double RNr18[NRNr18 + 1] =
+static const ldouble_t RNr18[NRNr18 + 1] =
 {
  -1.342044899087593397419622771847219619588E3L,
   6.127221294229172997509252330961641850598E2L,
@@ -395,7 +395,7 @@  static const long double RNr18[NRNr18 + 1] =
  -5.557645435858916025452563379795159124753E-2L
 };
 #define NRDr18 7
-static const long double RDr18[NRDr18 + 1] =
+static const ldouble_t RDr18[NRDr18 + 1] =
 {
   2.557518000661700588758505116291983092951E3L,
   1.070171433382888994954602511991940418588E3L,
@@ -408,14 +408,14 @@  static const long double RDr18[NRDr18 + 1] =
   /* 1.0E0 */
 };
 /* erfc(0.875) = C18a + C18b to extra precision.  */
-static const long double C18a = 0.215911865234375L;
-static const long double C18b = 1.3073705765341685464282101150637224028267E-5L;
+static const ldouble_t C18a = 0.215911865234375L;
+static const ldouble_t C18b = 1.3073705765341685464282101150637224028267E-5L;
 
 /* erfc(x + 1.0) = erfc(1.0) + x R(x)
    0 <= x < 0.125
    Peak relative error 1.6e-35  */
 #define NRNr19 8
-static const long double RNr19[NRNr19 + 1] =
+static const ldouble_t RNr19[NRNr19 + 1] =
 {
  -1.139180936454157193495882956565663294826E3L,
   6.134903129086899737514712477207945973616E2L,
@@ -428,7 +428,7 @@  static const long double RNr19[NRNr19 + 1] =
  -8.629945436917752003058064731308767664446E-2L
 };
 #define NRDr19 7
-static const long double RDr19[NRDr19 + 1] =
+static const ldouble_t RDr19[NRDr19 + 1] =
 {
   2.744303447981132701432716278363418643778E3L,
   1.266396359526187065222528050591302171471E3L,
@@ -441,14 +441,14 @@  static const long double RDr19[NRDr19 + 1] =
   /* 1.0E0 */
 };
 /* erfc(1.0) = C19a + C19b to extra precision.  */
-static const long double C19a = 0.15728759765625L;
-static const long double C19b = 1.1609394035130658779364917390740703933002E-5L;
+static const ldouble_t C19a = 0.15728759765625L;
+static const ldouble_t C19b = 1.1609394035130658779364917390740703933002E-5L;
 
 /* erfc(x + 1.125) = erfc(1.125) + x R(x)
    0 <= x < 0.125
    Peak relative error 3.6e-36  */
 #define NRNr20 8
-static const long double RNr20[NRNr20 + 1] =
+static const ldouble_t RNr20[NRNr20 + 1] =
 {
  -9.652706916457973956366721379612508047640E2L,
   5.577066396050932776683469951773643880634E2L,
@@ -461,7 +461,7 @@  static const long double RNr20[NRNr20 + 1] =
  -9.611744011489092894027478899545635991213E-2L
 };
 #define NRDr20 7
-static const long double RDr20[NRDr20 + 1] =
+static const ldouble_t RDr20[NRDr20 + 1] =
 {
   3.032829629520142564106649167182428189014E3L,
   1.659648470721967719961167083684972196891E3L,
@@ -474,14 +474,14 @@  static const long double RDr20[NRDr20 + 1] =
  /* 1.0E0 */
 };
 /* erfc(1.125) = C20a + C20b to extra precision.  */
-static const long double C20a = 0.111602783203125L;
-static const long double C20b = 8.9850951672359304215530728365232161564636E-6L;
+static const ldouble_t C20a = 0.111602783203125L;
+static const ldouble_t C20b = 8.9850951672359304215530728365232161564636E-6L;
 
 /* erfc(1/x) = 1/x exp (-1/x^2 - 0.5625 + R(1/x^2))
    7/8 <= 1/x < 1
    Peak relative error 1.4e-35  */
 #define NRNr8 9
-static const long double RNr8[NRNr8 + 1] =
+static const ldouble_t RNr8[NRNr8 + 1] =
 {
   3.587451489255356250759834295199296936784E1L,
   5.406249749087340431871378009874875889602E2L,
@@ -495,7 +495,7 @@  static const long double RNr8[NRNr8 + 1] =
   4.876422978828717219629814794707963640913E-2L
 };
 #define NRDr8 8
-static const long double RDr8[NRDr8 + 1] =
+static const ldouble_t RDr8[NRDr8 + 1] =
 {
   6.358593134096908350929496535931630140282E1L,
   9.900253816552450073757174323424051765523E2L,
@@ -513,7 +513,7 @@  static const long double RDr8[NRDr8 + 1] =
    0.75 <= 1/x <= 0.875
    Peak relative error 2.0e-36  */
 #define NRNr7 9
-static const long double RNr7[NRNr7 + 1] =
+static const ldouble_t RNr7[NRNr7 + 1] =
 {
  1.686222193385987690785945787708644476545E1L,
  1.178224543567604215602418571310612066594E3L,
@@ -527,7 +527,7 @@  static const long double RNr7[NRNr7 + 1] =
  6.700393957480661937695573729183733234400E2L
 };
 #define NRDr7 9
-static const long double RDr7[NRDr7 + 1] =
+static const ldouble_t RDr7[NRDr7 + 1] =
 {
 -1.709305024718358874701575813642933561169E3L,
 -3.280033887481333199580464617020514788369E4L,
@@ -546,7 +546,7 @@  static const long double RDr7[NRDr7 + 1] =
    5/8 <= 1/x < 3/4
    Peak relative error 1.9e-35  */
 #define NRNr6 9
-static const long double RNr6[NRNr6 + 1] =
+static const ldouble_t RNr6[NRNr6 + 1] =
 {
  1.642076876176834390623842732352935761108E0L,
  1.207150003611117689000664385596211076662E2L,
@@ -560,7 +560,7 @@  static const long double RNr6[NRNr6 + 1] =
  4.506934806567986810091824791963991057083E2L
 };
 #define NRDr6 9
-static const long double RDr6[NRDr6 + 1] =
+static const ldouble_t RDr6[NRDr6 + 1] =
 {
 -1.664557643928263091879301304019826629067E2L,
 -3.800035902507656624590531122291160668452E3L,
@@ -579,7 +579,7 @@  static const long double RDr6[NRDr6 + 1] =
    1/2 <= 1/x < 5/8
    Peak relative error 4.6e-36  */
 #define NRNr5 10
-static const long double RNr5[NRNr5 + 1] =
+static const ldouble_t RNr5[NRNr5 + 1] =
 {
 -3.332258927455285458355550878136506961608E-3L,
 -2.697100758900280402659586595884478660721E-1L,
@@ -594,7 +594,7 @@  static const long double RNr5[NRNr5 + 1] =
 -2.077715925587834606379119585995758954399E0L
 };
 #define NRDr5 9
-static const long double RDr5[NRDr5 + 1] =
+static const ldouble_t RDr5[NRDr5 + 1] =
 {
  3.377879570417399341550710467744693125385E-1L,
  1.021963322742390735430008860602594456187E1L,
@@ -613,7 +613,7 @@  static const long double RDr5[NRDr5 + 1] =
    3/8 <= 1/x < 1/2
    Peak relative error 2.0e-36  */
 #define NRNr4 10
-static const long double RNr4[NRNr4 + 1] =
+static const ldouble_t RNr4[NRNr4 + 1] =
 {
  3.258530712024527835089319075288494524465E-3L,
  2.987056016877277929720231688689431056567E-1L,
@@ -628,7 +628,7 @@  static const long double RNr4[NRNr4 + 1] =
  2.127493573166454249221983582495245662319E2L
 };
 #define NRDr4 10
-static const long double RDr4[NRDr4 + 1] =
+static const ldouble_t RDr4[NRDr4 + 1] =
 {
 -3.303141981514540274165450687270180479586E-1L,
 -1.353768629363605300707949368917687066724E1L,
@@ -648,7 +648,7 @@  static const long double RDr4[NRDr4 + 1] =
    1/4 <= 1/x < 3/8
    Peak relative error 8.4e-37  */
 #define NRNr3 11
-static const long double RNr3[NRNr3 + 1] =
+static const ldouble_t RNr3[NRNr3 + 1] =
 {
 -1.952401126551202208698629992497306292987E-6L,
 -2.130881743066372952515162564941682716125E-4L,
@@ -664,7 +664,7 @@  static const long double RNr3[NRNr3 + 1] =
 -1.787995944187565676837847610706317833247E0L
 };
 #define NRDr3 10
-static const long double RDr3[NRDr3 + 1] =
+static const ldouble_t RDr3[NRDr3 + 1] =
 {
  1.979130686770349481460559711878399476903E-4L,
  1.156941716128488266238105813374635099057E-2L,
@@ -684,7 +684,7 @@  static const long double RDr3[NRDr3 + 1] =
    1/8 <= 1/x < 1/4
    Peak relative error 1.5e-36  */
 #define NRNr2 11
-static const long double RNr2[NRNr2 + 1] =
+static const ldouble_t RNr2[NRNr2 + 1] =
 {
 -2.638914383420287212401687401284326363787E-8L,
 -3.479198370260633977258201271399116766619E-6L,
@@ -700,7 +700,7 @@  static const long double RNr2[NRNr2 + 1] =
 -1.572436106228070195510230310658206154374E0L
 };
 #define NRDr2 10
-static const long double RDr2[NRDr2 + 1] =
+static const ldouble_t RDr2[NRDr2 + 1] =
 {
  2.675042728136731923554119302571867799673E-6L,
  2.170997868451812708585443282998329996268E-4L,
@@ -720,7 +720,7 @@  static const long double RDr2[NRDr2 + 1] =
    1/128 <= 1/x < 1/8
    Peak relative error 2.2e-36  */
 #define NRNr1 9
-static const long double RNr1[NRNr1 + 1] =
+static const ldouble_t RNr1[NRNr1 + 1] =
 {
 -4.250780883202361946697751475473042685782E-8L,
 -5.375777053288612282487696975623206383019E-6L,
@@ -734,7 +734,7 @@  static const long double RNr1[NRNr1 + 1] =
 -1.290865243944292370661544030414667556649E0L
 };
 #define NRDr1 8
-static const long double RDr1[NRDr1 + 1] =
+static const ldouble_t RDr1[NRDr1 + 1] =
 {
  4.308976661749509034845251315983612976224E-6L,
  3.265390126432780184125233455960049294580E-4L,
@@ -749,10 +749,10 @@  static const long double RDr1[NRDr1 + 1] =
 };
 
 
-long double
-__erfl (long double x)
+ldouble_t
+__erfl (ldouble_t x)
 {
-  long double a, y, z;
+  ldouble_t a, y, z;
   int32_t i, ix, sign;
   ieee854_long_double_shape_type u;
 
@@ -763,7 +763,7 @@  __erfl (long double x)
   if (ix >= 0x7fff0000)
     {				/* erf(nan)=nan */
       i = ((sign & 0xffff0000) >> 31) << 1;
-      return (long double) (1 - i) + one / x;	/* erf(+-inf)=+-1 */
+      return (ldouble_t) (1 - i) + one / x;	/* erf(+-inf)=+-1 */
     }
 
   if (ix >= 0x3fff0000) /* |x| >= 1.0 */
@@ -784,7 +784,7 @@  __erfl (long double x)
 	  if (ix < 0x00080000)
 	    {
 	      /* Avoid spurious underflow.  */
-	      long double ret =  0.0625 * (16.0 * x + (16.0 * efx) * x);
+	      ldouble_t ret =  0.0625 * (16.0 * x + (16.0 * efx) * x);
 	      math_check_force_underflow (ret);
 	      return ret;
 	    }
@@ -804,10 +804,10 @@  __erfl (long double x)
 }
 
 weak_alias (__erfl, erfl)
-long double
-__erfcl (long double x)
+ldouble_t
+__erfcl (ldouble_t x)
 {
-  long double y, z, p, r;
+  ldouble_t y, z, p, r;
   int32_t i, ix, sign;
   ieee854_long_double_shape_type u;
 
@@ -819,7 +819,7 @@  __erfcl (long double x)
   if (ix >= 0x7fff0000)
     {				/* erfc(nan)=nan */
       /* erfc(+-inf)=0,2 */
-      return (long double) (((u_int32_t) sign >> 31) << 1) + one / x;
+      return (ldouble_t) (((u_int32_t) sign >> 31) << 1) + one / x;
     }
 
   if (ix < 0x3ffd0000) /* |x| <1/4 */
@@ -925,7 +925,7 @@  __erfcl (long double x)
 	__ieee754_expl ((z - x) * (z + x) + p);
       if ((sign & 0x80000000) == 0)
 	{
-	  long double ret = r / x;
+	  ldouble_t ret = r / x;
 	  if (ret == 0)
 	    __set_errno (ERANGE);
 	  return ret;
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index da902ef..8a32db3 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -62,7 +62,7 @@ 
    -.5 ln 2  <  x  <  .5 ln 2
    Theoretical peak relative error = 8.1e-36  */
 
-static const long double
+static const ldouble_t
   P0 = 2.943520915569954073888921213330863757240E8L,
   P1 = -5.722847283900608941516165725053359168840E7L,
   P2 = 8.944630806357575461578107295909719817253E6L,
@@ -88,10 +88,10 @@  static const long double
   minarg = -7.9018778583833765273564461846232128760607E1L, big = 1e4932L;
 
 
-long double
-__expm1l (long double x)
+ldouble_t
+__expm1l (ldouble_t x)
 {
-  long double px, qx, xx;
+  ldouble_t px, qx, xx;
   int32_t ix, sign;
   ieee854_long_double_shape_type u;
   int k;
diff --git a/sysdeps/ieee754/ldbl-128/s_fabsl.c b/sysdeps/ieee754/ldbl-128/s_fabsl.c
index a1bb6c5..934d9a9 100644
--- a/sysdeps/ieee754/ldbl-128/s_fabsl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fabsl.c
@@ -24,7 +24,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-long double __fabsl(long double x)
+ldouble_t __fabsl(ldouble_t x)
 {
 	u_int64_t hx;
 	GET_LDOUBLE_MSW64(hx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_finitel.c b/sysdeps/ieee754/ldbl-128/s_finitel.c
index 25450ba..d5114d5 100644
--- a/sysdeps/ieee754/ldbl-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-128/s_finitel.c
@@ -25,7 +25,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-int __finitel(long double x)
+int __finitel(ldouble_t x)
 {
 	int64_t hx;
 	GET_LDOUBLE_MSW64(hx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_floorl.c b/sysdeps/ieee754/ldbl-128/s_floorl.c
index 14a0efe..57a7220 100644
--- a/sysdeps/ieee754/ldbl-128/s_floorl.c
+++ b/sysdeps/ieee754/ldbl-128/s_floorl.c
@@ -27,7 +27,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-long double __floorl(long double x)
+ldouble_t __floorl(ldouble_t x)
 {
 	int64_t i0,i1,j0;
 	u_int64_t i,j;
diff --git a/sysdeps/ieee754/ldbl-128/s_fmal.c b/sysdeps/ieee754/ldbl-128/s_fmal.c
index 728949c..69507b0 100644
--- a/sysdeps/ieee754/ldbl-128/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128/s_fmal.c
@@ -28,8 +28,8 @@ 
    double rounding.  See a paper by Boldo and Melquiond:
    http://www.lri.fr/~melquion/doc/08-tc.pdf  */
 
-long double
-__fmal (long double x, long double y, long double z)
+ldouble_t
+__fmal (ldouble_t x, ldouble_t y, ldouble_t z)
 {
   union ieee854_long_double u, v, w;
   int adjust = 0;
@@ -75,7 +75,7 @@  __fmal (long double x, long double y, long double z)
 	  < IEEE854_LONG_DOUBLE_BIAS - LDBL_MANT_DIG - 2)
 	{
 	  int neg = u.ieee.negative ^ v.ieee.negative;
-	  long double tiny = neg ? -0x1p-16494L : 0x1p-16494L;
+	  ldouble_t tiny = neg ? -0x1p-16494L : 0x1p-16494L;
 	  if (w.ieee.exponent >= 3)
 	    return tiny + z;
 	  /* Scaling up, adding TINY and scaling down produces the
@@ -94,7 +94,7 @@  __fmal (long double x, long double y, long double z)
 		     && w.ieee.mantissa1 == 0
 		     && w.ieee.mantissa0 == 0)))
 	    {
-	      long double force_underflow = x * y;
+	      ldouble_t force_underflow = x * y;
 	      math_force_eval (force_underflow);
 	    }
 	  return v.d * 0x1p-114L;
@@ -190,22 +190,22 @@  __fmal (long double x, long double y, long double z)
 
   /* Multiplication m1 + m2 = x * y using Dekker's algorithm.  */
 #define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
-  long double x1 = x * C;
-  long double y1 = y * C;
-  long double m1 = x * y;
+  ldouble_t x1 = x * C;
+  ldouble_t y1 = y * C;
+  ldouble_t m1 = x * y;
   x1 = (x - x1) + x1;
   y1 = (y - y1) + y1;
-  long double x2 = x - x1;
-  long double y2 = y - y1;
-  long double m2 = (((x1 * y1 - m1) + x1 * y2) + x2 * y1) + x2 * y2;
+  ldouble_t x2 = x - x1;
+  ldouble_t y2 = y - y1;
+  ldouble_t m2 = (((x1 * y1 - m1) + x1 * y2) + x2 * y1) + x2 * y2;
 
   /* Addition a1 + a2 = z + m1 using Knuth's algorithm.  */
-  long double a1 = z + m1;
-  long double t1 = a1 - z;
-  long double t2 = a1 - t1;
+  ldouble_t a1 = z + m1;
+  ldouble_t t1 = a1 - z;
+  ldouble_t t2 = a1 - t1;
   t1 = m1 - t1;
   t2 = z - t2;
-  long double a2 = t1 + t2;
+  ldouble_t a2 = t1 + t2;
   /* Ensure the arithmetic is not scheduled after feclearexcept call.  */
   math_force_eval (m2);
   math_force_eval (a2);
diff --git a/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
index c89686f..fd179ba 100644
--- a/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
@@ -24,7 +24,7 @@ 
 
 
 int
-__fpclassifyl (long double x)
+__fpclassifyl (ldouble_t x)
 {
   u_int64_t hx, lx;
   int retval = FP_NORMAL;
diff --git a/sysdeps/ieee754/ldbl-128/s_frexpl.c b/sysdeps/ieee754/ldbl-128/s_frexpl.c
index 70b2d3a..12a3fb7 100644
--- a/sysdeps/ieee754/ldbl-128/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-128/s_frexpl.c
@@ -20,7 +20,7 @@  static char rcsid[] = "$NetBSD: $";
 /*
  * for non-zero x
  *	x = frexpl(arg,&exp);
- * return a long double fp quantity x such that 0.5 <= |x| <1.0
+ * return a ldouble_t fp quantity x such that 0.5 <= |x| <1.0
  * and the corresponding binary exponent "exp". That is
  *	arg = x*2^exp.
  * If arg is inf, 0.0, or NaN, then frexpl(arg,&exp) returns arg
@@ -30,10 +30,10 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
 two114 = 2.0769187434139310514121985316880384E+34L; /* 0x4071000000000000, 0 */
 
-long double __frexpl(long double x, int *eptr)
+ldouble_t __frexpl(ldouble_t x, int *eptr)
 {
 	u_int64_t hx, lx, ix;
 	GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_isinfl.c b/sysdeps/ieee754/ldbl-128/s_isinfl.c
index 0066a57..f623e45 100644
--- a/sysdeps/ieee754/ldbl-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isinfl.c
@@ -17,7 +17,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <math_private.h>
 
 int
-__isinfl (long double x)
+__isinfl (ldouble_t x)
 {
 	int64_t hx,lx;
 	GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_isnanl.c b/sysdeps/ieee754/ldbl-128/s_isnanl.c
index 297a669..dced4c0 100644
--- a/sysdeps/ieee754/ldbl-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isnanl.c
@@ -25,7 +25,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-int __isnanl(long double x)
+int __isnanl(ldouble_t x)
 {
 	int64_t hx,lx;
 	GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_issignalingl.c b/sysdeps/ieee754/ldbl-128/s_issignalingl.c
index c06f14d..950b3f1 100644
--- a/sysdeps/ieee754/ldbl-128/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-128/s_issignalingl.c
@@ -20,7 +20,7 @@ 
 #include <math_private.h>
 
 int
-__issignalingl (long double x)
+__issignalingl (ldouble_t x)
 {
   u_int64_t hxi, lxi __attribute__ ((unused));
   GET_LDOUBLE_WORDS64 (hxi, lxi, x);
diff --git a/sysdeps/ieee754/ldbl-128/s_llrintl.c b/sysdeps/ieee754/ldbl-128/s_llrintl.c
index 84fc576..58138bf 100644
--- a/sysdeps/ieee754/ldbl-128/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llrintl.c
@@ -26,19 +26,19 @@ 
 #include <math_private.h>
 #include <fix-fp-int-convert-overflow.h>
 
-static const long double two112[2] =
+static const ldouble_t two112[2] =
 {
   5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
  -5.19229685853482762853049632922009600E+33L  /* 0xC06F000000000000, 0 */
 };
 
 long long int
-__llrintl (long double x)
+__llrintl (ldouble_t x)
 {
   int32_t j0;
   u_int64_t i0,i1;
-  long double w;
-  long double t;
+  ldouble_t w;
+  ldouble_t t;
   long long int result;
   int sx;
 
@@ -52,7 +52,7 @@  __llrintl (long double x)
     {
 #if defined FE_INVALID || defined FE_INEXACT
       /* X < LLONG_MAX + 1 implied by J0 < 63.  */
-      if (x > (long double) LLONG_MAX)
+      if (x > (ldouble_t) LLONG_MAX)
 	{
 	  /* In the event of overflow we must raise the "invalid"
 	     exception, but not "inexact".  */
@@ -83,8 +83,8 @@  __llrintl (long double x)
 	 FE_INVALID must be raised and the return value is
 	 unspecified.  */
 #if defined FE_INVALID || defined FE_INEXACT
-      if (x < (long double) LLONG_MIN
-	  && x > (long double) LLONG_MIN - 1.0L)
+      if (x < (ldouble_t) LLONG_MIN
+	  && x > (ldouble_t) LLONG_MIN - 1.0L)
 	{
 	  /* If truncation produces LLONG_MIN, the cast will not raise
 	     the exception, but may raise "inexact".  */
@@ -92,7 +92,7 @@  __llrintl (long double x)
 	  feraiseexcept (t == LLONG_MIN ? FE_INEXACT : FE_INVALID);
 	  return LLONG_MIN;
 	}
-      else if (FIX_LDBL_LLONG_CONVERT_OVERFLOW && x != (long double) LLONG_MIN)
+      else if (FIX_LDBL_LLONG_CONVERT_OVERFLOW && x != (ldouble_t) LLONG_MIN)
 	{
 	  feraiseexcept (FE_INVALID);
 	  return sx == 0 ? LLONG_MAX : LLONG_MIN;
diff --git a/sysdeps/ieee754/ldbl-128/s_llroundl.c b/sysdeps/ieee754/ldbl-128/s_llroundl.c
index bfc81cc..042a492 100644
--- a/sysdeps/ieee754/ldbl-128/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llroundl.c
@@ -26,7 +26,7 @@ 
 #include <fix-fp-int-convert-overflow.h>
 
 long long int
-__llroundl (long double x)
+__llroundl (ldouble_t x)
 {
   int64_t j0;
   u_int64_t i1, i0;
@@ -79,13 +79,13 @@  __llroundl (long double x)
 	 unspecified.  */
 #ifdef FE_INVALID
       if (FIX_LDBL_LLONG_CONVERT_OVERFLOW
-	  && !(sign == -1 && x > (long double) LLONG_MIN - 0.5L))
+	  && !(sign == -1 && x > (ldouble_t) LLONG_MIN - 0.5L))
 	{
 	  feraiseexcept (FE_INVALID);
 	  return sign == 1 ? LLONG_MAX : LLONG_MIN;
 	}
       else if (!FIX_LDBL_LLONG_CONVERT_OVERFLOW
-	       && x <= (long double) LLONG_MIN - 0.5L)
+	       && x <= (ldouble_t) LLONG_MIN - 0.5L)
 	{
 	  /* If truncation produces LLONG_MIN, the cast will not raise
 	     the exception, but may raise "inexact".  */
diff --git a/sysdeps/ieee754/ldbl-128/s_log1pl.c b/sysdeps/ieee754/ldbl-128/s_log1pl.c
index b348f41..eb0dd03 100644
--- a/sysdeps/ieee754/ldbl-128/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128/s_log1pl.c
@@ -62,7 +62,7 @@ 
  * Theoretical peak relative error = 5.3e-37,
  * relative peak error spread = 2.3e-14
  */
-static const long double
+static const ldouble_t
   P12 = 1.538612243596254322971797716843006400388E-6L,
   P11 = 4.998469661968096229986658302195402690910E-1L,
   P10 = 2.321125933898420063925789532045674660756E1L,
@@ -96,7 +96,7 @@  static const long double
  * Theoretical peak relative error = 1.1e-35,
  * relative peak error spread 1.1e-9
  */
-static const long double
+static const ldouble_t
   R5 = -8.828896441624934385266096344596648080902E-1L,
   R4 = 8.057002716646055371965756206836056074715E1L,
   R3 = -2.024301798136027039250415126250455056397E3L,
@@ -112,17 +112,17 @@  static const long double
   S0 = 1.701761051846631278975701529965589676574E6L;
 
 /* C1 + C2 = ln 2 */
-static const long double C1 = 6.93145751953125E-1L;
-static const long double C2 = 1.428606820309417232121458176568075500134E-6L;
+static const ldouble_t C1 = 6.93145751953125E-1L;
+static const ldouble_t C2 = 1.428606820309417232121458176568075500134E-6L;
 
-static const long double sqrth = 0.7071067811865475244008443621048490392848L;
+static const ldouble_t sqrth = 0.7071067811865475244008443621048490392848L;
 /* ln (2^16384 * (1 - 2^-113)) */
-static const long double zero = 0.0L;
+static const ldouble_t zero = 0.0L;
 
-long double
-__log1pl (long double xm1)
+ldouble_t
+__log1pl (ldouble_t xm1)
 {
-  long double x, y, z, r, s;
+  ldouble_t x, y, z, r, s;
   ieee854_long_double_shape_type u;
   int32_t hx;
   int e;
diff --git a/sysdeps/ieee754/ldbl-128/s_logbl.c b/sysdeps/ieee754/ldbl-128/s_logbl.c
index b7c1ca1..b1e746d 100644
--- a/sysdeps/ieee754/ldbl-128/s_logbl.c
+++ b/sysdeps/ieee754/ldbl-128/s_logbl.c
@@ -26,8 +26,8 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-long double
-__logbl (long double x)
+ldouble_t
+__logbl (ldouble_t x)
 {
   int64_t lx, hx, ex;
 
@@ -48,7 +48,7 @@  __logbl (long double x)
 	ma = __builtin_clzll (hx);
       ex -= ma - 16;
     }
-  return (long double) (ex - 16383);
+  return (ldouble_t) (ex - 16383);
 }
 
 weak_alias (__logbl, logbl)
diff --git a/sysdeps/ieee754/ldbl-128/s_lrintl.c b/sysdeps/ieee754/ldbl-128/s_lrintl.c
index 23f828f..67ced38 100644
--- a/sysdeps/ieee754/ldbl-128/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lrintl.c
@@ -26,19 +26,19 @@ 
 #include <math_private.h>
 #include <fix-fp-int-convert-overflow.h>
 
-static const long double two112[2] =
+static const ldouble_t two112[2] =
 {
   5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
  -5.19229685853482762853049632922009600E+33L  /* 0xC06F000000000000, 0 */
 };
 
 long int
-__lrintl (long double x)
+__lrintl (ldouble_t x)
 {
   int32_t j0;
   u_int64_t i0,i1;
-  long double w;
-  long double t;
+  ldouble_t w;
+  ldouble_t t;
   long int result;
   int sx;
 
@@ -55,7 +55,7 @@  __lrintl (long double x)
 #if defined FE_INVALID || defined FE_INEXACT
 	  /* X < LONG_MAX + 1 implied by J0 < 31.  */
 	  if (sizeof (long int) == 4
-	      && x > (long double) LONG_MAX)
+	      && x > (ldouble_t) LONG_MAX)
 	    {
 	      /* In the event of overflow we must raise the "invalid"
 		 exception, but not "inexact".  */
@@ -82,7 +82,7 @@  __lrintl (long double x)
 #if defined FE_INVALID || defined FE_INEXACT
 	  /* X < LONG_MAX + 1 implied by J0 < 63.  */
 	  if (sizeof (long int) == 8
-	      && x > (long double) LONG_MAX)
+	      && x > (ldouble_t) LONG_MAX)
 	    {
 	      /* In the event of overflow we must raise the "invalid"
 		 exception, but not "inexact".  */
@@ -112,8 +112,8 @@  __lrintl (long double x)
 	 FE_INVALID must be raised and the return value is
 	 unspecified.  */
 #if defined FE_INVALID || defined FE_INEXACT
-      if (x < (long double) LONG_MIN
-	  && x > (long double) LONG_MIN - 1.0L)
+      if (x < (ldouble_t) LONG_MIN
+	  && x > (ldouble_t) LONG_MIN - 1.0L)
 	{
 	  /* If truncation produces LONG_MIN, the cast will not raise
 	     the exception, but may raise "inexact".  */
@@ -121,7 +121,7 @@  __lrintl (long double x)
 	  feraiseexcept (t == LONG_MIN ? FE_INEXACT : FE_INVALID);
 	  return LONG_MIN;
 	}
-      else if (FIX_LDBL_LONG_CONVERT_OVERFLOW && x != (long double) LONG_MIN)
+      else if (FIX_LDBL_LONG_CONVERT_OVERFLOW && x != (ldouble_t) LONG_MIN)
 	{
 	  feraiseexcept (FE_INVALID);
 	  return sx == 0 ? LONG_MAX : LONG_MIN;
diff --git a/sysdeps/ieee754/ldbl-128/s_lroundl.c b/sysdeps/ieee754/ldbl-128/s_lroundl.c
index f032625..eb30540 100644
--- a/sysdeps/ieee754/ldbl-128/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lroundl.c
@@ -26,7 +26,7 @@ 
 #include <fix-fp-int-convert-overflow.h>
 
 long int
-__lroundl (long double x)
+__lroundl (ldouble_t x)
 {
   int64_t j0;
   u_int64_t i1, i0;
@@ -88,13 +88,13 @@  __lroundl (long double x)
 	 unspecified.  */
 #ifdef FE_INVALID
       if (FIX_LDBL_LONG_CONVERT_OVERFLOW
-	  && !(sign == -1 && x > (long double) LONG_MIN - 0.5L))
+	  && !(sign == -1 && x > (ldouble_t) LONG_MIN - 0.5L))
 	{
 	  feraiseexcept (FE_INVALID);
 	  return sign == 1 ? LONG_MAX : LONG_MIN;
 	}
       else if (!FIX_LDBL_LONG_CONVERT_OVERFLOW
-	       && x <= (long double) LONG_MIN - 0.5L)
+	       && x <= (ldouble_t) LONG_MIN - 0.5L)
 	{
 	  /* If truncation produces LONG_MIN, the cast will not raise
 	     the exception, but may raise "inexact".  */
diff --git a/sysdeps/ieee754/ldbl-128/s_modfl.c b/sysdeps/ieee754/ldbl-128/s_modfl.c
index 597a5c9..03fa75e 100644
--- a/sysdeps/ieee754/ldbl-128/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_modfl.c
@@ -30,9 +30,9 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-static const long double one = 1.0;
+static const ldouble_t one = 1.0;
 
-long double __modfl(long double x, long double *iptr)
+ldouble_t __modfl(ldouble_t x, ldouble_t *iptr)
 {
 	int64_t i0,i1,j0;
 	u_int64_t i;
diff --git a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
index 2017c04..706d390 100644
--- a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -27,18 +27,18 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
 TWO112[2]={
   5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
  -5.19229685853482762853049632922009600E+33L  /* 0xC06F000000000000, 0 */
 };
 
-long double __nearbyintl(long double x)
+ldouble_t __nearbyintl(ldouble_t x)
 {
 	fenv_t env;
 	int64_t i0,j0,sx;
 	u_int64_t i1 __attribute__ ((unused));
-	long double w,t;
+	ldouble_t w,t;
 	GET_LDOUBLE_WORDS64(i0,i1,x);
 	sx = (((u_int64_t)i0)>>63);
 	j0 = ((i0>>48)&0x7fff)-0x3fff;
diff --git a/sysdeps/ieee754/ldbl-128/s_nextafterl.c b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
index 4e9a2ce..652fbe4 100644
--- a/sysdeps/ieee754/ldbl-128/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
@@ -28,7 +28,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-long double __nextafterl(long double x, long double y)
+ldouble_t __nextafterl(ldouble_t x, ldouble_t y)
 {
 	int64_t hx,hy,ix,iy;
 	u_int64_t lx,ly;
@@ -43,7 +43,7 @@  long double __nextafterl(long double x, long double y)
 	   return x+y;
 	if(x==y) return y;		/* x=y, return y */
 	if((ix|lx)==0) {			/* x == 0 */
-	    long double u;
+	    ldouble_t u;
 	    SET_LDOUBLE_WORDS64(x,hy&0x8000000000000000ULL,1);/* return +-minsubnormal */
 	    u = math_opt_barrier (x);
 	    u = u * u;
@@ -69,12 +69,12 @@  long double __nextafterl(long double x, long double y)
 	}
 	hy = hx&0x7fff000000000000LL;
 	if(hy==0x7fff000000000000LL) {
-	    long double u = x + x;		/* overflow  */
+	    ldouble_t u = x + x;		/* overflow  */
 	    math_force_eval (u);
 	    __set_errno (ERANGE);
 	}
 	if(hy==0) {
-	    long double u = x*x;		/* underflow */
+	    ldouble_t u = x*x;		/* underflow */
 	    math_force_eval (u);		/* raise underflow flag */
 	    __set_errno (ERANGE);
 	}
diff --git a/sysdeps/ieee754/ldbl-128/s_nextupl.c b/sysdeps/ieee754/ldbl-128/s_nextupl.c
index 3ee47d8..0ef64d6 100644
--- a/sysdeps/ieee754/ldbl-128/s_nextupl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nextupl.c
@@ -20,8 +20,8 @@ 
 #include <math_private.h>
 
 /* Return the least floating-point number greater than X.  */
-long double
-__nextupl (long double x)
+ldouble_t
+__nextupl (ldouble_t x)
 {
   int64_t hx, ix;
   u_int64_t lx;
diff --git a/sysdeps/ieee754/ldbl-128/s_remquol.c b/sysdeps/ieee754/ldbl-128/s_remquol.c
index 7356f5f..dc3c9ac 100644
--- a/sysdeps/ieee754/ldbl-128/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-128/s_remquol.c
@@ -23,11 +23,11 @@ 
 #include <math_private.h>
 
 
-static const long double zero = 0.0;
+static const ldouble_t zero = 0.0;
 
 
-long double
-__remquol (long double x, long double y, int *quo)
+ldouble_t
+__remquol (ldouble_t x, ldouble_t y, int *quo)
 {
   int64_t hx,hy;
   u_int64_t sx,lx,ly,qs;
@@ -87,7 +87,7 @@  __remquol (long double x, long double y, int *quo)
     }
   else
     {
-      long double y_half = 0.5L * y;
+      ldouble_t y_half = 0.5L * y;
       if (x > y_half)
 	{
 	  x -= y;
diff --git a/sysdeps/ieee754/ldbl-128/s_rintl.c b/sysdeps/ieee754/ldbl-128/s_rintl.c
index ae2142b..069f75f 100644
--- a/sysdeps/ieee754/ldbl-128/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_rintl.c
@@ -30,17 +30,17 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
 TWO112[2]={
   5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
  -5.19229685853482762853049632922009600E+33L  /* 0xC06F000000000000, 0 */
 };
 
-long double __rintl(long double x)
+ldouble_t __rintl(ldouble_t x)
 {
 	int64_t i0,j0,sx;
 	u_int64_t i1 __attribute__ ((unused));
-	long double w,t;
+	ldouble_t w,t;
 	GET_LDOUBLE_WORDS64(i0,i1,x);
 	sx = (((u_int64_t)i0)>>63);
 	j0 = ((i0>>48)&0x7fff)-0x3fff;
diff --git a/sysdeps/ieee754/ldbl-128/s_roundl.c b/sysdeps/ieee754/ldbl-128/s_roundl.c
index 63ffd73..d30d017 100644
--- a/sysdeps/ieee754/ldbl-128/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_roundl.c
@@ -23,8 +23,8 @@ 
 #include <math_private.h>
 
 
-long double
-__roundl (long double x)
+ldouble_t
+__roundl (ldouble_t x)
 {
   int32_t j0;
   u_int64_t i1, i0;
diff --git a/sysdeps/ieee754/ldbl-128/s_scalblnl.c b/sysdeps/ieee754/ldbl-128/s_scalblnl.c
index 1e24197..1c30d90 100644
--- a/sysdeps/ieee754/ldbl-128/s_scalblnl.c
+++ b/sysdeps/ieee754/ldbl-128/s_scalblnl.c
@@ -19,7 +19,7 @@  static char rcsid[] = "$NetBSD: $";
 #endif
 
 /*
- * scalblnl (long double x, long int n)
+ * scalblnl (ldouble_t x, long int n)
  * scalblnl(x,n) returns x* 2**n  computed by  exponent
  * manipulation rather than by actually performing an
  * exponentiation or a multiplication.
@@ -28,13 +28,13 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
 two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */
 twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */
 huge   = 1.0E+4900L,
 tiny   = 1.0E-4900L;
 
-long double __scalblnl (long double x, long int n)
+ldouble_t __scalblnl (ldouble_t x, long int n)
 {
 	int64_t k,hx,lx;
 	GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_scalbnl.c b/sysdeps/ieee754/ldbl-128/s_scalbnl.c
index a5cbd0d..b4e62f6 100644
--- a/sysdeps/ieee754/ldbl-128/s_scalbnl.c
+++ b/sysdeps/ieee754/ldbl-128/s_scalbnl.c
@@ -28,13 +28,13 @@  static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 
-static const long double
+static const ldouble_t
 two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */
 twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */
 huge   = 1.0E+4900L,
 tiny   = 1.0E-4900L;
 
-long double __scalbnl (long double x, int n)
+ldouble_t __scalbnl (ldouble_t x, int n)
 {
 	int64_t k,hx,lx;
 	GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_signbitl.c b/sysdeps/ieee754/ldbl-128/s_signbitl.c
index ee5d77e..876be6c 100644
--- a/sysdeps/ieee754/ldbl-128/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-128/s_signbitl.c
@@ -18,9 +18,10 @@ 
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_private.h>
 
 int
-__signbitl (long double x)
+__signbitl (ldouble_t x)
 {
   return __builtin_signbitl (x);
 }
diff --git a/sysdeps/ieee754/ldbl-128/s_sincosl.c b/sysdeps/ieee754/ldbl-128/s_sincosl.c
index 1abdb44..33f5f0f 100644
--- a/sysdeps/ieee754/ldbl-128/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sincosl.c
@@ -24,7 +24,7 @@ 
 #include <math_private.h>
 
 void
-__sincosl (long double x, long double *sinx, long double *cosx)
+__sincosl (ldouble_t x, ldouble_t *sinx, ldouble_t *cosx)
 {
   int64_t ix;
 
@@ -45,7 +45,7 @@  __sincosl (long double x, long double *sinx, long double *cosx)
   else
     {
       /* Argument reduction needed.  */
-      long double y[2];
+      ldouble_t y[2];
       int n;
 
       n = __ieee754_rem_pio2l (x, y);
diff --git a/sysdeps/ieee754/ldbl-128/s_sinl.c b/sysdeps/ieee754/ldbl-128/s_sinl.c
index 582a53f..d4c13a6 100644
--- a/sysdeps/ieee754/ldbl-128/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sinl.c
@@ -48,9 +48,9 @@ 
 #include <math.h>
 #include <math_private.h>
 
-long double __sinl(long double x)
+ldouble_t __sinl(ldouble_t x)
 {
-	long double y[2],z=0.0L;
+	ldouble_t y[2],z=0.0L;
 	int64_t n, ix;
 
     /* High word of x. */
diff --git a/sysdeps/ieee754/ldbl-128/s_tanhl.c b/sysdeps/ieee754/ldbl-128/s_tanhl.c
index f7a1d20..c5f9ede 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanhl.c
@@ -45,12 +45,12 @@ 
 #include <math.h>
 #include <math_private.h>
 
-static const long double one = 1.0, two = 2.0, tiny = 1.0e-4900L;
+static const ldouble_t one = 1.0, two = 2.0, tiny = 1.0e-4900L;
 
-long double
-__tanhl (long double x)
+ldouble_t
+__tanhl (ldouble_t x)
 {
-  long double t, z;
+  ldouble_t t, z;
   u_int32_t jx, ix;
   ieee854_long_double_shape_type u;
 
diff --git a/sysdeps/ieee754/ldbl-128/s_tanl.c b/sysdeps/ieee754/ldbl-128/s_tanl.c
index c7d6374..e8af5b3 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanl.c
@@ -48,9 +48,9 @@ 
 #include <math.h>
 #include <math_private.h>
 
-long double __tanl(long double x)
+ldouble_t __tanl(ldouble_t x)
 {
-	long double y[2],z=0.0L;
+	ldouble_t y[2],z=0.0L;
 	int64_t n, ix;
 
     /* High word of x. */
diff --git a/sysdeps/ieee754/ldbl-128/s_truncl.c b/sysdeps/ieee754/ldbl-128/s_truncl.c
index c71f0ab..f96f155 100644
--- a/sysdeps/ieee754/ldbl-128/s_truncl.c
+++ b/sysdeps/ieee754/ldbl-128/s_truncl.c
@@ -23,8 +23,8 @@ 
 #include <math_private.h>
 
 
-long double
-__truncl (long double x)
+ldouble_t
+__truncl (ldouble_t x)
 {
   int32_t j0;
   u_int64_t i0, i1, sx;
diff --git a/sysdeps/ieee754/ldbl-128/t_expl.h b/sysdeps/ieee754/ldbl-128/t_expl.h
index a23d3d9..777c188 100644
--- a/sysdeps/ieee754/ldbl-128/t_expl.h
+++ b/sysdeps/ieee754/ldbl-128/t_expl.h
@@ -29,7 +29,7 @@ 
    __expl_table[T_EXPL_ARGN+2*i] == i/S+s
    where absl(s) <= 2^-54 and absl(r) <= 2^-212.  */
 
-static const long double __expl_table [] = {
+static const ldouble_t __expl_table [] = {
  -3.47656250000000000584188889839535373E-01L, /* bffd640000000000002b1b04213cf000 */
   6.90417668990715641167244540876988960E-32L, /* 3f97667c3fdb588a6ae1af8748357a17 */
  -3.43749999999999981853132895957607418E-01L, /* bffd5ffffffffffffac4ff5f4050b000 */
diff --git a/sysdeps/ieee754/ldbl-128/t_sincosl.c b/sysdeps/ieee754/ldbl-128/t_sincosl.c
index de5fe0d..ca4224e 100644
--- a/sysdeps/ieee754/ldbl-128/t_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/t_sincosl.c
@@ -25,7 +25,10 @@ 
    Computed using gmp.
  */
 
-const long double __sincosl_table[] = {
+/* Include to grab typedefs and wrappers for ldouble_t and such.  */
+#include <math_private.h>
+
+const ldouble_t __sincosl_table[] = {
 
 /* x =  1.48437500000000000000000000000000000e-01L 3ffc3000000000000000000000000000 */
 /* cos(x) = 0.fd2f5320e1b790209b4dda2f98f79caaa7b873aff1014b0fbc5243766d03cb006bc837c4358 */
diff --git a/sysdeps/ieee754/ldbl-128/x2y2m1l.c b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
index f0fe68e..963a8da 100644
--- a/sysdeps/ieee754/ldbl-128/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
@@ -28,7 +28,7 @@ 
    overflow occurs.  */
 
 static inline void
-add_split (long double *hi, long double *lo, long double x, long double y)
+add_split (ldouble_t *hi, ldouble_t *lo, ldouble_t x, ldouble_t y)
 {
   /* Apply Dekker's algorithm.  */
   *hi = x + y;
@@ -41,8 +41,8 @@  add_split (long double *hi, long double *lo, long double x, long double y)
 static int
 compare (const void *p, const void *q)
 {
-  long double pld = fabsl (*(const long double *) p);
-  long double qld = fabsl (*(const long double *) q);
+  ldouble_t pld = fabsl (*(const ldouble_t *) p);
+  ldouble_t qld = fabsl (*(const ldouble_t *) q);
   if (pld < qld)
     return -1;
   else if (pld == qld)
@@ -55,22 +55,22 @@  compare (const void *p, const void *q)
    It is given that 1 > X >= Y >= epsilon / 2, and that X^2 + Y^2 >=
    0.5.  */
 
-long double
-__x2y2m1l (long double x, long double y)
+ldouble_t
+__x2y2m1l (ldouble_t x, ldouble_t y)
 {
-  long double vals[5];
+  ldouble_t vals[5];
   SET_RESTORE_ROUNDL (FE_TONEAREST);
   mul_split (&vals[1], &vals[0], x, x);
   mul_split (&vals[3], &vals[2], y, y);
   vals[4] = -1.0L;
-  qsort (vals, 5, sizeof (long double), compare);
+  qsort (vals, 5, sizeof (ldouble_t), compare);
   /* Add up the values so that each element of VALS has absolute value
      at most equal to the last set bit of the next nonzero
      element.  */
   for (size_t i = 0; i <= 3; i++)
     {
       add_split (&vals[i + 1], &vals[i], vals[i + 1], vals[i]);
-      qsort (vals + i + 1, 4 - i, sizeof (long double), compare);
+      qsort (vals + i + 1, 4 - i, sizeof (ldouble_t), compare);
     }
   /* Now any error from this addition will be small.  */
   return vals[4] + vals[3] + vals[2] + vals[1] + vals[0];