public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
@ 2010-08-17 12:43 Tobias Burnus
  2010-08-17 13:24 ` Daniel Kraft
  0 siblings, 1 reply; 18+ messages in thread
From: Tobias Burnus @ 2010-08-17 12:43 UTC (permalink / raw)
  To: gcc patches, gfortran

[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]

  Fortran 2008 has
   BESSEL_JN(N, X)
as elemental function (which is implemented) and
   BESSEL_JN(N1, N2, X)
as transformational function - which this patch adds.

Note: This patch only does the compile-time implementation - a run-time 
implementation is still pending.

Build and regtested on x86-64-linux.
OK for the trunk? (Pending the issue below.)

Note: I get the following failures, which seem to be unrelated:
a) gfortran.dg/widechar_intrinsics_5.f90: Fails (coredump) at -O1 but 
not at -O0
b) gfortran.dg/trim_optimize_1.f90: Fails in the dump for having more 
than 2 memmove
On gcc-testresults, I do not see those failures, but the builds there 
are also a tad older. I am currently bootstrapping to make sure. (b) 
seems to be a FE issue (dependency.c, frontend-passes.c) - but I do not 
have any modifications there; (a) looks like a FE->ME issue, but I do 
not see how this patch could affect those.

Tobias

PS: The array_memcpy_3.f90 issue (PR45266) has been solved by Richard by 
adjusting the pattern.

[-- Attachment #2: bessel_transf.diff --]
[-- Type: text/x-patch, Size: 15160 bytes --]

2010-08-17  Tobias Burnus  <burnus@net-b.de>

	PR fortran/36158
	PR fortran/33197
	* check.c (gfc_check_bessel_n2): New function.
	* gfortran.h (gfc_isym_id): Add GFC_ISYM_JN2 and GFC_ISYM_YN2.
	* intrinsic.c (add_functions): Add transformational version
	of the Bessel_jn/yn intrinsics.
	* intrinsic.h (gfc_check_bessel_n2,gfc_simplify_bessel_jn2,
	gfc_simplify_bessel_yn2): New prototypes.
	* intrinsic.texi (Bessel_jn, Bessel_yn): Document
	transformational variant.
	* simplify.c (gfc_simplify_bessel_jn, gfc_simplify_bessel_yn):
	Check for negative order.
	(gfc_simplify_bessel_n2,gfc_simplify_bessel_jn2,
	gfc_simplify_bessel_yn2): New functions.

2010-08-17  Tobias Burnus  <burnus@net-b.de>

	PR fortran/36158
	PR fortran/33197
	* gfortran.dg/bessel_3.f90: New.
	* gfortran.dg/bessel_4.f90: New.
	* gfortran.dg/bessel_5.f90: New.

Index: gcc/fortran/check.c
===================================================================
--- gcc/fortran/check.c	(revision 163302)
+++ gcc/fortran/check.c	(working copy)
@@ -892,6 +892,31 @@ gfc_check_besn (gfc_expr *n, gfc_expr *x
 }
 
 
+/* Transformational version of the Bessel JN and YN functions.  */
+
+gfc_try
+gfc_check_bessel_n2 (gfc_expr *n1, gfc_expr *n2, gfc_expr *x)
+{
+  if (type_check (n1, 0, BT_INTEGER) == FAILURE)
+    return FAILURE;
+  if (scalar_check (n1, 0) == FAILURE)
+    return FAILURE;
+
+
+  if (type_check (n2, 1, BT_INTEGER) == FAILURE)
+    return FAILURE;
+  if (scalar_check (n2, 0) == FAILURE)
+    return FAILURE;
+
+  if (type_check (x, 2, BT_REAL) == FAILURE)
+    return FAILURE;
+  if (scalar_check (x, 0) == FAILURE)
+    return FAILURE;
+
+  return SUCCESS;
+}
+
+
 gfc_try
 gfc_check_bitfcn (gfc_expr *i, gfc_expr *pos)
 {
Index: gcc/fortran/gfortran.h
===================================================================
--- gcc/fortran/gfortran.h	(revision 163302)
+++ gcc/fortran/gfortran.h	(working copy)
@@ -422,6 +422,7 @@ enum gfc_isym_id
   GFC_ISYM_J0,
   GFC_ISYM_J1,
   GFC_ISYM_JN,
+  GFC_ISYM_JN2,
   GFC_ISYM_KILL,
   GFC_ISYM_KIND,
   GFC_ISYM_LBOUND,
@@ -531,7 +532,8 @@ enum gfc_isym_id
   GFC_ISYM_XOR,
   GFC_ISYM_Y0,
   GFC_ISYM_Y1,
-  GFC_ISYM_YN
+  GFC_ISYM_YN,
+  GFC_ISYM_YN2
 };
 typedef enum gfc_isym_id gfc_isym_id;
 
Index: gcc/fortran/intrinsic.c
===================================================================
--- gcc/fortran/intrinsic.c	(revision 163302)
+++ gcc/fortran/intrinsic.c	(working copy)
@@ -1317,6 +1317,11 @@ add_functions (void)
 	     gfc_check_besn, gfc_simplify_bessel_jn, gfc_resolve_besn,
 	     n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dd, REQUIRED);
 
+  add_sym_3 ("bessel_jn", GFC_ISYM_JN2, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F2008,
+	     gfc_check_bessel_n2, gfc_simplify_bessel_jn2, NULL,
+	     "n1", BT_INTEGER, di, REQUIRED,"n2", BT_INTEGER, di, REQUIRED,
+	     x, BT_REAL, dr, REQUIRED);
+
   make_generic ("bessel_jn", GFC_ISYM_JN, GFC_STD_F2008);
 
   add_sym_1 ("besy0", GFC_ISYM_Y0, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
@@ -1353,6 +1358,11 @@ add_functions (void)
 	     gfc_check_besn, gfc_simplify_bessel_yn, gfc_resolve_besn,
 	     n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dd, REQUIRED);
 
+  add_sym_3 ("bessel_yn", GFC_ISYM_YN2, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F2008,
+	     gfc_check_bessel_n2, gfc_simplify_bessel_yn2, NULL,
+	     "n1", BT_INTEGER, di, REQUIRED,"n2", BT_INTEGER, di, REQUIRED,
+	      x, BT_REAL, dr, REQUIRED);
+
   make_generic ("bessel_yn", GFC_ISYM_YN, GFC_STD_F2008);
 
   add_sym_1 ("bit_size", GFC_ISYM_BIT_SIZE, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
Index: gcc/fortran/intrinsic.h
===================================================================
--- gcc/fortran/intrinsic.h	(revision 163302)
+++ gcc/fortran/intrinsic.h	(working copy)
@@ -40,6 +40,7 @@ gfc_try gfc_check_associated (gfc_expr *
 gfc_try gfc_check_atan_2 (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_atan2 (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_besn (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_bessel_n2 (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_try gfc_check_bitfcn (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_char (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_chdir (gfc_expr *);
@@ -223,9 +224,11 @@ gfc_expr *gfc_simplify_atan2 (gfc_expr *
 gfc_expr *gfc_simplify_bessel_j0 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_j1 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_jn (gfc_expr *, gfc_expr *);
+gfc_expr *gfc_simplify_bessel_jn2 (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_bessel_y0 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_y1 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_yn (gfc_expr *, gfc_expr *);
+gfc_expr *gfc_simplify_bessel_yn2 (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_bit_size (gfc_expr *);
 gfc_expr *gfc_simplify_btest (gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_ceiling (gfc_expr *, gfc_expr *);
Index: gcc/fortran/intrinsic.texi
===================================================================
--- gcc/fortran/intrinsic.texi	(revision 163302)
+++ gcc/fortran/intrinsic.texi	(working copy)
@@ -1630,23 +1630,31 @@ end program test_besj1
 @item @emph{Description}:
 @code{BESSEL_JN(N, X)} computes the Bessel function of the first kind of
 order @var{N} of @var{X}. This function is available under the name
-@code{BESJN} as a GNU extension.
+@code{BESJN} as a GNU extension.  If @var{N} and @var{X} are arrays,
+their ranks and shapes shall conform.  
 
-If both arguments are arrays, their ranks and shapes shall conform.
+@code{BESSEL_JN(N1, N2, X)} returns an array with the Bessel functions
+of the first kind of the orders @var{N1} to @var{N2}.
 
 @item @emph{Standard}:
-Fortran 2008 and later
+Fortran 2008 and later, negative @var{N}, @var{N1}, @var{N2} are
+allowed as GNU extension
 
 @item @emph{Class}:
-Elemental function
+Elemental function, except for the tranformational function
+@code{BESSEL_JN(N1, N2, X)}
 
 @item @emph{Syntax}:
 @code{RESULT = BESSEL_JN(N, X)}
+@code{RESULT = BESSEL_JN(N1, N2, X)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
 @item @var{N} @tab Shall be a scalar or an array of type  @code{INTEGER}.
+@item @var{N1} @tab Shall be a scalar of type  @code{INTEGER}.
+@item @var{N2} @tab Shall be a scalar of type  @code{INTEGER}.
 @item @var{X} @tab Shall be a scalar or an array of type  @code{REAL}.
+for @code{BESSEL_JN(N1, N2, X)} it shall be scalar.
 @end multitable
 
 @item @emph{Return value}:
@@ -1778,23 +1786,31 @@ end program test_besy1
 @item @emph{Description}:
 @code{BESSEL_YN(N, X)} computes the Bessel function of the second kind of
 order @var{N} of @var{X}. This function is available under the name
-@code{BESYN} as a GNU extension.
+@code{BESYN} as a GNU extension.  If @var{N} and @var{X} are arrays,
+their ranks and shapes shall conform.  
 
-If both arguments are arrays, their ranks and shapes shall conform.
+@code{BESSEL_YN(N1, N2, X)} returns an array with the Bessel functions
+of the first kind of the orders @var{N1} to @var{N2}.
 
 @item @emph{Standard}:
-Fortran 2008 and later
+Fortran 2008 and later, negative @var{N}, @var{N1}, @var{N2} are
+allowed as GNU extension
 
 @item @emph{Class}:
-Elemental function
+Elemental function, except for the tranformational function
+@code{BESSEL_YN(N1, N2, X)}
 
 @item @emph{Syntax}:
 @code{RESULT = BESSEL_YN(N, X)}
+@code{RESULT = BESSEL_YN(N1, N2, X)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
-@item @var{N} @tab Shall be a scalar or an array of type  @code{INTEGER}.
-@item @var{X} @tab Shall be a scalar or an array of type  @code{REAL}.
+@item @var{N} @tab Shall be a scalar or an array of type  @code{INTEGER} .
+@item @var{N1} @tab Shall be a scalar of type  @code{INTEGER}.
+@item @var{N2} @tab Shall be a scalar of type  @code{INTEGER}.
+@item @var{X} @tab Shall be a scalar or an array of type  @code{REAL};
+for @code{BESSEL_JN(N1, N2, X)} it shall be scalar.
 @end multitable
 
 @item @emph{Return value}:
Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c	(revision 163302)
+++ gcc/fortran/simplify.c	(working copy)
@@ -1183,12 +1183,19 @@ gfc_expr *
 gfc_simplify_bessel_jn (gfc_expr *order, gfc_expr *x)
 {
   gfc_expr *result;
-  long n;
+  long n = 0;
+
+  if (order->expr_type == EXPR_CONSTANT)
+    {
+      n = mpz_get_si (order->value.integer);
+      if (n < 0 && gfc_notify_std (GFC_STD_GNU, "Extension: Negativ argument "
+				    "N at %L", &order->where) == FAILURE)
+	return &gfc_bad_expr;
+    }
 
   if (x->expr_type != EXPR_CONSTANT || order->expr_type != EXPR_CONSTANT)
     return NULL;
 
-  n = mpz_get_si (order->value.integer);
   result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
   mpfr_jn (result->value.real, n, x->value.real, GFC_RND_MODE);
 
@@ -1196,6 +1203,72 @@ gfc_simplify_bessel_jn (gfc_expr *order,
 }
 
 
+/* Simplify transformational form of JN and YN.  */
+
+static gfc_expr *
+gfc_simplify_bessel_n2 (gfc_expr *order1, gfc_expr *order2, gfc_expr *x,
+			bool jn)
+{
+  gfc_expr *result;
+  long n1 = 0, n2 = 0;
+  int i;
+
+  if (order1->expr_type == EXPR_CONSTANT)
+    {
+      n1 = mpz_get_si (order1->value.integer);
+      if (n1 < 0 && gfc_notify_std (GFC_STD_GNU, "Extension: Negativ argument "
+				    "N1 at %L", &order1->where) == FAILURE)
+	return &gfc_bad_expr;
+    }
+
+  if (order2->expr_type == EXPR_CONSTANT)
+    {
+      n2 = mpz_get_si (order2->value.integer);
+      if (n2 < 0 && gfc_notify_std (GFC_STD_GNU, "Extension: Negativ argument "
+				    "N2 at %L", &order2->where) == FAILURE)
+	return &gfc_bad_expr;
+    }
+
+  if (x->expr_type != EXPR_CONSTANT || order1->expr_type != EXPR_CONSTANT
+      || order2->expr_type != EXPR_CONSTANT)
+    {
+      gfc_error ("Sorry, non-constant transformational Bessel function at %L"
+		   " not yet supported", &order2->where);
+      return &gfc_bad_expr;
+    }
+
+  result = gfc_get_array_expr (x->ts.type, x->ts.kind, &x->where);
+  result->rank = 1;
+  result->shape = gfc_get_shape (1);
+  mpz_init_set_ui (result->shape[0], MAX (n2-n1+1, 0));
+
+  for (i = n1; i <= n2; ++i)
+    {
+      gfc_expr *e;
+     
+      e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+
+      if (jn)
+	mpfr_jn (e->value.real, i, x->value.real, GFC_RND_MODE);
+      else
+	mpfr_yn (e->value.real, i, x->value.real, GFC_RND_MODE);
+
+      if (range_check (e, jn ? "BESSEL_JN" : "BESSEL_YN") == &gfc_bad_expr)
+	return &gfc_bad_expr;
+      gfc_constructor_append_expr (&result->value.constructor, e, &x->where);
+    }
+
+  return result;
+}
+
+
+gfc_expr *
+gfc_simplify_bessel_jn2 (gfc_expr *order1, gfc_expr *order2, gfc_expr *x)
+{
+  return gfc_simplify_bessel_n2 (order1, order2, x, true);
+}
+
+
 gfc_expr *
 gfc_simplify_bessel_y0 (gfc_expr *x)
 {
@@ -1230,12 +1303,19 @@ gfc_expr *
 gfc_simplify_bessel_yn (gfc_expr *order, gfc_expr *x)
 {
   gfc_expr *result;
-  long n;
+  long n = 0;
+
+  if (order->expr_type == EXPR_CONSTANT)
+    {
+      n = mpz_get_si (order->value.integer);
+      if (n < 0 && gfc_notify_std (GFC_STD_GNU, "Extension: Negativ argument "
+				    "N at %L", &order->where) == FAILURE)
+	return &gfc_bad_expr;
+    }
 
   if (x->expr_type != EXPR_CONSTANT || order->expr_type != EXPR_CONSTANT)
     return NULL;
 
-  n = mpz_get_si (order->value.integer);
   result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
   mpfr_yn (result->value.real, n, x->value.real, GFC_RND_MODE);
 
@@ -1243,6 +1323,13 @@ gfc_simplify_bessel_yn (gfc_expr *order,
 }
 
 
+gfc_expr *
+gfc_simplify_bessel_yn2 (gfc_expr *order1, gfc_expr *order2, gfc_expr *x)
+{
+  return gfc_simplify_bessel_n2 (order1, order2, x, false);
+}
+
+
 gfc_expr *
 gfc_simplify_bit_size (gfc_expr *e)
 {
Index: gcc/testsuite/gfortran.dg/bessel_3.f90
===================================================================
--- gcc/testsuite/gfortran.dg/bessel_3.f90	(revision 0)
+++ gcc/testsuite/gfortran.dg/bessel_3.f90	(revision 0)
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! { dg-options "-std=f2003 -Wimplicit-procedure" }
+!
+! PR fortran/36158 - Transformational BESSEL_JN/YN
+! PR fortran/33197 - F2008 math functions
+!
+IMPLICIT NONE
+print *, SIN (1.0)
+print *, BESSEL_J0(1.0) ! { dg-error "has no IMPLICIT type" })
+print *, BESSEL_J1(1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_JN(1,1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_JN(1,2,1.0) ! { dg-error "has no IMPLICIT type" }
+
+print *, BESSEL_Y0(1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_Y1(1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_YN(1,1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_YN(1,2,1.0) ! { dg-error "has no IMPLICIT type" }
+end
Index: gcc/testsuite/gfortran.dg/bessel_4.f90
===================================================================
--- gcc/testsuite/gfortran.dg/bessel_4.f90	(revision 0)
+++ gcc/testsuite/gfortran.dg/bessel_4.f90	(revision 0)
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! { dg-options "-std=f2008" }
+!
+! PR fortran/36158 - Transformational BESSEL_JN/YN
+! PR fortran/33197 - F2008 math functions
+!
+implicit none
+! OK, elemental function:
+ print *, bessel_yn(1, [1.0, 2.0])
+ print *, bessel_yn([1, 2], 2.0)
+! Wrong, transformational function:
+ print *, bessel_yn(1, 2, [2.0, 3.0]) ! { dg-error "Too many arguments" }
+! Wrong in F2008: Negative argument, ok as GNU extension
+ print *, bessel_yn(-1, 3.0) ! { dg-error "Extension: Negativ argument N " }
+ print *, bessel_yn(-1, 2, 3.0) ! { dg-error "Extension: Negativ argument N1" }
+end
Index: gcc/testsuite/gfortran.dg/bessel_5.f90
===================================================================
--- gcc/testsuite/gfortran.dg/bessel_5.f90	(revision 0)
+++ gcc/testsuite/gfortran.dg/bessel_5.f90	(revision 0)
@@ -0,0 +1,35 @@
+! { dg-do run }
+! { dg-options "-Wall" }
+!
+! PR fortran/36158 - Transformational BESSEL_JN/YN
+! PR fortran/33197 - F2008 math functions
+!
+! This is a dg-do run test as the middle end cannot simplify the
+! the scalarization of the elemental function (cf. PR 45305).
+!
+! -Wall has been specified to disabled -pedantic, which warns about the
+! negative order (GNU extension) to the order of the Bessel functions of
+! first and second kind.
+!
+implicit none
+if (any (abs (BESSEL_JN(2, 5, 2.457) - BESSEL_JN([2,3,4,5], 2.457)) &
+          > epsilon(0.0))) &
+  call abort()
+if (any (abs (BESSEL_YN(2, 5, 2.457) - BESSEL_YN([2,3,4,5], 2.457)) &
+         > epsilon(0.0))) &
+  call abort()
+if (any (abs (BESSEL_JN(-1, 1, 2.457) &
+              - [ BESSEL_JN(-1, 2.457), BESSEL_JN(0, 2.457), BESSEL_JN(1, 2.457) ]) &
+         > epsilon(0.0))) &
+  call abort()
+if (any (abs (BESSEL_YN(-1, 1, 2.457) &
+              - [ BESSEL_YN(-1, 2.457), BESSEL_YN(0, 2.457), BESSEL_YN(1, 2.457) ]) &
+         > epsilon(0.0))) &
+  call abort()
+if (any (abs (BESSEL_JN(0, 1, 2.457) - [BESSEL_J0(2.457), BESSEL_J1(2.457)]) &
+    > epsilon(0.0))) &
+  call abort()
+if (any (abs (BESSEL_YN(0, 1, 2.457) - [BESSEL_Y0(2.457), BESSEL_Y1(2.457)]) &
+         > epsilon(0.0))) &
+  call abort()
+end

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-17 12:43 [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic Tobias Burnus
@ 2010-08-17 13:24 ` Daniel Kraft
  2010-08-17 14:49   ` Steve Kargl
  0 siblings, 1 reply; 18+ messages in thread
From: Daniel Kraft @ 2010-08-17 13:24 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc patches, gfortran

Tobias Burnus wrote:
>  Fortran 2008 has
>   BESSEL_JN(N, X)
> as elemental function (which is implemented) and
>   BESSEL_JN(N1, N2, X)
> as transformational function - which this patch adds.
> 
> Note: This patch only does the compile-time implementation - a run-time 
> implementation is still pending.
> 
> Build and regtested on x86-64-linux.
> OK for the trunk? (Pending the issue below.)

Ok.  But:

+      if (n < 0 && gfc_notify_std (GFC_STD_GNU, "Extension: Negativ 
argument "
+				    "N at %L", &order->where) == FAILURE)

It's "negative" in English, I think.  The same is later, also.

> Note: I get the following failures, which seem to be unrelated:
> a) gfortran.dg/widechar_intrinsics_5.f90: Fails (coredump) at -O1 but 
> not at -O0
> b) gfortran.dg/trim_optimize_1.f90: Fails in the dump for having more 
> than 2 memmove
> On gcc-testresults, I do not see those failures, but the builds there 
> are also a tad older. I am currently bootstrapping to make sure. (b) 
> seems to be a FE issue (dependency.c, frontend-passes.c) - but I do not 
> have any modifications there; (a) looks like a FE->ME issue, but I do 
> not see how this patch could affect those.

I see (b) but not (a) on my system with the build of my last ASSOCIATE 
patch, but there has been some partial svn update so it may be wrong.

Yours,
Daniel

-- 
http://www.pro-vegan.info/
--
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-17 13:24 ` Daniel Kraft
@ 2010-08-17 14:49   ` Steve Kargl
  2010-08-17 14:55     ` Tobias Burnus
  0 siblings, 1 reply; 18+ messages in thread
From: Steve Kargl @ 2010-08-17 14:49 UTC (permalink / raw)
  To: Daniel Kraft; +Cc: Tobias Burnus, gcc patches, gfortran

On Tue, Aug 17, 2010 at 03:23:14PM +0200, Daniel Kraft wrote:
> Tobias Burnus wrote:
> > Fortran 2008 has
> >  BESSEL_JN(N, X)
> >as elemental function (which is implemented) and
> >  BESSEL_JN(N1, N2, X)
> >as transformational function - which this patch adds.
> >
> >Note: This patch only does the compile-time implementation - a run-time 
> >implementation is still pending.
> >
> >Build and regtested on x86-64-linux.
> >OK for the trunk? (Pending the issue below.)
> 
> Ok.  But:
> 

Not OK. :-)

In check.c, 

+  if (scalar_check (n2, 0) == FAILURE)
+    return FAILURE;

The 0 should 1.

+
+  if (type_check (x, 2, BT_REAL) == FAILURE)
+    return FAILURE;
+  if (scalar_check (x, 0) == FAILURE)
+    return FAILURE;

The 0 should be 2.

Also note that if n1 and n2 are to be nonnegative.
So, one should add,

   if (nonnegative_check ('n1', n1) == FAILURE)
     return FAILURE;

   if (nonnegative_check ('n2', n2) == FAILURE)
     return FAILURE;


In the simplification route

+  if (order->expr_type == EXPR_CONSTANT)
+    {
+      n = mpz_get_si (order->value.integer);
+      if (n < 0 && gfc_notify_std (GFC_STD_GNU, "Extension: Negativ argument "
+                                   "N at %L", &order->where) == FAILURE)
+       return &gfc_bad_expr;
+    }

   if (x->expr_type != EXPR_CONSTANT || order->expr_type != EXPR_CONSTANT)
     return NULL;

Please move the 2nd if-statement to the top of the function.  There's
no reason to possibly issue an error for n < 0, if once that is fixed
simplification terminates due to a non-constant x.

Finally, note that the mpfr_{jn,yn} routines are called n2 - n1 + 1
times, which may be very slow for large n2 - n1 + 1.  Bessel functions
are stable for downward recursion, and Neumann functions are stable
for upward recursion.  It may be better to use recursion, which 
involves two evaluations of mfpr_{jn,yn} and then some simple
multiplications and additions.

-- 
Steve

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-17 14:49   ` Steve Kargl
@ 2010-08-17 14:55     ` Tobias Burnus
  2010-08-17 15:39       ` Steve Kargl
  0 siblings, 1 reply; 18+ messages in thread
From: Tobias Burnus @ 2010-08-17 14:55 UTC (permalink / raw)
  To: Steve Kargl; +Cc: Daniel Kraft, gcc patches, gfortran

  On 08/17/2010 04:14 PM, Steve Kargl wrote:
> Not OK. :-)
> In check.c,
> +  if (scalar_check (n2, 0) == FAILURE)
> +    return FAILURE;
> The 0 should 1.
Thanks for spotting this.

> Also note that if n1 and n2 are to be nonnegative.
> So, one should add,
>
>     if (nonnegative_check ('n1', n1) == FAILURE)
>       return FAILURE;
>     if (nonnegative_check ('n2', n2) == FAILURE)
>       return FAILURE;

I disagree. Negative values are perfectly valid thus I would prefer 
adding such a restriction only for -std=f2003.

(J(-m,x) = (-1)**m * J(m,x) -- and analogously for YN - at least for 
integral m; using the Gamma function for negative m won't work, as it 
becomes +/-infinite for negative integer values). Thus, there is no need 
for negative "m", but also no need to reject them. As gfortran allowed 
negative "m" so far, I think it should continue to do so for -std=gnu.)

> In the simplification route
>
> +  if (order->expr_type == EXPR_CONSTANT)
> +    {
> +      n = mpz_get_si (order->value.integer);
> +      if (n<  0&&  gfc_notify_std (GFC_STD_GNU, "Extension: Negativ argument "
> +                                   "N at %L",&order->where) == FAILURE)
> +       return&gfc_bad_expr;
> +    }
>
>     if (x->expr_type != EXPR_CONSTANT || order->expr_type != EXPR_CONSTANT)
>       return NULL;
>
> Please move the 2nd if-statement to the top of the function.  There's
> no reason to possibly issue an error for n<  0, if once that is fixed
> simplification terminates due to a non-constant x.

Well, the error is useful, unless one already puts the error into 
check.c. But I agree that one can move the check into check.c.

> Finally, note that the mpfr_{jn,yn} routines are called n2 - n1 + 1
> times, which may be very slow for large n2 - n1 + 1.  Bessel functions
> are stable for downward recursion, and Neumann functions are stable
> for upward recursion.  It may be better to use recursion, which
> involves two evaluations of mfpr_{jn,yn} and then some simple
> multiplications and additions

Do you mean the following algorithm?

x2rev = 2.0/x
J(N-1, x) = x2rev * N * J(N, x) - J(N+1, x)
Y(N+1, x) = x2rev * N * Y(N, x) - Y(N-1, x)

Tobias

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-17 14:55     ` Tobias Burnus
@ 2010-08-17 15:39       ` Steve Kargl
  2010-08-17 17:00         ` Tobias Burnus
  0 siblings, 1 reply; 18+ messages in thread
From: Steve Kargl @ 2010-08-17 15:39 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: Daniel Kraft, gcc patches, gfortran

On Tue, Aug 17, 2010 at 04:50:09PM +0200, Tobias Burnus wrote:
>  On 08/17/2010 04:14 PM, Steve Kargl wrote:
> >Not OK. :-)
> >In check.c,
> >+  if (scalar_check (n2, 0) == FAILURE)
> >+    return FAILURE;
> >The 0 should 1.
> Thanks for spotting this.
> 
> >Also note that if n1 and n2 are to be nonnegative.
> >So, one should add,
> >
> >    if (nonnegative_check ('n1', n1) == FAILURE)
> >      return FAILURE;
> >    if (nonnegative_check ('n2', n2) == FAILURE)
> >      return FAILURE;
> 
> I disagree. Negative values are perfectly valid thus I would prefer 
> adding such a restriction only for -std=f2003.

Then you may need to fix your simplicification function.

+  mpz_init_set_ui (result->shape[0], MAX (n2-n1+1, 0));
+
+  for (i = n1; i <= n2; ++i)
+    {

What happens if n2 = -4 and n1 = 1?  Note, the standard
does not specify that n2 > n1.  It is implied by 

    Case (ii): The result of BESSEL JN (N1, N2, X) is a rank-one
      array with extent MAX (N2-N1+1, 0).

but there is no requirement for this ordering.  It may be prudent to
add a check that n2 > n1. 

> (J(-m,x) = (-1)**m * J(m,x) -- and analogously for YN - at least for 
> integral m; using the Gamma function for negative m won't work, as it 
> becomes +/-infinite for negative integer values). Thus, there is no need 
> for negative "m", but also no need to reject them. As gfortran allowed 
> negative "m" so far, I think it should continue to do so for -std=gnu.)

I would prefer to remove this extension.

> >In the simplification route
> >
> >+  if (order->expr_type == EXPR_CONSTANT)
> >+    {
> >+      n = mpz_get_si (order->value.integer);
> >+      if (n<  0&&  gfc_notify_std (GFC_STD_GNU, "Extension: Negativ 
> >argument "
> >+                                   "N at %L",&order->where) == FAILURE)
> >+       return&gfc_bad_expr;
> >+    }
> >
> >    if (x->expr_type != EXPR_CONSTANT || order->expr_type != EXPR_CONSTANT)
> >      return NULL;
> >
> >Please move the 2nd if-statement to the top of the function.  There's
> >no reason to possibly issue an error for n<  0, if once that is fixed
> >simplification terminates due to a non-constant x.
> 
> Well, the error is useful, unless one already puts the error into 
> check.c. But I agree that one can move the check into check.c.

Yes, the check belong in check.c.

> >Finally, note that the mpfr_{jn,yn} routines are called n2 - n1 + 1
> >times, which may be very slow for large n2 - n1 + 1.  Bessel functions
> >are stable for downward recursion, and Neumann functions are stable
> >for upward recursion.  It may be better to use recursion, which
> >involves two evaluations of mfpr_{jn,yn} and then some simple
> >multiplications and additions
> 
> Do you mean the following algorithm?
> 
> x2rev = 2.0/x
> J(N-1, x) = x2rev * N * J(N, x) - J(N+1, x)
> Y(N+1, x) = x2rev * N * Y(N, x) - Y(N-1, x)
> 

Yes.  If you have Abromowitz and Stegun, look up Miller's
algorithm for computing Bessel functions.  The new NIST
rewrite has

http://dlmf.nist.gov/10.74#iv

The guts of my bessel function routine has

   if (x == 0.e0_knd) then  ! Avoid division by zero
      j = 0
      j(0) = 1
   else
      !  
      ! Do the downward recursion.
      !
      jmx1 = besjn(n + 2, x)
      jmx  = besjn(n + 1, x)
      ix = 2 / x
      do i = n + 1, 1, -1
         j(i - 1) = i * ix * jmx - jmx1
         jmx1 = jmx
         jmx = j(i - 1)
      end do

If the initial values of J(N,x) and J(N+1, x) are accurate
approximations then the above generates the required sequence.
If the values are inaccurate, the generated sequence is 
porportional to the desired sequence of Bessel functions.
One then to normalize the sequence, for my routine I do

      jmx = cj0(x)   ! J(0)
      jmx1 = cj1(x)  ! J(1)
      if (abs(jmx) >= abs(jmx1)) then
         jmx = jmx  / j(0)
      else
         jmx = jmx1 / j(1)
      end if
      j = jmx * j
   end if


