help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] problem with gsl_sf_elljac_e


From: Robin Hankin
Subject: [Help-gsl] problem with gsl_sf_elljac_e
Date: Wed, 24 Nov 2004 08:50:17 +0000

Hi

If I have


/* to compile:
                    gcc -lgsl -lm -lgslcblas ellj.c
*/


#include <stdio.h>
#include <gsl/gsl_sf_elljac.h>
#include <gsl/gsl_sf_ellint.h>
#include <math.h>
#include <gsl/gsl_math.h>

     int
     main (void)
     {
       double m = 0.5;
       double phi = M_PI_2;
       double sn;
       double cn;
       double dn1,dn2;
       double K;
       int ignore;

       K = gsl_sf_ellint_F(M_PI_2,sqrt(m),  GSL_PREC_DOUBLE);
       ignore = gsl_sf_elljac_e(3*K,m,&sn, &cn, &dn1);
       ignore = gsl_sf_elljac_e(3*K + 0.0000000000001, m, &sn, &cn, &dn2);

       printf("%.18e\n", dn1);
       printf("%.18e\n", dn2);
       return 0;
     }


and compile and run it,  I get


octopus:~/unix/rksh/R.packages% gcc -lgsl -lm -lgslcblas ellj.c
octopus:~/unix/rksh/R.packages% ./a.out
1.000000000000000000e+00
7.101757734594013050e-01
octopus:~/unix/rksh/R.packages%


The second figure is roughly what I get from tables; the first looks a bit odd (I expected
the two numbers to differ by a small amount as dn(x) is continuous).

  I get this with a  redhat fedora PC and also a G5.  What's going on here?


--
Robin Hankin
Uncertainty Analyst
Southampton Oceanography Centre
SO14 3ZH
tel +44(0)23-8059-7743
address@hidden (edit in obvious way; spam precaution)




reply via email to

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