bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] [bug #43260] Hermite polynomial contribution


From: Patrick Alken
Subject: [Bug-gsl] [bug #43260] Hermite polynomial contribution
Date: Fri, 19 Sep 2014 16:22:18 +0000
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:32.0) Gecko/20100101 Firefox/32.0

URL:
  <http://savannah.gnu.org/bugs/?43260>

                 Summary: Hermite polynomial contribution
                 Project: GNU Scientific Library
            Submitted by: psa
            Submitted on: Fri 19 Sep 2014 04:22:17 PM GMT
                Category: None
                Severity: 3 - Normal
        Operating System: 
                  Status: None
             Assigned to: None
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any

    _______________________________________________________

Details:

>From konradg =at= gmx =dot= net

Dear GSL-Team,

a while back I asked how to submit some of my work and was told to
send it to this address. So here it goes!
There's a piece of code I'd like to contribute to your great library.
It consists of a few functions to compute Hermite polynomials, Hermite
functions and their respective derivatives, please see the attachment
gsl_hermite.c. I have tried to name them in such a way that they can
directly be used in the GSL, but since I'm not sure about any policies
please feel free to make any changes you deem neccessary.
Here's an overview:

- - gsl_sf_hermite_prob(const int n, const double x): Evaluates the
probabilists' Hermite polynomial of order n at position x.
- - gsl_sf_hermite_prob_der(int m, int n, double x): Evaluates the m-th
derivative of the probabilists' Hermite polynomial of order n at
position x.
- - gsl_sf_hermite_phys(const int n, const double x): Evaluates the
physicists' Hermite polynomial of order n at position x.
- - gsl_sf_hermite_phys_der(int m, int n, double x): Evaluates the m-th
derivative of the physicists' Hermite polynomial of order n at position x.
- - gsl_sf_hermite_func(const int n, const double x): Evaluates the
Hermite function of order n at position x.
- - gsl_sf_hermite_prob_series(const int n, const double x, const double
* a): Evaluates the series sum_{j=0}^n a_j*He_j(x) with He_j being the
j-th probabilists' Hermite polynomial.
- - gsl_sf_hermite_prob_array(const int nmax, const double x, double *
result_array): Evaluates all probabilists' Hermite polynomials up to
order nmax at position x. The results are stored in result_array.
- - gsl_sf_hermite_prob_array_der(const int m, const int nmax, const
double x, double * result_array): Evaluates the m-th derivative of all
probabilists' Hermite polynomials up to order nmax at position x. The
results are stored in result_array.
- - gsl_sf_hermite_prob_der_array(const int mmax, const int n, const
double x, double * result_array): Evaluates all derivatives (starting
from 0) up to the mmax-th derivative of the probabilists' Hermite
polynomial of order n at position x. The results are stored in
result_array.
- - gsl_sf_hermite_prob_series(const int n, const double x, const double
* a): Evaluates the series sum_{j=0}^n a_j*He_j(x) with He_j being the
j-th probabilists' Hermite polynomial.
- - gsl_sf_hermite_phys_array(const int nmax, const double x, double *
result_array): Evaluates all physicists' Hermite polynomials up to
order nmax at position x. The results are stored in result_array.
- - gsl_sf_hermite_phys_array_der(const int m, const int nmax, const
double x, double * result_array): Evaluates the m-th derivative of all
physicists' Hermite polynomials up to order nmax at position x. The
results are stored in result_array.
- - gsl_sf_hermite_phys_der_array(const int mmax, const int n, const
double x, double * result_array): Evaluates all derivatives (starting
from 0) up to the mmax-th derivative of the physicists' Hermite
polynomial of order n at position x. The results are stored in
result_array.
- - gsl_sf_hermite_phys_series(const int n, const double x, const double
* a): Evaluates the series sum_{j=0}^n a_j*H_j(x) with H_j being the
j-th physicists' Hermite polynomial.
- - gsl_sf_hermite_func_array(const int nmax, const double x, double *
result_array): Evaluates all Hermite functions up to order nmax at
position x. The results are stored in result_array.
- - gsl_sf_hermite_func_series(const int n, const double x, const double
* a): Evaluates the series sum_{j=0}^n a_j*Psi_j(x) with Psi_j being
the j-th Hermite function.
- - gsl_sf_hermite_func_der(const int m, const int n, const double x):
Evaluates the m-th derivative of the Hermite function of order n at
position x.

As you can see, the routines for the polynomials exist in the
probabilists' and the physicists' versions. If a default has to be
chosen, I'd suggest the probabilists' routines due to their smaller
susceptibility to overflow.
The naming of the routines may be an issue especially with
gsl_sf_hermite_prob_array_der vs. gsl_sf_hermite_prob_der_array (and
their physicists' equivalents), I'm not sure this is a very clear
choice, but I kept it for lack of a better idea.
Please find a very simple test of the routines in the second
attachment (gsl_hermite_test.c). A more thorough check would make sense.
Also included in the code is a small ToDo-list for additional
functionality. Unfortunately I probably won't be able to put a lot of
work into this at the moment. (I've had this code laying around for
quite a while already and only now got around to preparing it for the
GSL...)

There is only one issue that requires your attention: as I don't know
if there are any rules as to when an asymptotic approximation is to be
used instead of the (slower) standard calculation, I have set the
limit to the order 10000 (orders above that often result in overflow),
please adjust this value.

If there's anything that needs to be done before the functions can be
included in the next release (like writing documentation), please let
me know how I can help. In that case it would be good to know what the
deadline for the upcoming release is.

On a completely unrelated topic: the last digit in the first zero of
the Airy function Ai is wrong in the GSL-function: it reads
- -2.338107410459767039 instead of
- -2.338107410459767038, which is correct.

Last but not least: thanks you all for your time and effort, you've
helped many people a great deal!

Cheers,
Konrad



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 19 Sep 2014 04:22:17 PM GMT  Name: gsl_hermite.c  Size: 25kB   By:
psa

<http://savannah.gnu.org/bugs/download.php?file_id=32135>
-------------------------------------------------------
Date: Fri 19 Sep 2014 04:22:17 PM GMT  Name: gsl_hermite_test.c  Size: 26kB  
By: psa

<http://savannah.gnu.org/bugs/download.php?file_id=32136>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43260>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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