Dear ROOTers,
for the purposes of a multifit [which are irrelevant in this discussion] I have written down a function which contains the two solutions of the confluent hypergeometric equation: the Kummer’s function of the first kind M(a;b;z) [also denoted as 1_F_1(a;b;z)] and the Kummer’s function of the second kind, U(a;b;z).
To introduce these objects into my code, I leaned on the well-known GNU Scientific Library [GSL] where these two functions are implemented like this:
M(a;b;z) : double gsl_sf_hyperg_1F1 (double a, double b, double x) and,
U(a;b;z) : double gsl_sf_hyperg_U (double a, double b, double x).
Nevertheless, the fit fails for some, probably, serious reasons since for some logical values of a, b, and z the M and U seem to return irrational results.
For example for a = -1.5, b = 1.5, and z = -701.0, when calculating M, I take the followinq error message in my PC [I have the rather old version gsl-devel-1.5-2.rhel4]:
gsl: exp.c:256: ERROR: overflow
Default GSL error handler invoked.
Aborted,
while a collegue who has installed a more recent version of GSL [gsl-1.12-1.el5.rf.x86_64] takes the result 3.21333e+276!!! All these are totaly off value since the result, given by Mathematica, is simply 8259.38 . Also when I try to calculate U(11.14756, 0.5, 0.00175097) I face similar problems. [Usually I take the error message:
gsl: hyperg_U.c:121: ERROR: error
Default GSL error handler invoked.
Aborted ]
All these can be verified writing down the simple program:
// gsl_test.cpp
#include
#include <gsl/gsl_sf_hyperg.h>
using namespace std;
int main()
{
cout << gsl_sf_hyperg_1F1(-1.5, 1.5, -701.0) << endl;
// OR ----> cout << gsl_sf_hyperg_U(11.14756, 0.5, 0.00175097) << endl;
}
So, I have the following simple quaestions:
-
Can you confirm this as a bug?
-
Do you know if these features are present in the more recent versions of GNU?
-
Does anyone who have faced similar problems have managed to find a workaround?
-
Does anyone knows another way to introduce M(a;b;z) and U(a;b;z) into my code that doesn’t share the same deficiencies?
[ I repeat: I only want to execute a Fit with Minuit and I want to be sure that the function that I use is accurate and gives logical results. For example it should be able to calculate accurately gsl_sf_hyperg_1F1(-1.5, 1.5, -701.0).]
Also, any other suggestion or advise might be extremely valuable…
Bast wishes and thank’s a lot a priori,
Leonidas.