-- 
Steve

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-17 15:39       ` Steve Kargl
@ 2010-08-17 17:00         ` Tobias Burnus
  2010-08-17 19:08           ` Steve Kargl
  0 siblings, 1 reply; 18+ messages in thread
From: Tobias Burnus @ 2010-08-17 17:00 UTC (permalink / raw)
  To: Steve Kargl; +Cc: Daniel Kraft, gcc patches, gfortran

[-- Attachment #1: Type: text/plain, Size: 2893 bytes --]

  On 08/17/2010 05:36 PM, Steve Kargl wrote:
>> I disagree. Negative values are perfectly valid thus I would prefer
>> adding such a restriction only for -std=f2003.
> Then you may need to fix your simplicification function.

Let's do it differently: For the existing elemental function, we allow 
non-negative values but for the transformational one, we don't.

> +  mpz_init_set_ui (result->shape[0], MAX (n2-n1+1, 0));
> +
> +  for (i = n1; i<= n2; ++i)
> +    {
>
> What happens if n2 = -4 and n1 = 1?  Note, the standard
> does not specify that n2>  n1.  It is implied by
>
>      Case (ii): The result of BESSEL JN (N1, N2, X) is a rank-one
>        array with extent MAX (N2-N1+1, 0).
>
> but there is no requirement for this ordering.  It may be prudent to
> add a check that n2>  n1.

I think that's wrong. First, n2 == n1 is perfectly valid; secondly, if 
n2 < n1, one gets a zero-sized array, which might be not terribly 
useful, but is perfectly valid.


>> (J(-m,x) = (-1)**m * J(m,x) -- and analogously for YN - at least for
>> integral m; using the Gamma function for negative m won't work, as it
>> becomes +/-infinite for negative integer values). Thus, there is no need
>> for negative "m", but also no need to reject them. As gfortran allowed
>> negative "m" so far, I think it should continue to do so for -std=gnu.)
> I would prefer to remove this extension.
Why?

>> Do you mean the following algorithm?
>> x2rev = 2.0/x
>> J(N-1, x) = x2rev * N * J(N, x) - J(N+1, x)
>> Y(N+1, x) = x2rev * N * Y(N, x) - Y(N-1, x
> Yes.
>     if (x == 0.e0_knd) then  ! Avoid division by zero
>        j = 0
The x == 0 is a good point!

How about the attached patch? The patch seems to work correctly for JN 
and x == 0  and for YN (all x); the result agrees with the GLIBC result 
up to ULP.

The problem I still have is with JN. My feeling is that 
gfc_constructor_insert_expr does not correctly work. For
   print *, BESSEL_JN(0, 1, 1.0)
   print *, (BESSEL_JN(i, 1.0), i =0, 1)
I get:
   0.76519769       0.0000000
   0.76519769      0.44005057
using
     gfc_constructor_insert_expr (&result->value.constructor, e, 
&x->where, 0);
if I change the "0" to "1", I get:
   0.44005057      0.76519769
thus the value is correctly set - but somehow inserting the constructor 
as first element does not work.

Any idea?

Tobias

PS: Steve, are you interested in implementing a TREE or libgfortran 
version of this algorithm? I think using a libgfortran version makes 
more sense than implementing it as TREE; what do you think?

PPS: See first email for some test cases or see below.

print *, BESSEL_JN(0, 5, 0.0)
print *, (BESSEL_JN(i, 0.0), i =0, 5)
print *,
print *, BESSEL_YN(0, 5, 0.0)
print *, (BESSEL_YN(i, 0.0), i =0, 5)
print *,
print *, BESSEL_JN(0, 1, 1.0)
print *, (BESSEL_JN(i, 1.0), i =0, 1)
print *, ''
print *, BESSEL_YN(0, 4 2.5)
print *, (BESSEL_YN(i, 2.5), i =0, 4)
end

[-- Attachment #2: bessel.diff --]
[-- Type: text/x-patch, Size: 16531 bytes --]

Index: intrinsic.c
===================================================================
--- intrinsic.c	(revision 163305)
+++ intrinsic.c	(working copy)
@@ -1317,6 +1317,11 @@ add_functions (void)
 	     gfc_check_besn, gfc_simplify_bessel_jn, gfc_resolve_besn,
 	     n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dd, REQUIRED);
 
+  add_sym_3 ("bessel_jn", GFC_ISYM_JN2, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F2008,
+	     gfc_check_bessel_n2, gfc_simplify_bessel_jn2, NULL,
+	     "n1", BT_INTEGER, di, REQUIRED,"n2", BT_INTEGER, di, REQUIRED,
+	     x, BT_REAL, dr, REQUIRED);
+
   make_generic ("bessel_jn", GFC_ISYM_JN, GFC_STD_F2008);
 
   add_sym_1 ("besy0", GFC_ISYM_Y0, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
@@ -1353,6 +1358,11 @@ add_functions (void)
 	     gfc_check_besn, gfc_simplify_bessel_yn, gfc_resolve_besn,
 	     n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dd, REQUIRED);
 
+  add_sym_3 ("bessel_yn", GFC_ISYM_YN2, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F2008,
+	     gfc_check_bessel_n2, gfc_simplify_bessel_yn2, NULL,
+	     "n1", BT_INTEGER, di, REQUIRED,"n2", BT_INTEGER, di, REQUIRED,
+	      x, BT_REAL, dr, REQUIRED);
+
   make_generic ("bessel_yn", GFC_ISYM_YN, GFC_STD_F2008);
 
   add_sym_1 ("bit_size", GFC_ISYM_BIT_SIZE, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
Index: intrinsic.h
===================================================================
--- intrinsic.h	(revision 163305)
+++ intrinsic.h	(working copy)
@@ -40,6 +40,7 @@ gfc_try gfc_check_associated (gfc_expr *
 gfc_try gfc_check_atan_2 (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_atan2 (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_besn (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_bessel_n2 (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_try gfc_check_bitfcn (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_char (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_chdir (gfc_expr *);
@@ -223,9 +224,11 @@ gfc_expr *gfc_simplify_atan2 (gfc_expr *
 gfc_expr *gfc_simplify_bessel_j0 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_j1 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_jn (gfc_expr *, gfc_expr *);
+gfc_expr *gfc_simplify_bessel_jn2 (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_bessel_y0 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_y1 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_yn (gfc_expr *, gfc_expr *);
+gfc_expr *gfc_simplify_bessel_yn2 (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_bit_size (gfc_expr *);
 gfc_expr *gfc_simplify_btest (gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_ceiling (gfc_expr *, gfc_expr *);
Index: decl.c
===================================================================
--- decl.c	(revision 163305)
+++ decl.c	(working copy)
@@ -1312,9 +1312,10 @@ add_init_expr_to_sym (const char *name,
 	}
 
       /* Check if the assignment can happen. This has to be put off
-	 until later for a derived type variable.  */
+	 until later for derived type variables and procedure pointers.  */
       if (sym->ts.type != BT_DERIVED && init->ts.type != BT_DERIVED
 	  && sym->ts.type != BT_CLASS && init->ts.type != BT_CLASS
+	  && !sym->attr.proc_pointer 
 	  && gfc_check_assign_symbol (sym, init) == FAILURE)
 	return FAILURE;
 
@@ -1652,6 +1653,48 @@ gfc_match_null (gfc_expr **result)
 }
 
 
+/* Match the initialization expr for a data pointer or procedure pointer.  */
+
+static match
+match_pointer_init (gfc_expr **init, int procptr)
+{
+  match m;
+
+  if (gfc_pure (NULL) && gfc_state_stack->state != COMP_DERIVED)
+    {
+      gfc_error ("Initialization of pointer at %C is not allowed in "
+		 "a PURE procedure");
+      return MATCH_ERROR;
+    }
+
+  /* Match NULL() initilization.  */
+  m = gfc_match_null (init);
+  if (m != MATCH_NO)
+    return m;
+
+  /* Match non-NULL initialization.  */
+  gfc_matching_procptr_assignment = procptr;
+  m = gfc_match_rvalue (init);
+  gfc_matching_procptr_assignment = 0;
+  if (m == MATCH_ERROR)
+    return MATCH_ERROR;
+  else if (m == MATCH_NO)
+    {
+      gfc_error ("Error in pointer initialization at %C");
+      return MATCH_ERROR;
+    }
+
+  if (!procptr)
+    gfc_resolve_expr (*init);
+  
+  if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: non-NULL pointer "
+		      "initialization at %C") == FAILURE)
+    return MATCH_ERROR;
+
+  return MATCH_YES;
+}
+
+
 /* Match a variable name with an optional initializer.  When this
    subroutine is called, a variable is expected to be parsed next.
    Depending on what is happening at the moment, updates either the
@@ -1899,23 +1942,9 @@ variable_decl (int elem)
 	      goto cleanup;
 	    }
 
-	  m = gfc_match_null (&initializer);
-	  if (m == MATCH_NO)
-	    {
-	      gfc_error ("Pointer initialization requires a NULL() at %C");
-	      m = MATCH_ERROR;
-	    }
-
-	  if (gfc_pure (NULL) && gfc_state_stack->state != COMP_DERIVED)
-	    {
-	      gfc_error ("Initialization of pointer at %C is not allowed in "
-			 "a PURE procedure");
-	      m = MATCH_ERROR;
-	    }
-
+	  m = match_pointer_init (&initializer, 0);
 	  if (m != MATCH_YES)
 	    goto cleanup;
-
 	}
       else if (gfc_match_char ('=') == MATCH_YES)
 	{
@@ -4675,20 +4704,7 @@ match_procedure_decl (void)
 	      goto cleanup;
 	    }
 
-	  m = gfc_match_null (&initializer);
-	  if (m == MATCH_NO)
-	    {
-	      gfc_error ("Pointer initialization requires a NULL() at %C");
-	      m = MATCH_ERROR;
-	    }
-
-	  if (gfc_pure (NULL))
-	    {
-	      gfc_error ("Initialization of pointer at %C is not allowed in "
-			 "a PURE procedure");
-	      m = MATCH_ERROR;
-	    }
-
+	  m = match_pointer_init (&initializer, 1);
 	  if (m != MATCH_YES)
 	    goto cleanup;
 
@@ -4815,18 +4831,7 @@ match_ppc_decl (void)
 
       if (gfc_match (" =>") == MATCH_YES)
 	{
-	  m = gfc_match_null (&initializer);
-	  if (m == MATCH_NO)
-	    {
-	      gfc_error ("Pointer initialization requires a NULL() at %C");
-	      m = MATCH_ERROR;
-	    }
-	  if (gfc_pure (NULL))
-	    {
-	      gfc_error ("Initialization of pointer at %C is not allowed in "
-			 "a PURE procedure");
-	      m = MATCH_ERROR;
-	    }
+	  m = match_pointer_init (&initializer, 1);
 	  if (m != MATCH_YES)
 	    {
 	      gfc_free_expr (initializer);
Index: gfortran.h
===================================================================
--- gfortran.h	(revision 163305)
+++ gfortran.h	(working copy)
@@ -422,6 +422,7 @@ enum gfc_isym_id
   GFC_ISYM_J0,
   GFC_ISYM_J1,
   GFC_ISYM_JN,
+  GFC_ISYM_JN2,
   GFC_ISYM_KILL,
   GFC_ISYM_KIND,
   GFC_ISYM_LBOUND,
@@ -531,7 +532,8 @@ enum gfc_isym_id
   GFC_ISYM_XOR,
   GFC_ISYM_Y0,
   GFC_ISYM_Y1,
-  GFC_ISYM_YN
+  GFC_ISYM_YN,
+  GFC_ISYM_YN2
 };
 typedef enum gfc_isym_id gfc_isym_id;
 
Index: check.c
===================================================================
--- check.c	(revision 163305)
+++ check.c	(working copy)
@@ -884,11 +884,47 @@ gfc_check_besn (gfc_expr *n, gfc_expr *x
 {
   if (type_check (n, 0, BT_INTEGER) == FAILURE)
     return FAILURE;
+  if (n->expr_type == EXPR_CONSTANT)
+    {
+      int i;
+      gfc_extract_int (n, &i);
+      if (i < 0 && gfc_notify_std (GFC_STD_GNU, "Extension: Negative argument "
+				   "N at %L", &n->where) == FAILURE)
+	return FAILURE;
+    }
 
   if (type_check (x, 1, BT_REAL) == FAILURE)
     return FAILURE;
 
   return SUCCESS;
+}
+
+
+/* Transformational version of the Bessel JN and YN functions.  */
+
+gfc_try
+gfc_check_bessel_n2 (gfc_expr *n1, gfc_expr *n2, gfc_expr *x)
+{
+  if (type_check (n1, 0, BT_INTEGER) == FAILURE)
+    return FAILURE;
+  if (scalar_check (n1, 0) == FAILURE)
+    return FAILURE;
+  if (nonnegative_check("N1", n1) == FAILURE)
+    return FAILURE;
+
+  if (type_check (n2, 1, BT_INTEGER) == FAILURE)
+    return FAILURE;
+  if (scalar_check (n2, 1) == FAILURE)
+    return FAILURE;
+  if (nonnegative_check("N2", n2) == FAILURE)
+    return FAILURE;
+
+  if (type_check (x, 2, BT_REAL) == FAILURE)
+    return FAILURE;
+  if (scalar_check (x, 2) == FAILURE)
+    return FAILURE;
+
+  return SUCCESS;
 }
 
 
Index: intrinsic.texi
===================================================================
--- intrinsic.texi	(revision 163305)
+++ intrinsic.texi	(working copy)
@@ -1630,23 +1630,31 @@ end program test_besj1
 @item @emph{Description}:
 @code{BESSEL_JN(N, X)} computes the Bessel function of the first kind of
 order @var{N} of @var{X}. This function is available under the name
-@code{BESJN} as a GNU extension.
+@code{BESJN} as a GNU extension.  If @var{N} and @var{X} are arrays,
+their ranks and shapes shall conform.  
 
-If both arguments are arrays, their ranks and shapes shall conform.
+@code{BESSEL_JN(N1, N2, X)} returns an array with the Bessel functions
+of the first kind of the orders @var{N1} to @var{N2}.
 
 @item @emph{Standard}:
-Fortran 2008 and later
+Fortran 2008 and later, negative @var{N}, @var{N1}, @var{N2} are
+allowed as GNU extension
 
 @item @emph{Class}:
-Elemental function
+Elemental function, except for the tranformational function
+@code{BESSEL_JN(N1, N2, X)}
 
 @item @emph{Syntax}:
 @code{RESULT = BESSEL_JN(N, X)}
+@code{RESULT = BESSEL_JN(N1, N2, X)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
 @item @var{N} @tab Shall be a scalar or an array of type  @code{INTEGER}.
+@item @var{N1} @tab Shall be a scalar of type  @code{INTEGER}.
+@item @var{N2} @tab Shall be a scalar of type  @code{INTEGER}.
 @item @var{X} @tab Shall be a scalar or an array of type  @code{REAL}.
+for @code{BESSEL_JN(N1, N2, X)} it shall be scalar.
 @end multitable
 
 @item @emph{Return value}:
@@ -1778,23 +1786,31 @@ end program test_besy1
 @item @emph{Description}:
 @code{BESSEL_YN(N, X)} computes the Bessel function of the second kind of
 order @var{N} of @var{X}. This function is available under the name
-@code{BESYN} as a GNU extension.
+@code{BESYN} as a GNU extension.  If @var{N} and @var{X} are arrays,
+their ranks and shapes shall conform.  
 
-If both arguments are arrays, their ranks and shapes shall conform.
+@code{BESSEL_YN(N1, N2, X)} returns an array with the Bessel functions
+of the first kind of the orders @var{N1} to @var{N2}.
 
 @item @emph{Standard}:
-Fortran 2008 and later
+Fortran 2008 and later, negative @var{N}, @var{N1}, @var{N2} are
+allowed as GNU extension
 
 @item @emph{Class}:
-Elemental function
+Elemental function, except for the tranformational function
+@code{BESSEL_YN(N1, N2, X)}
 
 @item @emph{Syntax}:
 @code{RESULT = BESSEL_YN(N, X)}
+@code{RESULT = BESSEL_YN(N1, N2, X)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
-@item @var{N} @tab Shall be a scalar or an array of type  @code{INTEGER}.
-@item @var{X} @tab Shall be a scalar or an array of type  @code{REAL}.
+@item @var{N} @tab Shall be a scalar or an array of type  @code{INTEGER} .
+@item @var{N1} @tab Shall be a scalar of type  @code{INTEGER}.
+@item @var{N2} @tab Shall be a scalar of type  @code{INTEGER}.
+@item @var{X} @tab Shall be a scalar or an array of type  @code{REAL};
+for @code{BESSEL_JN(N1, N2, X)} it shall be scalar.
 @end multitable
 
 @item @emph{Return value}:
Index: simplify.c
===================================================================
--- simplify.c	(revision 163305)
+++ simplify.c	(working copy)
@@ -1196,6 +1196,183 @@ gfc_simplify_bessel_jn (gfc_expr *order,
 }
 
 
+/* Simplify transformational form of JN and YN.  */
+
+static gfc_expr *
+gfc_simplify_bessel_n2 (gfc_expr *order1, gfc_expr *order2, gfc_expr *x,
+			bool jn)
+{
+  gfc_expr *result;
+  gfc_expr *e;
+  long n1, n2;
+  int i;
+  mpfr_t x2rev, last1, last2;
+
+  if (x->expr_type != EXPR_CONSTANT || order1->expr_type != EXPR_CONSTANT
+      || order2->expr_type != EXPR_CONSTANT)
+    {
+      gfc_error ("Sorry, non-constant transformational Bessel function at %L"
+		   " not yet supported", &order2->where);
+      return &gfc_bad_expr;
+    }
+
+  n1 = mpz_get_si (order1->value.integer);
+  n2 = mpz_get_si (order2->value.integer);
+  result = gfc_get_array_expr (x->ts.type, x->ts.kind, &x->where);
+  result->rank = 1;
+  result->shape = gfc_get_shape (1);
+  mpz_init_set_ui (result->shape[0], MAX (n2-n1+1, 0));
+
+  if (n2 < n1)
+    return result;
+
+  /* Special case: x == 0; it is J0(0) == 1, JN(N > 1, 0.0) == 0; and
+     YN(N, 0) = -Inf.  */
+
+  if (mpfr_cmp_ui (x->value.real, 0.0) == 0)
+    {
+      if (!jn && gfc_option.flag_range_check)
+	{
+	  gfc_error ("Result of BESSEL_YN is -INF at %L", &result->where);
+ 	  gfc_free_expr (result);
+	  return &gfc_bad_expr;
+	}
+
+      if (jn && n1 == 0)
+	{
+	  e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+	  mpfr_set_ui (e->value.real, 1.0, GFC_RND_MODE);
+	  gfc_constructor_append_expr (&result->value.constructor, e,
+				       &x->where);
+	  n1++;
+	}
+
+      for (i = n1; i <= n2; i++)
+	{
+	  e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+	  if (jn)
+	    mpfr_set_ui (e->value.real, 0.0, GFC_RND_MODE);
+	  else
+            mpfr_set_inf (e->value.real, -1);
+	  gfc_constructor_append_expr (&result->value.constructor, e,
+				       &x->where);
+	}
+
+      return result;
+    }
+
+  /* Use the faster but more verbose recursion algorithm. Bessel functions
+     are stable for downward recursion, and Neumann functions are stable
+     for upward recursion. It is
+     x2rev = 2.0/x,
+     J(N-1, x) = x2rev * N * J(N, x) - J(N+1, x),
+     Y(N+1, x) = x2rev * N * Y(N, x) - Y(N-1, x).  */
+
+  gfc_set_model_kind (x->ts.kind);
+
+  /* Get first recursion anchor.  */
+
+  mpfr_init (last1);
+  if (jn)
+    mpfr_jn (last1, n2, x->value.real, GFC_RND_MODE);
+  else
+    mpfr_yn (last1, n1, x->value.real, GFC_RND_MODE);
+
+  e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+  mpfr_set (e->value.real, last1, GFC_RND_MODE);
+  if (range_check (e, jn ? "BESSEL_JN" : "BESSEL_YN") == &gfc_bad_expr)
+    {
+      mpfr_clear (last1);
+      gfc_free_expr (e);
+      gfc_free_expr (result);
+      return &gfc_bad_expr;
+    }
+  gfc_constructor_append_expr (&result->value.constructor, e, &x->where);
+
+  if (n1 == n2)
+    {
+      mpfr_clear (last1);
+      return result;
+    }
+ 
+  /* Get second recursion anchor.  */
+
+  mpfr_init (last2);
+  if (jn)
+    mpfr_jn (last2, n2-1, x->value.real, GFC_RND_MODE);
+  else
+    mpfr_yn (last2, n1+1, x->value.real, GFC_RND_MODE);
+
+  e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+  mpfr_set (e->value.real, last2, GFC_RND_MODE);
+  if (range_check (e, jn ? "BESSEL_JN" : "BESSEL_YN") == &gfc_bad_expr)
+    {
+      mpfr_clear (last1);
+      mpfr_clear (last2);
+      gfc_free_expr (e);
+      gfc_free_expr (result);
+      return &gfc_bad_expr;
+    }
+  if (jn)
+    gfc_constructor_insert_expr (&result->value.constructor, e, &x->where, 0);
+  else 
+    gfc_constructor_append_expr (&result->value.constructor, e, &x->where);
+
+  if (n1 + 1 == n2)
+    {
+      mpfr_clear (last1);
+      mpfr_clear (last2);
+      return result;
+    }
+
+  /* Start actual recursion.  */
+
+  mpfr_init (x2rev);
+  mpfr_ui_div (x2rev, 2.0, x->value.real, GFC_RND_MODE);
+ 
+  for (i = 2; i <= n2-n1; i++)
+    {
+      e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+      mpfr_mul_si (e->value.real, x2rev, jn ? (n2-i+1) : (n1+i-1),
+		   GFC_RND_MODE);
+      mpfr_mul (e->value.real, e->value.real, last2, GFC_RND_MODE);
+      mpfr_sub (e->value.real, e->value.real, last1, GFC_RND_MODE);
+
+      if (range_check (e, jn ? "BESSEL_JN" : "BESSEL_YN") == &gfc_bad_expr)
+	goto error;
+
+      if (jn)
+	gfc_constructor_insert_expr (&result->value.constructor, e, &x->where,
+				     0);
+      else 
+	gfc_constructor_append_expr (&result->value.constructor, e, &x->where);
+
+      mpfr_set (last1, last2, GFC_RND_MODE);
+      mpfr_set (last2, e->value.real, GFC_RND_MODE);
+    }
+
+  mpfr_clear (last1);
+  mpfr_clear (last2);
+  mpfr_clear (x2rev);
+  return result;
+
+error:
+  mpfr_clear (last1);
+  mpfr_clear (last2);
+  mpfr_clear (x2rev);
+  gfc_free_expr (e);
+  gfc_free_expr (result);
+  return &gfc_bad_expr;
+}
+
+
+gfc_expr *
+gfc_simplify_bessel_jn2 (gfc_expr *order1, gfc_expr *order2, gfc_expr *x)
+{
+  return gfc_simplify_bessel_n2 (order1, order2, x, true);
+}
+
+
 gfc_expr *
 gfc_simplify_bessel_y0 (gfc_expr *x)
 {
@@ -1243,6 +1420,13 @@ gfc_simplify_bessel_yn (gfc_expr *order,
 }
 
 
+gfc_expr *
+gfc_simplify_bessel_yn2 (gfc_expr *order1, gfc_expr *order2, gfc_expr *x)
+{
+  return gfc_simplify_bessel_n2 (order1, order2, x, false);
+}
+
+
 gfc_expr *
 gfc_simplify_bit_size (gfc_expr *e)
 {

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-17 17:00         ` Tobias Burnus
@ 2010-08-17 19:08           ` Steve Kargl
  2010-08-17 21:19             ` Tobias Burnus
  0 siblings, 1 reply; 18+ messages in thread
From: Steve Kargl @ 2010-08-17 19:08 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: Daniel Kraft, gcc patches, gfortran

On Tue, Aug 17, 2010 at 06:59:12PM +0200, Tobias Burnus wrote:
>  On 08/17/2010 05:36 PM, Steve Kargl wrote:
> >>I disagree. Negative values are perfectly valid thus I would prefer
> >>adding such a restriction only for -std=f2003.
> >Then you may need to fix your simplicification function.
> 
> Let's do it differently: For the existing elemental function, we allow 
> non-negative values but for the transformational one, we don't.
> 
> >+  mpz_init_set_ui (result->shape[0], MAX (n2-n1+1, 0));
> >+
> >+  for (i = n1; i<= n2; ++i)
> >+    {
> >
> >What happens if n2 = -4 and n1 = 1?  Note, the standard
> >does not specify that n2>  n1.  It is implied by
> >
> >     Case (ii): The result of BESSEL JN (N1, N2, X) is a rank-one
> >       array with extent MAX (N2-N1+1, 0).
> >
> >but there is no requirement for this ordering.  It may be prudent to
> >add a check that n2>  n1.
> 
> I think that's wrong. First, n2 == n1 is perfectly valid; secondly, if 
> n2 < n1, one gets a zero-sized array, which might be not terribly 
> useful, but is perfectly valid.

Whoops.  I misread the condition in the for-loop,
and thought that you would enter an infinite loop
stomping on memory.


> >>(J(-m,x) = (-1)**m * J(m,x) -- and analogously for YN - at least for
> >>integral m; using the Gamma function for negative m won't work, as it
> >>becomes +/-infinite for negative integer values). Thus, there is no need
> >>for negative "m", but also no need to reject them. As gfortran allowed
> >>negative "m" so far, I think it should continue to do so for -std=gnu.)
> >I would prefer to remove this extension.
> Why?

Experience.  I've been computing/using J() and Y() for more
than 23 years.  Getting a correct and accurate value is
is difficult.  The functions in libm have horrible accuracy 
near their zeros.

