[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] inaccurate value from gsl_sf_hyperg_1F1

From: Adam Stinchcombe
Subject: [Bug-gsl] inaccurate value from gsl_sf_hyperg_1F1
Date: Wed, 8 Feb 2012 12:05:50 -0500


I encountered (in practice) an inaccurate value from
gsl_sf_hyperg_1F1. It can be reproduced with the following code

#include <gsl/gsl_sf.h>
#include <gsl/gsl_sf_result.h>

/* a test of the confluent hypergeometric function */

int main(void) {
    double a=139.05;
    double b=140.03;
    double x=-100.03;
    double exact=1.187662608021457988523188e-43;
    gsl_sf_result result;
    int retval=gsl_sf_hyperg_1F1_e (a, b, x, &result);

    printf("exact  =%0.16e\nresult =%0.16e\nerror

    return 0;

Which gives the output
exact  =1.1876626080214580e-43
result =9.1235150685363201e-40
error  =1.6965763491929204e-41

This occurs for gsl versions gsl-1.13-1.el6.x86_64 and 1.15. The exact
value was computed in Maple, which agrees with the Mathematica value.
As you can see the gsl computed value is not near the exact value and
the exact value is not within the error estimate. As far as I can
tell, there is a seemingly arbitrary barrier at abs(x)=100 where the
asymptotic formula is used. I think that, for these parameters, that
is not far enough into the asymptotic regime.

Adam Stinchcombe

reply via email to

[Prev in Thread] Current Thread [Next in Thread]