[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] [bug #50343] Different value for mathieu_ce in Mathematica and
From: |
Patrick Alken |
Subject: |
[Bug-gsl] [bug #50343] Different value for mathieu_ce in Mathematica and GSL |
Date: |
Fri, 17 Feb 2017 17:17:00 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?50343>
Summary: Different value for mathieu_ce in Mathematica and
GSL
Project: GNU Scientific Library
Submitted by: psa
Submitted on: Fri 17 Feb 2017 10:16:59 PM UTC
Category: Runtime error
Severity: 3 - Normal
Operating System:
Status: None
Assigned to: None
Open/Closed: Open
Release:
Discussion Lock: Any
_______________________________________________________
Details:
from phyks =at= phyks =dot= me
I have some code that I prototyped in Mathematica and am now writing in C
using GSL, that makes use of Mathieu functions. I have different results
between the two of them, and I cannot figure out whether this is a bug in GSL,
Mathematica or simply some misunderstanding from my part.
I am using `MathieuC` function in latest Mathematica
(http://reference.wolfram.com/language/ref/MathieuC.html) which should be the
same function as `gsl_sf_mathieu_ce`
(https://www.gnu.org/software/gsl/manual/html_node/Angular-Mathieu-Functions.html#Angular-Mathieu-Functions)
except that the former one takes a single `a` argument being the
characteristic value whereas the GSL 2.3 implementation takes the order `n`
and the `q` parameter directly.
So, I guess,
```
> N[MathieuC[MathieuCharacteristicA[0, -1], -1, 2*Pi/180]]
1.41071
```
should be equivalent to
```
gsl_sf_mathieu_ce(0, -1.0, 2.0 * M_PI / 180.0)
```
which gives a totally different value: 0.99751942347886335.
I tried to debug with different values, and the discrepancies between
Mathematica and GSL seems to appear only when the `q` parameter (-1.0 here) is
negative. If I take 1.0 instead, I get values in agreement. I tried to find
yet another implementation to debug it, and found Scipy
(https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.mathieu_cem.html#scipy.special.mathieu_cem)
which relies on Fortran SPECFUN library apparently, and is in agreement with
GSL.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?50343>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Bug-gsl] [bug #50343] Different value for mathieu_ce in Mathematica and GSL,
Patrick Alken <=