Description Usage Arguments Details Value Author(s) Examples
Two different algorithms can be used.
1 2 |
a |
complex parameter |
b |
complex parameter |
c |
complex parameter |
z |
complex variable |
algorithm |
either “michel.stoitsov” (default) or “forrey” (see the details) |
The first, default, algorithm uses Fortran code in “hyp_2F1.f90” from N. L. J. Michel and M. V. Stoitsov, which is available at http://cpc.cs.qub.ac.uk/summaries/AEAE. The corresponding background reference is N. L. J. Michel and M. V. Stoitsov (2008): Fast computation of the Gauss hypergeometric function with all its parameters complex with application to the Pöschl-Teller-Ginocchio potential wave functions, Computer Physics Communications 178:535-551.
The second algorithm uses Fortran code in “cyp.f” from R. C. Forrey is used which is available at http://physics.bk.psu.edu/codes/chyp.f. The corresponding background reference is R. C. Forrey (1997): Computing the hypergeometric function, Journal of Computational Physics 137:79-100.
The complex value of the Gaussian hypergeometric function.
Daniel Sabanes Bove daniel.sabanesbove@ifspm.uzh.ch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ## library(appell)
## compare the results of both algorithms
## for random test data.
## todo: add better tests trying to replicate published results?
nTest <- 100L
set.seed(38)
a <- complex(real=rnorm(nTest),
imaginary=rnorm(nTest))
b <- complex(real=rnorm(nTest),
imaginary=rnorm(nTest))
c <- complex(real=rnorm(nTest),
imaginary=rnorm(nTest))
z <- complex(real=rnorm(nTest),
imaginary=rnorm(nTest))
tableHyp2f1 <- matrix(nrow=nTest,
ncol=2L,
dimnames=
list(NULL,
c("forrey", "michel.stoitsov")))
for(i in seq_len(nTest))
{
tableHyp2f1[i, "forrey"] <- hyp2f1(a[i], b[i], c[i], z[i],
algorithm="forrey")
tableHyp2f1[i, "michel.stoitsov"] <- hyp2f1(a[i], b[i], c[i], z[i],
algorithm="michel.stoitsov")
}
tableHyp2f1
abs(tableHyp2f1[, "forrey"] - tableHyp2f1[, "michel.stoitsov"])
## so very small differences,
## at least in this range of function parameters.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.