> >>Do you mean the following algorithm?
> >>x2rev = 2.0/x
> >>J(N-1, x) = x2rev * N * J(N, x) - J(N+1, x)
> >>Y(N+1, x) = x2rev * N * Y(N, x) - Y(N-1, x
> >Yes.
> >    if (x == 0.e0_knd) then  ! Avoid division by zero
> >       j = 0
> The x == 0 is a good point!
> 
> How about the attached patch?

I'll look over the patch in more detail in a few hours.

> PS: Steve, are you interested in implementing a TREE or libgfortran 
> version of this algorithm? I think using a libgfortran version makes 
> more sense than implementing it as TREE; what do you think?

I think we want to use TREE only because mpfr_{jn,yn} will
give accurate values for the two initial values in the
recursion scheme.  As noted above, the libm routines give
horrible accuracy near their zeros.  For j0(), I found 
over a million ULP at its 1st zero.  If you're interested
in the details

http://www.freebsd.org/cgi/query-pr.cgi?pr=standards/142803

-- 
Steve

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-17 19:08           ` Steve Kargl
@ 2010-08-17 21:19             ` Tobias Burnus
  0 siblings, 0 replies; 18+ messages in thread
From: Tobias Burnus @ 2010-08-17 21:19 UTC (permalink / raw)
  To: Steve Kargl; +Cc: Daniel Kraft, gcc patches, gfortran

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

  Steve Kargl wrote:
> I'll look over the patch in more detail in a few hours.

Thanks! Here is an updated version. With the help of Daniel K, I have 
found a solution to the constructor issue; JN now works as it should. YN 
also works, though for some of the examples, the result differs quite a 
bit from the result of mpfr_yn. I do not know whether I have chosen 
particularly difficult values or whether the algorithm has problems. 
Please check. (Cf. bessel_5.f90 - the ULP values given are the 
differences which maximally occur [though 1 ULP could be 0 ULP in some 
cases].)

Build and currently regtesting on x86-64-linux.
OK for the trunk?

Tobias

[-- Attachment #2: bessel_transf-2.diff --]
[-- Type: text/x-patch, Size: 18294 bytes --]

2010-08-17  Tobias Burnus  <burnus@net-b.de>

	PR fortran/36158
	PR fortran/33197
	* check.c (gfc_check_bessel_n2): New function.
	* gfortran.h (gfc_isym_id): Add GFC_ISYM_JN2 and GFC_ISYM_YN2.
	* intrinsic.c (add_functions): Add transformational version
	of the Bessel_jn/yn intrinsics.
	* intrinsic.h (gfc_check_bessel_n2,gfc_simplify_bessel_jn2,
	gfc_simplify_bessel_yn2): New prototypes.
	* intrinsic.texi (Bessel_jn, Bessel_yn): Document
	transformational variant.
	* simplify.c (gfc_simplify_bessel_jn, gfc_simplify_bessel_yn):
	Check for negative order.
	(gfc_simplify_bessel_n2,gfc_simplify_bessel_jn2,
	gfc_simplify_bessel_yn2): New functions.

2010-08-17  Tobias Burnus  <burnus@net-b.de>

	PR fortran/36158
	PR fortran/33197
	* gfortran.dg/bessel_3.f90: New.
	* gfortran.dg/bessel_4.f90: New.
	* gfortran.dg/bessel_5.f90: New.

Index: gcc/fortran/intrinsic.c
===================================================================
--- gcc/fortran/intrinsic.c	(Revision 163318)
+++ gcc/fortran/intrinsic.c	(Arbeitskopie)
@@ -1317,6 +1317,11 @@ add_functions (void)
 	     gfc_check_besn, gfc_simplify_bessel_jn, gfc_resolve_besn,
 	     n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dd, REQUIRED);
 
+  add_sym_3 ("bessel_jn", GFC_ISYM_JN2, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F2008,
+	     gfc_check_bessel_n2, gfc_simplify_bessel_jn2, NULL,
+	     "n1", BT_INTEGER, di, REQUIRED,"n2", BT_INTEGER, di, REQUIRED,
+	     x, BT_REAL, dr, REQUIRED);
+
   make_generic ("bessel_jn", GFC_ISYM_JN, GFC_STD_F2008);
 
   add_sym_1 ("besy0", GFC_ISYM_Y0, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
@@ -1353,6 +1358,11 @@ add_functions (void)
 	     gfc_check_besn, gfc_simplify_bessel_yn, gfc_resolve_besn,
 	     n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dd, REQUIRED);
 
+  add_sym_3 ("bessel_yn", GFC_ISYM_YN2, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F2008,
+	     gfc_check_bessel_n2, gfc_simplify_bessel_yn2, NULL,
+	     "n1", BT_INTEGER, di, REQUIRED,"n2", BT_INTEGER, di, REQUIRED,
+	      x, BT_REAL, dr, REQUIRED);
+
   make_generic ("bessel_yn", GFC_ISYM_YN, GFC_STD_F2008);
 
   add_sym_1 ("bit_size", GFC_ISYM_BIT_SIZE, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
Index: gcc/fortran/intrinsic.h
===================================================================
--- gcc/fortran/intrinsic.h	(Revision 163318)
+++ gcc/fortran/intrinsic.h	(Arbeitskopie)
@@ -40,6 +40,7 @@ gfc_try gfc_check_associated (gfc_expr *
 gfc_try gfc_check_atan_2 (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_atan2 (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_besn (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_bessel_n2 (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_try gfc_check_bitfcn (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_char (gfc_expr *, gfc_expr *);
 gfc_try gfc_check_chdir (gfc_expr *);
@@ -223,9 +224,11 @@ gfc_expr *gfc_simplify_atan2 (gfc_expr *
 gfc_expr *gfc_simplify_bessel_j0 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_j1 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_jn (gfc_expr *, gfc_expr *);
+gfc_expr *gfc_simplify_bessel_jn2 (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_bessel_y0 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_y1 (gfc_expr *);
 gfc_expr *gfc_simplify_bessel_yn (gfc_expr *, gfc_expr *);
+gfc_expr *gfc_simplify_bessel_yn2 (gfc_expr *, gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_bit_size (gfc_expr *);
 gfc_expr *gfc_simplify_btest (gfc_expr *, gfc_expr *);
 gfc_expr *gfc_simplify_ceiling (gfc_expr *, gfc_expr *);
Index: gcc/fortran/gfortran.h
===================================================================
--- gcc/fortran/gfortran.h	(Revision 163318)
+++ gcc/fortran/gfortran.h	(Arbeitskopie)
@@ -422,6 +422,7 @@ enum gfc_isym_id
   GFC_ISYM_J0,
   GFC_ISYM_J1,
   GFC_ISYM_JN,
+  GFC_ISYM_JN2,
   GFC_ISYM_KILL,
   GFC_ISYM_KIND,
   GFC_ISYM_LBOUND,
@@ -531,7 +532,8 @@ enum gfc_isym_id
   GFC_ISYM_XOR,
   GFC_ISYM_Y0,
   GFC_ISYM_Y1,
-  GFC_ISYM_YN
+  GFC_ISYM_YN,
+  GFC_ISYM_YN2
 };
 typedef enum gfc_isym_id gfc_isym_id;
 
Index: gcc/fortran/check.c
===================================================================
--- gcc/fortran/check.c	(Revision 163318)
+++ gcc/fortran/check.c	(Arbeitskopie)
@@ -884,11 +884,47 @@ gfc_check_besn (gfc_expr *n, gfc_expr *x
 {
   if (type_check (n, 0, BT_INTEGER) == FAILURE)
     return FAILURE;
+  if (n->expr_type == EXPR_CONSTANT)
+    {
+      int i;
+      gfc_extract_int (n, &i);
+      if (i < 0 && gfc_notify_std (GFC_STD_GNU, "Extension: Negative argument "
+				   "N at %L", &n->where) == FAILURE)
+	return FAILURE;
+    }
 
   if (type_check (x, 1, BT_REAL) == FAILURE)
     return FAILURE;
 
   return SUCCESS;
+}
+
+
+/* Transformational version of the Bessel JN and YN functions.  */
+
+gfc_try
+gfc_check_bessel_n2 (gfc_expr *n1, gfc_expr *n2, gfc_expr *x)
+{
+  if (type_check (n1, 0, BT_INTEGER) == FAILURE)
+    return FAILURE;
+  if (scalar_check (n1, 0) == FAILURE)
+    return FAILURE;
+  if (nonnegative_check("N1", n1) == FAILURE)
+    return FAILURE;
+
+  if (type_check (n2, 1, BT_INTEGER) == FAILURE)
+    return FAILURE;
+  if (scalar_check (n2, 1) == FAILURE)
+    return FAILURE;
+  if (nonnegative_check("N2", n2) == FAILURE)
+    return FAILURE;
+
+  if (type_check (x, 2, BT_REAL) == FAILURE)
+    return FAILURE;
+  if (scalar_check (x, 2) == FAILURE)
+    return FAILURE;
+
+  return SUCCESS;
 }
 
 
Index: gcc/fortran/intrinsic.texi
===================================================================
--- gcc/fortran/intrinsic.texi	(Revision 163318)
+++ gcc/fortran/intrinsic.texi	(Arbeitskopie)
@@ -1630,23 +1630,31 @@ end program test_besj1
 @item @emph{Description}:
 @code{BESSEL_JN(N, X)} computes the Bessel function of the first kind of
 order @var{N} of @var{X}. This function is available under the name
-@code{BESJN} as a GNU extension.
+@code{BESJN} as a GNU extension.  If @var{N} and @var{X} are arrays,
+their ranks and shapes shall conform.  
 
-If both arguments are arrays, their ranks and shapes shall conform.
+@code{BESSEL_JN(N1, N2, X)} returns an array with the Bessel functions
+of the first kind of the orders @var{N1} to @var{N2}.
 
 @item @emph{Standard}:
-Fortran 2008 and later
+Fortran 2008 and later, negative @var{N}, @var{N1}, @var{N2} are
+allowed as GNU extension
 
 @item @emph{Class}:
-Elemental function
+Elemental function, except for the tranformational function
+@code{BESSEL_JN(N1, N2, X)}
 
 @item @emph{Syntax}:
 @code{RESULT = BESSEL_JN(N, X)}
+@code{RESULT = BESSEL_JN(N1, N2, X)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
 @item @var{N} @tab Shall be a scalar or an array of type  @code{INTEGER}.
+@item @var{N1} @tab Shall be a scalar of type  @code{INTEGER}.
+@item @var{N2} @tab Shall be a scalar of type  @code{INTEGER}.
 @item @var{X} @tab Shall be a scalar or an array of type  @code{REAL}.
+for @code{BESSEL_JN(N1, N2, X)} it shall be scalar.
 @end multitable
 
 @item @emph{Return value}:
@@ -1778,23 +1786,31 @@ end program test_besy1
 @item @emph{Description}:
 @code{BESSEL_YN(N, X)} computes the Bessel function of the second kind of
 order @var{N} of @var{X}. This function is available under the name
-@code{BESYN} as a GNU extension.
+@code{BESYN} as a GNU extension.  If @var{N} and @var{X} are arrays,
+their ranks and shapes shall conform.  
 
-If both arguments are arrays, their ranks and shapes shall conform.
+@code{BESSEL_YN(N1, N2, X)} returns an array with the Bessel functions
+of the first kind of the orders @var{N1} to @var{N2}.
 
 @item @emph{Standard}:
-Fortran 2008 and later
+Fortran 2008 and later, negative @var{N}, @var{N1}, @var{N2} are
+allowed as GNU extension
 
 @item @emph{Class}:
-Elemental function
+Elemental function, except for the tranformational function
+@code{BESSEL_YN(N1, N2, X)}
 
 @item @emph{Syntax}:
 @code{RESULT = BESSEL_YN(N, X)}
+@code{RESULT = BESSEL_YN(N1, N2, X)}
 
 @item @emph{Arguments}:
 @multitable @columnfractions .15 .70
-@item @var{N} @tab Shall be a scalar or an array of type  @code{INTEGER}.
-@item @var{X} @tab Shall be a scalar or an array of type  @code{REAL}.
+@item @var{N} @tab Shall be a scalar or an array of type  @code{INTEGER} .
+@item @var{N1} @tab Shall be a scalar of type  @code{INTEGER}.
+@item @var{N2} @tab Shall be a scalar of type  @code{INTEGER}.
+@item @var{X} @tab Shall be a scalar or an array of type  @code{REAL};
+for @code{BESSEL_JN(N1, N2, X)} it shall be scalar.
 @end multitable
 
 @item @emph{Return value}:
Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c	(Revision 163318)
+++ gcc/fortran/simplify.c	(Arbeitskopie)
@@ -1196,6 +1196,183 @@ gfc_simplify_bessel_jn (gfc_expr *order,
 }
 
 
+/* Simplify transformational form of JN and YN.  */
+
+static gfc_expr *
+gfc_simplify_bessel_n2 (gfc_expr *order1, gfc_expr *order2, gfc_expr *x,
+			bool jn)
+{
+  gfc_expr *result;
+  gfc_expr *e;
+  long n1, n2;
+  int i;
+  mpfr_t x2rev, last1, last2;
+
+  if (x->expr_type != EXPR_CONSTANT || order1->expr_type != EXPR_CONSTANT
+      || order2->expr_type != EXPR_CONSTANT)
+    {
+      gfc_error ("Sorry, non-constant transformational Bessel function at %L"
+		   " not yet supported", &order2->where);
+      return &gfc_bad_expr;
+    }
+
+  n1 = mpz_get_si (order1->value.integer);
+  n2 = mpz_get_si (order2->value.integer);
+  result = gfc_get_array_expr (x->ts.type, x->ts.kind, &x->where);
+  result->rank = 1;
+  result->shape = gfc_get_shape (1);
+  mpz_init_set_ui (result->shape[0], MAX (n2-n1+1, 0));
+
+  if (n2 < n1)
+    return result;
+
+  /* Special case: x == 0; it is J0(0.0) == 1, JN(N > 0, 0.0) == 0; and
+     YN(N, 0.0) = -Inf.  */
+
+  if (mpfr_cmp_ui (x->value.real, 0.0) == 0)
+    {
+      if (!jn && gfc_option.flag_range_check)
+	{
+	  gfc_error ("Result of BESSEL_YN is -INF at %L", &result->where);
+ 	  gfc_free_expr (result);
+	  return &gfc_bad_expr;
+	}
+
+      if (jn && n1 == 0)
+	{
+	  e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+	  mpfr_set_ui (e->value.real, 1.0, GFC_RND_MODE);
+	  gfc_constructor_append_expr (&result->value.constructor, e,
+				       &x->where);
+	  n1++;
+	}
+
+      for (i = n1; i <= n2; i++)
+	{
+	  e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+	  if (jn)
+	    mpfr_set_ui (e->value.real, 0.0, GFC_RND_MODE);
+	  else
+            mpfr_set_inf (e->value.real, -1);
+	  gfc_constructor_append_expr (&result->value.constructor, e,
+				       &x->where);
+	}
+
+      return result;
+    }
+
+  /* Use the faster but more verbose recursion algorithm. Bessel functions
+     are stable for downward recursion and Neumann functions are stable
+     for upward recursion. It is
+     x2rev = 2.0/x,
+     J(N-1, x) = x2rev * N * J(N, x) - J(N+1, x),
+     Y(N+1, x) = x2rev * N * Y(N, x) - Y(N-1, x).  */
+
+  gfc_set_model_kind (x->ts.kind);
+
+  /* Get first recursion anchor.  */
+
+  mpfr_init (last1);
+  if (jn)
+    mpfr_jn (last1, n2, x->value.real, GFC_RND_MODE);
+  else
+    mpfr_yn (last1, n1, x->value.real, GFC_RND_MODE);
+
+  e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+  mpfr_set (e->value.real, last1, GFC_RND_MODE);
+  if (range_check (e, jn ? "BESSEL_JN" : "BESSEL_YN") == &gfc_bad_expr)
+    {
+      mpfr_clear (last1);
+      gfc_free_expr (e);
+      gfc_free_expr (result);
+      return &gfc_bad_expr;
+    }
+  gfc_constructor_append_expr (&result->value.constructor, e, &x->where);
+
+  if (n1 == n2)
+    {
+      mpfr_clear (last1);
+      return result;
+    }
+ 
+  /* Get second recursion anchor.  */
+
+  mpfr_init (last2);
+  if (jn)
+    mpfr_jn (last2, n2-1, x->value.real, GFC_RND_MODE);
+  else
+    mpfr_yn (last2, n1+1, x->value.real, GFC_RND_MODE);
+
+  e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+  mpfr_set (e->value.real, last2, GFC_RND_MODE);
+  if (range_check (e, jn ? "BESSEL_JN" : "BESSEL_YN") == &gfc_bad_expr)
+    {
+      mpfr_clear (last1);
+      mpfr_clear (last2);
+      gfc_free_expr (e);
+      gfc_free_expr (result);
+      return &gfc_bad_expr;
+    }
+  if (jn)
+     gfc_constructor_insert_expr (&result->value.constructor, e, &x->where, -2);
+  else 
+    gfc_constructor_append_expr (&result->value.constructor, e, &x->where);
+
+  if (n1 + 1 == n2)
+    {
+      mpfr_clear (last1);
+      mpfr_clear (last2);
+      return result;
+    }
+
+  /* Start actual recursion.  */
+
+  mpfr_init (x2rev);
+  mpfr_ui_div (x2rev, 2.0, x->value.real, GFC_RND_MODE);
+ 
+  for (i = 2; i <= n2-n1; i++)
+    {
+      e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where);
+      mpfr_mul_si (e->value.real, x2rev, jn ? (n2-i+1) : (n1+i-1),
+		   GFC_RND_MODE);
+      mpfr_mul (e->value.real, e->value.real, last2, GFC_RND_MODE);
+      mpfr_sub (e->value.real, e->value.real, last1, GFC_RND_MODE);
+
+      if (range_check (e, jn ? "BESSEL_JN" : "BESSEL_YN") == &gfc_bad_expr)
+	goto error;
+
+      if (jn)
+	gfc_constructor_insert_expr (&result->value.constructor, e, &x->where,
+				     -i-1);
+      else
+	gfc_constructor_append_expr (&result->value.constructor, e, &x->where);
+
+      mpfr_set (last1, last2, GFC_RND_MODE);
+      mpfr_set (last2, e->value.real, GFC_RND_MODE);
+    }
+
+  mpfr_clear (last1);
+  mpfr_clear (last2);
+  mpfr_clear (x2rev);
+  return result;
+
+error:
+  mpfr_clear (last1);
+  mpfr_clear (last2);
+  mpfr_clear (x2rev);
+  gfc_free_expr (e);
+  gfc_free_expr (result);
+  return &gfc_bad_expr;
+}
+
+
+gfc_expr *
+gfc_simplify_bessel_jn2 (gfc_expr *order1, gfc_expr *order2, gfc_expr *x)
+{
+  return gfc_simplify_bessel_n2 (order1, order2, x, true);
+}
+
+
 gfc_expr *
 gfc_simplify_bessel_y0 (gfc_expr *x)
 {
@@ -1243,6 +1420,13 @@ gfc_simplify_bessel_yn (gfc_expr *order,
 }
 
 
+gfc_expr *
+gfc_simplify_bessel_yn2 (gfc_expr *order1, gfc_expr *order2, gfc_expr *x)
+{
+  return gfc_simplify_bessel_n2 (order1, order2, x, false);
+}
+
+
 gfc_expr *
 gfc_simplify_bit_size (gfc_expr *e)
 {
Index: gcc/testsuite/gfortran.dg/bessel_3.f90
===================================================================
--- gcc/testsuite/gfortran.dg/bessel_3.f90	(Revision 0)
+++ gcc/testsuite/gfortran.dg/bessel_3.f90	(Revision 0)
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! { dg-options "-std=f2003 -Wimplicit-procedure" }
+!
+! PR fortran/36158 - Transformational BESSEL_JN/YN
+! PR fortran/33197 - F2008 math functions
+!
+IMPLICIT NONE
+print *, SIN (1.0)
+print *, BESSEL_J0(1.0) ! { dg-error "has no IMPLICIT type" })
+print *, BESSEL_J1(1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_JN(1,1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_JN(1,2,1.0) ! { dg-error "has no IMPLICIT type" }
+
+print *, BESSEL_Y0(1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_Y1(1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_YN(1,1.0) ! { dg-error "has no IMPLICIT type" }
+print *, BESSEL_YN(1,2,1.0) ! { dg-error "has no IMPLICIT type" }
+end
Index: gcc/testsuite/gfortran.dg/bessel_4.f90
===================================================================
--- gcc/testsuite/gfortran.dg/bessel_4.f90	(Revision 0)
+++ gcc/testsuite/gfortran.dg/bessel_4.f90	(Revision 0)
@@ -0,0 +1,24 @@
+! { dg-do compile }
+! { dg-options "-std=f2008" }
+!
+! PR fortran/36158 - Transformational BESSEL_JN/YN
+! PR fortran/33197 - F2008 math functions
+!
+implicit none
+! OK, elemental function:
+ print *, bessel_yn(1, [1.0, 2.0])
+ print *, bessel_yn([1, 2], 2.0)
+
+! Wrong, transformational function:
+! Does not pass check.c -- thus regarded as wrong generic function
+! and thus rejected with a slightly misleading error message
+ print *, bessel_yn(1, 2, [2.0, 3.0]) ! { dg-error "Too many arguments" }
+
+! Wrong in F2008: Negative argument, ok as GNU extension
+ print *, bessel_yn(-1, 3.0) ! { dg-error "Extension: Negative argument N " }
+
+! Wrong in F2008: Negative argument -- and no need for a GNU extension
+! Does not pass check.c -- thus regarded as wrong generic function
+! and thus rejected with a slightly misleading error message
+ print *, bessel_yn(-1, 2, 3.0) ! { dg-error "Too many arguments" }
+end
Index: gcc/testsuite/gfortran.dg/bessel_5.f90
===================================================================
--- gcc/testsuite/gfortran.dg/bessel_5.f90	(Revision 0)
+++ gcc/testsuite/gfortran.dg/bessel_5.f90	(Revision 0)
@@ -0,0 +1,86 @@
+! { dg-do run }
+! { dg-options "-Wall -fno-range-check" }
+!
+! PR fortran/36158 - Transformational BESSEL_JN/YN
+! PR fortran/33197 - F2008 math functions
+!
+! This is a dg-do run test as the middle end cannot simplify the
+! the scalarization of the elemental function (cf. PR 45305).
+!
+! -Wall has been specified to disabled -pedantic, which warns about the
+! negative order (GNU extension) to the order of the Bessel functions of
+! first and second kind.
+!
+
+implicit none
+integer :: i
+
+
+! Difference to mpfr_jn: 1 ULP
+
+if (any (abs (BESSEL_JN(2, 5, 2.457) - [(BESSEL_JN(i, 2.457), i = 2, 5)]) &
+          > epsilon(0.0))) then
+  print *, 'FAIL 1'
+  call abort()
+end if
+
+
+! Difference to mpfr_yn: 4 ULP
+
+if (any (abs (BESSEL_YN(2, 5, 2.457) - [(BESSEL_YN(i, 2.457), i = 2, 5)]) &
+         > epsilon(0.0)*4)) then
+  call abort()
+end if
+
+
+! Difference to mpfr_jn: 1 ULP
+
+if (any (abs (BESSEL_JN(0, 10, 4.457) &
+              - [ (BESSEL_JN(i, 4.457), i = 0, 10) ]) &
+         > epsilon(0.0))) then
+  call abort()
+end if
+
+
+! Difference to mpfr_yn: 192 ULP
+
+if (any (abs (BESSEL_YN(0, 10, 4.457) &
+              - [ (BESSEL_YN(i, 4.457), i = 0, 10) ]) &
+         > epsilon(0.0)*192)) then
+  call abort()
+end if
+
+
+! Difference to mpfr_jn: 0 ULP
+
+if (any (BESSEL_JN(0, 10, 0.0) /= [ (BESSEL_JN(i, 0.0), i = 0, 10) ])) &
+then
+  call abort()
+end if
+
+
+! Difference to mpfr_yn: 0 ULP
+
+if (any (BESSEL_YN(0, 10, 0.0) /= [ (BESSEL_YN(i, 0.0), i = 0, 10) ])) &
+then
+  call abort()
+end if
+
+
+! Difference to mpfr_jn: 1 ULP
+
+if (any (abs (BESSEL_JN(0, 10, 1.0) &
+              - [ (BESSEL_JN(i, 1.0), i = 0, 10) ]) &
+         > epsilon(0.0)*1)) then
+ call abort()
+end if
+
+! Difference to mpfr_yn: 32 ULP
+
+if (any (abs (BESSEL_YN(0, 10, 1.0) &
+              - [ (BESSEL_YN(i, 1.0), i = 0, 10) ]) &
+         > epsilon(0.0)*32)) then
+  call abort()
+end if
+
+end

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-20 20:44           ` Steve Kargl
@ 2010-08-21 21:06             ` Toon Moene
  0 siblings, 0 replies; 18+ messages in thread
From: Toon Moene @ 2010-08-21 21:06 UTC (permalink / raw)
  To: Steve Kargl; +Cc: Tobias Burnus, Tobias Burnus, gcc-patches, fortran

Steve Kargl wrote:

> The rather limited range of i before one hits an INF is
> why I was surprised J3 included the transformational form
> in F2008.  IIRC, you raised a concern with (or request to 
> removei from?) F2008 over the transformational form and
> J3 rejected it saying something about recursion is a
> common method to compute besseli functions.  I think J3
> underestimated the care that is needed and the fact that
> the range is rather limited without specialized algorithms.

I think you are right in your assumptions about J3's BESSEL function 
prowess.  The only reason for requesting transformational BESSEL 
functions was the fact that they could use the recursive method to 
compute the function result (this is all AFAICRecall, BTW).

AFAICRecall, Tobias' concern was about a transformational *intrinsic* 
function, as that wasn't possible within the gfortran framework back 
then (but he can probably explain that better than I).

Kind regards,

-- 
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html#Fortran

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-20  9:45         ` Tobias Burnus
@ 2010-08-20 20:44           ` Steve Kargl
  2010-08-21 21:06             ` Toon Moene
  0 siblings, 1 reply; 18+ messages in thread
From: Steve Kargl @ 2010-08-20 20:44 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: Tobias Burnus, gcc-patches, fortran

On Fri, Aug 20, 2010 at 10:32:21AM +0200, Tobias Burnus wrote:
>  On 08/20/2010 08:05 AM, Tobias Burnus wrote:
> > Steve Kargl wrote:
> >>There may be a method to improve the values computed, but it
> >>would substantially increase the computation.
> 
> I just have realized that I did a stupid comparison for the calculated 
> values! I should have compared
> abs ((YN-YN2)/YN) with epsilon - without the "/YN" the comparison is not 
> useful and will fail if abs(YN) is a large value - even though the 
> relative error is small. The following was tested against the run-time 
> version libgfortran (PR 36158) and the results seem to be sufficiently 
> accurate. Thus, I think one can live with the current algorithm.
> 
> The only think which we could handle explicitly is the -INF vs. NAN, cf. 
> below. Do you think that makes sense?
> 
> Test program (needs the patch from the PR for libgfortran as X is not 
> known at compile time):
> 
> implicit none
> real,parameter :: values(*) = [0.5, 1.0, 0.9, 
> 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78]
> integer, parameter :: Nmax = 100
> real :: rec(0:Nmax), lib(0:Nmax)
> integer :: i
> 
> do i = 1, ubound(values,dim=1)
>   call compare(values(i))
> end do
> contains
> subroutine compare(X)
> integer :: i
> real X
> rec = BESSEL_YN(0, Nmax, X)
> lib = [ (BESSEL_YN(i, X), i=0,Nmax) ]
> print *, 'YN for X = ', X, ' -- Epsilon = ',epsilon(x)
> do i = 0, Nmax
>   print '(i2,2e17.9,e12.2,f14.10,2l3)', i, rec(i), lib(i),&
>         rec(i)-lib(i), ((rec(i)-lib(i))/rec(i))/epsilon(x),&
>         abs((rec(i)-lib(i))/rec(i))<  epsilon(x),&
>         abs((rec(i)-lib(i))/rec(i))<  3*epsilon(x)
> end do
> end
> end
> 
> 
> Result as follows. (Details see attachment -- there also for JN).
> 
> a) As soon as the result is -Infinity at N, the N+2 step produces NaN
> instead of -INF - and thus a completely different result.
> One could add a check of the kind:
> 
> if (last2 == -INF)
>   setall remaining items to -INF
> 
> What do you think about adding such a check for YN?
> 

Returning an INF is probably preferable to an NaN,
but I'm not going to require you to implement this
before committing your patch.

> b) Until the result is -INF, the deviations are:
> x = 0.0: Exact (special case)
> x = 0.5:<  epsilon  (up to i = 25, above: -Inf)
> x = 1.0:<  epsilon  (up to i = 29 above: -Inf)
> x = 1.8:<  epsilon until  i=11, then<  3*epsilon (up to i = 34 above: -Inf)
> x = 2.0:<  epsilon  (up to i = 34 above: -Inf)
> x = 3.0:<  epsilon until  i=5,
>          <  3*epsilon until i=17
>          <  8*epsilon (up to i = 39 above: -Inf)
> x = 4.0:<  epsilon  (up to i = 43, above: -Inf)
> x = 4.25:<  epsilon until  i=34, then<  2*epsilon (up to i = 44 above: -Inf)
> x = 8.0:<  epsilon  (up to i = 55, above: -Inf)
> x = 34.53:<  epsilon until  i=5
>            <  6*epsilon until i=25
>            <  22*epsilon until i=100
> x = 475.78:<  epsilon until  i=7
>              <  2*epsilon until i=26
>              <  15*epsilon until i=62
>              <  28*epsilon until i=82
>              <  130*epsilon until i=100
 
The rather limited range of i before one hits an INF is
why I was surprised J3 included the transformational form
in F2008.  IIRC, you raised a concern with (or request to 
removei from?) F2008 over the transformational form and
J3 rejected it saying something about recursion is a
common method to compute besseli functions.  I think J3
underestimated the care that is needed and the fact that
the range is rather limited without specialized algorithms.

-- 
steve

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-20  7:17       ` Tobias Burnus
  2010-08-20  9:45         ` Tobias Burnus
@ 2010-08-20 20:14         ` Steve Kargl
  1 sibling, 0 replies; 18+ messages in thread
From: Steve Kargl @ 2010-08-20 20:14 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: Tobias Burnus, gcc-patches, fortran

On Fri, Aug 20, 2010 at 08:05:58AM +0200, Tobias Burnus wrote:
>  Steve Kargl wrote:
> >There may be a method to improve the values computed, but it
> >would substantially increase the computation.  Instead of
> >recursing on the actually estimates of the bessel function,
> >we could recurse on the significands by careful bookkeeping
> >of the exponents (which may require an additional array), e.g.,
> >
> [...]
> 
> I essentially do not use Bessel functions - and the few times I did only 
> for few N. I think gfortran's transformational function should use 
> something faster than doing N2-N1+1 calls to a full JN/YN function - but 
> if N2-N1+1 is a large number, currently the accuracy seems to be too low.
> 
> As you regularly seem to use Bessel functions (though mostly spherical 
> ones?), would you be satisfied by the current implementation in 
> gfortran?

Well, I may not be the best person to answer this question because
I tend to be suspicious of 'black boxes', so I write simply benchmarks
and test code.    

> Or would you use the book keeping version, which is in terms 
> of performance between the current recurrence version and the calling 
> the library function every time?

I think what you have now is good enough.  

> What are typical (larger) values for 
> N2-N1+1? Is this more likely 5 or 10 or 20 or 1000?

In classical field theory (both acoustic and EM), scattering
solutions are often written as infinite summations of partial
wave functions.  If one defines the dimensionless parameter
kd (k is the wave number and d is characteristic dimension),
then the seriesi usually can be truncated to N > int(kd) + m where 
m is usual around 20 or so.  For Mie scattering (eg, the cause
of rainbows), kd can be around 15000.  One needs to use
special techniques to do the summation, so one would most likely
use his own implementation.  For the acoustics research I do,
N is normally less than 500.

> I think the goal should be to have a version which is sufficiently 
> robust to be usable while at the same time being faster than calling the 
> elemental function N2-N1+1 times.
> 
> As you are a heavy user of Bessel functions, I would like if you could 
> decide on the algorithm - thus, what do you suggest?

I think what you have is sufficient.  Power users will use their
own specialized implementations.

-- 
Steve

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-20  7:17       ` Tobias Burnus
@ 2010-08-20  9:45         ` Tobias Burnus
  2010-08-20 20:44           ` Steve Kargl
  2010-08-20 20:14         ` Steve Kargl
  1 sibling, 1 reply; 18+ messages in thread
From: Tobias Burnus @ 2010-08-20  9:45 UTC (permalink / raw)
  To: Steve Kargl; +Cc: Tobias Burnus, gcc-patches, fortran

[-- Attachment #1: Type: text/plain, Size: 2753 bytes --]

  On 08/20/2010 08:05 AM, Tobias Burnus wrote:
>  Steve Kargl wrote:
>> There may be a method to improve the values computed, but it
>> would substantially increase the computation.

I just have realized that I did a stupid comparison for the calculated 
values! I should have compared
abs ((YN-YN2)/YN) with epsilon - without the "/YN" the comparison is not 
useful and will fail if abs(YN) is a large value - even though the 
relative error is small. The following was tested against the run-time 
version libgfortran (PR 36158) and the results seem to be sufficiently 
accurate. Thus, I think one can live with the current algorithm.

The only think which we could handle explicitly is the -INF vs. NAN, cf. 
below. Do you think that makes sense?


Test program (needs the patch from the PR for libgfortran as X is not 
known at compile time):

implicit none
real,parameter :: values(*) = [0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78]
integer, parameter :: Nmax = 100
real :: rec(0:Nmax), lib(0:Nmax)
integer :: i

do i = 1, ubound(values,dim=1)
   call compare(values(i))
end do
contains
subroutine compare(X)
integer :: i
real X
rec = BESSEL_YN(0, Nmax, X)
lib = [ (BESSEL_YN(i, X), i=0,Nmax) ]
print *, 'YN for X = ', X, ' -- Epsilon = ',epsilon(x)
do i = 0, Nmax
   print '(i2,2e17.9,e12.2,f14.10,2l3)', i, rec(i), lib(i),&
         rec(i)-lib(i), ((rec(i)-lib(i))/rec(i))/epsilon(x),&
         abs((rec(i)-lib(i))/rec(i))<  epsilon(x),&
         abs((rec(i)-lib(i))/rec(i))<  3*epsilon(x)
end do
end
end


Result as follows. (Details see attachment -- there also for JN).

a) As soon as the result is -Infinity at N, the N+2 step produces NaN
instead of -INF - and thus a completely different result.
One could add a check of the kind:

if (last2 == -INF)
   setall remaining items to -INF

What do you think about adding such a check for YN?


b) Until the result is -INF, the deviations are:
x = 0.0: Exact (special case)
x = 0.5:<  epsilon  (up to i = 25, above: -Inf)
x = 1.0:<  epsilon  (up to i = 29 above: -Inf)
x = 1.8:<  epsilon until  i=11, then<  3*epsilon (up to i = 34 above: -Inf)
x = 2.0:<  epsilon  (up to i = 34 above: -Inf)
x = 3.0:<  epsilon until  i=5,
          <  3*epsilon until i=17
          <  8*epsilon (up to i = 39 above: -Inf)
x = 4.0:<  epsilon  (up to i = 43, above: -Inf)
x = 4.25:<  epsilon until  i=34, then<  2*epsilon (up to i = 44 above: -Inf)
x = 8.0:<  epsilon  (up to i = 55, above: -Inf)
x = 34.53:<  epsilon until  i=5
            <  6*epsilon until i=25
            <  22*epsilon until i=100
x = 475.78:<  epsilon until  i=7
              <  2*epsilon until i=26
              <  15*epsilon until i=62
              <  28*epsilon until i=82
              <  130*epsilon until i=100

Tobias


[-- Attachment #2: bessel2.f90 --]
[-- Type: text/plain, Size: 673 bytes --]

implicit none
real,parameter :: values(*) = [0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78] 
integer, parameter :: Nmax = 100
real :: rec(0:Nmax), lib(0:Nmax)
integer :: i

do i = 1, ubound(values,dim=1)
  call compare(values(i))
end do
contains
subroutine compare(X)
integer :: i
real X
rec = BESSEL_YN(0, Nmax, X)
lib = [ (BESSEL_YN(i, X), i=0,Nmax) ]
print *, 'YN for X = ', X, ' -- Epsilon = ',epsilon(x)
do i = 0, Nmax
  print '(i2,2e17.9,e12.2,f14.10,2l3)', i, rec(i), lib(i), &
        rec(i)-lib(i), ((rec(i)-lib(i))/rec(i))/epsilon(x), &
        abs((rec(i)-lib(i))/rec(i)) < epsilon(x), &
        abs((rec(i)-lib(i))/rec(i)) < 3*epsilon(x)
end do
end
end

[-- Attachment #3: bessel_jn.txt --]
[-- Type: text/plain, Size: 77319 bytes --]

 JN for X =   0.50000000      -- Epsilon =   1.19209290E-07
 0  0.000000000E+00  0.938469827E+00   -0.94E+00     -Infinity  F  F
 1  0.000000000E+00  0.242268458E+00   -0.24E+00     -Infinity  F  F
 2  0.000000000E+00  0.306040253E-01   -0.31E-01     -Infinity  F  F
 3  0.000000000E+00  0.256373012E-02   -0.26E-02     -Infinity  F  F
 4  0.000000000E+00  0.160736497E-03   -0.16E-03     -Infinity  F  F
 5  0.000000000E+00  0.805362743E-05   -0.81E-05     -Infinity  F  F
 6  0.000000000E+00  0.336068496E-06   -0.34E-06     -Infinity  F  F
 7  0.000000000E+00  0.120158665E-07   -0.12E-07     -Infinity  F  F
 8  0.000000000E+00  0.375822290E-09   -0.38E-09     -Infinity  F  F
 9  0.000000000E+00  0.104467685E-10   -0.10E-10     -Infinity  F  F
10  0.000000000E+00  0.261317769E-12   -0.26E-12     -Infinity  F  F
11  0.000000000E+00  0.594185354E-14   -0.59E-14     -Infinity  F  F
12  0.000000000E+00  0.123838268E-15   -0.12E-15     -Infinity  F  F
13  0.000000000E+00  0.238232400E-17   -0.24E-17     -Infinity  F  F
14  0.000000000E+00  0.425541612E-19   -0.43E-19     -Infinity  F  F
15  0.000000000E+00  0.709420719E-21   -0.71E-21     -Infinity  F  F
16  0.000000000E+00  0.110872444E-22   -0.11E-22     -Infinity  F  F
17  0.000000000E+00  0.163081067E-24   -0.16E-24     -Infinity  F  F
18  0.000000000E+00  0.226542864E-26   -0.23E-26     -Infinity  F  F
19  0.000000000E+00  0.298131789E-28   -0.30E-28     -Infinity  F  F
20  0.000000000E+00  0.372720247E-30   -0.37E-30     -Infinity  F  F
21  0.000000000E+00  0.443774574E-32   -0.44E-32     -Infinity  F  F
22  0.000000000E+00  0.504351648E-34   -0.50E-34     -Infinity  F  F
23  0.000000000E+00  0.548270333E-36   -0.55E-36     -Infinity  F  F
24  0.000000000E+00  0.571174439E-38   -0.57E-38     -Infinity  F  F
25  0.000000000E+00  0.571225306E-40   -0.57E-40     -Infinity  F  F
26  0.000000000E+00  0.549308998E-42   -0.55E-42     -Infinity  F  F
27  0.000000000E+00  0.560519386E-44   -0.56E-44     -Infinity  F  F
28  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
29  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
30  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
31  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
32  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
33  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
34  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
35  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
36  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
37  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
38  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
39  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
40  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
41  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
42  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
43  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
44  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
45  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
46  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
47  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
48  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
49  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
50  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
51  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
52  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
53  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
54  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
55  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
56  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
57  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
58  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
59  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
60  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
61  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
62  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
63  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
64  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
65  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
66  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
67  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
68  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
69  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
70  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
71  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
72  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
73  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
74  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
75  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
76  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
77  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
78  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
79  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
80  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
81  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
82  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
83  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
84  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
85  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
86  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
87  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
88  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
89  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
90  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
91  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
92  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
93  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
94  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
95  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
96  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
97  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
98  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
99  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
**  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
 JN for X =    1.0000000      -- Epsilon =   1.19209290E-07
 0  0.000000000E+00  0.765197694E+00   -0.77E+00     -Infinity  F  F
 1  0.000000000E+00  0.440050572E+00   -0.44E+00     -Infinity  F  F
 2  0.000000000E+00  0.114903487E+00   -0.11E+00     -Infinity  F  F
 3  0.000000000E+00  0.195633546E-01   -0.20E-01     -Infinity  F  F
 4  0.000000000E+00  0.247663911E-02   -0.25E-02     -Infinity  F  F
 5  0.000000000E+00  0.249757722E-03   -0.25E-03     -Infinity  F  F
 6  0.000000000E+00  0.209383379E-04   -0.21E-04     -Infinity  F  F
 7  0.000000000E+00  0.150232574E-05   -0.15E-05     -Infinity  F  F
 8  0.000000000E+00  0.942234450E-07   -0.94E-07     -Infinity  F  F
 9  0.000000000E+00  0.524924992E-08   -0.52E-08     -Infinity  F  F
10  0.000000000E+00  0.263061517E-09   -0.26E-09     -Infinity  F  F
11  0.000000000E+00  0.119800680E-10   -0.12E-10     -Infinity  F  F
12  0.000000000E+00  0.499971809E-12   -0.50E-12     -Infinity  F  F
13  0.000000000E+00  0.192561675E-13   -0.19E-13     -Infinity  F  F
14  0.000000000E+00  0.688540748E-15   -0.69E-15     -Infinity  F  F
15  0.000000000E+00  0.229753137E-16   -0.23E-16     -Infinity  F  F
16  0.000000000E+00  0.718639730E-18   -0.72E-18     -Infinity  F  F
17  0.000000000E+00  0.211537531E-19   -0.21E-19     -Infinity  F  F
18  0.000000000E+00  0.588034438E-21   -0.59E-21     -Infinity  F  F
19  0.000000000E+00  0.154847874E-22   -0.15E-22     -Infinity  F  F
20  0.000000000E+00  0.387350352E-24   -0.39E-24     -Infinity  F  F
21  0.000000000E+00  0.922762263E-26   -0.92E-26     -Infinity  F  F
22  0.000000000E+00  0.209822388E-27   -0.21E-27     -Infinity  F  F
23  0.000000000E+00  0.456342442E-29   -0.46E-29     -Infinity  F  F
24  0.000000000E+00  0.951109935E-31   -0.95E-31     -Infinity  F  F
25  0.000000000E+00  0.190295197E-32   -0.19E-32     -Infinity  F  F
26  0.000000000E+00  0.366082776E-34   -0.37E-34     -Infinity  F  F
27  0.000000000E+00  0.678155141E-36   -0.68E-36     -Infinity  F  F
28  0.000000000E+00  0.121136465E-37   -0.12E-37     -Infinity  F  F
29  0.000000000E+00  0.208915384E-39   -0.21E-39     -Infinity  F  F
30  0.000000000E+00  0.348222668E-41   -0.35E-41     -Infinity  F  F
31  0.000000000E+00  0.560519386E-43   -0.56E-43     -Infinity  F  F
32  0.000000000E+00  0.140129846E-44   -0.14E-44     -Infinity  F  F
33  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
34  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
35  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
36  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
37  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
38  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
39  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
40  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
41  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
42  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
43  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
44  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
45  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
46  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
47  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
48  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
49  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
50  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
51  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
52  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
53  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
54  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
55  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
56  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
57  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
58  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
59  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
60  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
61  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
62  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
63  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
64  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
65  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
66  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
67  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
68  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
69  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
70  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
71  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
72  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
73  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
74  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
75  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
76  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
77  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
78  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
79  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
80  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
81  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
82  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
83  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
84  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
85  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
86  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
87  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
88  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
89  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
90  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
91  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
92  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
93  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
94  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
95  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
96  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
97  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
98  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
99  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
**  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
 JN for X =   0.89999998      -- Epsilon =   1.19209290E-07
 0  0.000000000E+00  0.807523847E+00   -0.81E+00     -Infinity  F  F
 1  0.000000000E+00  0.405949533E+00   -0.41E+00     -Infinity  F  F
 2  0.000000000E+00  0.945863053E-01   -0.95E-01     -Infinity  F  F
 3  0.000000000E+00  0.144340275E-01   -0.14E-01     -Infinity  F  F
 4  0.000000000E+00  0.164055196E-02   -0.16E-02     -Infinity  F  F
 5  0.000000000E+00  0.148658015E-03   -0.15E-03     -Infinity  F  F
 6  0.000000000E+00  0.112035650E-04   -0.11E-04     -Infinity  F  F
 7  0.000000000E+00  0.722850473E-06   -0.72E-06     -Infinity  F  F
 8  0.000000000E+00  0.407752800E-07   -0.41E-07     -Infinity  F  F
 9  0.000000000E+00  0.204336970E-08   -0.20E-08     -Infinity  F  F
10  0.000000000E+00  0.921215049E-10   -0.92E-10     -Infinity  F  F
11  0.000000000E+00  0.377440397E-11   -0.38E-11     -Infinity  F  F
12  0.000000000E+00  0.141724306E-12   -0.14E-12     -Infinity  F  F
13  0.000000000E+00  0.491130963E-14   -0.49E-14     -Infinity  F  F
14  0.000000000E+00  0.158016061E-15   -0.16E-15     -Infinity  F  F
15  0.000000000E+00  0.474448796E-17   -0.47E-17     -Infinity  F  F
16  0.000000000E+00  0.133538203E-18   -0.13E-18     -Infinity  F  F
17  0.000000000E+00  0.353717616E-20   -0.35E-20     -Infinity  F  F
18  0.000000000E+00  0.884818514E-22   -0.88E-22     -Infinity  F  F
19  0.000000000E+00  0.209674101E-23   -0.21E-23     -Infinity  F  F
20  0.000000000E+00  0.471994215E-25   -0.47E-25     -Infinity  F  F
21  0.000000000E+00  0.101186010E-26   -0.10E-26     -Infinity  F  F
22  0.000000000E+00  0.207054216E-28   -0.21E-28     -Infinity  F  F
23  0.000000000E+00  0.405254875E-30   -0.41E-30     -Infinity  F  F
24  0.000000000E+00  0.760109618E-32   -0.76E-32     -Infinity  F  F
25  0.000000000E+00  0.136862314E-33   -0.14E-33     -Infinity  F  F
26  0.000000000E+00  0.236945445E-35   -0.24E-35     -Infinity  F  F
27  0.000000000E+00  0.395015023E-37   -0.40E-37     -Infinity  F  F
28  0.000000000E+00  0.635004004E-39   -0.64E-39     -Infinity  F  F
29  0.000000000E+00  0.985533210E-41   -0.99E-41     -Infinity  F  F
30  0.000000000E+00  0.148537637E-42   -0.15E-42     -Infinity  F  F
31  0.000000000E+00  0.280259693E-44   -0.28E-44     -Infinity  F  F
32  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
33  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
34  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
35  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
36  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
37  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
38  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
39  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
40  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
41  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
42  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
43  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
44  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
45  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
46  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
47  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
48  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
49  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
50  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
51  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
52  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
53  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
54  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
55  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
56  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
57  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
58  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
59  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
60  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
61  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
62  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
63  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
64  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
65  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
66  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
67  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
68  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
69  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
70  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
71  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
72  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
73  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
74  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
75  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
76  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
77  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
78  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
79  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
80  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
81  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
82  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
83  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
84  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
85  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
86  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
87  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
88  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
89  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
90  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
91  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
92  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
93  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
94  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
95  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
96  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
97  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
98  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
99  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
**  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
 JN for X =    1.8000000      -- Epsilon =   1.19209290E-07
 0  0.000000000E+00  0.339986444E+00   -0.34E+00     -Infinity  F  F
 1  0.000000000E+00  0.581516981E+00   -0.58E+00     -Infinity  F  F
 2  0.000000000E+00  0.306143463E+00   -0.31E+00     -Infinity  F  F
 3  0.000000000E+00  0.988020077E-01   -0.99E-01     -Infinity  F  F
 4  0.000000000E+00  0.231965128E-01   -0.23E-01     -Infinity  F  F
 5  0.000000000E+00  0.429361500E-02   -0.43E-02     -Infinity  F  F
 6  0.000000000E+00  0.656899007E-03   -0.66E-03     -Infinity  F  F
 7  0.000000000E+00  0.857124396E-04   -0.86E-04     -Infinity  F  F
 8  0.000000000E+00  0.975337662E-05   -0.98E-05     -Infinity  F  F
 9  0.000000000E+00  0.984262329E-06   -0.98E-06     -Infinity  F  F
10  0.000000000E+00  0.892448497E-07   -0.89E-07     -Infinity  F  F
11  0.000000000E+00  0.734717487E-08   -0.73E-08     -Infinity  F  F
12  0.000000000E+00  0.553927237E-09   -0.55E-09     -Infinity  F  F
13  0.000000000E+00  0.385209017E-10   -0.39E-10     -Infinity  F  F
14  0.000000000E+00  0.248596478E-11   -0.25E-11     -Infinity  F  F
15  0.000000000E+00  0.149664501E-12   -0.15E-12     -Infinity  F  F
16  0.000000000E+00  0.844384021E-14   -0.84E-14     -Infinity  F  F
17  0.000000000E+00  0.448216166E-15   -0.45E-15     -Infinity  F  F
18  0.000000000E+00  0.224641178E-16   -0.22E-16     -Infinity  F  F
19  0.000000000E+00  0.106636743E-17   -0.11E-17     -Infinity  F  F
20  0.000000000E+00  0.480794337E-19   -0.48E-19     -Infinity  F  F
21  0.000000000E+00  0.206417227E-20   -0.21E-20     -Infinity  F  F
22  0.000000000E+00  0.845789715E-22   -0.85E-22     -Infinity  F  F
23  0.000000000E+00  0.331448232E-23   -0.33E-23     -Infinity  F  F
24  0.000000000E+00  0.124461272E-24   -0.12E-24     -Infinity  F  F
25  0.000000000E+00  0.448620343E-26   -0.45E-26     -Infinity  F  F
26  0.000000000E+00  0.155471236E-27   -0.16E-27     -Infinity  F  F
27  0.000000000E+00  0.518793993E-29   -0.52E-29     -Infinity  F  F
28  0.000000000E+00  0.166921914E-30   -0.17E-30     -Infinity  F  F
29  0.000000000E+00  0.518516436E-32   -0.52E-32     -Infinity  F  F
30  0.000000000E+00  0.155690622E-33   -0.16E-33     -Infinity  F  F
31  0.000000000E+00  0.452374695E-35   -0.45E-35     -Infinity  F  F
32  0.000000000E+00  0.127328133E-36   -0.13E-36     -Infinity  F  F
33  0.000000000E+00  0.347509407E-38   -0.35E-38     -Infinity  F  F
34  0.000000000E+00  0.920498948E-40   -0.92E-40     -Infinity  F  F
35  0.000000000E+00  0.236819440E-41   -0.24E-41     -Infinity  F  F
36  0.000000000E+00  0.602558340E-43   -0.60E-43     -Infinity  F  F
37  0.000000000E+00  0.140129846E-44   -0.14E-44     -Infinity  F  F
38  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
39  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
40  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
41  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
42  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
43  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
44  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
45  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
46  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
47  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
48  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
49  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
50  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
51  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
52  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
53  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
54  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
55  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
56  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
57  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
58  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
59  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
60  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
61  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
62  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
63  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
64  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
65  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
66  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
67  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
68  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
69  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
70  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
71  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
72  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
73  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
74  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
75  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
76  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
77  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
78  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
79  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
80  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
81  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
82  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
83  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
84  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
85  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
86  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
87  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
88  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
89  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
90  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
91  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
92  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
93  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
94  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
95  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
96  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
97  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
98  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
99  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
**  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
 JN for X =    2.0000000      -- Epsilon =   1.19209290E-07
 0  0.000000000E+00  0.223890811E+00   -0.22E+00     -Infinity  F  F
 1  0.000000000E+00  0.576724827E+00   -0.58E+00     -Infinity  F  F
 2  0.000000000E+00  0.352834016E+00   -0.35E+00     -Infinity  F  F
 3  0.000000000E+00  0.128943279E+00   -0.13E+00     -Infinity  F  F
 4  0.000000000E+00  0.339957252E-01   -0.34E-01     -Infinity  F  F
 5  0.000000000E+00  0.703963125E-02   -0.70E-02     -Infinity  F  F
 6  0.000000000E+00  0.120242930E-02   -0.12E-02     -Infinity  F  F
 7  0.000000000E+00  0.174944129E-03   -0.17E-03     -Infinity  F  F
 8  0.000000000E+00  0.221795581E-04   -0.22E-04     -Infinity  F  F
 9  0.000000000E+00  0.249234358E-05   -0.25E-05     -Infinity  F  F
10  0.000000000E+00  0.251538751E-06   -0.25E-06     -Infinity  F  F
11  0.000000000E+00  0.230428476E-07   -0.23E-07     -Infinity  F  F
12  0.000000000E+00  0.193269512E-08   -0.19E-08     -Infinity  F  F
13  0.000000000E+00  0.149494181E-09   -0.15E-09     -Infinity  F  F
14  0.000000000E+00  0.107294659E-10   -0.11E-10     -Infinity  F  F
15  0.000000000E+00  0.718301883E-12   -0.72E-12     -Infinity  F  F
16  0.000000000E+00  0.450600725E-13   -0.45E-13     -Infinity  F  F
17  0.000000000E+00  0.265930822E-14   -0.27E-14     -Infinity  F  F
18  0.000000000E+00  0.148173776E-15   -0.15E-15     -Infinity  F  F
19  0.000000000E+00  0.781924569E-17   -0.78E-17     -Infinity  F  F
20  0.000000000E+00  0.391897314E-18   -0.39E-18     -Infinity  F  F
21  0.000000000E+00  0.187023404E-19   -0.19E-19     -Infinity  F  F
22  0.000000000E+00  0.851792770E-21   -0.85E-21     -Infinity  F  F
23  0.000000000E+00  0.371017913E-22   -0.37E-22     -Infinity  F  F
24  0.000000000E+00  0.154849225E-23   -0.15E-23     -Infinity  F  F
25  0.000000000E+00  0.620352882E-25   -0.62E-25     -Infinity  F  F
26  0.000000000E+00  0.238938072E-26   -0.24E-26     -Infinity  F  F
27  0.000000000E+00  0.886129756E-28   -0.89E-28     -Infinity  F  F
28  0.000000000E+00  0.316865505E-29   -0.32E-29     -Infinity  F  F
29  0.000000000E+00  0.109389823E-30   -0.11E-30     -Infinity  F  F
30  0.000000000E+00  0.365025600E-32   -0.37E-32     -Infinity  F  F
31  0.000000000E+00  0.117869172E-33   -0.12E-33     -Infinity  F  F
32  0.000000000E+00  0.368690639E-35   -0.37E-35     -Infinity  F  F
33  0.000000000E+00  0.111824200E-36   -0.11E-36     -Infinity  F  F
34  0.000000000E+00  0.329171455E-38   -0.33E-38     -Infinity  F  F
35  0.000000000E+00  0.941238166E-40   -0.94E-40     -Infinity  F  F
36  0.000000000E+00  0.261622423E-41   -0.26E-41     -Infinity  F  F
37  0.000000000E+00  0.714662217E-43   -0.71E-43     -Infinity  F  F
38  0.000000000E+00  0.140129846E-44   -0.14E-44     -Infinity  F  F
39  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
40  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
41  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
42  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
43  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
44  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
45  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
46  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
47  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
48  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
49  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
50  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
51  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
52  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
53  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
54  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
55  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
56  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
57  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
58  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
59  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
60  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
61  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
62  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
63  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
64  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
65  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
66  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
67  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
68  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
69  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
70  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
71  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
72  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
73  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
74  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
75  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
76  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
77  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
78  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
79  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
80  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
81  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
82  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
83  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
84  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
85  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
86  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
87  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
88  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
89  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
90  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
91  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
92  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
93  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
94  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
95  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
96  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
97  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
98  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
99  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
**  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
 JN for X =    3.0000000      -- Epsilon =   1.19209290E-07
 0  0.000000000E+00 -0.260051936E+00    0.26E+00     +Infinity  F  F
 1  0.000000000E+00  0.339059025E+00   -0.34E+00     -Infinity  F  F
 2  0.000000000E+00  0.486091286E+00   -0.49E+00     -Infinity  F  F
 3  0.000000000E+00  0.309062690E+00   -0.31E+00     -Infinity  F  F
 4  0.000000000E+00  0.132034168E+00   -0.13E+00     -Infinity  F  F
 5  0.000000000E+00  0.430284292E-01   -0.43E-01     -Infinity  F  F
 6  0.000000000E+00  0.113939308E-01   -0.11E-01     -Infinity  F  F
 7  0.000000000E+00  0.254729413E-02   -0.25E-02     -Infinity  F  F
 8  0.000000000E+00  0.493441767E-03   -0.49E-03     -Infinity  F  F
 9  0.000000000E+00  0.843950038E-04   -0.84E-04     -Infinity  F  F
10  0.000000000E+00  0.129283508E-04   -0.13E-04     -Infinity  F  F
11  0.000000000E+00  0.179398921E-05   -0.18E-05     -Infinity  F  F
12  0.000000000E+00  0.227572514E-06   -0.23E-06     -Infinity  F  F
13  0.000000000E+00  0.265906852E-07   -0.27E-07     -Infinity  F  F
14  0.000000000E+00  0.288015656E-08   -0.29E-08     -Infinity  F  F
15  0.000000000E+00  0.290764385E-09   -0.29E-09     -Infinity  F  F
16  0.000000000E+00  0.274882478E-10   -0.27E-10     -Infinity  F  F
17  0.000000000E+00  0.244352021E-11   -0.24E-11     -Infinity  F  F
18  0.000000000E+00  0.204983301E-12   -0.20E-12     -Infinity  F  F
19  0.000000000E+00  0.162798089E-13   -0.16E-13     -Infinity  F  F
20  0.000000000E+00  0.122759447E-14   -0.12E-14     -Infinity  F  F
21  0.000000000E+00  0.881163610E-16   -0.88E-16     -Infinity  F  F
22  0.000000000E+00  0.603488186E-17   -0.60E-17     -Infinity  F  F
23  0.000000000E+00  0.395196162E-18   -0.40E-18     -Infinity  F  F
24  0.000000000E+00  0.247930570E-19   -0.25E-19     -Infinity  F  F
25  0.000000000E+00  0.149276717E-20   -0.15E-20     -Infinity  F  F
26  0.000000000E+00  0.863989178E-22   -0.86E-22     -Infinity  F  F
27  0.000000000E+00  0.481430924E-23   -0.48E-23     -Infinity  F  F
28  0.000000000E+00  0.258627949E-24   -0.26E-24     -Infinity  F  F
29  0.000000000E+00  0.134120806E-25   -0.13E-25     -Infinity  F  F
30  0.000000000E+00  0.672233954E-27   -0.67E-27     -Infinity  F  F
31  0.000000000E+00  0.326015463E-28   -0.33E-28     -Infinity  F  F
32  0.000000000E+00  0.153146771E-29   -0.15E-29     -Infinity  F  F
33  0.000000000E+00  0.697523243E-31   -0.70E-31     -Infinity  F  F
34  0.000000000E+00  0.308314683E-32   -0.31E-32     -Infinity  F  F
35  0.000000000E+00  0.132371615E-33   -0.13E-33     -Infinity  F  F
36  0.000000000E+00  0.552483278E-35   -0.55E-35     -Infinity  F  F
37  0.000000000E+00  0.224339230E-36   -0.22E-36     -Infinity  F  F
38  0.000000000E+00  0.886898053E-38   -0.89E-38     -Infinity  F  F
39  0.000000000E+00  0.341608540E-39   -0.34E-39     -Infinity  F  F
40  0.000000000E+00  0.128274861E-40   -0.13E-40     -Infinity  F  F
41  0.000000000E+00  0.469434986E-42   -0.47E-42     -Infinity  F  F
42  0.000000000E+00  0.168155816E-43   -0.17E-43     -Infinity  F  F
43  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
44  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
45  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
46  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
47  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
48  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
49  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
50  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
51  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
52  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
53  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
54  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
55  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
56  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
57  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
58  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
59  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
60  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
61  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
62  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
63  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
64  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
65  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
66  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
67  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
68  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
69  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
70  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
71  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
72  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
73  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
74  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
75  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
76  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
77  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
78  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
79  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
80  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
81  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
82  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
83  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
84  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
85  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
86  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
87  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
88  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
89  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
90  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
91  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
92  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
93  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
94  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
95  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
96  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
97  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
98  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
99  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
**  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
 JN for X =    4.0000000      -- Epsilon =   1.19209290E-07
 0  0.000000000E+00 -0.397149831E+00    0.40E+00     +Infinity  F  F
 1  0.000000000E+00 -0.660433322E-01    0.66E-01     +Infinity  F  F
 2  0.000000000E+00  0.364128172E+00   -0.36E+00     -Infinity  F  F
 3  0.000000000E+00  0.430171490E+00   -0.43E+00     -Infinity  F  F
 4  0.000000000E+00  0.281129062E+00   -0.28E+00     -Infinity  F  F
 5  0.000000000E+00  0.132086664E+00   -0.13E+00     -Infinity  F  F
 6  0.000000000E+00  0.490875766E-01   -0.49E-01     -Infinity  F  F
 7  0.000000000E+00  0.151760699E-01   -0.15E-01     -Infinity  F  F
 8  0.000000000E+00  0.402866770E-02   -0.40E-02     -Infinity  F  F
 9  0.000000000E+00  0.938602025E-03   -0.94E-03     -Infinity  F  F
10  0.000000000E+00  0.195040571E-03   -0.20E-03     -Infinity  F  F
11  0.000000000E+00  0.366009117E-04   -0.37E-04     -Infinity  F  F
12  0.000000000E+00  0.626446308E-05   -0.63E-05     -Infinity  F  F
13  0.000000000E+00  0.985858719E-06   -0.99E-06     -Infinity  F  F
14  0.000000000E+00  0.143619673E-06   -0.14E-06     -Infinity  F  F
15  0.000000000E+00  0.194788434E-07   -0.19E-07     -Infinity  F  F
16  0.000000000E+00  0.247169174E-08   -0.25E-08     -Infinity  F  F
17  0.000000000E+00  0.294685359E-09   -0.29E-09     -Infinity  F  F
18  0.000000000E+00  0.331345125E-10   -0.33E-10     -Infinity  F  F
19  0.000000000E+00  0.352531372E-11   -0.35E-11     -Infinity  F  F
20  0.000000000E+00  0.355951217E-12   -0.36E-12     -Infinity  F  F
21  0.000000000E+00  0.341985826E-13   -0.34E-13     -Infinity  F  F
22  0.000000000E+00  0.313391793E-14   -0.31E-14     -Infinity  F  F
23  0.000000000E+00  0.274517290E-15   -0.27E-15     -Infinity  F  F
24  0.000000000E+00  0.230309416E-16   -0.23E-16     -Infinity  F  F
25  0.000000000E+00  0.185394957E-17   -0.19E-17     -Infinity  F  F
26  0.000000000E+00  0.143433183E-18   -0.14E-18     -Infinity  F  F
27  0.000000000E+00  0.106814761E-19   -0.11E-19     -Infinity  F  F
28  0.000000000E+00  0.766757098E-21   -0.77E-21     -Infinity  F  F
29  0.000000000E+00  0.531251182E-22   -0.53E-22     -Infinity  F  F
30  0.000000000E+00  0.355703535E-23   -0.36E-23     -Infinity  F  F
31  0.000000000E+00  0.230418826E-24   -0.23E-24     -Infinity  F  F
32  0.000000000E+00  0.144561334E-25   -0.14E-25     -Infinity  F  F
33  0.000000000E+00  0.879274168E-27   -0.88E-27     -Infinity  F  F
34  0.000000000E+00  0.518970351E-28   -0.52E-28     -Infinity  F  F
35  0.000000000E+00  0.297501746E-29   -0.30E-29     -Infinity  F  F
36  0.000000000E+00  0.165778005E-30   -0.17E-30     -Infinity  F  F
37  0.000000000E+00  0.898660582E-32   -0.90E-32     -Infinity  F  F
38  0.000000000E+00  0.474262839E-33   -0.47E-33     -Infinity  F  F
39  0.000000000E+00  0.243838395E-34   -0.24E-34     -Infinity  F  F
40  0.000000000E+00  0.122218059E-35   -0.12E-35     -Infinity  F  F
41  0.000000000E+00  0.597576443E-37   -0.60E-37     -Infinity  F  F
42  0.000000000E+00  0.285193384E-38   -0.29E-38     -Infinity  F  F
43  0.000000000E+00  0.132929975E-39   -0.13E-39     -Infinity  F  F
44  0.000000000E+00  0.605501066E-41   -0.61E-41     -Infinity  F  F
45  0.000000000E+00  0.269049305E-42   -0.27E-42     -Infinity  F  F
46  0.000000000E+00  0.126116862E-43   -0.13E-43     -Infinity  F  F
47  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
48  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
49  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
50  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
51  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
52  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
53  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
54  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
55  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
56  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
57  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
58  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
59  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
60  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
61  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
62  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
63  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
64  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
65  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
66  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
67  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
68  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
69  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
70  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
71  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
72  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
73  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
74  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
75  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
76  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
77  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
78  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
79  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
80  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
81  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
82  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
83  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
84  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
85  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
86  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
87  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
88  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
89  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
90  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
91  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
92  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
93  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
94  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
95  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
96  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
97  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
98  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
99  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
**  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
 JN for X =    4.2500000      -- Epsilon =   1.19209290E-07
 0  0.000000000E+00 -0.369199812E+00    0.37E+00     +Infinity  F  F
 1  0.000000000E+00 -0.155553207E+00    0.16E+00     +Infinity  F  F
 2  0.000000000E+00  0.295998305E+00   -0.30E+00     -Infinity  F  F
 3  0.000000000E+00  0.434139848E+00   -0.43E+00     -Infinity  F  F
 4  0.000000000E+00  0.316905051E+00   -0.32E+00     -Infinity  F  F
 5  0.000000000E+00  0.162387207E+00   -0.16E+00     -Infinity  F  F
 6  0.000000000E+00  0.651825964E-01   -0.65E-01     -Infinity  F  F
 7  0.000000000E+00  0.216577463E-01   -0.22E-01     -Infinity  F  F
 8  0.000000000E+00  0.616058055E-02   -0.62E-02     -Infinity  F  F
 9  0.000000000E+00  0.153502170E-02   -0.15E-02     -Infinity  F  F
10  0.000000000E+00  0.340688886E-03   -0.34E-03     -Infinity  F  F
11  0.000000000E+00  0.682200771E-04   -0.68E-04     -Infinity  F  F
12  0.000000000E+00  0.124504104E-04   -0.12E-04     -Infinity  F  F
13  0.000000000E+00  0.208813412E-05   -0.21E-05     -Infinity  F  F
14  0.000000000E+00  0.324053076E-06   -0.32E-06     -Infinity  F  F
15  0.000000000E+00  0.468032155E-07   -0.47E-07     -Infinity  F  F
16  0.000000000E+00  0.632260999E-08   -0.63E-08     -Infinity  F  F
17  0.000000000E+00  0.802326483E-09   -0.80E-09     -Infinity  F  F
18  0.000000000E+00  0.960021090E-10   -0.96E-10     -Infinity  F  F
19  0.000000000E+00  0.108676401E-10   -0.11E-10     -Infinity  F  F
20  0.000000000E+00  0.116736189E-11   -0.12E-11     -Infinity  F  F
21  0.000000000E+00  0.119302639E-12   -0.12E-12     -Infinity  F  F
22  0.000000000E+00  0.116281869E-13   -0.12E-13     -Infinity  F  F
23  0.000000000E+00  0.108327234E-14   -0.11E-14     -Infinity  F  F
24  0.000000000E+00  0.966472203E-16   -0.97E-16     -Infinity  F  F
25  0.000000000E+00  0.827285913E-17   -0.83E-17     -Infinity  F  F
26  0.000000000E+00  0.680551527E-18   -0.68E-18     -Infinity  F  F
27  0.000000000E+00  0.538855759E-19   -0.54E-19     -Infinity  F  F
28  0.000000000E+00  0.411252067E-20   -0.41E-20     -Infinity  F  F
29  0.000000000E+00  0.302928570E-21   -0.30E-21     -Infinity  F  F
30  0.000000000E+00  0.215626120E-22   -0.22E-22     -Infinity  F  F
31  0.000000000E+00  0.148487111E-23   -0.15E-23     -Infinity  F  F
32  0.000000000E+00  0.990299187E-25   -0.99E-25     -Infinity  F  F
33  0.000000000E+00  0.640279262E-26   -0.64E-26     -Infinity  F  F
34  0.000000000E+00  0.401704401E-27   -0.40E-27     -Infinity  F  F
35  0.000000000E+00  0.244772154E-28   -0.24E-28     -Infinity  F  F
36  0.000000000E+00  0.144976596E-29   -0.14E-29     -Infinity  F  F
37  0.000000000E+00  0.835327209E-31   -0.84E-31     -Infinity  F  F
38  0.000000000E+00  0.468555795E-32   -0.47E-32     -Infinity  F  F
39  0.000000000E+00  0.256045789E-33   -0.26E-33     -Infinity  F  F
40  0.000000000E+00  0.136401038E-34   -0.14E-34     -Infinity  F  F
41  0.000000000E+00  0.708819677E-36   -0.71E-36     -Infinity  F  F
42  0.000000000E+00  0.359530082E-37   -0.36E-37     -Infinity  F  F
43  0.000000000E+00  0.178100831E-38   -0.18E-38     -Infinity  F  F
44  0.000000000E+00  0.862120854E-40   -0.86E-40     -Infinity  F  F
45  0.000000000E+00  0.408058113E-41   -0.41E-41     -Infinity  F  F
46  0.000000000E+00  0.189175293E-42   -0.19E-42     -Infinity  F  F
47  0.000000000E+00  0.840779079E-44   -0.84E-44     -Infinity  F  F
48  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
49  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
50  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
51  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
52  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
53  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
54  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
55  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
56  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
57  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
58  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
59  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
60  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
61  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
62  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
63  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
64  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
65  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
66  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
67  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
68  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
69  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
70  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
71  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
72  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
73  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
74  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
75  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
76  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
77  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
78  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
79  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
80  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
81  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
82  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
83  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
84  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
85  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
86  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
87  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
88  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
89  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
90  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
91  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
92  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
93  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
94  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
95  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
96  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
97  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
98  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
99  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
**  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
 JN for X =    8.0000000      -- Epsilon =   1.19209290E-07
 0  0.000000000E+00  0.171650827E+00   -0.17E+00     -Infinity  F  F
 1  0.000000000E+00  0.234636351E+00   -0.23E+00     -Infinity  F  F
 2  0.000000000E+00 -0.112991735E+00    0.11E+00     +Infinity  F  F
 3  0.000000000E+00 -0.291132212E+00    0.29E+00     +Infinity  F  F
 4  0.000000000E+00 -0.105357423E+00    0.11E+00     +Infinity  F  F
 5  0.000000000E+00  0.185774788E+00   -0.19E+00     -Infinity  F  F
 6  0.000000000E+00  0.337575912E+00   -0.34E+00     -Infinity  F  F
 7  0.000000000E+00  0.320589066E+00   -0.32E+00     -Infinity  F  F
 8  0.000000000E+00  0.223454952E+00   -0.22E+00     -Infinity  F  F
 9  0.000000000E+00  0.126320958E+00   -0.13E+00     -Infinity  F  F
10  0.000000000E+00  0.607670397E-01   -0.61E-01     -Infinity  F  F
11  0.000000000E+00  0.255966671E-01   -0.26E-01     -Infinity  F  F
12  0.000000000E+00  0.962382182E-02   -0.96E-02     -Infinity  F  F
13  0.000000000E+00  0.327479397E-02   -0.33E-02     -Infinity  F  F
14  0.000000000E+00  0.101925631E-02   -0.10E-02     -Infinity  F  F
15  0.000000000E+00  0.292603392E-03   -0.29E-03     -Infinity  F  F
16  0.000000000E+00  0.780064584E-04   -0.78E-04     -Infinity  F  F
17  0.000000000E+00  0.194222357E-04   -0.19E-04     -Infinity  F  F
18  0.000000000E+00  0.453809389E-05   -0.45E-05     -Infinity  F  F
19  0.000000000E+00  0.999190434E-06   -0.10E-05     -Infinity  F  F
20  0.000000000E+00  0.208058367E-06   -0.21E-06     -Infinity  F  F
21  0.000000000E+00  0.411015506E-07   -0.41E-07     -Infinity  F  F
22  0.000000000E+00  0.772477105E-08   -0.77E-08     -Infinity  F  F
23  0.000000000E+00  0.138470357E-08   -0.14E-08     -Infinity  F  F
24  0.000000000E+00  0.237274811E-09   -0.24E-09     -Infinity  F  F
25  0.000000000E+00  0.389455031E-10   -0.39E-10     -Infinity  F  F
26  0.000000000E+00  0.613452041E-11   -0.61E-11     -Infinity  F  F
27  0.000000000E+00  0.928878936E-12   -0.93E-12     -Infinity  F  F
28  0.000000000E+00  0.135416282E-12   -0.14E-12     -Infinity  F  F
29  0.000000000E+00  0.190343973E-13   -0.19E-13     -Infinity  F  F
30  0.000000000E+00  0.258309982E-14   -0.26E-14     -Infinity  F  F
31  0.000000000E+00  0.338853969E-15   -0.34E-15     -Infinity  F  F
32  0.000000000E+00  0.430180869E-16   -0.43E-16     -Infinity  F  F
33  0.000000000E+00  0.529080395E-17   -0.53E-17     -Infinity  F  F
34  0.000000000E+00  0.631042854E-18   -0.63E-18     -Infinity  F  F
35  0.000000000E+00  0.730583107E-19   -0.73E-19     -Infinity  F  F
36  0.000000000E+00  0.821744566E-20   -0.82E-20     -Infinity  F  F
37  0.000000000E+00  0.898712449E-21   -0.90E-21     -Infinity  F  F
38  0.000000000E+00  0.956447463E-22   -0.96E-22     -Infinity  F  F
39  0.000000000E+00  0.991239384E-23   -0.99E-23     -Infinity  F  F
40  0.000000000E+00  0.100109841E-23   -0.10E-23     -Infinity  F  F
41  0.000000000E+00  0.985925447E-25   -0.99E-25     -Infinity  F  F
42  0.000000000E+00  0.947442131E-26   -0.95E-26     -Infinity  F  F
43  0.000000000E+00  0.888920573E-27   -0.89E-27     -Infinity  F  F
44  0.000000000E+00  0.814745163E-28   -0.81E-28     -Infinity  F  F
45  0.000000000E+00  0.729901795E-29   -0.73E-29     -Infinity  F  F
46  0.000000000E+00  0.639463331E-30   -0.64E-30     -Infinity  F  F
47  0.000000000E+00  0.548138599E-31   -0.55E-31     -Infinity  F  F
48  0.000000000E+00  0.459931781E-32   -0.46E-32     -Infinity  F  F
49  0.000000000E+00  0.377938377E-33   -0.38E-33     -Infinity  F  F
50  0.000000000E+00  0.304271432E-34   -0.30E-34     -Infinity  F  F
51  0.000000000E+00  0.240101501E-35   -0.24E-35     -Infinity  F  F
52  0.000000000E+00  0.185777962E-36   -0.19E-36     -Infinity  F  F
53  0.000000000E+00  0.141002407E-37   -0.14E-37     -Infinity  F  F
54  0.000000000E+00  0.105014988E-38   -0.11E-38     -Infinity  F  F
55  0.000000000E+00  0.767757416E-40   -0.77E-40     -Infinity  F  F
56  0.000000000E+00  0.551130686E-41   -0.55E-41     -Infinity  F  F
57  0.000000000E+00  0.388159675E-42   -0.39E-42     -Infinity  F  F
58  0.000000000E+00  0.266246708E-43   -0.27E-43     -Infinity  F  F
59  0.000000000E+00  0.140129846E-44   -0.14E-44     -Infinity  F  F
60  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
61  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
62  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
63  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
64  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
65  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
66  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
67  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
68  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
69  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
70  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
71  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
72  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
73  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
74  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
75  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
76  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
77  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
78  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
79  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
80  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
81  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
82  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
83  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
84  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
85  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
86  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
87  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
88  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
89  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
90  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
91  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
92  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
93  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
94  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
95  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
96  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
97  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
98  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
99  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
**  0.000000000E+00  0.000000000E+00    0.00E+00           NaN  F  F
 JN for X =    34.529999      -- Epsilon =   1.19209290E-07
 0 -0.929715782E-01 -0.929716527E-01    0.75E-07 -6.7224845886  F  F
 1  0.976139754E-01  0.976141840E-01   -0.21E-06-17.9277610779  F  F
 2  0.986254439E-01  0.986255258E-01   -0.82E-07 -6.9708175659  F  F
 3 -0.861890763E-01 -0.861892775E-01    0.20E-06-19.5790481567  F  F
 4 -0.113601826E+00 -0.113601945E+00    0.12E-06 -8.8026752472  F  F
 5  0.598695092E-01  0.598696843E-01   -0.18E-06-24.5325202942  F  F
 6  0.130940229E+00  0.130940408E+00   -0.18E-06-11.4556083679  F  F
 7 -0.143646523E-01 -0.143647641E-01    0.11E-06-65.2643737793  F  F
 8 -0.136764303E+00 -0.136764526E+00    0.22E-06-13.7097177505  F  F
 9 -0.490071625E-01 -0.490071550E-01   -0.75E-08  1.2753237486  F  T
10  0.111217558E+00  0.111217789E+00   -0.23E-06-17.4208106995  F  F
11  0.113425091E+00  0.113425225E+00   -0.13E-06 -9.9184408188  F  F
12 -0.389513522E-01 -0.389515013E-01    0.15E-06-32.0913124084  F  F
13 -0.140498146E+00 -0.140498385E+00    0.24E-06-14.2350635529  F  F
14 -0.668393150E-01 -0.668393448E-01    0.30E-07 -3.7403135300  F  F
15  0.862988681E-01  0.862990916E-01   -0.22E-06-21.7268199921  F  F
16  0.141816616E+00  0.141816840E+00   -0.22E-06-13.2213001251  F  F
17  0.451269001E-01  0.451268852E-01    0.15E-07  2.7699663639  F  T
18 -0.973823667E-01 -0.973826051E-01    0.24E-06-20.5375995636  F  F
19 -0.146654993E+00 -0.146655232E+00    0.24E-06-13.6374492645  F  F
20 -0.640103370E-01 -0.640103519E-01    0.15E-07 -1.9528095722  F  T
21  0.725045875E-01  0.725048035E-01   -0.22E-06-24.9984188080  F  F
22  0.152200103E+00  0.152200386E+00   -0.28E-06-15.6044569016  F  F
23  0.121437050E+00  0.121437192E+00   -0.14E-06 -9.7787284851  F  F
24  0.957529247E-02  0.957520306E-02    0.89E-07 78.3265914917  F  F
25 -0.108126476E+00 -0.108126745E+00    0.27E-06-20.8089637756  F  F
26 -0.166144192E+00 -0.166144490E+00    0.30E-06-15.0471706390  F  F
27 -0.142076179E+00 -0.142076358E+00    0.18E-06-10.5577163696  F  F
28 -0.560427085E-01 -0.560427010E-01   -0.75E-08  1.1152209044  F  T
29  0.511873364E-01  0.511875227E-01   -0.19E-06-30.5251274109  F  F
30  0.142022014E+00  0.142022312E+00   -0.30E-06-17.6029052734  F  F
31  0.195592880E+00  0.195593208E+00   -0.33E-06-14.0598163605  F  F
32  0.209172845E+00  0.209173173E+00   -0.33E-06-13.1470222473  F  F
33  0.192100793E+00  0.192101061E+00   -0.27E-06-11.7126016617  F  F
34  0.158005059E+00  0.158005238E+00   -0.18E-06 -9.4933671951  F  F
35  0.119058907E+00  0.119058974E+00   -0.67E-07 -4.7245521545  F  F
36  0.833538473E-01  0.833539441E-01   -0.97E-07 -9.7476005554  F  F
37  0.547458045E-01  0.547458604E-01   -0.56E-07 -8.5622997284  F  F
38  0.339699164E-01  0.339699425E-01   -0.26E-07 -6.4395213127  F  F
39  0.200214647E-01  0.200215019E-01   -0.37E-07-15.6082487106  F  F
40  0.112566808E-01  0.112566976E-01   -0.17E-07-12.4925813675  F  F
41  0.605830550E-02  0.605831202E-02   -0.65E-08 -9.0268640518  F  F
42  0.313025876E-02  0.313026202E-02   -0.33E-08 -8.7353000641  F  F
43  0.155657227E-02  0.155657297E-02   -0.70E-09 -3.7642807961  F  F
44  0.746521342E-03  0.746522564E-03   -0.12E-08-13.7355833054  F  F
45  0.345943903E-03  0.345944281E-03   -0.38E-09 -9.1744012833  F  F
46  0.155157002E-03  0.155157075E-03   -0.73E-10 -3.9337673187  F  F
47  0.674486218E-04  0.674487383E-04   -0.12E-09-14.4786128998  F  F
48  0.284563794E-04  0.284564048E-04   -0.25E-10 -7.5070352554  F  F
49  0.116655538E-04  0.116655610E-04   -0.73E-11 -5.2320837975  F  F
50  0.465176663E-05  0.465176845E-05   -0.18E-11 -3.2802138329  F  F
51  0.180611323E-05  0.180611539E-05   -0.22E-11-10.0324897766  F  F
52  0.683407109E-06  0.683407279E-06   -0.17E-12 -2.0932054520  F  T
53  0.252222662E-06  0.252222861E-06   -0.20E-12 -6.6168918610  F  F
54  0.908646243E-07  0.908646882E-07   -0.64E-13 -5.9037475586  F  F
55  0.319759970E-07  0.319760254E-07   -0.28E-13 -7.4561734200  F  F
56  0.109992566E-07  0.109992673E-07   -0.11E-13 -8.1284551620  F  F
57  0.370071107E-08  0.370071462E-08   -0.36E-14 -8.0531339645  F  F
58  0.121855581E-08  0.121855570E-08    0.11E-15  0.7642838955  T  T
59  0.392902322E-09  0.392902155E-09    0.17E-15  3.5555500984  F  F
60  0.124116481E-09  0.124116550E-09   -0.69E-16 -4.6897606850  F  F
61  0.384321082E-10  0.384321117E-10   -0.35E-17 -0.7572790384  T  T
62  0.116702889E-10  0.116702915E-10   -0.26E-17 -1.8703798056  F  T
63  0.347683297E-11  0.347683514E-11   -0.22E-17 -5.2317423820  F  F
64  0.101667828E-11  0.101667904E-11   -0.76E-18 -6.2620229721  F  F
65  0.291913683E-12  0.291913846E-12   -0.16E-18 -4.6734433174  F  F
66  0.823307690E-13  0.823307622E-13    0.68E-20  0.6904274225  T  T
67  0.228173193E-13  0.228173380E-13   -0.19E-19 -6.8509101868  F  F
68  0.621602455E-14  0.621601989E-14    0.47E-20  6.2869524956  F  F
69  0.166514035E-14  0.166514088E-14   -0.53E-21 -2.6669776440  F  T
70  0.438750176E-15  0.438750096E-15    0.79E-22  1.5182530880  F  T
71  0.113748227E-15  0.113748227E-15    0.00E+00  0.0000000000  T  T
72  0.290241927E-16  0.290241861E-16    0.66E-23  1.9125820398  F  T
73  0.729098416E-17  0.729098664E-17   -0.25E-23 -2.8551263809  F  T
74  0.180359991E-17  0.180360074E-17   -0.83E-24 -3.8472466469  F  F
75  0.439476458E-18  0.439476355E-18    0.10E-24  1.9736250639  F  T
76  0.105507016E-18  0.105507029E-18   -0.13E-25 -1.0276114941  F  T
77  0.249621864E-19  0.249621605E-19    0.26E-25  8.6867561340  F  F
78  0.582158002E-20  0.582157921E-20    0.81E-27  1.1639904976  F  T
79  0.133861027E-20  0.133860966E-20    0.61E-27  3.7966222763  F  F
80  0.303540878E-21  0.303540651E-21    0.23E-27  6.2786407471  F  F
81  0.678924555E-22  0.678924177E-22    0.38E-28  4.6785368919  F  F
82  0.149815194E-22  0.149815130E-22    0.63E-29  3.5336575508  F  F
83  0.326216526E-23  0.326216210E-23    0.32E-29  8.1141748428  F  F
84  0.701059750E-24  0.701060046E-24   -0.30E-30 -3.5397009850  F  F
85  0.148724896E-24  0.148724711E-24    0.18E-30 10.4284067154  F  F
86  0.311508630E-25  0.311508445E-25    0.18E-31  4.9788784981  F  F
87  0.644302992E-26  0.644302568E-26    0.42E-32  5.5164909363  F  F
88  0.131618688E-26  0.131618534E-26    0.15E-32  9.8198041916  F  F
89  0.265597488E-27  0.265597367E-27    0.12E-33  3.8017752171  F  F
90  0.529515721E-28  0.529515540E-28    0.18E-34  2.8603739738  F  T
91  0.104315776E-28  0.104315738E-28    0.38E-35  3.0248959064  F  F
92  0.203096855E-29  0.203096572E-29    0.28E-35 11.6524829865  F  F
93  0.390843126E-30  0.390842914E-30    0.21E-36  4.5413031578  F  F
94  0.743550135E-31  0.743549842E-31    0.29E-37  3.3154325485  F  F
95  0.139857996E-31  0.139857849E-31    0.15E-37  8.8131904602  F  F
96  0.260131426E-32  0.260131151E-32    0.28E-38  8.8844165802  F  F
97  0.478502929E-33  0.478502608E-33    0.32E-39  5.6348700523  F  F
98  0.870600389E-34  0.870599183E-34    0.12E-39 11.6139764786  F  F
99  0.156693340E-34  0.156693340E-34    0.00E+00  0.0000000000  T  T
**  0.279018210E-35  0.279018210E-35    0.00E+00  0.0000000000  T  T
 JN for X =    475.78000      -- Epsilon =   1.19209290E-07
 0 -0.299014114E-01 -0.299014132E-01    0.19E-08 -0.5225505829  T  T
 1 -0.211017877E-01 -0.211017914E-01    0.37E-08 -1.4809172153  F  T
 2  0.298127066E-01  0.298127085E-01   -0.19E-08 -0.5241053700  T  T
 3  0.213524308E-01  0.213524345E-01   -0.37E-08 -1.4635336399  F  T
 4 -0.295434333E-01 -0.295434352E-01    0.19E-08 -0.5288823247  T  T
 5 -0.218491890E-01 -0.218491927E-01    0.37E-08 -1.4302589893  F  T
 6  0.290842038E-01  0.290842056E-01   -0.19E-08 -0.5372332335  T  T
 7  0.225827433E-01  0.225827470E-01   -0.37E-08 -1.3838000298  F  T
 8 -0.284196977E-01 -0.284196995E-01    0.19E-08 -0.5497947335  T  T
 9 -0.235384684E-01 -0.235384721E-01    0.37E-08 -1.3276139498  F  T
10  0.275291763E-01  0.275291782E-01   -0.19E-08 -0.5675796270  T  T
11  0.246956907E-01  0.246956944E-01   -0.37E-08 -1.2654029131  F  T
12 -0.263872519E-01 -0.263872519E-01    0.00E+00 -0.0000000000  T  T
13 -0.260267556E-01 -0.260267593E-01    0.37E-08 -1.2006875277  F  T
14  0.249649659E-01  0.249649640E-01    0.19E-08  0.6258770823  T  T
15  0.274959616E-01  0.274959654E-01   -0.37E-08 -1.1365305185  F  T
16 -0.232312251E-01 -0.232312232E-01   -0.19E-08  0.6725861430  T  T
17 -0.290584471E-01 -0.290584508E-01    0.37E-08 -1.0754188299  F  T
18  0.211546626E-01  0.211546607E-01    0.19E-08  0.7386078835  T  T
19  0.306591187E-01  0.306591224E-01   -0.37E-08 -1.0192725658  F  T
20 -0.187059548E-01 -0.187059529E-01   -0.19E-08  0.8352954984  T  T
21 -0.322317742E-01 -0.322317779E-01    0.37E-08 -0.9695401788  T  T
22  0.158606600E-01  0.158606581E-01    0.19E-08  0.9851418734  T  T
23  0.336985625E-01  0.336985663E-01   -0.37E-08 -0.9273392558  T  T
24 -0.126025695E-01 -0.126025686E-01   -0.93E-09  0.6199132800  T  T
25 -0.349699967E-01 -0.349700004E-01    0.37E-08 -0.8936231732  T  T
26  0.892755203E-02  0.892755017E-02    0.19E-08  1.7501997948  F  T
27  0.359457247E-01  0.359457284E-01   -0.37E-08 -0.8693662286  T  T
28 -0.484779011E-02 -0.484778779E-02   -0.23E-08  4.0288977623  F  F
29 -0.365163162E-01 -0.365163200E-01    0.37E-08 -0.8557818532  T  T
30  0.396265183E-03  0.396262854E-03    0.23E-08 49.2883338928  F  F
31  0.365662873E-01  0.365662910E-01   -0.37E-08 -0.8546123505  T  T
32  0.436877320E-02  0.436877552E-02   -0.23E-08 -4.4706487656  F  F
33 -0.359786190E-01 -0.359786227E-01    0.37E-08 -0.8685714006  T  T
34 -0.935971178E-02 -0.935971458E-02    0.28E-08 -2.5040836334  F  T
35  0.346409008E-01  0.346409008E-01    0.00E+00  0.0000000000  T  T
36  0.144563168E-01  0.144563206E-01   -0.37E-08 -2.1616847515  F  T
37 -0.324532203E-01 -0.324532203E-01    0.00E+00 -0.0000000000  T  T
38 -0.195038989E-01 -0.195039026E-01    0.37E-08 -1.6022437811  F  T
39  0.293377135E-01  0.293377116E-01    0.19E-08  0.5325909257  T  T
40  0.243135616E-01  0.243135653E-01   -0.37E-08 -1.2852909565  F  T
41 -0.252495110E-01 -0.252495091E-01   -0.19E-08  0.6188238859  T  T
42 -0.286652781E-01 -0.286652818E-01    0.37E-08 -1.0901690722  F  T
43  0.201885924E-01  0.201885905E-01    0.19E-08  0.7739519477  T  T
44  0.323144831E-01  0.323144868E-01   -0.37E-08 -0.9670586586  T  T
45 -0.142117245E-01 -0.142117217E-01   -0.28E-08  1.6491664648  F  T
46 -0.350028165E-01 -0.350028202E-01    0.37E-08 -0.8927853107  T  T
47  0.744334562E-02  0.744334282E-02    0.28E-08  3.1487855911  F  F
48  0.364734009E-01  0.364734046E-01   -0.37E-08 -0.8567887545  T  T
49 -0.839638524E-04 -0.839605927E-04   -0.33E-08325.6609802246  F  F
50 -0.364906974E-01 -0.364906974E-01    0.00E+00 -0.0000000000  T  T
51 -0.758569408E-02 -0.758569734E-02    0.33E-08 -3.6046471596  F  F
52  0.348644406E-01  0.348644406E-01    0.00E+00  0.0000000000  T  T
53  0.152066574E-01  0.152066611E-01   -0.37E-08 -2.0550210476  F  T
54 -0.314765200E-01 -0.314765163E-01   -0.37E-08  0.9928035140  T  T
55 -0.223516915E-01 -0.223516934E-01    0.19E-08 -0.6990522146  T  T
56  0.263088234E-01  0.263088197E-01    0.37E-08  1.1878144741  F  T
57  0.285448655E-01  0.285448655E-01    0.00E+00  0.0000000000  T  T
58 -0.194692872E-01 -0.194692835E-01   -0.37E-08  1.6050921679  F  T
59 -0.332916752E-01 -0.332916752E-01    0.00E+00 -0.0000000000  T  T
60  0.112124914E-01  0.112124886E-01    0.28E-08  2.0903027058  F  T
61  0.361196622E-01  0.361196585E-01    0.37E-08  0.8651797175  T  T
62 -0.195065048E-02 -0.195064861E-02   -0.19E-08  8.0101480484  F  F
63 -0.366280489E-01 -0.366280451E-01   -0.37E-08  0.8531712890  T  T
64 -0.774949323E-02 -0.774949417E-02    0.93E-09 -1.0081304312  F  T
65  0.345431864E-01  0.345431827E-01    0.37E-08  0.9046646357  T  T
66  0.171879195E-01  0.171879195E-01    0.00E+00  0.0000000000  T  T
67 -0.297745839E-01 -0.297745802E-01   -0.37E-08  1.0495529175  F  T
68 -0.255737156E-01 -0.255737156E-01    0.00E+00 -0.0000000000  T  T
69  0.224644281E-01  0.224644244E-01    0.37E-08  1.3910881281  F  T
70  0.320895240E-01  0.320895240E-01    0.00E+00  0.0000000000  T  T
71 -0.130219674E-01 -0.130219646E-01   -0.28E-08  1.7998431921  F  T
72 -0.359760262E-01 -0.359760225E-01   -0.37E-08  0.8686339855  T  T
73  0.213343091E-02  0.213342998E-02    0.93E-09  3.6619417667  F  F
74  0.366307013E-01  0.366306975E-01    0.37E-08  0.8531095386  T  T
75  0.926121324E-02  0.926121324E-02    0.00E+00  0.0000000000  T  T
76 -0.337109007E-01 -0.337108970E-01   -0.37E-08  0.9269998670  T  T
77 -0.200310163E-01 -0.200310163E-01    0.00E+00 -0.0000000000  T  T
78  0.272272807E-01  0.272272769E-01    0.37E-08  1.1477459669  F  T
79  0.289583690E-01  0.289583690E-01    0.00E+00  0.0000000000  T  T
80 -0.176106039E-01 -0.176106002E-01   -0.37E-08  1.7744990587  F  T
81 -0.348806381E-01 -0.348806344E-01   -0.37E-08  0.8959125280  T  T
82  0.573397335E-02  0.573397055E-02    0.28E-08  4.0874795914  F  F
83  0.368571207E-01  0.368571170E-01    0.37E-08  0.8478687406  T  T
84  0.712550431E-02  0.712550618E-02   -0.19E-08 -2.1928272247  F  T
85 -0.343410745E-01 -0.343410708E-01   -0.37E-08  0.9099889994  T  T
86 -0.193958450E-01 -0.193958469E-01    0.19E-08 -0.8055849075  T  T
87  0.273292512E-01  0.273292474E-01    0.37E-08  1.1434634924  F  T
88  0.293905698E-01  0.293905698E-01    0.00E+00  0.0000000000  T  T
89 -0.164571255E-01 -0.164571218E-01   -0.37E-08  1.8988735676  F  T
90 -0.355475508E-01 -0.355475508E-01    0.00E+00 -0.0000000000  T  T
91  0.300855935E-02  0.300855469E-02    0.47E-08 12.9837894440  F  F
92  0.366984159E-01  0.366984122E-01    0.37E-08  0.8515353799  T  T
93  0.111839436E-01  0.111839455E-01   -0.19E-08 -1.3970922232  F  T
94 -0.323261991E-01 -0.323261954E-01   -0.37E-08  0.9667081237  T  T
95 -0.239573382E-01 -0.239573382E-01    0.00E+00 -0.0000000000  T  T
96  0.227589719E-01  0.227589700E-01    0.19E-08  0.6865424514  T  T
97  0.331416726E-01  0.331416726E-01    0.00E+00  0.0000000000  T  T
98 -0.924540404E-02 -0.924540404E-02    0.00E+00 -0.0000000000  T  T
99 -0.369503647E-01 -0.369503647E-01    0.00E+00 -0.0000000000  T  T
** -0.613181293E-02 -0.613181293E-02    0.00E+00 -0.0000000000  T  T

[-- Attachment #4: bessel_yn.txt --]
[-- Type: text/plain, Size: 77319 bytes --]

 YN for X =   0.50000000      -- Epsilon =   1.19209290E-07
 0 -0.444518715E+00 -0.444518715E+00    0.00E+00 -0.0000000000  T  T
 1 -0.147147238E+01 -0.147147238E+01    0.00E+00 -0.0000000000  T  T
 2 -0.544137096E+01 -0.544137096E+01    0.00E+00 -0.0000000000  T  T
 3 -0.420594940E+02 -0.420594940E+02    0.00E+00 -0.0000000000  T  T
 4 -0.499272552E+03 -0.499272552E+03    0.00E+00 -0.0000000000  T  T
 5 -0.794630127E+04 -0.794630127E+04    0.00E+00 -0.0000000000  T  T
 6 -0.158426766E+06 -0.158426766E+06    0.00E+00 -0.0000000000  T  T
 7 -0.379429625E+07 -0.379429625E+07    0.00E+00 -0.0000000000  T  T
 8 -0.106081872E+09 -0.106081872E+09    0.00E+00 -0.0000000000  T  T
 9 -0.339082573E+10 -0.339082573E+10    0.00E+00 -0.0000000000  T  T
10 -0.121963651E+12 -0.121963651E+12    0.00E+00 -0.0000000000  T  T
11 -0.487515541E+13 -0.487515541E+13    0.00E+00 -0.0000000000  T  T
12 -0.214384870E+15 -0.214384870E+15    0.00E+00 -0.0000000000  T  T
13 -0.102855984E+17 -0.102855984E+17    0.00E+00 -0.0000000000  T  T
14 -0.534636739E+18 -0.534636739E+18    0.00E+00 -0.0000000000  T  T
15 -0.299293728E+20 -0.299293728E+20    0.00E+00 -0.0000000000  T  T
16 -0.179522770E+22 -0.179522770E+22    0.00E+00 -0.0000000000  T  T
17 -0.114864642E+24 -0.114864642E+24    0.00E+00 -0.0000000000  T  T
18 -0.780900079E+25 -0.780900079E+25    0.00E+00 -0.0000000000  T  T
19 -0.562133203E+27 -0.562133203E+27    0.00E+00 -0.0000000000  T  T
20 -0.427143149E+29 -0.427143149E+29    0.00E+00 -0.0000000000  T  T
21 -0.341658304E+31 -0.341658304E+31    0.00E+00 -0.0000000000  T  T
22 -0.286950265E+33 -0.286950265E+33    0.00E+00 -0.0000000000  T  T
23 -0.252482055E+35 -0.252482055E+35    0.00E+00 -0.0000000000  T  T
24 -0.232254791E+37 -0.232254791E+37    0.00E+00 -0.0000000000  T  T
25 -0.222939358E+39 -0.222939358E+39    0.00E+00 -0.0000000000  T  T
26        -Infinity        -Infinity         NaN           NaN  F  F
27        -Infinity        -Infinity         NaN           NaN  F  F
28              NaN        -Infinity         NaN           NaN  F  F
29              NaN        -Infinity         NaN           NaN  F  F
30              NaN        -Infinity         NaN           NaN  F  F
31              NaN        -Infinity         NaN           NaN  F  F
32              NaN        -Infinity         NaN           NaN  F  F
33              NaN        -Infinity         NaN           NaN  F  F
34              NaN        -Infinity         NaN           NaN  F  F
35              NaN        -Infinity         NaN           NaN  F  F
36              NaN        -Infinity         NaN           NaN  F  F
37              NaN        -Infinity         NaN           NaN  F  F
38              NaN        -Infinity         NaN           NaN  F  F
39              NaN        -Infinity         NaN           NaN  F  F
40              NaN        -Infinity         NaN           NaN  F  F
41              NaN        -Infinity         NaN           NaN  F  F
42              NaN        -Infinity         NaN           NaN  F  F
43              NaN        -Infinity         NaN           NaN  F  F
44              NaN        -Infinity         NaN           NaN  F  F
45              NaN        -Infinity         NaN           NaN  F  F
46              NaN        -Infinity         NaN           NaN  F  F
47              NaN        -Infinity         NaN           NaN  F  F
48              NaN        -Infinity         NaN           NaN  F  F
49              NaN        -Infinity         NaN           NaN  F  F
50              NaN        -Infinity         NaN           NaN  F  F
51              NaN        -Infinity         NaN           NaN  F  F
52              NaN        -Infinity         NaN           NaN  F  F
53              NaN        -Infinity         NaN           NaN  F  F
54              NaN        -Infinity         NaN           NaN  F  F
55              NaN        -Infinity         NaN           NaN  F  F
56              NaN        -Infinity         NaN           NaN  F  F
57              NaN        -Infinity         NaN           NaN  F  F
58              NaN        -Infinity         NaN           NaN  F  F
59              NaN        -Infinity         NaN           NaN  F  F
60              NaN        -Infinity         NaN           NaN  F  F
61              NaN        -Infinity         NaN           NaN  F  F
62              NaN        -Infinity         NaN           NaN  F  F
63              NaN        -Infinity         NaN           NaN  F  F
64              NaN        -Infinity         NaN           NaN  F  F
65              NaN        -Infinity         NaN           NaN  F  F
66              NaN        -Infinity         NaN           NaN  F  F
67              NaN        -Infinity         NaN           NaN  F  F
68              NaN        -Infinity         NaN           NaN  F  F
69              NaN        -Infinity         NaN           NaN  F  F
70              NaN        -Infinity         NaN           NaN  F  F
71              NaN        -Infinity         NaN           NaN  F  F
72              NaN        -Infinity         NaN           NaN  F  F
73              NaN        -Infinity         NaN           NaN  F  F
74              NaN        -Infinity         NaN           NaN  F  F
75              NaN        -Infinity         NaN           NaN  F  F
76              NaN        -Infinity         NaN           NaN  F  F
77              NaN        -Infinity         NaN           NaN  F  F
78              NaN        -Infinity         NaN           NaN  F  F
79              NaN        -Infinity         NaN           NaN  F  F
80              NaN        -Infinity         NaN           NaN  F  F
81              NaN        -Infinity         NaN           NaN  F  F
82              NaN        -Infinity         NaN           NaN  F  F
83              NaN        -Infinity         NaN           NaN  F  F
84              NaN        -Infinity         NaN           NaN  F  F
85              NaN        -Infinity         NaN           NaN  F  F
86              NaN        -Infinity         NaN           NaN  F  F
87              NaN        -Infinity         NaN           NaN  F  F
88              NaN        -Infinity         NaN           NaN  F  F
89              NaN        -Infinity         NaN           NaN  F  F
90              NaN        -Infinity         NaN           NaN  F  F
91              NaN        -Infinity         NaN           NaN  F  F
92              NaN        -Infinity         NaN           NaN  F  F
93              NaN        -Infinity         NaN           NaN  F  F
94              NaN        -Infinity         NaN           NaN  F  F
95              NaN        -Infinity         NaN           NaN  F  F
96              NaN        -Infinity         NaN           NaN  F  F
97              NaN        -Infinity         NaN           NaN  F  F
98              NaN        -Infinity         NaN           NaN  F  F
99              NaN        -Infinity         NaN           NaN  F  F
**              NaN        -Infinity         NaN           NaN  F  F
 YN for X =    1.0000000      -- Epsilon =   1.19209290E-07
 0  0.882569551E-01  0.882569551E-01    0.00E+00  0.0000000000  T  T
 1 -0.781212807E+00 -0.781212807E+00    0.00E+00 -0.0000000000  T  T
 2 -0.165068257E+01 -0.165068257E+01    0.00E+00 -0.0000000000  T  T
 3 -0.582151747E+01 -0.582151747E+01    0.00E+00 -0.0000000000  T  T
 4 -0.332784195E+02 -0.332784195E+02    0.00E+00 -0.0000000000  T  T
 5 -0.260405853E+03 -0.260405853E+03    0.00E+00 -0.0000000000  T  T
 6 -0.257078027E+04 -0.257078027E+04    0.00E+00 -0.0000000000  T  T
 7 -0.305889570E+05 -0.305889570E+05    0.00E+00 -0.0000000000  T  T
 8 -0.425674625E+06 -0.425674625E+06    0.00E+00 -0.0000000000  T  T
 9 -0.678020500E+07 -0.678020500E+07    0.00E+00 -0.0000000000  T  T
10 -0.121618016E+09 -0.121618016E+09    0.00E+00 -0.0000000000  T  T
11 -0.242558029E+10 -0.242558029E+10    0.00E+00 -0.0000000000  T  T
12 -0.532411474E+11 -0.532411474E+11    0.00E+00 -0.0000000000  T  T
13 -0.127536189E+13 -0.127536189E+13    0.00E+00 -0.0000000000  T  T
14 -0.331061679E+14 -0.331061679E+14    0.00E+00 -0.0000000000  T  T
15 -0.925697388E+15 -0.925697388E+15    0.00E+00 -0.0000000000  T  T
16 -0.277378158E+17 -0.277378158E+17    0.00E+00 -0.0000000000  T  T
17 -0.886684385E+18 -0.886684385E+18    0.00E+00 -0.0000000000  T  T
18 -0.301195311E+20 -0.301195311E+20    0.00E+00 -0.0000000000  T  T
19 -0.108341640E+22 -0.108341640E+22    0.00E+00 -0.0000000000  T  T
20 -0.411397026E+23 -0.411397026E+23    0.00E+00 -0.0000000000  T  T
21 -0.164450461E+25 -0.164450461E+25    0.00E+00 -0.0000000000  T  T
22 -0.690280530E+26 -0.690280530E+26    0.00E+00 -0.0000000000  T  T
23 -0.303558971E+28 -0.303558971E+28    0.00E+00 -0.0000000000  T  T
24 -0.139568096E+30 -0.139568096E+30    0.00E+00 -0.0000000000  T  T
25 -0.669623286E+31 -0.669623286E+31    0.00E+00 -0.0000000000  T  T
26 -0.334672060E+33 -0.334672060E+33    0.00E+00 -0.0000000000  T  T
27 -0.173962514E+35 -0.173962514E+35    0.00E+00 -0.0000000000  T  T
28 -0.939062888E+36 -0.939062888E+36    0.00E+00 -0.0000000000  T  T
29 -0.525701245E+38 -0.525701245E+38    0.00E+00 -0.0000000000  T  T
30        -Infinity        -Infinity         NaN           NaN  F  F
31        -Infinity        -Infinity         NaN           NaN  F  F
32              NaN        -Infinity         NaN           NaN  F  F
33              NaN        -Infinity         NaN           NaN  F  F
34              NaN        -Infinity         NaN           NaN  F  F
35              NaN        -Infinity         NaN           NaN  F  F
36              NaN        -Infinity         NaN           NaN  F  F
37              NaN        -Infinity         NaN           NaN  F  F
38              NaN        -Infinity         NaN           NaN  F  F
39              NaN        -Infinity         NaN           NaN  F  F
40              NaN        -Infinity         NaN           NaN  F  F
41              NaN        -Infinity         NaN           NaN  F  F
42              NaN        -Infinity         NaN           NaN  F  F
43              NaN        -Infinity         NaN           NaN  F  F
44              NaN        -Infinity         NaN           NaN  F  F
45              NaN        -Infinity         NaN           NaN  F  F
46              NaN        -Infinity         NaN           NaN  F  F
47              NaN        -Infinity         NaN           NaN  F  F
48              NaN        -Infinity         NaN           NaN  F  F
49              NaN        -Infinity         NaN           NaN  F  F
50              NaN        -Infinity         NaN           NaN  F  F
51              NaN        -Infinity         NaN           NaN  F  F
52              NaN        -Infinity         NaN           NaN  F  F
53              NaN        -Infinity         NaN           NaN  F  F
54              NaN        -Infinity         NaN           NaN  F  F
55              NaN        -Infinity         NaN           NaN  F  F
56              NaN        -Infinity         NaN           NaN  F  F
57              NaN        -Infinity         NaN           NaN  F  F
58              NaN        -Infinity         NaN           NaN  F  F
59              NaN        -Infinity         NaN           NaN  F  F
60              NaN        -Infinity         NaN           NaN  F  F
61              NaN        -Infinity         NaN           NaN  F  F
62              NaN        -Infinity         NaN           NaN  F  F
63              NaN        -Infinity         NaN           NaN  F  F
64              NaN        -Infinity         NaN           NaN  F  F
65              NaN        -Infinity         NaN           NaN  F  F
66              NaN        -Infinity         NaN           NaN  F  F
67              NaN        -Infinity         NaN           NaN  F  F
68              NaN        -Infinity         NaN           NaN  F  F
69              NaN        -Infinity         NaN           NaN  F  F
70              NaN        -Infinity         NaN           NaN  F  F
71              NaN        -Infinity         NaN           NaN  F  F
72              NaN        -Infinity         NaN           NaN  F  F
73              NaN        -Infinity         NaN           NaN  F  F
74              NaN        -Infinity         NaN           NaN  F  F
75              NaN        -Infinity         NaN           NaN  F  F
76              NaN        -Infinity         NaN           NaN  F  F
77              NaN        -Infinity         NaN           NaN  F  F
78              NaN        -Infinity         NaN           NaN  F  F
79              NaN        -Infinity         NaN           NaN  F  F
80              NaN        -Infinity         NaN           NaN  F  F
81              NaN        -Infinity         NaN           NaN  F  F
82              NaN        -Infinity         NaN           NaN  F  F
83              NaN        -Infinity         NaN           NaN  F  F
84              NaN        -Infinity         NaN           NaN  F  F
85              NaN        -Infinity         NaN           NaN  F  F
86              NaN        -Infinity         NaN           NaN  F  F
87              NaN        -Infinity         NaN           NaN  F  F
88              NaN        -Infinity         NaN           NaN  F  F
89              NaN        -Infinity         NaN           NaN  F  F
90              NaN        -Infinity         NaN           NaN  F  F
91              NaN        -Infinity         NaN           NaN  F  F
92              NaN        -Infinity         NaN           NaN  F  F
93              NaN        -Infinity         NaN           NaN  F  F
94              NaN        -Infinity         NaN           NaN  F  F
95              NaN        -Infinity         NaN           NaN  F  F
96              NaN        -Infinity         NaN           NaN  F  F
97              NaN        -Infinity         NaN           NaN  F  F
98              NaN        -Infinity         NaN           NaN  F  F
99              NaN        -Infinity         NaN           NaN  F  F
**              NaN        -Infinity         NaN           NaN  F  F
 YN for X =   0.89999998      -- Epsilon =   1.19209290E-07
 0  0.562828034E-02  0.562828034E-02    0.00E+00  0.0000000000  T  T
 1 -0.873126566E+00 -0.873126566E+00    0.00E+00 -0.0000000000  T  T
 2 -0.194590962E+01 -0.194590962E+01    0.00E+00 -0.0000000000  T  T
 3 -0.777536154E+01 -0.777536154E+01    0.00E+00 -0.0000000000  T  T
 4 -0.498898354E+02 -0.498898354E+02    0.00E+00 -0.0000000000  T  T
 5 -0.435689850E+03 -0.435689850E+03    0.00E+00 -0.0000000000  T  T
 6 -0.479110889E+04 -0.479110889E+04    0.00E+00 -0.0000000000  T  T
 7 -0.634457617E+05 -0.634457617E+05    0.00E+00 -0.0000000000  T  T
 8 -0.982143000E+06 -0.982143000E+06    0.00E+00 -0.0000000000  T  T
 9 -0.173968740E+08 -0.173968740E+08    0.00E+00 -0.0000000000  T  T
10 -0.346955328E+09 -0.346955328E+09    0.00E+00 -0.0000000000  T  T
11 -0.769272218E+10 -0.769272218E+10    0.00E+00 -0.0000000000  T  T
12 -0.187697381E+12 -0.187697381E+12    0.00E+00 -0.0000000000  T  T
13 -0.499757089E+13 -0.499757089E+13    0.00E+00 -0.0000000000  T  T
14 -0.144186565E+15 -0.144186565E+15    0.00E+00 -0.0000000000  T  T
15 -0.448080704E+16 -0.448080704E+16    0.00E+00 -0.0000000000  T  T
16 -0.149216063E+18 -0.149216063E+18    0.00E+00 -0.0000000000  T  T
17 -0.530097920E+19 -0.530097920E+19    0.00E+00 -0.0000000000  T  T
18 -0.200110008E+21 -0.200110008E+21    0.00E+00 -0.0000000000  T  T
19 -0.799909944E+22 -0.799909944E+22    0.00E+00 -0.0000000000  T  T
20 -0.337539676E+24 -0.337539676E+24    0.00E+00 -0.0000000000  T  T
21 -0.149937649E+26 -0.149937649E+26    0.00E+00 -0.0000000000  T  T
22 -0.699371482E+27 -0.699371482E+27    0.00E+00 -0.0000000000  T  T
23 -0.341765053E+29 -0.341765006E+29   -0.47E+22  1.1591027975  F  T
24 -0.174609992E+31 -0.174609946E+31   -0.45E+24  2.1779692173  F  T
25 -0.930911567E+32 -0.930911277E+32   -0.29E+26  2.6145224571  F  T
26 -0.516998485E+34 -0.516998330E+34   -0.15E+28  2.5107891560  F  T
27 -0.298617144E+36 -0.298617065E+36   -0.79E+29  2.2256391048  F  T
28 -0.179118599E+38 -0.179118548E+38   -0.51E+31  2.3747000694  F  T
29        -Infinity        -Infinity         NaN           NaN  F  F
30        -Infinity        -Infinity         NaN           NaN  F  F
31              NaN        -Infinity         NaN           NaN  F  F
32              NaN        -Infinity         NaN           NaN  F  F
33              NaN        -Infinity         NaN           NaN  F  F
34              NaN        -Infinity         NaN           NaN  F  F
35              NaN        -Infinity         NaN           NaN  F  F
36              NaN        -Infinity         NaN           NaN  F  F
37              NaN        -Infinity         NaN           NaN  F  F
38              NaN        -Infinity         NaN           NaN  F  F
39              NaN        -Infinity         NaN           NaN  F  F
40              NaN        -Infinity         NaN           NaN  F  F
41              NaN        -Infinity         NaN           NaN  F  F
42              NaN        -Infinity         NaN           NaN  F  F
43              NaN        -Infinity         NaN           NaN  F  F
44              NaN        -Infinity         NaN           NaN  F  F
45              NaN        -Infinity         NaN           NaN  F  F
46              NaN        -Infinity         NaN           NaN  F  F
47              NaN        -Infinity         NaN           NaN  F  F
48              NaN        -Infinity         NaN           NaN  F  F
49              NaN        -Infinity         NaN           NaN  F  F
50              NaN        -Infinity         NaN           NaN  F  F
51              NaN        -Infinity         NaN           NaN  F  F
52              NaN        -Infinity         NaN           NaN  F  F
53              NaN        -Infinity         NaN           NaN  F  F
54              NaN        -Infinity         NaN           NaN  F  F
55              NaN        -Infinity         NaN           NaN  F  F
56              NaN        -Infinity         NaN           NaN  F  F
57              NaN        -Infinity         NaN           NaN  F  F
58              NaN        -Infinity         NaN           NaN  F  F
59              NaN        -Infinity         NaN           NaN  F  F
60              NaN        -Infinity         NaN           NaN  F  F
61              NaN        -Infinity         NaN           NaN  F  F
62              NaN        -Infinity         NaN           NaN  F  F
63              NaN        -Infinity         NaN           NaN  F  F
64              NaN        -Infinity         NaN           NaN  F  F
65              NaN        -Infinity         NaN           NaN  F  F
66              NaN        -Infinity         NaN           NaN  F  F
67              NaN        -Infinity         NaN           NaN  F  F
68              NaN        -Infinity         NaN           NaN  F  F
69              NaN        -Infinity         NaN           NaN  F  F
70              NaN        -Infinity         NaN           NaN  F  F
71              NaN        -Infinity         NaN           NaN  F  F
72              NaN        -Infinity         NaN           NaN  F  F
73              NaN        -Infinity         NaN           NaN  F  F
74              NaN        -Infinity         NaN           NaN  F  F
75              NaN        -Infinity         NaN           NaN  F  F
76              NaN        -Infinity         NaN           NaN  F  F
77              NaN        -Infinity         NaN           NaN  F  F
78              NaN        -Infinity         NaN           NaN  F  F
79              NaN        -Infinity         NaN           NaN  F  F
80              NaN        -Infinity         NaN           NaN  F  F
81              NaN        -Infinity         NaN           NaN  F  F
82              NaN        -Infinity         NaN           NaN  F  F
83              NaN        -Infinity         NaN           NaN  F  F
84              NaN        -Infinity         NaN           NaN  F  F
85              NaN        -Infinity         NaN           NaN  F  F
86              NaN        -Infinity         NaN           NaN  F  F
87              NaN        -Infinity         NaN           NaN  F  F
88              NaN        -Infinity         NaN           NaN  F  F
89              NaN        -Infinity         NaN           NaN  F  F
90              NaN        -Infinity         NaN           NaN  F  F
91              NaN        -Infinity         NaN           NaN  F  F
92              NaN        -Infinity         NaN           NaN  F  F
93              NaN        -Infinity         NaN           NaN  F  F
94              NaN        -Infinity         NaN           NaN  F  F
95              NaN        -Infinity         NaN           NaN  F  F
96              NaN        -Infinity         NaN           NaN  F  F
97              NaN        -Infinity         NaN           NaN  F  F
98              NaN        -Infinity         NaN           NaN  F  F
99              NaN        -Infinity         NaN           NaN  F  F
**              NaN        -Infinity         NaN           NaN  F  F
 YN for X =    1.8000000      -- Epsilon =   1.19209290E-07
 0  0.477431715E+00  0.477431715E+00    0.00E+00  0.0000000000  T  T
 1 -0.223664910E+00 -0.223664910E+00    0.00E+00 -0.0000000000  T  T
 2 -0.725948274E+00 -0.725948274E+00    0.00E+00 -0.0000000000  T  T
 3 -0.138955355E+01 -0.138955355E+01    0.00E+00 -0.0000000000  T  T
 4 -0.390589714E+01 -0.390589714E+01    0.00E+00 -0.0000000000  T  T
 5 -0.159699898E+02 -0.159699898E+02    0.00E+00 -0.0000000000  T  T
 6 -0.848162689E+02 -0.848162689E+02    0.00E+00 -0.0000000000  T  T
 7 -0.549471863E+03 -0.549471863E+03    0.00E+00 -0.0000000000  T  T
 8 -0.418885400E+04 -0.418885400E+04    0.00E+00 -0.0000000000  T  T
 9 -0.366847852E+05 -0.366847852E+05    0.00E+00 -0.0000000000  T  T
10 -0.362659000E+06 -0.362659000E+06    0.00E+00 -0.0000000000  T  T
11 -0.399286000E+07 -0.399286000E+07    0.00E+00 -0.0000000000  T  T
12 -0.484389680E+08 -0.484389640E+08   -0.40E+01  0.6927156448  T  T
13 -0.641860096E+09 -0.641860032E+09   -0.64E+02  0.8364297748  T  T
14 -0.922287309E+10 -0.922287206E+10   -0.10E+04  0.9313729405  T  T
15 -0.142825062E+12 -0.142825046E+12   -0.16E+05  0.9622887969  T  T
16 -0.237119524E+13 -0.237119498E+13   -0.26E+06  0.9273902178  T  T
17 -0.420117595E+14 -0.420117553E+14   -0.42E+07  0.8374886513  T  T
18 -0.791184247E+15 -0.791184180E+15   -0.67E+08  0.7115282416  T  T
19 -0.157816726E+17 -0.157816726E+17    0.00E+00 -0.0000000000  T  T
20 -0.332377486E+18 -0.332377486E+18    0.00E+00 -0.0000000000  T  T
21 -0.737038488E+19 -0.737038488E+19    0.00E+00 -0.0000000000  T  T
22 -0.171643282E+21 -0.171643282E+21    0.00E+00 -0.0000000000  T  T
23 -0.418835469E+22 -0.418835441E+22   -0.28E+15  0.5637496114  T  T
24 -0.106864096E+24 -0.106864078E+24   -0.18E+17  1.4140925407  F  T
25 -0.284552095E+25 -0.284552067E+25   -0.29E+18  0.8497043848  T  T
26 -0.789353888E+26 -0.789353796E+26   -0.92E+19  0.9801846147  T  T
27 -0.227751014E+28 -0.227750999E+28   -0.15E+21  0.5435497165  T  T
28 -0.682463748E+29 -0.682463654E+29   -0.94E+22  1.1609138250  F  T
29 -0.212094324E+31 -0.212094293E+31   -0.30E+24  1.1953649521  F  T
30 -0.682732636E+32 -0.682732443E+32   -0.19E+26  2.3766152859  F  T
31 -0.227365468E+34 -0.227365406E+34   -0.62E+27  2.2836787701  F  T
32 -0.782465008E+35 -0.782464810E+35   -0.20E+29  2.1234624386  F  T
33 -0.277982435E+37 -0.277982371E+37   -0.63E+30  1.9126790762  F  T
34 -0.101848647E+39 -0.101848627E+39   -0.20E+32  1.6705296040  F  T
35        -Infinity        -Infinity         NaN           NaN  F  F
36        -Infinity        -Infinity         NaN           NaN  F  F
37              NaN        -Infinity         NaN           NaN  F  F
38              NaN        -Infinity         NaN           NaN  F  F
39              NaN        -Infinity         NaN           NaN  F  F
40              NaN        -Infinity         NaN           NaN  F  F
41              NaN        -Infinity         NaN           NaN  F  F
42              NaN        -Infinity         NaN           NaN  F  F
43              NaN        -Infinity         NaN           NaN  F  F
44              NaN        -Infinity         NaN           NaN  F  F
45              NaN        -Infinity         NaN           NaN  F  F
46              NaN        -Infinity         NaN           NaN  F  F
47              NaN        -Infinity         NaN           NaN  F  F
48              NaN        -Infinity         NaN           NaN  F  F
49              NaN        -Infinity         NaN           NaN  F  F
50              NaN        -Infinity         NaN           NaN  F  F
51              NaN        -Infinity         NaN           NaN  F  F
52              NaN        -Infinity         NaN           NaN  F  F
53              NaN        -Infinity         NaN           NaN  F  F
54              NaN        -Infinity         NaN           NaN  F  F
55              NaN        -Infinity         NaN           NaN  F  F
56              NaN        -Infinity         NaN           NaN  F  F
57              NaN        -Infinity         NaN           NaN  F  F
58              NaN        -Infinity         NaN           NaN  F  F
59              NaN        -Infinity         NaN           NaN  F  F
60              NaN        -Infinity         NaN           NaN  F  F
61              NaN        -Infinity         NaN           NaN  F  F
62              NaN        -Infinity         NaN           NaN  F  F
63              NaN        -Infinity         NaN           NaN  F  F
64              NaN        -Infinity         NaN           NaN  F  F
65              NaN        -Infinity         NaN           NaN  F  F
66              NaN        -Infinity         NaN           NaN  F  F
67              NaN        -Infinity         NaN           NaN  F  F
68              NaN        -Infinity         NaN           NaN  F  F
69              NaN        -Infinity         NaN           NaN  F  F
70              NaN        -Infinity         NaN           NaN  F  F
71              NaN        -Infinity         NaN           NaN  F  F
72              NaN        -Infinity         NaN           NaN  F  F
73              NaN        -Infinity         NaN           NaN  F  F
74              NaN        -Infinity         NaN           NaN  F  F
75              NaN        -Infinity         NaN           NaN  F  F
76              NaN        -Infinity         NaN           NaN  F  F
77              NaN        -Infinity         NaN           NaN  F  F
78              NaN        -Infinity         NaN           NaN  F  F
79              NaN        -Infinity         NaN           NaN  F  F
80              NaN        -Infinity         NaN           NaN  F  F
81              NaN        -Infinity         NaN           NaN  F  F
82              NaN        -Infinity         NaN           NaN  F  F
83              NaN        -Infinity         NaN           NaN  F  F
84              NaN        -Infinity         NaN           NaN  F  F
85              NaN        -Infinity         NaN           NaN  F  F
86              NaN        -Infinity         NaN           NaN  F  F
87              NaN        -Infinity         NaN           NaN  F  F
88              NaN        -Infinity         NaN           NaN  F  F
89              NaN        -Infinity         NaN           NaN  F  F
90              NaN        -Infinity         NaN           NaN  F  F
91              NaN        -Infinity         NaN           NaN  F  F
92              NaN        -Infinity         NaN           NaN  F  F
93              NaN        -Infinity         NaN           NaN  F  F
94              NaN        -Infinity         NaN           NaN  F  F
95              NaN        -Infinity         NaN           NaN  F  F
96              NaN        -Infinity         NaN           NaN  F  F
97              NaN        -Infinity         NaN           NaN  F  F
98              NaN        -Infinity         NaN           NaN  F  F
99              NaN        -Infinity         NaN           NaN  F  F
**              NaN        -Infinity         NaN           NaN  F  F
 YN for X =    2.0000000      -- Epsilon =   1.19209290E-07
 0  0.510375679E+00  0.510375679E+00    0.00E+00  0.0000000000  T  T
 1 -0.107032441E+00 -0.107032441E+00    0.00E+00 -0.0000000000  T  T
 2 -0.617408097E+00 -0.617408097E+00    0.00E+00 -0.0000000000  T  T
 3 -0.112778378E+01 -0.112778378E+01    0.00E+00 -0.0000000000  T  T
 4 -0.276594329E+01 -0.276594329E+01    0.00E+00 -0.0000000000  T  T
 5 -0.993598938E+01 -0.993598938E+01    0.00E+00 -0.0000000000  T  T
 6 -0.469140053E+02 -0.469140053E+02    0.00E+00 -0.0000000000  T  T
 7 -0.271548035E+03 -0.271548035E+03    0.00E+00 -0.0000000000  T  T
 8 -0.185392212E+04 -0.185392212E+04    0.00E+00 -0.0000000000  T  T
 9 -0.145598291E+05 -0.145598291E+05    0.00E+00 -0.0000000000  T  T
10 -0.129184539E+06 -0.129184539E+06    0.00E+00 -0.0000000000  T  T
11 -0.127728550E+07 -0.127728550E+07    0.00E+00 -0.0000000000  T  T
12 -0.139209550E+08 -0.139209550E+08    0.00E+00 -0.0000000000  T  T
13 -0.165774176E+09 -0.165774176E+09    0.00E+00 -0.0000000000  T  T
14 -0.214114342E+10 -0.214114342E+10    0.00E+00 -0.0000000000  T  T
15 -0.298102354E+11 -0.298102354E+11    0.00E+00 -0.0000000000  T  T
16 -0.445012378E+12 -0.445012378E+12    0.00E+00 -0.0000000000  T  T
17 -0.709038755E+13 -0.709038755E+13    0.00E+00 -0.0000000000  T  T
18 -0.120091572E+15 -0.120091572E+15    0.00E+00 -0.0000000000  T  T
19 -0.215455786E+16 -0.215455786E+16    0.00E+00 -0.0000000000  T  T
20 -0.408165087E+17 -0.408165087E+17    0.00E+00 -0.0000000000  T  T
21 -0.814175647E+18 -0.814175647E+18    0.00E+00 -0.0000000000  T  T
22 -0.170568723E+20 -0.170568723E+20    0.00E+00 -0.0000000000  T  T
23 -0.374437014E+21 -0.374437014E+21    0.00E+00 -0.0000000000  T  T
24 -0.859499435E+22 -0.859499435E+22    0.00E+00 -0.0000000000  T  T
25 -0.205905440E+24 -0.205905440E+24    0.00E+00 -0.0000000000  T  T
26 -0.513904096E+25 -0.513904096E+25    0.00E+00 -0.0000000000  T  T
27 -0.133409159E+27 -0.133409159E+27    0.00E+00 -0.0000000000  T  T
28 -0.359690820E+28 -0.359690820E+28    0.00E+00 -0.0000000000  T  T
29 -0.100580021E+30 -0.100580021E+30    0.00E+00 -0.0000000000  T  T
30 -0.291322380E+31 -0.291322380E+31    0.00E+00 -0.0000000000  T  T
31 -0.872961272E+32 -0.872961272E+32    0.00E+00 -0.0000000000  T  T
32 -0.270326676E+34 -0.270326676E+34    0.00E+00 -0.0000000000  T  T
33 -0.864172368E+35 -0.864172368E+35    0.00E+00 -0.0000000000  T  T
34 -0.284906564E+37 -0.284906564E+37    0.00E+00 -0.0000000000  T  T
35 -0.967818173E+38 -0.967818173E+38    0.00E+00 -0.0000000000  T  T
36        -Infinity        -Infinity         NaN           NaN  F  F
37        -Infinity        -Infinity         NaN           NaN  F  F
38              NaN        -Infinity         NaN           NaN  F  F
39              NaN        -Infinity         NaN           NaN  F  F
40              NaN        -Infinity         NaN           NaN  F  F
41              NaN        -Infinity         NaN           NaN  F  F
42              NaN        -Infinity         NaN           NaN  F  F
43              NaN        -Infinity         NaN           NaN  F  F
44              NaN        -Infinity         NaN           NaN  F  F
45              NaN        -Infinity         NaN           NaN  F  F
46              NaN        -Infinity         NaN           NaN  F  F
47              NaN        -Infinity         NaN           NaN  F  F
48              NaN        -Infinity         NaN           NaN  F  F
49              NaN        -Infinity         NaN           NaN  F  F
50              NaN        -Infinity         NaN           NaN  F  F
51              NaN        -Infinity         NaN           NaN  F  F
52              NaN        -Infinity         NaN           NaN  F  F
53              NaN        -Infinity         NaN           NaN  F  F
54              NaN        -Infinity         NaN           NaN  F  F
55              NaN        -Infinity         NaN           NaN  F  F
56              NaN        -Infinity         NaN           NaN  F  F
57              NaN        -Infinity         NaN           NaN  F  F
58              NaN        -Infinity         NaN           NaN  F  F
59              NaN        -Infinity         NaN           NaN  F  F
60              NaN        -Infinity         NaN           NaN  F  F
61              NaN        -Infinity         NaN           NaN  F  F
62              NaN        -Infinity         NaN           NaN  F  F
63              NaN        -Infinity         NaN           NaN  F  F
64              NaN        -Infinity         NaN           NaN  F  F
65              NaN        -Infinity         NaN           NaN  F  F
66              NaN        -Infinity         NaN           NaN  F  F
67              NaN        -Infinity         NaN           NaN  F  F
68              NaN        -Infinity         NaN           NaN  F  F
69              NaN        -Infinity         NaN           NaN  F  F
70              NaN        -Infinity         NaN           NaN  F  F
71              NaN        -Infinity         NaN           NaN  F  F
72              NaN        -Infinity         NaN           NaN  F  F
73              NaN        -Infinity         NaN           NaN  F  F
74              NaN        -Infinity         NaN           NaN  F  F
75              NaN        -Infinity         NaN           NaN  F  F
76              NaN        -Infinity         NaN           NaN  F  F
77              NaN        -Infinity         NaN           NaN  F  F
78              NaN        -Infinity         NaN           NaN  F  F
79              NaN        -Infinity         NaN           NaN  F  F
80              NaN        -Infinity         NaN           NaN  F  F
81              NaN        -Infinity         NaN           NaN  F  F
82              NaN        -Infinity         NaN           NaN  F  F
83              NaN        -Infinity         NaN           NaN  F  F
84              NaN        -Infinity         NaN           NaN  F  F
85              NaN        -Infinity         NaN           NaN  F  F
86              NaN        -Infinity         NaN           NaN  F  F
87              NaN        -Infinity         NaN           NaN  F  F
88              NaN        -Infinity         NaN           NaN  F  F
89              NaN        -Infinity         NaN           NaN  F  F
90              NaN        -Infinity         NaN           NaN  F  F
91              NaN        -Infinity         NaN           NaN  F  F
92              NaN        -Infinity         NaN           NaN  F  F
93              NaN        -Infinity         NaN           NaN  F  F
94              NaN        -Infinity         NaN           NaN  F  F
95              NaN        -Infinity         NaN           NaN  F  F
96              NaN        -Infinity         NaN           NaN  F  F
97              NaN        -Infinity         NaN           NaN  F  F
98              NaN        -Infinity         NaN           NaN  F  F
99              NaN        -Infinity         NaN           NaN  F  F
**              NaN        -Infinity         NaN           NaN  F  F
 YN for X =    3.0000000      -- Epsilon =   1.19209290E-07
 0  0.376850069E+00  0.376850069E+00    0.00E+00  0.0000000000  T  T
 1  0.324674398E+00  0.324674398E+00    0.00E+00  0.0000000000  T  T
 2 -0.160400465E+00 -0.160400465E+00    0.00E+00 -0.0000000000  T  T
 3 -0.538541675E+00 -0.538541675E+00    0.00E+00 -0.0000000000  T  T
 4 -0.916682899E+00 -0.916682899E+00    0.00E+00 -0.0000000000  T  T
 5 -0.190594614E+01 -0.190594614E+01    0.00E+00 -0.0000000000  T  T
 6 -0.543647146E+01 -0.543647099E+01   -0.48E-06  0.7357713580  T  T
 7 -0.198399391E+02 -0.198399372E+02   -0.19E-05  0.8064540625  T  T
 8 -0.871499176E+02 -0.871499023E+02   -0.15E-04  1.4687334299  F  T
 9 -0.444959625E+03 -0.444959564E+03   -0.61E-04  1.1506662369  F  T
10 -0.258260791E+04 -0.258260742E+04   -0.49E-03  1.5859937668  F  T
11 -0.167724277E+05 -0.167724238E+05   -0.39E-02  1.9536825418  F  T
12 -0.120415195E+06 -0.120415172E+06   -0.23E-01  1.6327507496  F  T
13 -0.946549125E+06 -0.946548938E+06   -0.19E+00  1.6616823673  F  T
14 -0.808301100E+07 -0.808300950E+07   -0.15E+01  1.5567109585  F  T
15 -0.744948880E+08 -0.744948640E+08   -0.24E+02  2.7025558949  F  T
16 -0.736865856E+09 -0.736865600E+09   -0.26E+03  2.9143481255  F  T
17 -0.778540749E+10 -0.778540493E+10   -0.26E+04  2.7583446503  F  T
18 -0.874977608E+11 -0.874977280E+11   -0.33E+05  3.1415421963  F  F
19 -0.104218768E+13 -0.104218729E+13   -0.39E+06  3.1650104523  F  F
20 -0.131135470E+14 -0.131135418E+14   -0.52E+07  3.3538191319  F  F
21 -0.173805113E+15 -0.173805029E+15   -0.84E+08  4.0487155914  F  F
22 -0.242015797E+16 -0.242015689E+16   -0.11E+10  3.7217402458  F  F
23 -0.353218475E+17 -0.353218304E+17   -0.17E+11  4.0800580978  F  F
24 -0.539181536E+18 -0.539181226E+18   -0.31E+12  4.8111314774  F  F
25 -0.859158276E+19 -0.859157781E+19   -0.49E+13  4.8309111595  F  F
26 -0.142653876E+21 -0.142653779E+21   -0.97E+14  5.6896929741  F  F
27 -0.246407586E+22 -0.246407417E+22   -0.17E+16  5.7494573593  F  F
28 -0.442107116E+23 -0.442106801E+23   -0.32E+17  5.9816389084  F  F
29 -0.822802608E+24 -0.822801887E+24   -0.72E+18  7.3463902473  F  F
30 -0.158633064E+26 -0.158632926E+26   -0.14E+20  7.3160586357  F  F
31 -0.316443343E+27 -0.316443048E+27   -0.30E+21  7.8240866661  F  F
32 -0.652396641E+28 -0.652395992E+28   -0.65E+22  8.3491172791  F  F
33 -0.138861508E+30 -0.138861366E+30   -0.14E+24  8.5583286285  F  F
34 -0.304842916E+31 -0.304842614E+31   -0.30E+25  8.3167467117  F  F
35 -0.689588696E+32 -0.689587971E+32   -0.73E+26  8.8236989975  F  F
36 -0.160599184E+34 -0.160599029E+34   -0.15E+28  8.0826950073  F  F
37 -0.384748447E+35 -0.384748100E+35   -0.35E+29  7.5573697090  F  F
38 -0.947440236E+36 -0.947439365E+36   -0.87E+30  7.7163219452  F  F
39 -0.239633450E+38 -0.239633221E+38   -0.23E+32  7.9875674248  F  F
40        -Infinity        -Infinity         NaN           NaN  F  F
41        -Infinity        -Infinity         NaN           NaN  F  F
42              NaN        -Infinity         NaN           NaN  F  F
43              NaN        -Infinity         NaN           NaN  F  F
44              NaN        -Infinity         NaN           NaN  F  F
45              NaN        -Infinity         NaN           NaN  F  F
46              NaN        -Infinity         NaN           NaN  F  F
47              NaN        -Infinity         NaN           NaN  F  F
48              NaN        -Infinity         NaN           NaN  F  F
49              NaN        -Infinity         NaN           NaN  F  F
50              NaN        -Infinity         NaN           NaN  F  F
51              NaN        -Infinity         NaN           NaN  F  F
52              NaN        -Infinity         NaN           NaN  F  F
53              NaN        -Infinity         NaN           NaN  F  F
54              NaN        -Infinity         NaN           NaN  F  F
55              NaN        -Infinity         NaN           NaN  F  F
56              NaN        -Infinity         NaN           NaN  F  F
57              NaN        -Infinity         NaN           NaN  F  F
58              NaN        -Infinity         NaN           NaN  F  F
59              NaN        -Infinity         NaN           NaN  F  F
60              NaN        -Infinity         NaN           NaN  F  F
61              NaN        -Infinity         NaN           NaN  F  F
62              NaN        -Infinity         NaN           NaN  F  F
63              NaN        -Infinity         NaN           NaN  F  F
64              NaN        -Infinity         NaN           NaN  F  F
65              NaN        -Infinity         NaN           NaN  F  F
66              NaN        -Infinity         NaN           NaN  F  F
67              NaN        -Infinity         NaN           NaN  F  F
68              NaN        -Infinity         NaN           NaN  F  F
69              NaN        -Infinity         NaN           NaN  F  F
70              NaN        -Infinity         NaN           NaN  F  F
71              NaN        -Infinity         NaN           NaN  F  F
72              NaN        -Infinity         NaN           NaN  F  F
73              NaN        -Infinity         NaN           NaN  F  F
74              NaN        -Infinity         NaN           NaN  F  F
75              NaN        -Infinity         NaN           NaN  F  F
76              NaN        -Infinity         NaN           NaN  F  F
77              NaN        -Infinity         NaN           NaN  F  F
78              NaN        -Infinity         NaN           NaN  F  F
79              NaN        -Infinity         NaN           NaN  F  F
80              NaN        -Infinity         NaN           NaN  F  F
81              NaN        -Infinity         NaN           NaN  F  F
82              NaN        -Infinity         NaN           NaN  F  F
83              NaN        -Infinity         NaN           NaN  F  F
84              NaN        -Infinity         NaN           NaN  F  F
85              NaN        -Infinity         NaN           NaN  F  F
86              NaN        -Infinity         NaN           NaN  F  F
87              NaN        -Infinity         NaN           NaN  F  F
88              NaN        -Infinity         NaN           NaN  F  F
89              NaN        -Infinity         NaN           NaN  F  F
90              NaN        -Infinity         NaN           NaN  F  F
91              NaN        -Infinity         NaN           NaN  F  F
92              NaN        -Infinity         NaN           NaN  F  F
93              NaN        -Infinity         NaN           NaN  F  F
94              NaN        -Infinity         NaN           NaN  F  F
95              NaN        -Infinity         NaN           NaN  F  F
96              NaN        -Infinity         NaN           NaN  F  F
97              NaN        -Infinity         NaN           NaN  F  F
98              NaN        -Infinity         NaN           NaN  F  F
99              NaN        -Infinity         NaN           NaN  F  F
**              NaN        -Infinity         NaN           NaN  F  F
 YN for X =    4.0000000      -- Epsilon =   1.19209290E-07
 0 -0.169407371E-01 -0.169407371E-01    0.00E+00 -0.0000000000  T  T
 1  0.397925735E+00  0.397925735E+00    0.00E+00  0.0000000000  T  T
 2  0.215903610E+00  0.215903610E+00    0.00E+00  0.0000000000  T  T
 3 -0.182022125E+00 -0.182022125E+00    0.00E+00 -0.0000000000  T  T
 4 -0.488936812E+00 -0.488936812E+00    0.00E+00 -0.0000000000  T  T
 5 -0.795851469E+00 -0.795851469E+00    0.00E+00 -0.0000000000  T  T
 6 -0.150069189E+01 -0.150069189E+01    0.00E+00 -0.0000000000  T  T
 7 -0.370622420E+01 -0.370622420E+01    0.00E+00 -0.0000000000  T  T
 8 -0.114710922E+02 -0.114710922E+02    0.00E+00 -0.0000000000  T  T
 9 -0.421781464E+02 -0.421781464E+02    0.00E+00 -0.0000000000  T  T
10 -0.178330566E+03 -0.178330566E+03    0.00E+00 -0.0000000000  T  T
11 -0.849474670E+03 -0.849474670E+03    0.00E+00 -0.0000000000  T  T
12 -0.449378027E+04 -0.449378027E+04    0.00E+00 -0.0000000000  T  T
13 -0.261132070E+05 -0.261132070E+05    0.00E+00 -0.0000000000  T  T
14 -0.165242062E+06 -0.165242062E+06    0.00E+00 -0.0000000000  T  T
15 -0.113058125E+07 -0.113058125E+07    0.00E+00 -0.0000000000  T  T
16 -0.831411700E+07 -0.831411700E+07    0.00E+00 -0.0000000000  T  T
17 -0.653823560E+08 -0.653823560E+08    0.00E+00 -0.0000000000  T  T
18 -0.547435904E+09 -0.547435904E+09    0.00E+00 -0.0000000000  T  T
19 -0.486154086E+10 -0.486154086E+10    0.00E+00 -0.0000000000  T  T
20 -0.456372019E+11 -0.456372019E+11    0.00E+00 -0.0000000000  T  T
21 -0.451510501E+12 -0.451510501E+12    0.00E+00 -0.0000000000  T  T
22 -0.469522291E+13 -0.469522291E+13    0.00E+00 -0.0000000000  T  T
23 -0.511959431E+14 -0.511959431E+14    0.00E+00 -0.0000000000  T  T
24 -0.584058107E+15 -0.584058107E+15    0.00E+00 -0.0000000000  T  T
25 -0.695750127E+16 -0.695750127E+16    0.00E+00 -0.0000000000  T  T
26 -0.863847116E+17 -0.863847116E+17    0.00E+00 -0.0000000000  T  T
27 -0.111604375E+19 -0.111604375E+19    0.00E+00 -0.0000000000  T  T
28 -0.149802060E+20 -0.149802060E+20    0.00E+00 -0.0000000000  T  T
29 -0.208606840E+21 -0.208606840E+21    0.00E+00 -0.0000000000  T  T
30 -0.300981896E+22 -0.300981896E+22    0.00E+00 -0.0000000000  T  T
31 -0.449386780E+23 -0.449386780E+23    0.00E+00 -0.0000000000  T  T
32 -0.693539643E+24 -0.693539643E+24    0.00E+00 -0.0000000000  T  T
33 -0.110516957E+26 -0.110516957E+26    0.00E+00 -0.0000000000  T  T
34 -0.181659440E+27 -0.181659440E+27    0.00E+00 -0.0000000000  T  T
35 -0.307715864E+28 -0.307715864E+28    0.00E+00 -0.0000000000  T  T
36 -0.536686184E+29 -0.536686184E+29    0.00E+00 -0.0000000000  T  T
37 -0.962957923E+30 -0.962957923E+30    0.00E+00 -0.0000000000  T  T
38 -0.177610522E+32 -0.177610522E+32    0.00E+00 -0.0000000000  T  T
39 -0.336497016E+33 -0.336497016E+33    0.00E+00 -0.0000000000  T  T
40 -0.654393055E+34 -0.654393055E+34    0.00E+00 -0.0000000000  T  T
41 -0.130542104E+36 -0.130542104E+36    0.00E+00 -0.0000000000  T  T
42 -0.266956917E+37 -0.266956917E+37    0.00E+00 -0.0000000000  T  T
43 -0.559304076E+38 -0.559304076E+38    0.00E+00 -0.0000000000  T  T
44        -Infinity        -Infinity         NaN           NaN  F  F
45        -Infinity        -Infinity         NaN           NaN  F  F
46              NaN        -Infinity         NaN           NaN  F  F
47              NaN        -Infinity         NaN           NaN  F  F
48              NaN        -Infinity         NaN           NaN  F  F
49              NaN        -Infinity         NaN           NaN  F  F
50              NaN        -Infinity         NaN           NaN  F  F
51              NaN        -Infinity         NaN           NaN  F  F
52              NaN        -Infinity         NaN           NaN  F  F
53              NaN        -Infinity         NaN           NaN  F  F
54              NaN        -Infinity         NaN           NaN  F  F
55              NaN        -Infinity         NaN           NaN  F  F
56              NaN        -Infinity         NaN           NaN  F  F
57              NaN        -Infinity         NaN           NaN  F  F
58              NaN        -Infinity         NaN           NaN  F  F
59              NaN        -Infinity         NaN           NaN  F  F
60              NaN        -Infinity         NaN           NaN  F  F
61              NaN        -Infinity         NaN           NaN  F  F
62              NaN        -Infinity         NaN           NaN  F  F
63              NaN        -Infinity         NaN           NaN  F  F
64              NaN        -Infinity         NaN           NaN  F  F
65              NaN        -Infinity         NaN           NaN  F  F
66              NaN        -Infinity         NaN           NaN  F  F
67              NaN        -Infinity         NaN           NaN  F  F
68              NaN        -Infinity         NaN           NaN  F  F
69              NaN        -Infinity         NaN           NaN  F  F
70              NaN        -Infinity         NaN           NaN  F  F
71              NaN        -Infinity         NaN           NaN  F  F
72              NaN        -Infinity         NaN           NaN  F  F
73              NaN        -Infinity         NaN           NaN  F  F
74              NaN        -Infinity         NaN           NaN  F  F
75              NaN        -Infinity         NaN           NaN  F  F
76              NaN        -Infinity         NaN           NaN  F  F
77              NaN        -Infinity         NaN           NaN  F  F
78              NaN        -Infinity         NaN           NaN  F  F
79              NaN        -Infinity         NaN           NaN  F  F
80              NaN        -Infinity         NaN           NaN  F  F
81              NaN        -Infinity         NaN           NaN  F  F
82              NaN        -Infinity         NaN           NaN  F  F
83              NaN        -Infinity         NaN           NaN  F  F
84              NaN        -Infinity         NaN           NaN  F  F
85              NaN        -Infinity         NaN           NaN  F  F
86              NaN        -Infinity         NaN           NaN  F  F
87              NaN        -Infinity         NaN           NaN  F  F
88              NaN        -Infinity         NaN           NaN  F  F
89              NaN        -Infinity         NaN           NaN  F  F
90              NaN        -Infinity         NaN           NaN  F  F
91              NaN        -Infinity         NaN           NaN  F  F
92              NaN        -Infinity         NaN           NaN  F  F
93              NaN        -Infinity         NaN           NaN  F  F
94              NaN        -Infinity         NaN           NaN  F  F
95              NaN        -Infinity         NaN           NaN  F  F
96              NaN        -Infinity         NaN           NaN  F  F
97              NaN        -Infinity         NaN           NaN  F  F
98              NaN        -Infinity         NaN           NaN  F  F
99              NaN        -Infinity         NaN           NaN  F  F
**              NaN        -Infinity         NaN           NaN  F  F
 YN for X =    4.2500000      -- Epsilon =   1.19209290E-07
 0 -0.111918867E+00 -0.111918867E+00    0.00E+00 -0.0000000000  T  T
 1  0.358568966E+00  0.358568966E+00    0.00E+00  0.0000000000  T  T
 2  0.280657202E+00  0.280657202E+00    0.00E+00  0.0000000000  T  T
 3 -0.944209993E-01 -0.944209993E-01    0.00E+00 -0.0000000000  T  T
 4 -0.413957447E+00 -0.413957447E+00    0.00E+00 -0.0000000000  T  T
 5 -0.684792995E+00 -0.684792995E+00    0.00E+00 -0.0000000000  T  T
 6 -0.119732022E+01 -0.119732022E+01    0.00E+00 -0.0000000000  T  T
 7 -0.269587588E+01 -0.269587588E+01    0.00E+00 -0.0000000000  T  T
 8 -0.768321228E+01 -0.768321228E+01    0.00E+00 -0.0000000000  T  T
 9 -0.262291603E+02 -0.262291603E+02    0.00E+00 -0.0000000000  T  T
10 -0.103404999E+03 -0.103404999E+03    0.00E+00 -0.0000000000  T  T
11 -0.460382629E+03 -0.460382629E+03    0.00E+00 -0.0000000000  T  T
12 -0.227975220E+04 -0.227975220E+04    0.00E+00 -0.0000000000  T  T
13 -0.124135127E+05 -0.124135127E+05    0.00E+00 -0.0000000000  T  T
14 -0.736617422E+05 -0.736617422E+05    0.00E+00 -0.0000000000  T  T
15 -0.472887406E+06 -0.472887406E+06    0.00E+00 -0.0000000000  T  T
16 -0.326436700E+07 -0.326436700E+07    0.00E+00 -0.0000000000  T  T
17 -0.241058760E+08 -0.241058760E+08    0.00E+00 -0.0000000000  T  T
18 -0.189582640E+09 -0.189582640E+09    0.00E+00 -0.0000000000  T  T
19 -0.158177075E+10 -0.158177075E+10    0.00E+00 -0.0000000000  T  T
20 -0.139533087E+11 -0.139533087E+11    0.00E+00 -0.0000000000  T  T
21 -0.129743495E+12 -0.129743495E+12    0.00E+00 -0.0000000000  T  T
22 -0.126821768E+13 -0.126821768E+13    0.00E+00 -0.0000000000  T  T
23 -0.130000397E+14 -0.130000397E+14    0.00E+00 -0.0000000000  T  T
24 -0.139438093E+15 -0.139438093E+15    0.00E+00 -0.0000000000  T  T
25 -0.156183023E+16 -0.156183023E+16    0.00E+00 -0.0000000000  T  T
26 -0.182350353E+17 -0.182350353E+17    0.00E+00 -0.0000000000  T  T
27 -0.221549205E+18 -0.221549205E+18    0.00E+00 -0.0000000000  T  T
28 -0.279674307E+19 -0.279674307E+19    0.00E+00 -0.0000000000  T  T
29 -0.366296537E+20 -0.366296537E+20    0.00E+00 -0.0000000000  T  T
30 -0.497090298E+21 -0.497090298E+21    0.00E+00 -0.0000000000  T  T
31 -0.698111591E+22 -0.698111591E+22    0.00E+00 -0.0000000000  T  T
32 -0.101345070E+24 -0.101345070E+24    0.00E+00 -0.0000000000  T  T
33 -0.151915639E+25 -0.151915639E+25    0.00E+00 -0.0000000000  T  T
34 -0.234902615E+26 -0.234902591E+26   -0.23E+19  0.8234396577  T  T
35 -0.374325020E+27 -0.374324983E+27   -0.37E+20  0.8267815113  T  T
36 -0.614186321E+28 -0.614186262E+28   -0.59E+21  0.8062309623  T  T
37 -0.103676071E+30 -0.103676062E+30   -0.94E+22  0.7641894817  T  T
38 -0.179904150E+31 -0.179904135E+31   -0.15E+24  0.7046255469  T  T
39 -0.320674199E+32 -0.320674174E+32   -0.24E+25  0.6324927211  T  T
40 -0.586732436E+33 -0.586732398E+33   -0.39E+26  0.5530946255  T  T
41 -0.110123085E+35 -0.110123073E+35   -0.12E+28  0.9429988265  T  T
42 -0.211886055E+36 -0.211886015E+36   -0.40E+29  1.5683287382  F  T
43 -0.417685295E+37 -0.417685232E+37   -0.63E+30  1.2729468346  F  T
44 -0.843079630E+38 -0.843079528E+38   -0.10E+32  1.0090457201  F  T
45        -Infinity        -Infinity         NaN           NaN  F  F
46        -Infinity        -Infinity         NaN           NaN  F  F
47              NaN        -Infinity         NaN           NaN  F  F
48              NaN        -Infinity         NaN           NaN  F  F
49              NaN        -Infinity         NaN           NaN  F  F
50              NaN        -Infinity         NaN           NaN  F  F
51              NaN        -Infinity         NaN           NaN  F  F
52              NaN        -Infinity         NaN           NaN  F  F
53              NaN        -Infinity         NaN           NaN  F  F
54              NaN        -Infinity         NaN           NaN  F  F
55              NaN        -Infinity         NaN           NaN  F  F
56              NaN        -Infinity         NaN           NaN  F  F
57              NaN        -Infinity         NaN           NaN  F  F
58              NaN        -Infinity         NaN           NaN  F  F
59              NaN        -Infinity         NaN           NaN  F  F
60              NaN        -Infinity         NaN           NaN  F  F
61              NaN        -Infinity         NaN           NaN  F  F
62              NaN        -Infinity         NaN           NaN  F  F
63              NaN        -Infinity         NaN           NaN  F  F
64              NaN        -Infinity         NaN           NaN  F  F
65              NaN        -Infinity         NaN           NaN  F  F
66              NaN        -Infinity         NaN           NaN  F  F
67              NaN        -Infinity         NaN           NaN  F  F
68              NaN        -Infinity         NaN           NaN  F  F
69              NaN        -Infinity         NaN           NaN  F  F
70              NaN        -Infinity         NaN           NaN  F  F
71              NaN        -Infinity         NaN           NaN  F  F
72              NaN        -Infinity         NaN           NaN  F  F
73              NaN        -Infinity         NaN           NaN  F  F
74              NaN        -Infinity         NaN           NaN  F  F
75              NaN        -Infinity         NaN           NaN  F  F
76              NaN        -Infinity         NaN           NaN  F  F
77              NaN        -Infinity         NaN           NaN  F  F
78              NaN        -Infinity         NaN           NaN  F  F
79              NaN        -Infinity         NaN           NaN  F  F
80              NaN        -Infinity         NaN           NaN  F  F
81              NaN        -Infinity         NaN           NaN  F  F
82              NaN        -Infinity         NaN           NaN  F  F
83              NaN        -Infinity         NaN           NaN  F  F
84              NaN        -Infinity         NaN           NaN  F  F
85              NaN        -Infinity         NaN           NaN  F  F
86              NaN        -Infinity         NaN           NaN  F  F
87              NaN        -Infinity         NaN           NaN  F  F
88              NaN        -Infinity         NaN           NaN  F  F
89              NaN        -Infinity         NaN           NaN  F  F
90              NaN        -Infinity         NaN           NaN  F  F
91              NaN        -Infinity         NaN           NaN  F  F
92              NaN        -Infinity         NaN           NaN  F  F
93              NaN        -Infinity         NaN           NaN  F  F
94              NaN        -Infinity         NaN           NaN  F  F
95              NaN        -Infinity         NaN           NaN  F  F
96              NaN        -Infinity         NaN           NaN  F  F
97              NaN        -Infinity         NaN           NaN  F  F
98              NaN        -Infinity         NaN           NaN  F  F
99              NaN        -Infinity         NaN           NaN  F  F
**              NaN        -Infinity         NaN           NaN  F  F
 YN for X =    8.0000000      -- Epsilon =   1.19209290E-07
 0  0.223521501E+00  0.223521501E+00    0.00E+00  0.0000000000  T  T
 1 -0.158060491E+00 -0.158060491E+00    0.00E+00 -0.0000000000  T  T
 2 -0.263036609E+00 -0.263036609E+00    0.00E+00 -0.0000000000  T  T
 3  0.265421867E-01  0.265421867E-01    0.00E+00  0.0000000000  T  T
 4  0.282943249E+00  0.282943249E+00    0.00E+00  0.0000000000  T  T
 5  0.256401062E+00  0.256401062E+00    0.00E+00  0.0000000000  T  T
 6  0.375580788E-01  0.375580788E-01    0.00E+00  0.0000000000  T  T
 7 -0.200063944E+00 -0.200063944E+00    0.00E+00 -0.0000000000  T  T
 8 -0.387669981E+00 -0.387669981E+00    0.00E+00 -0.0000000000  T  T
 9 -0.575276017E+00 -0.575276017E+00    0.00E+00 -0.0000000000  T  T
10 -0.906701028E+00 -0.906701028E+00    0.00E+00 -0.0000000000  T  T
11 -0.169147646E+01 -0.169147646E+01    0.00E+00 -0.0000000000  T  T
12 -0.374485922E+01 -0.374485922E+01    0.00E+00 -0.0000000000  T  T
13 -0.954310036E+01 -0.954310036E+01    0.00E+00 -0.0000000000  T  T
14 -0.272702160E+02 -0.272702160E+02    0.00E+00 -0.0000000000  T  T
15 -0.859026566E+02 -0.859026566E+02    0.00E+00 -0.0000000000  T  T
16 -0.294864746E+03 -0.294864746E+03    0.00E+00 -0.0000000000  T  T
17 -0.109355627E+04 -0.109355627E+04    0.00E+00 -0.0000000000  T  T
18 -0.435274951E+04 -0.435274951E+04    0.00E+00 -0.0000000000  T  T
19 -0.184938164E+05 -0.184938164E+05    0.00E+00 -0.0000000000  T  T
20 -0.834928750E+05 -0.834928750E+05    0.00E+00 -0.0000000000  T  T
21 -0.398970562E+06 -0.398970562E+06    0.00E+00 -0.0000000000  T  T
22 -0.201110262E+07 -0.201110262E+07    0.00E+00 -0.0000000000  T  T
23 -0.106620930E+08 -0.106620930E+08    0.00E+00 -0.0000000000  T  T
24 -0.592959320E+08 -0.592959320E+08    0.00E+00 -0.0000000000  T  T
25 -0.345113504E+09 -0.345113504E+09    0.00E+00 -0.0000000000  T  T
26 -0.209766362E+10 -0.209766362E+10    0.00E+00 -0.0000000000  T  T
27 -0.132897004E+11 -0.132897004E+11    0.00E+00 -0.0000000000  T  T
28 -0.876078203E+11 -0.876078203E+11    0.00E+00 -0.0000000000  T  T
29 -0.599965041E+12 -0.599965041E+12    0.00E+00 -0.0000000000  T  T
30 -0.426213874E+13 -0.426213874E+13    0.00E+00 -0.0000000000  T  T
31 -0.313660749E+14 -0.313660749E+14    0.00E+00 -0.0000000000  T  T
32 -0.238824945E+15 -0.238824945E+15    0.00E+00 -0.0000000000  T  T
33 -0.187923355E+16 -0.187923355E+16    0.00E+00 -0.0000000000  T  T
34 -0.152648517E+17 -0.152648517E+17    0.00E+00 -0.0000000000  T  T
35 -0.127872000E+18 -0.127872000E+18    0.00E+00 -0.0000000000  T  T
36 -0.110361514E+19 -0.110361514E+19    0.00E+00 -0.0000000000  T  T
37 -0.980466404E+19 -0.980466404E+19    0.00E+00 -0.0000000000  T  T
38 -0.895895268E+20 -0.895895268E+20    0.00E+00 -0.0000000000  T  T
39 -0.841295843E+21 -0.841295843E+21    0.00E+00 -0.0000000000  T  T
40 -0.811304501E+22 -0.811304501E+22    0.00E+00 -0.0000000000  T  T
41 -0.802891473E+23 -0.802891473E+23    0.00E+00 -0.0000000000  T  T
42 -0.814850692E+24 -0.814850692E+24    0.00E+00 -0.0000000000  T  T
43 -0.847564364E+25 -0.847564364E+25    0.00E+00 -0.0000000000  T  T
44 -0.902983249E+26 -0.902983249E+26    0.00E+00 -0.0000000000  T  T
45 -0.984805996E+27 -0.984805996E+27    0.00E+00 -0.0000000000  T  T
46 -0.109887685E+29 -0.109887685E+29    0.00E+00 -0.0000000000  T  T
47 -0.125386036E+30 -0.125386036E+30    0.00E+00 -0.0000000000  T  T
48 -0.146229703E+31 -0.146229703E+31    0.00E+00 -0.0000000000  T  T
49 -0.174221782E+32 -0.174221782E+32    0.00E+00 -0.0000000000  T  T
50 -0.211959378E+33 -0.211959378E+33    0.00E+00 -0.0000000000  T  T
51 -0.263207004E+34 -0.263207004E+34    0.00E+00 -0.0000000000  T  T
52 -0.333469331E+35 -0.333469331E+35    0.00E+00 -0.0000000000  T  T
53 -0.430878044E+36 -0.430878044E+36    0.00E+00 -0.0000000000  T  T
54 -0.567578704E+37 -0.567578704E+37    0.00E+00 -0.0000000000  T  T
55 -0.761922458E+38 -0.761922458E+38    0.00E+00 -0.0000000000  T  T
56        -Infinity        -Infinity         NaN           NaN  F  F
57        -Infinity        -Infinity         NaN           NaN  F  F
58              NaN        -Infinity         NaN           NaN  F  F
59              NaN        -Infinity         NaN           NaN  F  F
60              NaN        -Infinity         NaN           NaN  F  F
61              NaN        -Infinity         NaN           NaN  F  F
62              NaN        -Infinity         NaN           NaN  F  F
63              NaN        -Infinity         NaN           NaN  F  F
64              NaN        -Infinity         NaN           NaN  F  F
65              NaN        -Infinity         NaN           NaN  F  F
66              NaN        -Infinity         NaN           NaN  F  F
67              NaN        -Infinity         NaN           NaN  F  F
68              NaN        -Infinity         NaN           NaN  F  F
69              NaN        -Infinity         NaN           NaN  F  F
70              NaN        -Infinity         NaN           NaN  F  F
71              NaN        -Infinity         NaN           NaN  F  F
72              NaN        -Infinity         NaN           NaN  F  F
73              NaN        -Infinity         NaN           NaN  F  F
74              NaN        -Infinity         NaN           NaN  F  F
75              NaN        -Infinity         NaN           NaN  F  F
76              NaN        -Infinity         NaN           NaN  F  F
77              NaN        -Infinity         NaN           NaN  F  F
78              NaN        -Infinity         NaN           NaN  F  F
79              NaN        -Infinity         NaN           NaN  F  F
80              NaN        -Infinity         NaN           NaN  F  F
81              NaN        -Infinity         NaN           NaN  F  F
82              NaN        -Infinity         NaN           NaN  F  F
83              NaN        -Infinity         NaN           NaN  F  F
84              NaN        -Infinity         NaN           NaN  F  F
85              NaN        -Infinity         NaN           NaN  F  F
86              NaN        -Infinity         NaN           NaN  F  F
87              NaN        -Infinity         NaN           NaN  F  F
88              NaN        -Infinity         NaN           NaN  F  F
89              NaN        -Infinity         NaN           NaN  F  F
90              NaN        -Infinity         NaN           NaN  F  F
91              NaN        -Infinity         NaN           NaN  F  F
92              NaN        -Infinity         NaN           NaN  F  F
93              NaN        -Infinity         NaN           NaN  F  F
94              NaN        -Infinity         NaN           NaN  F  F
95              NaN        -Infinity         NaN           NaN  F  F
96              NaN        -Infinity         NaN           NaN  F  F
97              NaN        -Infinity         NaN           NaN  F  F
98              NaN        -Infinity         NaN           NaN  F  F
99              NaN        -Infinity         NaN           NaN  F  F
**              NaN        -Infinity         NaN           NaN  F  F
 YN for X =    34.529999      -- Epsilon =   1.19209290E-07
 0  0.989498049E-01  0.989498049E-01    0.00E+00  0.0000000000  T  T
 1  0.944138989E-01  0.944138989E-01    0.00E+00  0.0000000000  T  T
 2 -0.934812874E-01 -0.934812874E-01    0.00E+00 -0.0000000000  T  T
 3 -0.105242893E+00 -0.105242893E+00    0.00E+00 -0.0000000000  T  T
 4  0.751940757E-01  0.751940757E-01    0.00E+00  0.0000000000  T  T
 5  0.122664049E+00  0.122664049E+00    0.00E+00  0.0000000000  T  T
 6 -0.396701694E-01 -0.396701656E-01   -0.37E-08  0.7877455950  T  T
 7 -0.136450380E+00 -0.136450380E+00    0.00E+00 -0.0000000000  T  T
 8 -0.156528950E-01 -0.156528987E-01    0.37E-08 -1.9964357615  F  T
 9  0.129197374E+00  0.129197374E+00    0.00E+00  0.0000000000  T  T
10  0.830016583E-01  0.830016583E-01    0.00E+00  0.0000000000  T  T
11 -0.811222792E-01 -0.811222717E-01   -0.75E-08  0.7704418898  T  T
12 -0.134686857E+00 -0.134686857E+00    0.00E+00 -0.0000000000  T  T
13 -0.124915242E-01 -0.124915317E-01    0.75E-08 -5.0033926964  F  F
14  0.125281140E+00  0.125281125E+00    0.15E-07  0.9977559447  T  T
15  0.114080638E+00  0.114080630E+00    0.75E-08  0.5478580594  T  T
16 -0.261667669E-01 -0.261667594E-01   -0.75E-08  2.3885259628  F  T
17 -0.138330176E+00 -0.138330162E+00   -0.15E-07  0.9036350846  T  T
18 -0.110040188E+00 -0.110040180E+00   -0.75E-08  0.5679743290  T  T
19  0.236053914E-01  0.236053839E-01    0.75E-08  2.6477003098  F  T
20  0.136017740E+00  0.136017725E+00    0.15E-07  0.9189977646  T  T
21  0.133959323E+00  0.133959323E+00    0.00E+00  0.0000000000  T  T
22  0.269214958E-01  0.269215107E-01   -0.15E-07 -4.6431298256  F  F
23 -0.996544957E-01 -0.996544734E-01   -0.22E-07  1.8815007210  F  T
24 -0.159678712E+00 -0.159678712E+00    0.00E+00 -0.0000000000  T  T
25 -0.122314185E+00 -0.122314207E+00    0.22E-07 -1.5329375267  F  T
26 -0.174342245E-01 -0.174342543E-01    0.30E-07-14.3396110535  F  F
27  0.960593447E-01  0.960593224E-01    0.22E-07  1.9519183636  F  T
28  0.167657360E+00  0.167657346E+00    0.15E-07  0.7455682158  T  T
29  0.175843716E+00  0.175843716E+00    0.00E+00  0.0000000000  T  T
30  0.127707109E+00  0.127707124E+00   -0.15E-07 -0.9788022041  T  T
31  0.460626483E-01  0.460626781E-01   -0.30E-07 -5.4273910522  F  F
32 -0.449997783E-01 -0.449997336E-01   -0.45E-07  8.3333740234  F  F
33 -0.129467964E+00 -0.129467919E+00   -0.45E-07  2.8964693546  F  T
34 -0.202462897E+00 -0.202462852E+00   -0.45E-07  1.8521912098  F  T
35 -0.269242644E+00 -0.269242644E+00    0.00E+00 -0.0000000000  T  T
36 -0.343351901E+00 -0.343352020E+00    0.12E-06 -2.9124639034  F  T
37 -0.446695268E+00 -0.446695507E+00    0.24E-06 -4.4773254395  F  F
38 -0.613944650E+00 -0.613945067E+00    0.42E-06 -5.7008395195  F  F
39 -0.904587567E+00 -0.904588163E+00    0.60E-06 -5.5273809433  F  F
40 -0.142943299E+01 -0.142943406E+01    0.11E-05 -6.2962026596  F  F
41 -0.240715981E+01 -0.240716195E+01    0.21E-05 -7.4776921272  F  F
42 -0.428696156E+01 -0.428696632E+01    0.48E-05 -9.3306179047  F  F
43 -0.802159119E+01 -0.802160072E+01    0.95E-05 -9.9730834961  F  F
44 -0.156915159E+02 -0.156915359E+02    0.20E-04-10.7064228058  F  F
45 -0.319683723E+02 -0.319684124E+02    0.40E-04-10.5103883743  F  F
46 -0.676317902E+02 -0.676318741E+02    0.84E-04-10.4093055725  F  F
47 -0.148226379E+03 -0.148226578E+03    0.20E-03-11.2260723114  F  F
48 -0.335880493E+03 -0.335880981E+03    0.49E-03-12.1948137283  F  F
49 -0.785585632E+03 -0.785586792E+03    0.12E-02-12.3831186295  F  F
50 -0.189369934E+04 -0.189370227E+04    0.29E-02-12.9777727127  F  F
51 -0.469862939E+04 -0.469863672E+04    0.73E-02-13.0761537552  F  F
52 -0.119858311E+05 -0.119858516E+05    0.21E-01-14.3529472351  F  F
53 -0.314011797E+05 -0.314012344E+05    0.55E-01-14.6093873978  F  F
54 -0.844093359E+05 -0.844094844E+05    0.15E+00-14.7517328262  F  F
55 -0.232607156E+06 -0.232607578E+06    0.42E+00-15.2142524719  F  F
56 -0.656592375E+06 -0.656593500E+06    0.11E+01-14.3729724884  F  F
57 -0.189708738E+07 -0.189709038E+07    0.30E+01-13.2655057907  F  F
58 -0.560659800E+07 -0.560660700E+07    0.90E+01-13.4658260345  F  F
59 -0.169377040E+08 -0.169377320E+08    0.28E+02-13.8673477173  F  F
60 -0.522749280E+08 -0.522750160E+08    0.88E+02-14.1214447021  F  F
61 -0.164730176E+09 -0.164730448E+09    0.27E+03-13.8511438370  F  F
62 -0.529743104E+09 -0.529744000E+09    0.90E+03-14.1883726120  F  F
63 -0.173761971E+10 -0.173762278E+10    0.31E+04-14.8305196762  F  F
64 -0.581083238E+10 -0.581084314E+10    0.11E+05-15.5217542648  F  F
65 -0.198026813E+11 -0.198027162E+11    0.35E+05-14.7483959198  F  F
66 -0.687431434E+11 -0.687432663E+11    0.12E+06-14.9948358536  F  F
67 -0.242986058E+12 -0.242986500E+12    0.44E+06-15.2718706131  F  F
68 -0.874208821E+12 -0.874210460E+12    0.16E+07-15.7215242386  F  F
69 -0.320017636E+13 -0.320018265E+13    0.63E+07-16.4917659760  F  F
70 -0.119153759E+14 -0.119153990E+14    0.23E+08-16.2406997681  F  F
71 -0.451100667E+14 -0.451101548E+14    0.88E+08-16.3793106079  F  F
72 -0.173593737E+15 -0.173594072E+15    0.34E+09-16.2145805359  F  F
73 -0.678825621E+15 -0.678826896E+15    0.13E+10-15.7566967010  F  F
74 -0.269662179E+16 -0.269662716E+16    0.54E+10-16.7008953094  F  F
75 -0.108792402E+17 -0.108792617E+17    0.21E+11-16.5585079193  F  F
76 -0.445633265E+17 -0.445634210E+17    0.94E+11-17.7866783142  F  F
77 -0.185287157E+18 -0.185287569E+18    0.41E+12-18.6670494080  F  F
78 -0.781796954E+18 -0.781798741E+18    0.18E+13-19.1711921692  F  F
79 -0.334672345E+19 -0.334673143E+19    0.80E+13-19.9805717468  F  F
80 -0.145319109E+20 -0.145319450E+20    0.34E+14-19.6756324768  F  F
81 -0.639890918E+20 -0.639892458E+20    0.15E+15-20.1795654297  F  F
82 -0.285677539E+21 -0.285678260E+21    0.72E+15-21.1795864105  F  F
83 -0.129283441E+22 -0.129283779E+22    0.34E+16-21.9163398743  F  F
84 -0.592951302E+22 -0.592952822E+22    0.15E+17-21.5032653809  F  F
85 -0.275562291E+23 -0.275563011E+23    0.72E+17-21.9356174469  F  F
86 -0.129736843E+24 -0.129737176E+24    0.33E+18-21.5485515594  F  F
87 -0.618685782E+24 -0.618687367E+24    0.16E+19-21.4942455292  F  F
88 -0.298788053E+25 -0.298788831E+25    0.78E+19-21.8489303589  F  F
89 -0.146105938E+26 -0.146106307E+26    0.37E+20-21.1822338104  F  F
90 -0.723288211E+26 -0.723290010E+26    0.18E+21-20.8594493866  F  F
91 -0.362429342E+27 -0.362430227E+27    0.89E+21-20.4940376282  F  F
92 -0.183795625E+28 -0.183796068E+28    0.44E+22-20.2062492371  F  F
93 -0.943148732E+28 -0.943151093E+28    0.24E+23-21.0009727478  F  F
94 -0.489658875E+29 -0.489660103E+29    0.12E+24-21.0343608856  F  F
95 -0.257165288E+30 -0.257165930E+30    0.64E+24-20.9496192932  F  F
96 -0.136607635E+31 -0.136607968E+31    0.33E+25-20.4148998260  F  F
97 -0.733874188E+31 -0.733875940E+31    0.18E+26-20.0371494293  F  F
98 -0.398651993E+32 -0.398652985E+32    0.99E+26-20.8597679138  F  F
99 -0.218945054E+33 -0.218945596E+33    0.54E+27-20.7506847382  F  F
** -0.121559731E+34 -0.121560033E+34    0.30E+28-20.8230533600  F  F
 YN for X =    475.78000      -- Epsilon =   1.19209290E-07
 0 -0.210703555E-01 -0.210703555E-01    0.00E+00 -0.0000000000  T  T
 1  0.298792869E-01  0.298792869E-01    0.00E+00  0.0000000000  T  T
 2  0.211959574E-01  0.211959574E-01    0.00E+00  0.0000000000  T  T
 3 -0.297010876E-01 -0.297010876E-01    0.00E+00 -0.0000000000  T  T
 4 -0.215705149E-01 -0.215705149E-01    0.00E+00 -0.0000000000  T  T
 5  0.293383896E-01  0.293383896E-01    0.00E+00  0.0000000000  T  T
 6  0.221871529E-01  0.221871529E-01    0.00E+00  0.0000000000  T  T
 7 -0.287787914E-01 -0.287787914E-01    0.00E+00 -0.0000000000  T  T
 8 -0.230339803E-01 -0.230339784E-01   -0.19E-08  0.6783456206  T  T
 9  0.280041825E-01  0.280041825E-01    0.00E+00  0.0000000000  T  T
10  0.240934510E-01  0.240934491E-01    0.19E-08  0.6485164762  T  T
11 -0.269913841E-01 -0.269913841E-01    0.00E+00 -0.0000000000  T  T
12 -0.253415294E-01 -0.253415275E-01   -0.19E-08  0.6165768504  T  T
13  0.257130694E-01  0.257130694E-01    0.00E+00  0.0000000000  T  T
14  0.267466735E-01  0.267466716E-01    0.19E-08  0.5841848254  T  T
15 -0.241390076E-01 -0.241390076E-01    0.00E+00 -0.0000000000  T  T
16 -0.282687433E-01 -0.282687414E-01   -0.19E-08  0.5527306199  T  T
17  0.222377088E-01  0.222377088E-01    0.00E+00  0.0000000000  T  T
18  0.298578851E-01  0.298578832E-01    0.19E-08  0.5233123302  T  T
19 -0.199785046E-01 -0.199785046E-01    0.00E+00 -0.0000000000  T  T
20 -0.314535461E-01 -0.314535424E-01   -0.37E-08  0.9935286641  T  T
21  0.173341278E-01  0.173341278E-01    0.00E+00  0.0000000000  T  T
22  0.329837352E-01  0.329837315E-01    0.37E-08  0.9474366903  T  T
23 -0.142838014E-01 -0.142838014E-01    0.00E+00 -0.0000000000  T  T
24 -0.343647413E-01 -0.343647376E-01   -0.37E-08  0.9093623161  T  T
25  0.108168470E-01  0.108168479E-01   -0.93E-09 -0.7222529650  T  T
26  0.355014913E-01  0.355014876E-01    0.37E-08  0.8802447319  T  T
27 -0.693673920E-02 -0.693674106E-02    0.19E-08 -2.2524993420  F  T
28 -0.362887979E-01 -0.362887941E-01   -0.37E-08  0.8611472845  T  T
29  0.266549457E-02  0.266549736E-02   -0.28E-08 -8.7929277420  F  F
30  0.366137363E-01  0.366137326E-01    0.37E-08  0.8535048366  T  T
31  0.195181649E-02  0.195181323E-02    0.33E-08 14.0093860626  F  F
32 -0.363593921E-01 -0.363593884E-01   -0.37E-08  0.8594753146  T  T
33 -0.684273476E-02 -0.684273103E-02   -0.37E-08  4.5668873787  F  F
34  0.354101695E-01  0.354101658E-01    0.37E-08  0.8825148344  T  T
35  0.119036697E-01  0.119036660E-01    0.37E-08  2.6252408028  F  T
36 -0.336588211E-01 -0.336588174E-01   -0.37E-08  0.9284341931  T  T
37 -0.169972740E-01 -0.169972703E-01   -0.37E-08  1.8385300636  F  T
38  0.310151652E-01  0.310151633E-01    0.19E-08  0.5037857890  T  T
39  0.219515655E-01  0.219515599E-01    0.56E-08  2.1353828907  F  T
40 -0.274163969E-01 -0.274163950E-01   -0.19E-08  0.5699144006  T  T
41 -0.265614949E-01 -0.265614875E-01   -0.75E-08  2.3530302048  F  T
42  0.228385609E-01  0.228385609E-01    0.00E+00  0.0000000000  T  T
43  0.305936933E-01  0.305936858E-01    0.75E-08  2.0429046154  F  T
44 -0.173085742E-01 -0.173085742E-01    0.00E+00 -0.0000000000  T  T
45 -0.337950774E-01 -0.337950699E-01   -0.75E-08  1.8493818045  F  T
46  0.109157935E-01  0.109157953E-01   -0.19E-08 -1.4314122200  F  T
47  0.359058268E-01  0.359058194E-01    0.75E-08  1.7406646013  F  T
48 -0.382186798E-02 -0.382187171E-02    0.37E-08 -8.1766300201  F  F
49 -0.366769806E-01 -0.366769731E-01   -0.75E-08  1.7040661573  F  T
50 -0.373276696E-02 -0.373276183E-02   -0.51E-08 11.5112333298  F  F
51  0.358924232E-01  0.358924158E-01    0.75E-08  1.7413145304  F  T
52  0.114275571E-01  0.114275496E-01    0.75E-08  5.4692354202  F  F
53 -0.333944932E-01 -0.333944857E-01   -0.75E-08  1.8715660572  F  T
54 -0.188675858E-01 -0.188675746E-01   -0.11E-07  4.9688391685  F  F
55  0.291116331E-01  0.291116275E-01    0.56E-08  1.6101810932  F  T
56  0.255981758E-01  0.255981628E-01    0.13E-07  4.2727656364  F  F
57 -0.230857469E-01 -0.230857451E-01   -0.19E-08  0.6768245101  T  T
58 -0.311296713E-01 -0.311296582E-01   -0.13E-07  3.5135288239  F  F
59  0.154960165E-01  0.154960174E-01   -0.93E-09 -0.5041618347  T  T
60  0.349728987E-01  0.349728838E-01    0.15E-07  3.5741961002  F  F
61 -0.667524245E-02 -0.667524710E-02    0.47E-08 -5.8518471718  F  F
62 -0.366845727E-01 -0.366845578E-01   -0.15E-07  3.4074268341  F  F
63 -0.288566202E-02 -0.288565271E-02   -0.93E-08 27.0735092163  F  F
64  0.359203666E-01  0.359203555E-01    0.11E-07  2.6099400520  F  T
65  0.125493873E-01  0.125493743E-01    0.13E-07  8.7155647278  F  F
66 -0.324914269E-01 -0.324914195E-01   -0.75E-08  1.9235843420  F  T
67 -0.215637814E-01 -0.215637647E-01   -0.17E-07  6.5213518143  F  F
68  0.264181439E-01  0.264181420E-01    0.19E-08  0.5914495587  T  T
69  0.291153137E-01  0.291152969E-01    0.17E-07  4.8299326897  F  F
70 -0.179732461E-01 -0.179732479E-01    0.19E-08 -0.8693476915  T  T
71 -0.344040059E-01 -0.344039910E-01   -0.15E-07  3.6332979202  F  F
72  0.770512037E-02  0.770512689E-02   -0.65E-08 -7.0975527763  F  F
73  0.367360450E-01  0.367360301E-01    0.15E-07  3.4026527405  F  F
74  0.356786884E-02  0.356785767E-02    0.11E-07 26.2761898041  F  F
75 -0.356261954E-01 -0.356261842E-01   -0.11E-07  2.6314907074  F  T
76 -0.147998026E-01 -0.147997877E-01   -0.15E-07  8.4460582733  F  F
77  0.308980234E-01  0.308980159E-01    0.75E-08  2.0227830410  F  T
78  0.248008445E-01  0.248008259E-01    0.19E-07  6.3001885414  F  F
79 -0.227662567E-01 -0.227662548E-01   -0.19E-08  0.6863227487  T  T
80 -0.323612057E-01 -0.323611870E-01   -0.19E-07  4.8283119202  F  F
81  0.118835103E-01  0.118835149E-01   -0.47E-08 -3.2871179581  F  F
82  0.364074633E-01  0.364074484E-01    0.15E-07  3.4333620071  F  F
83  0.666038133E-03  0.666027889E-03    0.10E-07129.0278930664  F  F
84 -0.361750834E-01 -0.361750722E-01   -0.11E-07  2.5915627480  F  T
85 -0.134396190E-01 -0.134396041E-01   -0.15E-07  9.3008584976  F  F
86  0.313730016E-01  0.313729942E-01    0.75E-08  1.9921587706  F  T
87  0.247813240E-01  0.247813053E-01    0.19E-07  6.3051514626  F  F
88 -0.223100930E-01 -0.223100930E-01    0.00E+00 -0.0000000000  T  T
89 -0.330342501E-01 -0.330342278E-01   -0.22E-07  5.6759271622  F  F
90  0.995123666E-02  0.995124504E-02   -0.84E-08 -7.0657048225  F  F
91  0.367990620E-01  0.367990434E-01    0.19E-07  4.2460322380  F  F
92  0.412549917E-02  0.412548333E-02    0.16E-07 32.1930732727  F  F
93 -0.352035947E-01 -0.352035798E-01   -0.15E-07  3.5507738590  F  F
94 -0.178878866E-01 -0.178878643E-01   -0.22E-07 10.4819536209  F  F
95  0.281353630E-01  0.281353574E-01    0.56E-08  1.6660528183  F  T
96  0.291235819E-01  0.291235559E-01    0.26E-07  7.5110955238  F  F
97 -0.163826030E-01 -0.163826086E-01    0.56E-08 -2.8612668514  F  T
98 -0.358036123E-01 -0.358035900E-01   -0.22E-07  5.2369017601  F  F
99  0.163312163E-02  0.163313653E-02   -0.15E-07-76.5405349731  F  F
**  0.364832506E-01  0.364832357E-01    0.15E-07  3.4262297153  F  F

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-20  3:36     ` Steve Kargl
@ 2010-08-20  7:17       ` Tobias Burnus
  2010-08-20  9:45         ` Tobias Burnus
  2010-08-20 20:14         ` Steve Kargl
  0 siblings, 2 replies; 18+ messages in thread
From: Tobias Burnus @ 2010-08-20  7:17 UTC (permalink / raw)
  To: Steve Kargl; +Cc: Tobias Burnus, gcc-patches, fortran

  Steve Kargl wrote:
> There may be a method to improve the values computed, but it
> would substantially increase the computation.  Instead of
> recursing on the actually estimates of the bessel function,
> we could recurse on the significands by careful bookkeeping
> of the exponents (which may require an additional array), e.g.,
>
[...]

I essentially do not use Bessel functions - and the few times I did only 
for few N. I think gfortran's transformational function should use 
something faster than doing N2-N1+1 calls to a full JN/YN function - but 
if N2-N1+1 is a large number, currently the accuracy seems to be too low.

As you regularly seem to use Bessel functions (though mostly spherical 
ones?), would you be satisfied by the current implementation in 
gfortran? Or would you use the book keeping version, which is in terms 
of performance between the current recurrence version and the calling 
the library function every time? What are typical (larger) values for 
N2-N1+1? Is this more likely 5 or 10 or 20 or 1000?

I think the goal should be to have a version which is sufficiently 
robust to be usable while at the same time being faster than calling the 
elemental function N2-N1+1 times.

As you are a heavy user of Bessel functions, I would like if you could 
decide on the algorithm - thus, what do you suggest?

Tobias

PS: As Steve has already found out: PR 36158 contains a run-time 
implementation of the transformational BESSEL_JN/YN(N1, N2, X). Note: I 
would like to use the same algorithm for both the library and the 
simply.c version.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-19  7:36   ` Tobias Burnus
  2010-08-19  7:38     ` Tobias Burnus
@ 2010-08-20  3:36     ` Steve Kargl
  2010-08-20  7:17       ` Tobias Burnus
  1 sibling, 1 reply; 18+ messages in thread
From: Steve Kargl @ 2010-08-20  3:36 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: Tobias Burnus, gcc-patches, fortran

On Thu, Aug 19, 2010 at 09:30:10AM +0200, Tobias Burnus wrote:
>  On 08/19/2010 05:34 AM, Steve Kargl wrote:
> >I read your patch and it appears to be correct,
> >except that 2.0 in mpfr_ui_div should probably
> >be an integer 2.
> 
> Fixed. I also added a link to DLMF for the recurrence algorithm.
> 
> >I haven't had time to investigate your program and
> >findings, but I have no reason to suspect that your
> >results are flawed.  I am somewhat puzzled by them.
> >After all the work you did, I hesitate to suggest
> >that I would rather have gfortran produce correct
> >results slowly (ie, n2 - n1 + 1 calls to mpfr_{jn,yn})
> >than to get possibly wrong results fast via
> >recurrence algorithm.  If you want to change back
> >to your original algorithm that's fine with me;
> >otherwise, the current patch can be committed and
> >I'll see if I can find time to poke at it.
> 
> I have committed the version with the recurrence algorithm but added a 
> note to intrinsics.texi that the transformational version uses a 
> recurrence algorithm which might lead to different results than invoking 
> the elemental function. From what I have heard from the J3/WG5 committee 
> the transformational version has been added explicitly because it allows 
> the implementation of the recurrence algorithm. Thus, it makes sense to 
> use it.
> 
> The next step is to add an implementation for run-time evaluation, which 
> will also use the recurrence algorithm - thus the mpfr and the run-time 
> version will give the same result, which is useful by itself.
> 
> I think it were be useful if you could find time to poke at it. One 
> could also consider using the algorithm for JN but not for YN - but 
> first one should do more checks to make sure that I haven't just been 
> lucky that JN worked so well.
> 

I compared the gfortran results against my math library.  I think
you're see that your algorithm is using a more accurate approximation
for the initial two functions in the recursion algorithm.  Note
my math library routines use y0[f], y1[f], and jn[f] from libm
to initialize the recursion and thus issues in libm may potentially
affect my results.   When we observe a large relative error, I think
the algorithm may be hitting a castastrophic cancelation issue (ie,
subtraction of nearly equal large number). 

There may be a method to improve the values computed, but it
would substantially increase the computation.  Instead of 
recursing on the actually estimates of the bessel function,
we could recurse on the significands by careful bookkeeping
of the exponents (which may require an additional array), e.g.,

Let jnm1 = j(n-1), jn = j(n), and jnp1 = j(n+1):

jnm1 = (2n/x) * jn - jnp1
     = (2n/x) * fn * 2**en - fnp1 * 2**enp1

Assume en > enp1, then

     = 2**en * ((2n/x) * fn - fnp1 * 2**(enp1-en))

and due to the recursion |enp1 - en| is normally small  
so

fnm1 = (2n/x) * fn - fnp1 * 2**(enp1-en)

I used this to compute fairly large sequence, ie., n1 = 0
and n2 = 15000 to 20000 for spherical bessel functions.
I haven't proved that it avoids catastrophic cancellation
issues, it does allow long sequence that otherwise would 
be +-Inf or NaN.

Here are some numbers from my comparison.  The first column is
the gfortran result for bessel_jn(0,20,X) where X = 1., 2., and
10.  The 2nd column is my single precision result and the
third column is my double precision result.  The last two columns
are the relative errors, measured in epsilons, in comparison to
my SP and DP results, respectively.  The last line in each
group is the result from bessel_jn(20,X), ie., the MPFR value
from the constant folding and the relative error.

j(1.)
 0    7.651976E-01   7.651977E-01   7.65197687E-01   0.65   0.57
 1    4.400505E-01   4.400506E-01   4.40050586E-01   1.14   0.83
 2    1.149035E-01   1.149035E-01   1.14903485E-01   1.09   0.92
 3    1.956335E-02   1.956335E-02   1.95633540E-02   0.80   0.55
 4    2.476639E-03   2.476639E-03   2.47663896E-03   0.00   0.28
 5    2.497577E-04   2.497577E-04   2.49757730E-04   0.00   0.26
 6    2.093834E-05   2.093834E-05   2.09383380E-05   0.00   0.04
 7    1.502326E-06   1.502326E-06   1.50232582E-06   0.00   0.23
 8    9.422345E-08   9.422345E-08   9.42234417E-08   0.00   0.30
 9    5.249250E-09   5.249250E-09   5.24925018E-09   0.00   0.30
10    2.630615E-10   2.630615E-10   2.63061512E-10   0.00   0.15
11    1.198007E-11   1.198007E-11   1.19800675E-11   0.00   0.25
12    4.999718E-13   4.999718E-13   4.99971818E-13   0.00   0.15
13    1.925617E-14   1.925617E-14   1.92561676E-14   0.74   0.80
14    6.885407E-16   6.885408E-16   6.88540820E-16   0.64   0.88
15    2.297531E-17   2.297532E-17   2.29753153E-17   0.60   0.58
16    7.186396E-19   7.186397E-19   7.18639659E-19   0.60   0.37
17    2.115375E-20   2.115376E-20   2.11537557E-20   0.64   0.36
18    5.880344E-22   5.880344E-22   5.88034457E-22   0.00   0.28
19    1.548478E-23   1.548478E-23   1.54847844E-23   0.00   0.11
20    3.873503E-25   3.873503E-25   3.87350301E-25   0.00   0.04
      3.873503E-25   0.00

j(2.)
 0    2.238908E-01   2.238908E-01   2.23890779E-01   1.67   1.03
 1    5.767247E-01   5.767248E-01   5.76724808E-01   1.73   1.45
 2    3.528340E-01   3.528340E-01   3.52834029E-01   2.13   1.72
 3    1.289432E-01   1.289433E-01   1.28943249E-01   2.91   1.93
 4    3.399571E-02   3.399572E-02   3.39957198E-02   2.76   2.34
 5    7.039628E-03   7.039630E-03   7.03962976E-03   2.22   1.55
 6    1.202429E-03   1.202429E-03   1.20242897E-03   2.44   1.80
 7    1.749440E-04   1.749441E-04   1.74944075E-04   2.09   1.59
 8    2.217955E-05   2.217955E-05   2.21795523E-05   2.06   1.25
 9    2.492343E-06   2.492344E-06   2.49234344E-06   1.53   1.03
10    2.515386E-07   2.515386E-07   2.51538628E-07   0.95   0.66
11    2.304285E-08   2.304285E-08   2.30428476E-08   0.65   0.02
12    1.932695E-09   1.932695E-09   1.93269515E-09   0.96   0.15
13    1.494942E-10   1.494942E-10   1.49494201E-10   0.78   0.35
14    1.072946E-11   1.072947E-11   1.07294645E-11   0.68   0.22
15    7.183016E-13   7.183017E-13   7.18301636E-13   0.63   0.28
16    4.506006E-14   4.506006E-14   4.50600590E-14   0.63   0.01
17    2.659308E-15   2.659308E-15   2.65930781E-15   0.67   0.03
18    1.481737E-16   1.481737E-16   1.48173725E-16   0.75   0.09
19    7.819243E-18   7.819244E-18   7.81924327E-18   0.89   0.07
20    3.918973E-19   3.918973E-19   3.91897281E-19   0.55   0.16
      3.918973E-19   0.00

j(10.)
 0   -2.459358E-01  -2.459358E-01  -2.45935764E-01   2.03   2.15
 1    4.347282E-02   4.347274E-02   4.34727462E-02  14.38  14.06
 2    2.546304E-01   2.546303E-01   2.54630314E-01   2.95   2.41
 3    5.837934E-02   5.837938E-02   5.83793793E-02   6.42   6.05
 4   -2.196028E-01  -2.196027E-01  -2.19602686E-01   3.98   4.10
 5   -2.340616E-01  -2.340615E-01  -2.34061528E-01   1.07   1.46
 6   -1.445878E-02  -1.445884E-02  -1.44588421E-02  38.90  38.62
 7    2.167110E-01   2.167109E-01   2.16710918E-01   4.61   4.90
 8    3.178542E-01   3.178541E-01   3.17854127E-01   2.36   2.61
 9    2.918558E-01   2.918557E-01   2.91855685E-01   1.71   1.93
10    2.074862E-01   2.074861E-01   2.07486107E-01   1.81   1.86
11    1.231165E-01   1.231165E-01   1.23116528E-01   1.02   1.18
12    6.337026E-02   6.337025E-02   6.33702550E-02   0.99   0.35
13    2.897208E-02   2.897208E-02   2.89720839E-02   0.54   0.60
14    1.195716E-02   1.195716E-02   1.19571632E-02   0.00   0.17
15    4.507973E-03   4.507973E-03   4.50797314E-03   0.87   0.34
16    1.566756E-03   1.566756E-03   1.56675619E-03   0.62   0.49
17    5.056467E-04   5.056466E-04   5.05646670E-04   0.97   0.35
18    1.524425E-04   1.524425E-04   1.52442485E-04   0.80   0.66
19    4.314628E-05   4.314628E-05   4.31462775E-05   0.00   0.32
20    1.151337E-05   1.151337E-05   1.15133692E-05   0.00   0.24
      1.151337E-05   0.00

y(1.)
 0    8.825696E-02   8.825696E-02   8.82569642E-02   0.00   0.15
 1   -7.812128E-01  -7.812128E-01  -7.81212821E-01   0.00   0.16
 2   -1.650683E+00  -1.650683E+00  -1.65068261E+00   0.00   0.19
 3   -5.821517E+00  -5.821517E+00  -5.82151761E+00   0.00   0.20
 4   -3.327842E+01  -3.327842E+01  -3.32784230E+01   0.96   0.89
 5   -2.604059E+02  -2.604059E+02  -2.60405867E+02   0.98   0.43
 6   -2.570780E+03  -2.570781E+03  -2.57078024E+03   0.80   0.10
 7   -3.058896E+04  -3.058896E+04  -3.05889571E+04   1.07   0.01
 8   -4.256746E+05  -4.256747E+05  -4.25674618E+05   1.23   0.13
 9   -6.780205E+06  -6.780206E+06  -6.78020494E+06   1.24   0.08
10   -1.216180E+08  -1.216180E+08  -1.21618014E+08   1.10   0.12
11   -2.425580E+09  -2.425581E+09  -2.42558008E+09   0.89   0.72
12   -5.324115E+10  -5.324116E+10  -5.32411438E+10   1.29   0.57
13   -1.275362E+12  -1.275362E+12  -1.27536187E+12   1.72   0.11
14   -3.310617E+13  -3.310617E+13  -3.31061675E+13   1.59   0.10
15   -9.256974E+14  -9.256975E+14  -9.25697328E+14   1.22   0.55
16   -2.773782E+16  -2.773782E+16  -2.77378137E+16   1.30   0.64
17   -8.866844E+17  -8.866845E+17  -8.86684340E+17   1.30   0.42
18   -3.011953E+19  -3.011954E+19  -3.01195297E+19   1.22   0.39
19   -1.083416E+21  -1.083417E+21  -1.08341639E+21   1.63   0.08
20   -4.113970E+22  -4.113971E+22  -4.11397031E+22   1.84   0.12
     -4.113970E+22   0.00

y(2.)
 0    5.103757E-01   5.103757E-01   5.10375673E-01   0.00   0.10
 1   -1.070324E-01  -1.070324E-01  -1.07032432E-01   0.58   0.13
 2   -6.174081E-01  -6.174081E-01  -6.17408104E-01   0.00   0.10
 3   -1.127784E+00  -1.127784E+00  -1.12778378E+00   0.00   0.01
 4   -2.765943E+00  -2.765943E+00  -2.76594323E+00   0.00   0.19
 5   -9.935989E+00  -9.935989E+00  -9.93598913E+00   0.00   0.21
 6   -4.691401E+01  -4.691401E+01  -4.69140024E+01   0.00   0.51
 7   -2.715480E+02  -2.715480E+02  -2.71548025E+02   0.00   0.29
 8   -1.853922E+03  -1.853922E+03  -1.85392218E+03   0.55   0.25
 9   -1.455983E+04  -1.455983E+04  -1.45598294E+04   0.56   0.16
10   -1.291845E+05  -1.291845E+05  -1.29184542E+05   0.51   0.20
11   -1.277286E+06  -1.277286E+06  -1.27728559E+06   0.82   0.61
12   -1.392096E+07  -1.392096E+07  -1.39209570E+07   1.21   1.19
13   -1.657742E+08  -1.657742E+08  -1.65774198E+08   0.81   1.12
14   -2.141143E+09  -2.141144E+09  -2.14114362E+09   0.50   0.76
15   -2.981024E+10  -2.981024E+10  -2.98102365E+10   0.00   0.30
16   -4.450124E+11  -4.450124E+11  -4.45012403E+11   0.00   0.49
17   -7.090388E+12  -7.090388E+12  -7.09038822E+12   0.00   0.79
18   -1.200916E+14  -1.200916E+14  -1.20091587E+14   0.00   1.06
19   -2.154558E+15  -2.154558E+15  -2.15455818E+15   0.00   1.25
20   -4.081651E+16  -4.081651E+16  -4.08165139E+16   0.00   1.06
     -4.081651E+16   0.88

y(10.)
 0    5.567117E-02   5.567117E-02   5.56711673E-02   0.56   0.10
 1    2.490154E-01   2.490154E-01   2.49015424E-01   0.50   0.12
 2   -5.868081E-03  -5.868082E-03  -5.86808244E-03   2.00   2.06
 3   -2.513627E-01  -2.513627E-01  -2.51362657E-01   0.99   0.19
 4   -1.449495E-01  -1.449495E-01  -1.44949512E-01   0.00   0.79
 5    1.354030E-01   1.354031E-01   1.35403048E-01   0.92   0.66
 6    2.803526E-01   2.803526E-01   2.80352560E-01   0.89   0.09
 7    2.010201E-01   2.010201E-01   2.01020024E-01   0.00   1.59
 8    1.075506E-03   1.075499E-03   1.07547373E-03  59.93 253.31
 9   -1.992992E-01  -1.992993E-01  -1.99299266E-01   0.63   0.83
10   -3.598142E-01  -3.598142E-01  -3.59814152E-01   0.00   0.35
11   -5.203291E-01  -5.203291E-01  -5.20329039E-01   0.96   1.28
12   -7.849100E-01  -7.849098E-01  -7.84909733E-01   1.91   2.47
13   -1.363455E+00  -1.363454E+00  -1.36345432E+00   2.20   3.07
14   -2.760073E+00  -2.760072E+00  -2.76007150E+00   2.90   3.68
15   -6.364748E+00  -6.364747E+00  -6.36474588E+00   2.51   3.43
16   -1.633417E+01  -1.633417E+01  -1.63341661E+01   2.94   3.63
17   -4.590461E+01  -4.590459E+01  -4.59045857E+01   2.79   3.68
18   -1.397415E+02  -1.397414E+02  -1.39741425E+02   3.66   4.53
19   -4.571648E+02  -4.571646E+02  -4.57164546E+02   3.92   5.13
20   -1.597485E+03  -1.597484E+03  -1.59748385E+03   3.85   5.33
     -1.597484E+03   5.13

-- 
steve

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-19  7:36   ` Tobias Burnus
@ 2010-08-19  7:38     ` Tobias Burnus
  2010-08-20  3:36     ` Steve Kargl
  1 sibling, 0 replies; 18+ messages in thread
From: Tobias Burnus @ 2010-08-19  7:38 UTC (permalink / raw)
  Cc: gcc-patches, fortran

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

  On 08/19/2010 09:30 AM, Tobias Burnus wrote:
> Thanks for reviewing. Committed as Rev. 163364.

It helps if one not only finds typos before committal but also fixes 
them before committal ...

Committed as Rev. 163365.

Tobias

[-- Attachment #2: commit.diff --]
[-- Type: text/x-patch, Size: 1838 bytes --]

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(revision 163364)
+++ gcc/fortran/ChangeLog	(working copy)
@@ -1,5 +1,11 @@
 2010-08-19  Tobias Burnus  <burnus@net-b.de>
 
+	* intrinsic.texi (Bessel_jn, Bessel_yn): Fix typo.
+	* * simplify.c (gfc_simplify_bessel_yn): Change recursive
+	into recurrence.
+
+2010-08-19  Tobias Burnus  <burnus@net-b.de>
+
 	PR fortran/36158
 	PR fortran/33197
 	* check.c (gfc_check_bessel_n2): New function.
Index: gcc/fortran/intrinsic.texi
===================================================================
--- gcc/fortran/intrinsic.texi	(revision 163364)
+++ gcc/fortran/intrinsic.texi	(working copy)
@@ -1661,7 +1661,7 @@
 kind as @var{X}.
 
 @item @emph{Note}:
-The transformational function uses a recurrance algorithm which might,
+The transformational function uses a recurrence algorithm which might,
 for some values of @var{X}, lead to different results than calls to
 the elemental function.
 
@@ -1821,7 +1821,7 @@
 kind as @var{X}.
 
 @item @emph{Note}:
-The transformational function uses a recurrance algorithm which might,
+The transformational function uses a recurrence algorithm which might,
 for some values of @var{X}, lead to different results than calls to
 the elemental function.
 
Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c	(revision 163364)
+++ gcc/fortran/simplify.c	(working copy)
@@ -1261,7 +1261,7 @@
       return result;
     }
 
-  /* Use the faster but more verbose recursion algorithm. Bessel functions
+  /* Use the faster but more verbose recurrence algorithm. Bessel functions
      are stable for downward recursion and Neumann functions are stable
      for upward recursion. It is
        x2rev = 2.0/x,

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-19  6:37 ` Steve Kargl
@ 2010-08-19  7:36   ` Tobias Burnus
  2010-08-19  7:38     ` Tobias Burnus
  2010-08-20  3:36     ` Steve Kargl
  0 siblings, 2 replies; 18+ messages in thread
From: Tobias Burnus @ 2010-08-19  7:36 UTC (permalink / raw)
  To: Steve Kargl; +Cc: Tobias Burnus, gcc-patches, fortran

  On 08/19/2010 05:34 AM, Steve Kargl wrote:
> I read your patch and it appears to be correct,
> except that 2.0 in mpfr_ui_div should probably
> be an integer 2.

Fixed. I also added a link to DLMF for the recurrence algorithm.

> I haven't had time to investigate your program and
> findings, but I have no reason to suspect that your
> results are flawed.  I am somewhat puzzled by them.
> After all the work you did, I hesitate to suggest
> that I would rather have gfortran produce correct
> results slowly (ie, n2 - n1 + 1 calls to mpfr_{jn,yn})
> than to get possibly wrong results fast via
> recurrence algorithm.  If you want to change back
> to your original algorithm that's fine with me;
> otherwise, the current patch can be committed and
> I'll see if I can find time to poke at it.

I have committed the version with the recurrence algorithm but added a 
note to intrinsics.texi that the transformational version uses a 
recurrence algorithm which might lead to different results than invoking 
the elemental function. From what I have heard from the J3/WG5 committee 
the transformational version has been added explicitly because it allows 
the implementation of the recurrence algorithm. Thus, it makes sense to 
use it.

The next step is to add an implementation for run-time evaluation, which 
will also use the recurrence algorithm - thus the mpfr and the run-time 
version will give the same result, which is useful by itself.

I think it were be useful if you could find time to poke at it. One 
could also consider using the algorithm for JN but not for YN - but 
first one should do more checks to make sure that I haven't just been 
lucky that JN worked so well.

Thanks for reviewing. Committed as Rev. 163364.

Tobias

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
  2010-08-18 10:40 Tobias Burnus
@ 2010-08-19  6:37 ` Steve Kargl
  2010-08-19  7:36   ` Tobias Burnus
  0 siblings, 1 reply; 18+ messages in thread
From: Steve Kargl @ 2010-08-19  6:37 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc-patches, fortran

On Wed, Aug 18, 2010 at 12:37:29PM +0200, Tobias Burnus wrote:
> Hi all, hi Steve,
> 
> Tobias Burnus wrote:
> > Here is an updated version. [...] JN now works as it should.
> > YN also works, though for some of the examples, the result
> > differs quite a bit from the result of mpfr_yn.
> 
> I had another look using a C program and seemingly I had
> chosen some values which are difficult to get correct. The
> following result is using libm of GLIBC 2.5.
> 
> (Alternatively, apply the patch and use the Fortran program;
>  as currently called in bessel_5.f90, the mpfr functions
>  are called and never the library version.)
> 
> I think one can use the transformational form, but one might
> want to add a big warning that the result of the
> transformational intrinsic is obtained using a recurrence
> algorithm which may lead to large errors - or at least to
> different errors than the elemental function. (Not that the
> implemention of non-recurrence algorithms as used in libm
> are necessarily correct.)
> 

I read your patch and it appears to be correct,
except that 2.0 in mpfr_ui_div should probably
be an integer 2.

Thanks for moving the checks into check.c.

I haven't had time to investigate your program and
findings, but I have no reason to suspect that your
results are flawed.  I am somewhat puzzled by them.
After all the work you did, I hesitate to suggest
that I would rather have gfortran produce correct
results slowly (ie, n2 - n1 + 1 calls to mpfr_{jn,yn})
than to get possibly wrong results fast via 
recurrence algorithm.  If you want to change back
to your original algorithm that's fine with me;
otherwise, the current patch can be committed and
I'll see if I can find time to poke at it.

-- 
Steve

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic
@ 2010-08-18 10:40 Tobias Burnus
  2010-08-19  6:37 ` Steve Kargl
  0 siblings, 1 reply; 18+ messages in thread
From: Tobias Burnus @ 2010-08-18 10:40 UTC (permalink / raw)
  To: Steve Kargl, gcc-patches, fortran

Hi all, hi Steve,

Tobias Burnus wrote:
> Here is an updated version. [...] JN now works as it should.
> YN also works, though for some of the examples, the result
> differs quite a bit from the result of mpfr_yn.

I had another look using a C program and seemingly I had
chosen some values which are difficult to get correct. The
following result is using libm of GLIBC 2.5.

(Alternatively, apply the patch and use the Fortran program;
 as currently called in bessel_5.f90, the mpfr functions
 are called and never the library version.)

I think one can use the transformational form, but one might
want to add a big warning that the result of the
transformational intrinsic is obtained using a recurrence
algorithm which may lead to large errors - or at least to
different errors than the elemental function. (Not that the
implemention of non-recurrence algorithms as used in libm
are necessarily correct.)

Some results for YN for N=0 to 10 and different x values
using the C program below. The columns are: N, the libm's
ynf result, the result for the recurrence algorithm, the
difference, the difference divided by machine-precision
epsilon.

Recurrence algorithm for x =     +1.00000000
 1: +8.82569551e-02 | +8.82569551e-02 | +0.00000000e+00 |     +0.00000000
 2: -7.81212807e-01 | -7.81212807e-01 | +0.00000000e+00 |     +0.00000000
 2: -1.65068257e+00 | -1.65068257e+00 | +0.00000000e+00 |     +0.00000000
 3: -5.82151747e+00 | -5.82151747e+00 | +0.00000000e+00 |     +0.00000000
 4: -3.32784195e+01 | -3.32784195e+01 | +0.00000000e+00 |     +0.00000000
 5: -2.60405853e+02 | -2.60405853e+02 | +0.00000000e+00 |     +0.00000000
 6: -2.57078027e+03 | -2.57078027e+03 | +0.00000000e+00 |     +0.00000000
 7: -3.05889570e+04 | -3.05889570e+04 | +0.00000000e+00 |     +0.00000000
 8: -4.25674625e+05 | -4.25674625e+05 | +0.00000000e+00 |     +0.00000000
 9: -6.78020500e+06 | -6.78020500e+06 | +0.00000000e+00 |     +0.00000000
10: -1.21618016e+08 | -1.21618016e+08 | +0.00000000e+00 |     +0.00000000

Recurrence algorithm for x =     +2.00000000
 1: +5.10375679e-01 | +5.10375679e-01 | +0.00000000e+00 |     +0.00000000
 2: -1.07032441e-01 | -1.07032441e-01 | +0.00000000e+00 |     +0.00000000
 2: -6.17408097e-01 | -6.17408097e-01 | +0.00000000e+00 |     +0.00000000
 3: -1.12778378e+00 | -1.12778378e+00 | +0.00000000e+00 |     +0.00000000
 4: -2.76594329e+00 | -2.76594329e+00 | +0.00000000e+00 |     +0.00000000
 5: -9.93598938e+00 | -9.93598938e+00 | +0.00000000e+00 |     +0.00000000
 6: -4.69140053e+01 | -4.69140053e+01 | +0.00000000e+00 |     +0.00000000
 7: -2.71548035e+02 | -2.71548035e+02 | +0.00000000e+00 |     +0.00000000
 8: -1.85392212e+03 | -1.85392212e+03 | +0.00000000e+00 |     +0.00000000
 9: -1.45598291e+04 | -1.45598291e+04 | +0.00000000e+00 |     +0.00000000
10: -1.29184539e+05 | -1.29184539e+05 | +0.00000000e+00 |     +0.00000000

Recurrence algorithm for x =     +3.00000000
 1: +3.76850069e-01 | +3.76850069e-01 | +0.00000000e+00 |     +0.00000000
 2: +3.24674398e-01 | +3.24674398e-01 | +0.00000000e+00 |     +0.00000000
 2: -1.60400465e-01 | -1.60400465e-01 | +0.00000000e+00 |     +0.00000000
 3: -5.38541675e-01 | -5.38541675e-01 | +0.00000000e+00 |     +0.00000000
 4: -9.16682899e-01 | -9.16682899e-01 | +0.00000000e+00 |     +0.00000000
 5: -1.90594614e+00 | -1.90594614e+00 | +0.00000000e+00 |     +0.00000000
 6: -5.43647099e+00 | -5.43647146e+00 | +4.76837158e-07 |     +8.00062370
 7: -1.98399372e+01 | -1.98399391e+01 | +1.90734863e-06 |    +32.00249481
 8: -8.71499023e+01 | -8.71499176e+01 | +1.52587891e-05 |   +256.01995850
 9: -4.44959564e+02 | -4.44959625e+02 | +6.10351562e-05 |  +1024.07983398
10: -2.58260742e+03 | -2.58260791e+03 | +4.88281250e-04 |  +8192.63867188

 1: -1.81523263e-01 | -1.81523263e-01 | +0.00000000e+00 |     +0.00000000
 2: +3.12031418e-01 | +3.12031418e-01 | +0.00000000e+00 |     +0.00000000
 2: +3.21541846e-01 | +3.21541846e-01 | +0.00000000e+00 |     +0.00000000
 3: -2.34589577e-02 | -2.34589577e-02 | +0.00000000e+00 |     +0.00000000
 4: -3.53122234e-01 | -3.53122234e-01 | +0.00000000e+00 |     +0.00000000
 5: -6.10370517e-01 | -6.10370517e-01 | +0.00000000e+00 |     +0.00000000
 6: -1.01634288e+00 | -1.01634264e+00 | -2.38418579e-07 |     -4.00031185
 7: -2.12602520e+00 | -2.12602425e+00 | -9.53674316e-07 |    -16.00124741
 8: -5.66177082e+00 | -5.66176844e+00 | -2.38418579e-06 |    -40.00311661
 9: -1.81989326e+01 | -1.81989250e+01 | -7.62939453e-06 |   -128.00997925
10: -6.78362808e+01 | -6.78362503e+01 | -3.05175781e-05 |   -512.03991699

Recurrence algorithm for x =     +5.00000000
 1: -3.08517635e-01 | -3.08517635e-01 | +0.00000000e+00 |     +0.00000000
 2: +1.47863135e-01 | +1.47863135e-01 | +0.00000000e+00 |     +0.00000000
 2: +3.67662877e-01 | +3.67662877e-01 | +0.00000000e+00 |     +0.00000000
 3: +1.46267161e-01 | +1.46267161e-01 | +0.00000000e+00 |     +0.00000000
 4: -1.92142278e-01 | -1.92142278e-01 | +0.00000000e+00 |     +0.00000000
 5: -4.53694820e-01 | -4.53694820e-01 | +0.00000000e+00 |     +0.00000000
 6: -7.15247393e-01 | -7.15247393e-01 | +0.00000000e+00 |     +0.00000000
 7: -1.26289904e+00 | -1.26289904e+00 | +0.00000000e+00 |     +0.00000000
 8: -2.82086992e+00 | -2.82086992e+00 | +0.00000000e+00 |     +0.00000000
 9: -7.76388502e+00 | -7.76388502e+00 | +0.00000000e+00 |     +0.00000000
10: -2.51291161e+01 | -2.51291180e+01 | +1.90734863e-06 |    +32.00249481

Tobias

The C program, link with -lm; without _GNU_SOURCE "math.h"
does not provide the Bessel function as function prototype.

#define _GNU_SOURCE
#include <math.h>
#include <stdio.h>

int main ()
{
  float last1, last2, x, x2rev, cur, eps = 5.96e-08f;
  x = 1.00f;

  printf("Recurrence algorithm for x = %+15.8f\n", x);

  last1 = ynf(0, x);
  printf ("%2i: %+15.8e | %+15.8e | %+15.8e | %+15.8f\n", 1,
          ynf(0, x), last1, (ynf(0, x) - last1),
          (ynf(0, x) - last1)/eps);

  last2 = ynf(1, x);
  printf ("%2i: %+15.8e | %+15.8e | %+15.8e | %+15.8f\n", 2,
          ynf(1, x), last2, (ynf(1, x) - last2),
          (ynf(1, x) - last2)/eps);

  x2rev = 2.0f/x;

  for (int i = 2; i < 11; i++)
    {
      cur = x2rev * (i-1) * last2 - last1;
      printf ("%2i: %+15.8e | %+15.8e | %+15.8e | %+15.8f\n", i,
              ynf(i, x), cur, (ynf(i, x) - cur),
              (ynf(i, x) - cur)/eps);
      last1 = last2;
      last2 = cur;
    }
  return 0;
}

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-08-21 18:57 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-17 12:43 [Patch,Fortran] PR36158 - Add transformational version of BESSEL_JN intrinsic Tobias Burnus
2010-08-17 13:24 ` Daniel Kraft
2010-08-17 14:49   ` Steve Kargl
2010-08-17 14:55     ` Tobias Burnus
2010-08-17 15:39       ` Steve Kargl
2010-08-17 17:00         ` Tobias Burnus
2010-08-17 19:08           ` Steve Kargl
2010-08-17 21:19             ` Tobias Burnus
2010-08-18 10:40 Tobias Burnus
2010-08-19  6:37 ` Steve Kargl
2010-08-19  7:36   ` Tobias Burnus
2010-08-19  7:38     ` Tobias Burnus
2010-08-20  3:36     ` Steve Kargl
2010-08-20  7:17       ` Tobias Burnus
2010-08-20  9:45         ` Tobias Burnus
2010-08-20 20:44           ` Steve Kargl
2010-08-21 21:06             ` Toon Moene
2010-08-20 20:14         ` Steve Kargl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).