#include <assert.h>
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
#if defined (HAVE_GFC_REAL_16)
-#if defined (HAVE_JNL)
+#if (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_JNL))
extern void bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1,
int n2, GFC_REAL_16 x);
export_proto(bessel_jn_r16);
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
- if (unlikely (x == 0.0L))
+ if (unlikely (x == 0))
{
- ret->data[0] = 1.0L;
+ ret->data[0] = 1;
for (i = 1; i <= n2-n1; i++)
- ret->data[i*stride] = 0.0L;
+ ret->data[i*stride] = 0;
return;
}
ret->data = ret->data;
- last1 = jnl (n2, x);
+ last1 = MATHFUNC(jn) (n2, x);
ret->data[(n2-n1)*stride] = last1;
if (n1 == n2)
return;
- last2 = jnl (n2 - 1, x);
+ last2 = MATHFUNC(jn) (n2 - 1, x);
ret->data[(n2-n1-1)*stride] = last2;
if (n1 + 1 == n2)
return;
- x2rev = 2.0L/x;
+ x2rev = GFC_REAL_16_LITERAL(2.)/x;
for (i = n2-n1-2; i >= 0; i--)
{
#endif
-#if defined (HAVE_YNL)
+#if (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_YNL))
extern void bessel_yn_r16 (gfc_array_r16 * const restrict ret,
int n1, int n2, GFC_REAL_16 x);
export_proto(bessel_yn_r16);
stride = GFC_DESCRIPTOR_STRIDE(ret,0);
- if (unlikely (x == 0.0L))
+ if (unlikely (x == 0))
{
for (i = 0; i <= n2-n1; i++)
#if defined(GFC_REAL_16_INFINITY)
}
ret->data = ret->data;
- last1 = ynl (n1, x);
+ last1 = MATHFUNC(yn) (n1, x);
ret->data[0] = last1;
if (n1 == n2)
return;
- last2 = ynl (n1 + 1, x);
+ last2 = MATHFUNC(yn) (n1 + 1, x);
ret->data[1*stride] = last2;
if (n1 + 1 == n2)
return;
- x2rev = 2.0L/x;
+ x2rev = GFC_REAL_16_LITERAL(2.)/x;
for (i = 2; i <= n1+n2; i++)
{