summaryrefslogtreecommitdiff
path: root/gsl-1.9/specfunc/legendre_con.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-04-08 17:33:11 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-04-08 17:33:11 +0000
commit73f643f3f4a55310b2c8c1a9858906b2dd676e72 (patch)
treeb1df97f18dace4a5702b0bc7aafdfee8a2f25ada /gsl-1.9/specfunc/legendre_con.c
parentee523abdace8337d05ec4a179fcdf5de3fe0f634 (diff)
2011-04-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* AUTHORS, BUGS, COPYING, ChangeLog, INSTALL, Makefile.am, Makefile.in, NEWS, README, SUPPORT, THANKS, TODO, acconfig.h, aclocal.m4, autogen.sh, config.guess, config.h.in, config.sub, configure, configure.ac, gsl-config.in, gsl-histogram.c, gsl-randist.c, gsl.m4, gsl.pc.in, gsl.spec.in, gsl_machine.h, gsl_math.h, gsl_mode.h, gsl_nan.h, gsl_pow_int.h, gsl_precision.h, gsl_types.h, gsl_version.h.in, install-sh, ltmain.sh, mdate-sh, missing, mkinstalldirs, templates_off.h, templates_on.h, test_gsl_histogram.sh, version.c, blas/ChangeLog, blas/Makefile.am, blas/Makefile.in, blas/TODO, blas/blas.c, blas/gsl_blas.h, blas/gsl_blas_types.h, block/ChangeLog, block/Makefile.am, block/Makefile.in, block/block.c, block/block_source.c, block/file.c, block/fprintf_source.c, block/fwrite_source.c, block/gsl_block.h, block/gsl_block_char.h, block/gsl_block_complex_double.h, block/gsl_block_complex_float.h, block/gsl_block_complex_long_double.h, block/gsl_block_double.h, block/gsl_block_float.h, block/gsl_block_int.h, block/gsl_block_long.h, block/gsl_block_long_double.h, block/gsl_block_short.h, block/gsl_block_uchar.h, block/gsl_block_uint.h, block/gsl_block_ulong.h, block/gsl_block_ushort.h, block/gsl_check_range.h, block/init.c, block/init_source.c, block/test.c, block/test_complex_io.c, block/test_complex_source.c, block/test_io.c, block/test_source.c, bspline/ChangeLog, bspline/Makefile.am, bspline/Makefile.in, bspline/TODO, bspline/bspline.c, bspline/gsl_bspline.h, bspline/test.c, cblas/ChangeLog, cblas/Makefile.am, cblas/Makefile.in, cblas/TODO, cblas/caxpy.c, cblas/cblas.h, cblas/ccopy.c, cblas/cdotc_sub.c, cblas/cdotu_sub.c, cblas/cgbmv.c, cblas/cgemm.c, cblas/cgemv.c, cblas/cgerc.c, cblas/cgeru.c, cblas/chbmv.c, cblas/chemm.c, cblas/chemv.c, cblas/cher.c, cblas/cher2.c, cblas/cher2k.c, cblas/cherk.c, cblas/chpmv.c, cblas/chpr.c, cblas/chpr2.c, cblas/cscal.c, cblas/csscal.c, cblas/cswap.c, cblas/csymm.c, cblas/csyr2k.c, cblas/csyrk.c, cblas/ctbmv.c, cblas/ctbsv.c, cblas/ctpmv.c, cblas/ctpsv.c, cblas/ctrmm.c, cblas/ctrmv.c, cblas/ctrsm.c, cblas/ctrsv.c, cblas/dasum.c, cblas/daxpy.c, cblas/dcopy.c, cblas/ddot.c, cblas/dgbmv.c, cblas/dgemm.c, cblas/dgemv.c, cblas/dger.c, cblas/dnrm2.c, cblas/drot.c, cblas/drotg.c, cblas/drotm.c, cblas/drotmg.c, cblas/dsbmv.c, cblas/dscal.c, cblas/dsdot.c, cblas/dspmv.c, cblas/dspr.c, cblas/dspr2.c, cblas/dswap.c, cblas/dsymm.c, cblas/dsymv.c, cblas/dsyr.c, cblas/dsyr2.c, cblas/dsyr2k.c, cblas/dsyrk.c, cblas/dtbmv.c, cblas/dtbsv.c, cblas/dtpmv.c, cblas/dtpsv.c, cblas/dtrmm.c, cblas/dtrmv.c, cblas/dtrsm.c, cblas/dtrsv.c, cblas/dzasum.c, cblas/dznrm2.c, cblas/gsl_cblas.h, cblas/hypot.c, cblas/icamax.c, cblas/idamax.c, cblas/isamax.c, cblas/izamax.c, cblas/sasum.c, cblas/saxpy.c, cblas/scasum.c, cblas/scnrm2.c, cblas/scopy.c, cblas/sdot.c, cblas/sdsdot.c, cblas/sgbmv.c, cblas/sgemm.c, cblas/sgemv.c, cblas/sger.c, cblas/snrm2.c, cblas/source_asum_c.h, cblas/source_asum_r.h, cblas/source_axpy_c.h, cblas/source_axpy_r.h, cblas/source_copy_c.h, cblas/source_copy_r.h, cblas/source_dot_c.h, cblas/source_dot_r.h, cblas/source_gbmv_c.h, cblas/source_gbmv_r.h, cblas/source_gemm_c.h, cblas/source_gemm_r.h, cblas/source_gemv_c.h, cblas/source_gemv_r.h, cblas/source_ger.h, cblas/source_gerc.h, cblas/source_geru.h, cblas/source_hbmv.h, cblas/source_hemm.h, cblas/source_hemv.h, cblas/source_her.h, cblas/source_her2.h, cblas/source_her2k.h, cblas/source_herk.h, cblas/source_hpmv.h, cblas/source_hpr.h, cblas/source_hpr2.h, cblas/source_iamax_c.h, cblas/source_iamax_r.h, cblas/source_nrm2_c.h, cblas/source_nrm2_r.h, cblas/source_rot.h, cblas/source_rotg.h, cblas/source_rotm.h, cblas/source_rotmg.h, cblas/source_sbmv.h, cblas/source_scal_c.h, cblas/source_scal_c_s.h, cblas/source_scal_r.h, cblas/source_spmv.h, cblas/source_spr.h, cblas/source_spr2.h, cblas/source_swap_c.h, cblas/source_swap_r.h, cblas/source_symm_c.h, cblas/source_symm_r.h, cblas/source_symv.h, cblas/source_syr.h, cblas/source_syr2.h, cblas/source_syr2k_c.h, cblas/source_syr2k_r.h, cblas/source_syrk_c.h, cblas/source_syrk_r.h, cblas/source_tbmv_c.h, cblas/source_tbmv_r.h, cblas/source_tbsv_c.h, cblas/source_tbsv_r.h, cblas/source_tpmv_c.h, cblas/source_tpmv_r.h, cblas/source_tpsv_c.h, cblas/source_tpsv_r.h, cblas/source_trmm_c.h, cblas/source_trmm_r.h, cblas/source_trmv_c.h, cblas/source_trmv_r.h, cblas/source_trsm_c.h, cblas/source_trsm_r.h, cblas/source_trsv_c.h, cblas/source_trsv_r.h, cblas/srot.c, cblas/srotg.c, cblas/srotm.c, cblas/srotmg.c, cblas/ssbmv.c, cblas/sscal.c, cblas/sspmv.c, cblas/sspr.c, cblas/sspr2.c, cblas/sswap.c, cblas/ssymm.c, cblas/ssymv.c, cblas/ssyr.c, cblas/ssyr2.c, cblas/ssyr2k.c, cblas/ssyrk.c, cblas/stbmv.c, cblas/stbsv.c, cblas/stpmv.c, cblas/stpsv.c, cblas/strmm.c, cblas/strmv.c, cblas/strsm.c, cblas/strsv.c, cblas/test.c, cblas/test_amax.c, cblas/test_asum.c, cblas/test_axpy.c, cblas/test_copy.c, cblas/test_dot.c, cblas/test_gbmv.c, cblas/test_gemm.c, cblas/test_gemv.c, cblas/test_ger.c, cblas/test_hbmv.c, cblas/test_hemm.c, cblas/test_hemv.c, cblas/test_her.c, cblas/test_her2.c, cblas/test_her2k.c, cblas/test_herk.c, cblas/test_hpmv.c, cblas/test_hpr.c, cblas/test_hpr2.c, cblas/test_nrm2.c, cblas/test_rot.c, cblas/test_rotg.c, cblas/test_rotm.c, cblas/test_rotmg.c, cblas/test_sbmv.c, cblas/test_scal.c, cblas/test_spmv.c, cblas/test_spr.c, cblas/test_spr2.c, cblas/test_swap.c, cblas/test_symm.c, cblas/test_symv.c, cblas/test_syr.c, cblas/test_syr2.c, cblas/test_syr2k.c, cblas/test_syrk.c, cblas/test_tbmv.c, cblas/test_tbsv.c, cblas/test_tpmv.c, cblas/test_tpsv.c, cblas/test_trmm.c, cblas/test_trmv.c, cblas/test_trsm.c, cblas/test_trsv.c, cblas/tests.c, cblas/tests.h, cblas/xerbla.c, cblas/zaxpy.c, cblas/zcopy.c, cblas/zdotc_sub.c, cblas/zdotu_sub.c, cblas/zdscal.c, cblas/zgbmv.c, cblas/zgemm.c, cblas/zgemv.c, cblas/zgerc.c, cblas/zgeru.c, cblas/zhbmv.c, cblas/zhemm.c, cblas/zhemv.c, cblas/zher.c, cblas/zher2.c, cblas/zher2k.c, cblas/zherk.c, cblas/zhpmv.c, cblas/zhpr.c, cblas/zhpr2.c, cblas/zscal.c, cblas/zswap.c, cblas/zsymm.c, cblas/zsyr2k.c, cblas/zsyrk.c, cblas/ztbmv.c, cblas/ztbsv.c, cblas/ztpmv.c, cblas/ztpsv.c, cblas/ztrmm.c, cblas/ztrmv.c, cblas/ztrsm.c, cblas/ztrsv.c, cdf/ChangeLog, cdf/Makefile.am, cdf/Makefile.in, cdf/beta.c, cdf/beta_inc.c, cdf/betainv.c, cdf/binomial.c, cdf/cauchy.c, cdf/cauchyinv.c, cdf/chisq.c, cdf/chisqinv.c, cdf/error.h, cdf/exponential.c, cdf/exponentialinv.c, cdf/exppow.c, cdf/fdist.c, cdf/fdistinv.c, cdf/flat.c, cdf/flatinv.c, cdf/gamma.c, cdf/gammainv.c, cdf/gauss.c, cdf/gaussinv.c, cdf/geometric.c, cdf/gsl_cdf.h, cdf/gumbel1.c, cdf/gumbel1inv.c, cdf/gumbel2.c, cdf/gumbel2inv.c, cdf/hypergeometric.c, cdf/laplace.c, cdf/laplaceinv.c, cdf/logistic.c, cdf/logisticinv.c, cdf/lognormal.c, cdf/lognormalinv.c, cdf/nbinomial.c, cdf/pareto.c, cdf/paretoinv.c, cdf/pascal.c, cdf/poisson.c, cdf/rat_eval.h, cdf/rayleigh.c, cdf/rayleighinv.c, cdf/tdist.c, cdf/tdistinv.c, cdf/test.c, cdf/test_auto.c, cdf/weibull.c, cdf/weibullinv.c, cheb/ChangeLog, cheb/Makefile.am, cheb/Makefile.in, cheb/deriv.c, cheb/eval.c, cheb/gsl_chebyshev.h, cheb/init.c, cheb/integ.c, cheb/test.c, combination/ChangeLog, combination/Makefile.am, combination/Makefile.in, combination/combination.c, combination/file.c, combination/gsl_combination.h, combination/init.c, combination/test.c, complex/ChangeLog, complex/Makefile.am, complex/Makefile.in, complex/TODO, complex/gsl_complex.h, complex/gsl_complex_math.h, complex/math.c, complex/results.h, complex/results1.h, complex/results_real.h, complex/test.c, const/ChangeLog, const/Makefile.am, const/Makefile.in, const/TODO, const/gsl_const.h, const/gsl_const_cgs.h, const/gsl_const_cgsm.h, const/gsl_const_mks.h, const/gsl_const_mksa.h, const/gsl_const_num.h, const/test.c, deriv/ChangeLog, deriv/Makefile.am, deriv/Makefile.in, deriv/deriv.c, deriv/gsl_deriv.h, deriv/test.c, dht/ChangeLog, dht/Makefile.am, dht/Makefile.in, dht/dht.c, dht/gsl_dht.h, dht/test.c, diff/ChangeLog, diff/Makefile.am, diff/Makefile.in, diff/diff.c, diff/gsl_diff.h, diff/test.c, doc/12-cities.eps, doc/ChangeLog, doc/Makefile.am, doc/Makefile.in, doc/algorithm.sty, doc/algorithmic.sty, doc/autoconf.texi, doc/blas.texi, doc/bspline.eps, doc/bspline.texi, doc/calc.sty, doc/cblas.texi, doc/cheb.eps, doc/cheb.texi, doc/combination.texi, doc/complex.texi, doc/const.texi, doc/debug.texi, doc/dht.texi, doc/diff.texi, doc/dwt-orig.eps, doc/dwt-samp.eps, doc/dwt.texi, doc/eigen.texi, doc/err.texi, doc/fdl.texi, doc/fft-complex-radix2-f.eps, doc/fft-complex-radix2-t.eps, doc/fft-complex-radix2.eps, doc/fft-real-mixedradix.eps, doc/fft.texi, doc/fftalgorithms.bib, doc/fftalgorithms.tex, doc/final-route.eps, doc/fit-exp.eps, doc/fit-wlinear.eps, doc/fit-wlinear2.eps, doc/fitting.texi, doc/freemanuals.texi, doc/gpl.texi, doc/gsl-config.1, doc/gsl-design.texi, doc/gsl-histogram.1, doc/gsl-randist.1, doc/gsl-ref.info, doc/gsl-ref.info-1, doc/gsl-ref.info-2, doc/gsl-ref.info-3, doc/gsl-ref.info-4, doc/gsl-ref.info-5, doc/gsl-ref.info-6, doc/gsl-ref.texi, doc/gsl.3, doc/histogram.eps, doc/histogram.texi, doc/histogram2d.eps, doc/ieee754.texi, doc/initial-route.eps, doc/integration.texi, doc/interp.texi, doc/interp2.eps, doc/interpp2.eps, doc/intro.texi, doc/landau.dat, doc/linalg.texi, doc/math.texi, doc/mdate-sh, doc/min-interval.eps, doc/min.texi, doc/montecarlo.texi, doc/multifit.texi, doc/multimin.eps, doc/multimin.texi, doc/multiroots.texi, doc/ntuple.eps, doc/ntuple.texi, doc/ode-initval.texi, doc/permutation.texi, doc/poly.texi, doc/qrng.eps, doc/qrng.texi, doc/rand-bernoulli.tex, doc/rand-beta.tex, doc/rand-binomial.tex, doc/rand-bivariate-gaussian.tex, doc/rand-cauchy.tex, doc/rand-chisq.tex, doc/rand-erlang.tex, doc/rand-exponential.tex, doc/rand-exppow.tex, doc/rand-fdist.tex, doc/rand-flat.tex, doc/rand-gamma.tex, doc/rand-gaussian-tail.tex, doc/rand-gaussian.tex, doc/rand-geometric.tex, doc/rand-gumbel.tex, doc/rand-gumbel1.tex, doc/rand-gumbel2.tex, doc/rand-hypergeometric.tex, doc/rand-landau.tex, doc/rand-laplace.tex, doc/rand-levy.tex, doc/rand-levyskew.tex, doc/rand-logarithmic.tex, doc/rand-logistic.tex, doc/rand-lognormal.tex, doc/rand-nbinomial.tex, doc/rand-pareto.tex, doc/rand-pascal.tex, doc/rand-poisson.tex, doc/rand-rayleigh-tail.tex, doc/rand-rayleigh.tex, doc/rand-tdist.tex, doc/rand-weibull.tex, doc/randist.texi, doc/random-walk.tex, doc/randplots.gnp, doc/rng.texi, doc/roots-bisection.eps, doc/roots-false-position.eps, doc/roots-newtons-method.eps, doc/roots-secant-method.eps, doc/roots.texi, doc/siman-energy.eps, doc/siman-test.eps, doc/siman.texi, doc/sort.texi, doc/specfunc-airy.texi, doc/specfunc-bessel.texi, doc/specfunc-clausen.texi, doc/specfunc-coulomb.texi, doc/specfunc-coupling.texi, doc/specfunc-dawson.texi, doc/specfunc-debye.texi, doc/specfunc-dilog.texi, doc/specfunc-elementary.texi, doc/specfunc-ellint.texi, doc/specfunc-elljac.texi, doc/specfunc-erf.texi, doc/specfunc-exp.texi, doc/specfunc-expint.texi, doc/specfunc-fermi-dirac.texi, doc/specfunc-gamma.texi, doc/specfunc-gegenbauer.texi, doc/specfunc-hyperg.texi, doc/specfunc-laguerre.texi, doc/specfunc-lambert.texi, doc/specfunc-legendre.texi, doc/specfunc-log.texi, doc/specfunc-mathieu.texi, doc/specfunc-pow-int.texi, doc/specfunc-psi.texi, doc/specfunc-synchrotron.texi, doc/specfunc-transport.texi, doc/specfunc-trig.texi, doc/specfunc-zeta.texi, doc/specfunc.texi, doc/stamp-vti, doc/statistics.texi, doc/sum.texi, doc/texinfo.tex, doc/usage.texi, doc/vdp.eps, doc/vectors.texi, doc/version-ref.texi, doc/examples/blas.c, doc/examples/blas.out, doc/examples/block.c, doc/examples/block.out, doc/examples/bspline.c, doc/examples/cblas.c, doc/examples/cblas.out, doc/examples/cdf.c, doc/examples/cdf.out, doc/examples/cheb.c, doc/examples/combination.c, doc/examples/combination.out, doc/examples/const.c, doc/examples/const.out, doc/examples/demo_fn.c, doc/examples/demo_fn.h, doc/examples/diff.c, doc/examples/diff.out, doc/examples/dwt.c, doc/examples/dwt.dat, doc/examples/ecg.dat, doc/examples/eigen.c, doc/examples/eigen_nonsymm.c, doc/examples/expfit.c, doc/examples/fft.c, doc/examples/fftmr.c, doc/examples/fftreal.c, doc/examples/fitting.c, doc/examples/fitting2.c, doc/examples/fitting3.c, doc/examples/histogram.c, doc/examples/histogram2d.c, doc/examples/ieee.c, doc/examples/ieeeround.c, doc/examples/integration.c, doc/examples/integration.out, doc/examples/interp.c, doc/examples/interpp.c, doc/examples/intro.c, doc/examples/intro.out, doc/examples/linalglu.c, doc/examples/linalglu.out, doc/examples/matrix.c, doc/examples/matrixw.c, doc/examples/min.c, doc/examples/min.out, doc/examples/monte.c, doc/examples/nlfit.c, doc/examples/ntupler.c, doc/examples/ntuplew.c, doc/examples/ode-initval.c, doc/examples/odefixed.c, doc/examples/permseq.c, doc/examples/permshuffle.c, doc/examples/polyroots.c, doc/examples/polyroots.out, doc/examples/qrng.c, doc/examples/randpoisson.2.out, doc/examples/randpoisson.c, doc/examples/randpoisson.out, doc/examples/randwalk.c, doc/examples/rng.c, doc/examples/rng.out, doc/examples/rngunif.2.out, doc/examples/rngunif.c, doc/examples/rngunif.out, doc/examples/rootnewt.c, doc/examples/roots.c, doc/examples/siman.c, doc/examples/sortsmall.c, doc/examples/sortsmall.out, doc/examples/specfun.c, doc/examples/specfun.out, doc/examples/specfun_e.c, doc/examples/specfun_e.out, doc/examples/stat.c, doc/examples/stat.out, doc/examples/statsort.c, doc/examples/statsort.out, doc/examples/sum.c, doc/examples/sum.out, doc/examples/vector.c, doc/examples/vectorr.c, doc/examples/vectorview.c, doc/examples/vectorview.out, doc/examples/vectorw.c, eigen/ChangeLog, eigen/Makefile.am, eigen/Makefile.in, eigen/TODO, eigen/francis.c, eigen/gsl_eigen.h, eigen/herm.c, eigen/hermv.c, eigen/jacobi.c, eigen/nonsymm.c, eigen/nonsymmv.c, eigen/qrstep.c, eigen/schur.c, eigen/schur.h, eigen/sort.c, eigen/symm.c, eigen/symmv.c, eigen/test.c, err/ChangeLog, err/Makefile.am, err/Makefile.in, err/TODO, err/error.c, err/gsl_errno.h, err/gsl_message.h, err/message.c, err/stream.c, err/strerror.c, err/test.c, fft/ChangeLog, fft/Makefile.am, fft/Makefile.in, fft/TODO, fft/bitreverse.c, fft/bitreverse.h, fft/c_init.c, fft/c_main.c, fft/c_pass.h, fft/c_pass_2.c, fft/c_pass_3.c, fft/c_pass_4.c, fft/c_pass_5.c, fft/c_pass_6.c, fft/c_pass_7.c, fft/c_pass_n.c, fft/c_radix2.c, fft/compare.h, fft/compare_source.c, fft/complex_internal.h, fft/dft.c, fft/dft_source.c, fft/factorize.c, fft/factorize.h, fft/fft.c, fft/gsl_dft_complex.h, fft/gsl_dft_complex_float.h, fft/gsl_fft.h, fft/gsl_fft_complex.h, fft/gsl_fft_complex_float.h, fft/gsl_fft_halfcomplex.h, fft/gsl_fft_halfcomplex_float.h, fft/gsl_fft_real.h, fft/gsl_fft_real_float.h, fft/hc_init.c, fft/hc_main.c, fft/hc_pass.h, fft/hc_pass_2.c, fft/hc_pass_3.c, fft/hc_pass_4.c, fft/hc_pass_5.c, fft/hc_pass_n.c, fft/hc_radix2.c, fft/hc_unpack.c, fft/real_init.c, fft/real_main.c, fft/real_pass.h, fft/real_pass_2.c, fft/real_pass_3.c, fft/real_pass_4.c, fft/real_pass_5.c, fft/real_pass_n.c, fft/real_radix2.c, fft/real_unpack.c, fft/signals.c, fft/signals.h, fft/signals_source.c, fft/test.c, fft/test_complex_source.c, fft/test_real_source.c, fft/test_trap_source.c, fft/urand.c, fit/ChangeLog, fit/Makefile.am, fit/Makefile.in, fit/gsl_fit.h, fit/linear.c, fit/test.c, gsl/Makefile.am, gsl/Makefile.in, histogram/ChangeLog, histogram/Makefile.am, histogram/Makefile.in, histogram/TODO, histogram/add.c, histogram/add2d.c, histogram/calloc_range.c, histogram/calloc_range2d.c, histogram/copy.c, histogram/copy2d.c, histogram/file.c, histogram/file2d.c, histogram/find.c, histogram/find2d.c, histogram/get.c, histogram/get2d.c, histogram/gsl_histogram.h, histogram/gsl_histogram2d.h, histogram/init.c, histogram/init2d.c, histogram/maxval.c, histogram/maxval2d.c, histogram/oper.c, histogram/oper2d.c, histogram/params.c, histogram/params2d.c, histogram/pdf.c, histogram/pdf2d.c, histogram/reset.c, histogram/reset2d.c, histogram/stat.c, histogram/stat2d.c, histogram/test.c, histogram/test1d.c, histogram/test1d_resample.c, histogram/test1d_trap.c, histogram/test2d.c, histogram/test2d_resample.c, histogram/test2d_trap.c, histogram/urand.c, ieee-utils/ChangeLog, ieee-utils/Makefile.am, ieee-utils/Makefile.in, ieee-utils/TODO, ieee-utils/endian.c, ieee-utils/env.c, ieee-utils/fp-aix.c, ieee-utils/fp-darwin.c, ieee-utils/fp-darwin86.c, ieee-utils/fp-freebsd.c, ieee-utils/fp-gnuc99.c, ieee-utils/fp-gnum68k.c, ieee-utils/fp-gnuppc.c, ieee-utils/fp-gnusparc.c, ieee-utils/fp-gnux86.c, ieee-utils/fp-hpux.c, ieee-utils/fp-hpux11.c, ieee-utils/fp-irix.c, ieee-utils/fp-netbsd.c, ieee-utils/fp-openbsd.c, ieee-utils/fp-os2emx.c, ieee-utils/fp-solaris.c, ieee-utils/fp-sunos4.c, ieee-utils/fp-tru64.c, ieee-utils/fp-unknown.c, ieee-utils/fp.c, ieee-utils/gsl_ieee_utils.h, ieee-utils/make_rep.c, ieee-utils/print.c, ieee-utils/read.c, ieee-utils/standardize.c, ieee-utils/test.c, integration/ChangeLog, integration/Makefile.am, integration/Makefile.in, integration/TODO, integration/append.c, integration/err.c, integration/gsl_integration.h, integration/initialise.c, integration/positivity.c, integration/ptsort.c, integration/qag.c, integration/qagp.c, integration/qags.c, integration/qawc.c, integration/qawf.c, integration/qawo.c, integration/qaws.c, integration/qc25c.c, integration/qc25f.c, integration/qc25s.c, integration/qcheb.c, integration/qelg.c, integration/qk.c, integration/qk15.c, integration/qk21.c, integration/qk31.c, integration/qk41.c, integration/qk51.c, integration/qk61.c, integration/qmomo.c, integration/qmomof.c, integration/qng.c, integration/qng.h, integration/qpsrt.c, integration/qpsrt2.c, integration/reset.c, integration/set_initial.c, integration/test.c, integration/tests.c, integration/tests.h, integration/util.c, integration/workspace.c, interpolation/ChangeLog, interpolation/Makefile.am, interpolation/Makefile.in, interpolation/TODO, interpolation/accel.c, interpolation/akima.c, interpolation/bsearch.c, interpolation/bsearch.h, interpolation/cspline.c, interpolation/gsl_interp.h, interpolation/gsl_spline.h, interpolation/integ_eval.h, interpolation/interp.c, interpolation/linear.c, interpolation/poly.c, interpolation/spline.c, interpolation/test.c, linalg/ChangeLog, linalg/Makefile.am, linalg/Makefile.in, linalg/TODO, linalg/apply_givens.c, linalg/balance.c, linalg/balancemat.c, linalg/bidiag.c, linalg/cholesky.c, linalg/exponential.c, linalg/givens.c, linalg/gsl_linalg.h, linalg/hermtd.c, linalg/hessenberg.c, linalg/hh.c, linalg/householder.c, linalg/householdercomplex.c, linalg/lq.c, linalg/lu.c, linalg/luc.c, linalg/multiply.c, linalg/ptlq.c, linalg/qr.c, linalg/qrpt.c, linalg/svd.c, linalg/svdstep.c, linalg/symmtd.c, linalg/test.c, linalg/tridiag.c, linalg/tridiag.h, matrix/ChangeLog, matrix/Makefile.am, matrix/Makefile.in, matrix/TODO, matrix/copy.c, matrix/copy_source.c, matrix/file.c, matrix/file_source.c, matrix/getset.c, matrix/getset_source.c, matrix/gsl_matrix.h, matrix/gsl_matrix_char.h, matrix/gsl_matrix_complex_double.h, matrix/gsl_matrix_complex_float.h, matrix/gsl_matrix_complex_long_double.h, matrix/gsl_matrix_double.h, matrix/gsl_matrix_float.h, matrix/gsl_matrix_int.h, matrix/gsl_matrix_long.h, matrix/gsl_matrix_long_double.h, matrix/gsl_matrix_short.h, matrix/gsl_matrix_uchar.h, matrix/gsl_matrix_uint.h, matrix/gsl_matrix_ulong.h, matrix/gsl_matrix_ushort.h, matrix/init.c, matrix/init_source.c, matrix/matrix.c, matrix/matrix_source.c, matrix/minmax.c, matrix/minmax_source.c, matrix/oper.c, matrix/oper_complex_source.c, matrix/oper_source.c, matrix/prop.c, matrix/prop_source.c, matrix/rowcol.c, matrix/rowcol_source.c, matrix/submatrix.c, matrix/submatrix_source.c, matrix/swap.c, matrix/swap_source.c, matrix/test.c, matrix/test_complex_source.c, matrix/test_source.c, matrix/test_static.c, matrix/view.c, matrix/view.h, matrix/view_source.c, min/ChangeLog, min/Makefile.am, min/Makefile.in, min/bracketing.c, min/brent.c, min/convergence.c, min/fsolver.c, min/golden.c, min/gsl_min.h, min/min.h, min/test.c, min/test.h, min/test_funcs.c, monte/ChangeLog, monte/Makefile.am, monte/Makefile.in, monte/README, monte/TODO, monte/gsl_monte.h, monte/gsl_monte_miser.h, monte/gsl_monte_plain.h, monte/gsl_monte_vegas.h, monte/miser.c, monte/plain.c, monte/test.c, monte/test_main.c, monte/vegas.c, multifit/ChangeLog, multifit/Makefile.am, multifit/Makefile.in, multifit/TODO, multifit/convergence.c, multifit/covar.c, multifit/fdfsolver.c, multifit/fsolver.c, multifit/gradient.c, multifit/gsl_multifit.h, multifit/gsl_multifit_nlin.h, multifit/lmder.c, multifit/lmiterate.c, multifit/lmpar.c, multifit/lmset.c, multifit/lmutil.c, multifit/multilinear.c, multifit/qrsolv.c, multifit/test.c, multifit/test_brown.c, multifit/test_enso.c, multifit/test_estimator.c, multifit/test_filip.c, multifit/test_fn.c, multifit/test_hahn1.c, multifit/test_kirby2.c, multifit/test_longley.c, multifit/test_nelson.c, multifit/test_pontius.c, multifit/work.c, multimin/ChangeLog, multimin/Makefile.am, multimin/Makefile.in, multimin/TODO, multimin/conjugate_fr.c, multimin/conjugate_pr.c, multimin/convergence.c, multimin/diff.c, multimin/directional_minimize.c, multimin/fdfminimizer.c, multimin/fminimizer.c, multimin/gsl_multimin.h, multimin/linear_minimize.c, multimin/linear_wrapper.c, multimin/simplex.c, multimin/steepest_descent.c, multimin/test.c, multimin/test_funcs.c, multimin/test_funcs.h, multimin/vector_bfgs.c, multimin/vector_bfgs2.c, multiroots/ChangeLog, multiroots/Makefile.am, multiroots/Makefile.in, multiroots/broyden.c, multiroots/convergence.c, multiroots/dnewton.c, multiroots/dogleg.c, multiroots/enorm.c, multiroots/fdfsolver.c, multiroots/fdjac.c, multiroots/fsolver.c, multiroots/gnewton.c, multiroots/gsl_multiroots.h, multiroots/hybrid.c, multiroots/hybridj.c, multiroots/newton.c, multiroots/test.c, multiroots/test_funcs.c, multiroots/test_funcs.h, ntuple/ChangeLog, ntuple/Makefile.am, ntuple/Makefile.in, ntuple/gsl_ntuple.h, ntuple/ntuple.c, ntuple/test.c, ode-initval/ChangeLog, ode-initval/Makefile.am, ode-initval/Makefile.in, ode-initval/TODO, ode-initval/bsimp.c, ode-initval/control.c, ode-initval/cscal.c, ode-initval/cstd.c, ode-initval/evolve.c, ode-initval/gear1.c, ode-initval/gear2.c, ode-initval/gsl_odeiv.h, ode-initval/odeiv_util.h, ode-initval/rk2.c, ode-initval/rk2imp.c, ode-initval/rk2simp.c, ode-initval/rk4.c, ode-initval/rk4imp.c, ode-initval/rk8pd.c, ode-initval/rkck.c, ode-initval/rkf45.c, ode-initval/step.c, ode-initval/test.c, permutation/ChangeLog, permutation/Makefile.am, permutation/Makefile.in, permutation/canonical.c, permutation/file.c, permutation/gsl_permutation.h, permutation/gsl_permute.h, permutation/gsl_permute_char.h, permutation/gsl_permute_complex_double.h, permutation/gsl_permute_complex_float.h, permutation/gsl_permute_complex_long_double.h, permutation/gsl_permute_double.h, permutation/gsl_permute_float.h, permutation/gsl_permute_int.h, permutation/gsl_permute_long.h, permutation/gsl_permute_long_double.h, permutation/gsl_permute_short.h, permutation/gsl_permute_uchar.h, permutation/gsl_permute_uint.h, permutation/gsl_permute_ulong.h, permutation/gsl_permute_ushort.h, permutation/gsl_permute_vector.h, permutation/gsl_permute_vector_char.h, permutation/gsl_permute_vector_complex_double.h, permutation/gsl_permute_vector_complex_float.h, permutation/gsl_permute_vector_complex_long_double.h, permutation/gsl_permute_vector_double.h, permutation/gsl_permute_vector_float.h, permutation/gsl_permute_vector_int.h, permutation/gsl_permute_vector_long.h, permutation/gsl_permute_vector_long_double.h, permutation/gsl_permute_vector_short.h, permutation/gsl_permute_vector_uchar.h, permutation/gsl_permute_vector_uint.h, permutation/gsl_permute_vector_ulong.h, permutation/gsl_permute_vector_ushort.h, permutation/init.c, permutation/permutation.c, permutation/permute.c, permutation/permute_source.c, permutation/test.c, poly/ChangeLog, poly/Makefile.am, poly/Makefile.in, poly/TODO, poly/balance.c, poly/companion.c, poly/dd.c, poly/eval.c, poly/gsl_poly.h, poly/qr.c, poly/solve_cubic.c, poly/solve_quadratic.c, poly/test.c, poly/zsolve.c, poly/zsolve_cubic.c, poly/zsolve_init.c, poly/zsolve_quadratic.c, qrng/ChangeLog, qrng/Makefile.am, qrng/Makefile.in, qrng/TODO, qrng/gsl_qrng.h, qrng/niederreiter-2.c, qrng/qrng.c, qrng/sobol.c, qrng/test.c, randist/ChangeLog, randist/Makefile.am, randist/Makefile.in, randist/TODO, randist/bernoulli.c, randist/beta.c, randist/bigauss.c, randist/binomial.c, randist/binomial_tpe.c, randist/cauchy.c, randist/chisq.c, randist/dirichlet.c, randist/discrete.c, randist/erlang.c, randist/exponential.c, randist/exppow.c, randist/fdist.c, randist/flat.c, randist/gamma.c, randist/gauss.c, randist/gausstail.c, randist/gausszig.c, randist/geometric.c, randist/gsl_randist.h, randist/gumbel.c, randist/hyperg.c, randist/landau.c, randist/laplace.c, randist/levy.c, randist/logarithmic.c, randist/logistic.c, randist/lognormal.c, randist/multinomial.c, randist/nbinomial.c, randist/pareto.c, randist/pascal.c, randist/poisson.c, randist/rayleigh.c, randist/shuffle.c, randist/sphere.c, randist/tdist.c, randist/test.c, randist/weibull.c, rng/ChangeLog, rng/Makefile.am, rng/Makefile.in, rng/TODO, rng/borosh13.c, rng/cmrg.c, rng/coveyou.c, rng/default.c, rng/file.c, rng/fishman18.c, rng/fishman20.c, rng/fishman2x.c, rng/gfsr4.c, rng/gsl_rng.h, rng/knuthran.c, rng/knuthran2.c, rng/knuthran2002.c, rng/lecuyer21.c, rng/minstd.c, rng/mrg.c, rng/mt.c, rng/r250.c, rng/ran0.c, rng/ran1.c, rng/ran2.c, rng/ran3.c, rng/rand.c, rng/rand48.c, rng/random.c, rng/randu.c, rng/ranf.c, rng/ranlux.c, rng/ranlxd.c, rng/ranlxs.c, rng/ranmar.c, rng/rng.c, rng/schrage.c, rng/slatec.c, rng/taus.c, rng/taus113.c, rng/test.c, rng/transputer.c, rng/tt.c, rng/types.c, rng/uni.c, rng/uni32.c, rng/vax.c, rng/waterman14.c, rng/zuf.c, roots/ChangeLog, roots/Makefile.am, roots/Makefile.in, roots/TODO, roots/bisection.c, roots/brent.c, roots/convergence.c, roots/falsepos.c, roots/fdfsolver.c, roots/fsolver.c, roots/gsl_roots.h, roots/newton.c, roots/roots.h, roots/secant.c, roots/steffenson.c, roots/test.c, roots/test.h, roots/test_funcs.c, siman/ChangeLog, siman/Makefile.am, siman/Makefile.in, siman/TODO, siman/gsl_siman.h, siman/siman.c, siman/siman_test_driver.sh, siman/siman_tsp.c, siman/test.c, sort/ChangeLog, sort/Makefile.am, sort/Makefile.in, sort/TODO, sort/gsl_heapsort.h, sort/gsl_sort.h, sort/gsl_sort_char.h, sort/gsl_sort_double.h, sort/gsl_sort_float.h, sort/gsl_sort_int.h, sort/gsl_sort_long.h, sort/gsl_sort_long_double.h, sort/gsl_sort_short.h, sort/gsl_sort_uchar.h, sort/gsl_sort_uint.h, sort/gsl_sort_ulong.h, sort/gsl_sort_ushort.h, sort/gsl_sort_vector.h, sort/gsl_sort_vector_char.h, sort/gsl_sort_vector_double.h, sort/gsl_sort_vector_float.h, sort/gsl_sort_vector_int.h, sort/gsl_sort_vector_long.h, sort/gsl_sort_vector_long_double.h, sort/gsl_sort_vector_short.h, sort/gsl_sort_vector_uchar.h, sort/gsl_sort_vector_uint.h, sort/gsl_sort_vector_ulong.h, sort/gsl_sort_vector_ushort.h, sort/sort.c, sort/sortind.c, sort/sortvec.c, sort/sortvec_source.c, sort/sortvecind.c, sort/sortvecind_source.c, sort/subset.c, sort/subset_source.c, sort/subsetind.c, sort/subsetind_source.c, sort/test.c, sort/test_heapsort.c, sort/test_source.c, specfunc/ChangeLog, specfunc/Makefile.am, specfunc/Makefile.in, specfunc/TODO, specfunc/airy.c, specfunc/airy_der.c, specfunc/airy_zero.c, specfunc/atanint.c, specfunc/bessel.c, specfunc/bessel.h, specfunc/bessel_I0.c, specfunc/bessel_I1.c, specfunc/bessel_In.c, specfunc/bessel_Inu.c, specfunc/bessel_J0.c, specfunc/bessel_J1.c, specfunc/bessel_Jn.c, specfunc/bessel_Jnu.c, specfunc/bessel_K0.c, specfunc/bessel_K1.c, specfunc/bessel_Kn.c, specfunc/bessel_Knu.c, specfunc/bessel_Y0.c, specfunc/bessel_Y1.c, specfunc/bessel_Yn.c, specfunc/bessel_Ynu.c, specfunc/bessel_amp_phase.c, specfunc/bessel_amp_phase.h, specfunc/bessel_i.c, specfunc/bessel_j.c, specfunc/bessel_k.c, specfunc/bessel_olver.c, specfunc/bessel_olver.h, specfunc/bessel_sequence.c, specfunc/bessel_temme.c, specfunc/bessel_temme.h, specfunc/bessel_y.c, specfunc/bessel_zero.c, specfunc/beta.c, specfunc/beta_inc.c, specfunc/cheb_eval.c, specfunc/cheb_eval_mode.c, specfunc/chebyshev.h, specfunc/check.h, specfunc/clausen.c, specfunc/coulomb.c, specfunc/coulomb_bound.c, specfunc/coupling.c, specfunc/dawson.c, specfunc/debye.c, specfunc/dilog.c, specfunc/elementary.c, specfunc/ellint.c, specfunc/elljac.c, specfunc/erfc.c, specfunc/error.h, specfunc/eval.h, specfunc/exp.c, specfunc/expint.c, specfunc/expint3.c, specfunc/fermi_dirac.c, specfunc/gamma.c, specfunc/gamma_inc.c, specfunc/gegenbauer.c, specfunc/gsl_sf.h, specfunc/gsl_sf_airy.h, specfunc/gsl_sf_bessel.h, specfunc/gsl_sf_clausen.h, specfunc/gsl_sf_coulomb.h, specfunc/gsl_sf_coupling.h, specfunc/gsl_sf_dawson.h, specfunc/gsl_sf_debye.h, specfunc/gsl_sf_dilog.h, specfunc/gsl_sf_elementary.h, specfunc/gsl_sf_ellint.h, specfunc/gsl_sf_elljac.h, specfunc/gsl_sf_erf.h, specfunc/gsl_sf_exp.h, specfunc/gsl_sf_expint.h, specfunc/gsl_sf_fermi_dirac.h, specfunc/gsl_sf_gamma.h, specfunc/gsl_sf_gegenbauer.h, specfunc/gsl_sf_hyperg.h, specfunc/gsl_sf_laguerre.h, specfunc/gsl_sf_lambert.h, specfunc/gsl_sf_legendre.h, specfunc/gsl_sf_log.h, specfunc/gsl_sf_mathieu.h, specfunc/gsl_sf_pow_int.h, specfunc/gsl_sf_psi.h, specfunc/gsl_sf_result.h, specfunc/gsl_sf_synchrotron.h, specfunc/gsl_sf_transport.h, specfunc/gsl_sf_trig.h, specfunc/gsl_sf_zeta.h, specfunc/gsl_specfunc.h, specfunc/hyperg.c, specfunc/hyperg.h, specfunc/hyperg_0F1.c, specfunc/hyperg_1F1.c, specfunc/hyperg_2F0.c, specfunc/hyperg_2F1.c, specfunc/hyperg_U.c, specfunc/laguerre.c, specfunc/lambert.c, specfunc/legendre.h, specfunc/legendre_H3d.c, specfunc/legendre_Qn.c, specfunc/legendre_con.c, specfunc/legendre_poly.c, specfunc/log.c, specfunc/mathieu_angfunc.c, specfunc/mathieu_charv.c, specfunc/mathieu_coeff.c, specfunc/mathieu_radfunc.c, specfunc/mathieu_workspace.c, specfunc/poch.c, specfunc/pow_int.c, specfunc/psi.c, specfunc/recurse.h, specfunc/result.c, specfunc/shint.c, specfunc/sinint.c, specfunc/synchrotron.c, specfunc/test_airy.c, specfunc/test_bessel.c, specfunc/test_coulomb.c, specfunc/test_dilog.c, specfunc/test_gamma.c, specfunc/test_hyperg.c, specfunc/test_legendre.c, specfunc/test_mathieu.c, specfunc/test_sf.c, specfunc/test_sf.h, specfunc/transport.c, specfunc/trig.c, specfunc/zeta.c, statistics/ChangeLog, statistics/Makefile.am, statistics/Makefile.in, statistics/TODO, statistics/absdev.c, statistics/absdev_source.c, statistics/covariance.c, statistics/covariance_source.c, statistics/gsl_statistics.h, statistics/gsl_statistics_char.h, statistics/gsl_statistics_double.h, statistics/gsl_statistics_float.h, statistics/gsl_statistics_int.h, statistics/gsl_statistics_long.h, statistics/gsl_statistics_long_double.h, statistics/gsl_statistics_short.h, statistics/gsl_statistics_uchar.h, statistics/gsl_statistics_uint.h, statistics/gsl_statistics_ulong.h, statistics/gsl_statistics_ushort.h, statistics/kurtosis.c, statistics/kurtosis_source.c, statistics/lag1.c, statistics/lag1_source.c, statistics/mean.c, statistics/mean_source.c, statistics/median.c, statistics/median_source.c, statistics/minmax.c, statistics/minmax_source.c, statistics/p_variance.c, statistics/p_variance_source.c, statistics/quantiles.c, statistics/quantiles_source.c, statistics/skew.c, statistics/skew_source.c, statistics/test.c, statistics/test_float_source.c, statistics/test_int_source.c, statistics/test_nist.c, statistics/ttest.c, statistics/ttest_source.c, statistics/variance.c, statistics/variance_source.c, statistics/wabsdev.c, statistics/wabsdev_source.c, statistics/wkurtosis.c, statistics/wkurtosis_source.c, statistics/wmean.c, statistics/wmean_source.c, statistics/wskew.c, statistics/wskew_source.c, statistics/wvariance.c, statistics/wvariance_source.c, sum/ChangeLog, sum/Makefile.am, sum/Makefile.in, sum/gsl_sum.h, sum/levin_u.c, sum/levin_utrunc.c, sum/test.c, sum/work_u.c, sum/work_utrunc.c, sys/ChangeLog, sys/Makefile.am, sys/Makefile.in, sys/coerce.c, sys/expm1.c, sys/fcmp.c, sys/fdiv.c, sys/gsl_sys.h, sys/hypot.c, sys/infnan.c, sys/invhyp.c, sys/ldfrexp.c, sys/log1p.c, sys/minmax.c, sys/pow_int.c, sys/prec.c, sys/test.c, test/ChangeLog, test/Makefile.am, test/Makefile.in, test/gsl_test.h, test/results.c, utils/Makefile.am, utils/Makefile.in, utils/README, utils/memcpy.c, utils/memmove.c, utils/placeholder.c, utils/strdup.c, utils/strtol.c, utils/strtoul.c, utils/system.h, vector/ChangeLog, vector/Makefile.am, vector/Makefile.in, vector/TODO, vector/copy.c, vector/copy_source.c, vector/file.c, vector/file_source.c, vector/gsl_vector.h, vector/gsl_vector_char.h, vector/gsl_vector_complex.h, vector/gsl_vector_complex_double.h, vector/gsl_vector_complex_float.h, vector/gsl_vector_complex_long_double.h, vector/gsl_vector_double.h, vector/gsl_vector_float.h, vector/gsl_vector_int.h, vector/gsl_vector_long.h, vector/gsl_vector_long_double.h, vector/gsl_vector_short.h, vector/gsl_vector_uchar.h, vector/gsl_vector_uint.h, vector/gsl_vector_ulong.h, vector/gsl_vector_ushort.h, vector/init.c, vector/init_source.c, vector/minmax.c, vector/minmax_source.c, vector/oper.c, vector/oper_source.c, vector/prop.c, vector/prop_source.c, vector/reim.c, vector/reim_source.c, vector/subvector.c, vector/subvector_source.c, vector/swap.c, vector/swap_source.c, vector/test.c, vector/test_complex_source.c, vector/test_source.c, vector/test_static.c, vector/vector.c, vector/vector_source.c, vector/view.c, vector/view.h, vector/view_source.c, wavelet/ChangeLog, wavelet/Makefile.am, wavelet/Makefile.in, wavelet/TODO, wavelet/bspline.c, wavelet/daubechies.c, wavelet/dwt.c, wavelet/gsl_wavelet.h, wavelet/gsl_wavelet2d.h, wavelet/haar.c, wavelet/test.c, wavelet/wavelet.c: New files.
Diffstat (limited to 'gsl-1.9/specfunc/legendre_con.c')
-rw-r--r--gsl-1.9/specfunc/legendre_con.c1373
1 files changed, 1373 insertions, 0 deletions
diff --git a/gsl-1.9/specfunc/legendre_con.c b/gsl-1.9/specfunc/legendre_con.c
new file mode 100644
index 0000000..6d60550
--- /dev/null
+++ b/gsl-1.9/specfunc/legendre_con.c
@@ -0,0 +1,1373 @@
+/* specfunc/legendre_con.c
+ *
+ * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* Author: G. Jungman */
+
+#include <config.h>
+#include <gsl/gsl_math.h>
+#include <gsl/gsl_errno.h>
+#include <gsl/gsl_poly.h>
+#include <gsl/gsl_sf_exp.h>
+#include <gsl/gsl_sf_trig.h>
+#include <gsl/gsl_sf_gamma.h>
+#include <gsl/gsl_sf_ellint.h>
+#include <gsl/gsl_sf_pow_int.h>
+#include <gsl/gsl_sf_bessel.h>
+#include <gsl/gsl_sf_hyperg.h>
+#include <gsl/gsl_sf_legendre.h>
+
+#include "error.h"
+#include "legendre.h"
+
+#define Root_2OverPi_ 0.797884560802865355879892
+#define locEPS (1000.0*GSL_DBL_EPSILON)
+
+
+/*-*-*-*-*-*-*-*-*-*-*-* Private Section *-*-*-*-*-*-*-*-*-*-*-*/
+
+
+#define RECURSE_LARGE (1.0e-5*GSL_DBL_MAX)
+#define RECURSE_SMALL (1.0e+5*GSL_DBL_MIN)
+
+
+/* Continued fraction for f_{ell+1}/f_ell
+ * f_ell := P^{-mu-ell}_{-1/2 + I tau}(x), x < 1.0
+ *
+ * Uses standard CF method from Temme's book.
+ */
+static
+int
+conicalP_negmu_xlt1_CF1(const double mu, const int ell, const double tau,
+ const double x, gsl_sf_result * result)
+{
+ const double RECUR_BIG = GSL_SQRT_DBL_MAX;
+ const int maxiter = 5000;
+ int n = 1;
+ double xi = x/(sqrt(1.0-x)*sqrt(1.0+x));
+ double Anm2 = 1.0;
+ double Bnm2 = 0.0;
+ double Anm1 = 0.0;
+ double Bnm1 = 1.0;
+ double a1 = 1.0;
+ double b1 = 2.0*(mu + ell + 1.0) * xi;
+ double An = b1*Anm1 + a1*Anm2;
+ double Bn = b1*Bnm1 + a1*Bnm2;
+ double an, bn;
+ double fn = An/Bn;
+
+ while(n < maxiter) {
+ double old_fn;
+ double del;
+ n++;
+ Anm2 = Anm1;
+ Bnm2 = Bnm1;
+ Anm1 = An;
+ Bnm1 = Bn;
+ an = tau*tau + (mu - 0.5 + ell + n)*(mu - 0.5 + ell + n);
+ bn = 2.0*(ell + mu + n) * xi;
+ An = bn*Anm1 + an*Anm2;
+ Bn = bn*Bnm1 + an*Bnm2;
+
+ if(fabs(An) > RECUR_BIG || fabs(Bn) > RECUR_BIG) {
+ An /= RECUR_BIG;
+ Bn /= RECUR_BIG;
+ Anm1 /= RECUR_BIG;
+ Bnm1 /= RECUR_BIG;
+ Anm2 /= RECUR_BIG;
+ Bnm2 /= RECUR_BIG;
+ }
+
+ old_fn = fn;
+ fn = An/Bn;
+ del = old_fn/fn;
+
+ if(fabs(del - 1.0) < 2.0*GSL_DBL_EPSILON) break;
+ }
+
+ result->val = fn;
+ result->err = 4.0 * GSL_DBL_EPSILON * (sqrt(n) + 1.0) * fabs(fn);
+
+ if(n >= maxiter)
+ GSL_ERROR ("error", GSL_EMAXITER);
+ else
+ return GSL_SUCCESS;
+}
+
+
+/* Continued fraction for f_{ell+1}/f_ell
+ * f_ell := P^{-mu-ell}_{-1/2 + I tau}(x), x >= 1.0
+ *
+ * Uses Gautschi (Euler) equivalent series.
+ */
+static
+int
+conicalP_negmu_xgt1_CF1(const double mu, const int ell, const double tau,
+ const double x, gsl_sf_result * result)
+{
+ const int maxk = 20000;
+ const double gamma = 1.0-1.0/(x*x);
+ const double pre = sqrt(x-1.0)*sqrt(x+1.0) / (x*(2.0*(ell+mu+1.0)));
+ double tk = 1.0;
+ double sum = 1.0;
+ double rhok = 0.0;
+ int k;
+
+ for(k=1; k<maxk; k++) {
+ double tlk = 2.0*(ell + mu + k);
+ double l1k = (ell + mu - 0.5 + 1.0 + k);
+ double ak = -(tau*tau + l1k*l1k)/(tlk*(tlk+2.0)) * gamma;
+ rhok = -ak*(1.0 + rhok)/(1.0 + ak*(1.0 + rhok));
+ tk *= rhok;
+ sum += tk;
+ if(fabs(tk/sum) < GSL_DBL_EPSILON) break;
+ }
+
+ result->val = pre * sum;
+ result->err = fabs(pre * tk);
+ result->err += 2.0 * GSL_DBL_EPSILON * (sqrt(k) + 1.0) * fabs(pre*sum);
+
+ if(k >= maxk)
+ GSL_ERROR ("error", GSL_EMAXITER);
+ else
+ return GSL_SUCCESS;
+}
+
+
+/* Implementation of large negative mu asymptotic
+ * [Dunster, Proc. Roy. Soc. Edinburgh 119A, 311 (1991), p. 326]
+ */
+
+inline
+static double olver_U1(double beta2, double p)
+{
+ return (p-1.0)/(24.0*(1.0+beta2)) * (3.0 + beta2*(2.0 + 5.0*p*(1.0+p)));
+}
+
+inline
+static double olver_U2(double beta2, double p)
+{
+ double beta4 = beta2*beta2;
+ double p2 = p*p;
+ double poly1 = 4.0*beta4 + 84.0*beta2 - 63.0;
+ double poly2 = 16.0*beta4 + 90.0*beta2 - 81.0;
+ double poly3 = beta2*p2*(97.0*beta2 - 432.0 + 77.0*p*(beta2-6.0) - 385.0*beta2*p2*(1.0 + p));
+ return (1.0-p)/(1152.0*(1.0+beta2)) * (poly1 + poly2 + poly3);
+}
+
+static const double U3c1[] = { -1307.0, -1647.0, 3375.0, 3675.0 };
+static const double U3c2[] = { 29366.0, 35835.0, -252360.0, -272630.0,
+ 276810.0, 290499.0 };
+static const double U3c3[] = { -29748.0, -8840.0, 1725295.0, 1767025.0,
+ -7313470.0, -754778.0, 6309875.0, 6480045.0 };
+static const double U3c4[] = { 2696.0, -16740.0, -524250.0, -183975.0,
+ 14670540.0, 14172939.0, -48206730.0, -48461985.0,
+ 36756720.0, 37182145.0 };
+static const double U3c5[] = { 9136.0, 22480.0, 12760.0,
+ -252480.0, -4662165.0, -1705341.0,
+ 92370135.0, 86244015.0, -263678415.0,
+ -260275015.0, 185910725.0, 185910725.0 };
+
+#if 0
+static double olver_U3(double beta2, double p)
+{
+ double beta4 = beta2*beta2;
+ double beta6 = beta4*beta2;
+ double opb2s = (1.0+beta2)*(1.0+beta2);
+ double den = 39813120.0 * opb2s*opb2s;
+ double poly1 = gsl_poly_eval(U3c1, 4, p);
+ double poly2 = gsl_poly_eval(U3c2, 6, p);
+ double poly3 = gsl_poly_eval(U3c3, 8, p);
+ double poly4 = gsl_poly_eval(U3c4, 10, p);
+ double poly5 = gsl_poly_eval(U3c5, 12, p);
+
+ return (p-1.0)*( 1215.0*poly1 + 324.0*beta2*poly2
+ + 54.0*beta4*poly3 + 12.0*beta6*poly4
+ + beta4*beta4*poly5
+ ) / den;
+}
+#endif /* 0 */
+
+
+/* Large negative mu asymptotic
+ * P^{-mu}_{-1/2 + I tau}, mu -> Inf
+ * |x| < 1
+ *
+ * [Dunster, Proc. Roy. Soc. Edinburgh 119A, 311 (1991), p. 326]
+ */
+int
+gsl_sf_conicalP_xlt1_large_neg_mu_e(double mu, double tau, double x,
+ gsl_sf_result * result, double * ln_multiplier)
+{
+ double beta = tau/mu;
+ double beta2 = beta*beta;
+ double S = beta * acos((1.0-beta2)/(1.0+beta2));
+ double p = x/sqrt(beta2*(1.0-x*x) + 1.0);
+ gsl_sf_result lg_mup1;
+ int lg_stat = gsl_sf_lngamma_e(mu+1.0, &lg_mup1);
+ double ln_pre_1 = 0.5*mu*(S - log(1.0+beta2) + log((1.0-p)/(1.0+p))) - lg_mup1.val;
+ double ln_pre_2 = -0.25 * log(1.0 + beta2*(1.0-x));
+ double ln_pre_3 = -tau * atan(p*beta);
+ double ln_pre = ln_pre_1 + ln_pre_2 + ln_pre_3;
+ double sum = 1.0 - olver_U1(beta2, p)/mu + olver_U2(beta2, p)/(mu*mu);
+
+ if(sum == 0.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ *ln_multiplier = 0.0;
+ return GSL_SUCCESS;
+ }
+ else {
+ int stat_e = gsl_sf_exp_mult_e(ln_pre, sum, result);
+ if(stat_e != GSL_SUCCESS) {
+ result->val = sum;
+ result->err = 2.0 * GSL_DBL_EPSILON * fabs(sum);
+ *ln_multiplier = ln_pre;
+ }
+ else {
+ *ln_multiplier = 0.0;
+ }
+ return lg_stat;
+ }
+}
+
+
+/* Implementation of large tau asymptotic
+ *
+ * A_n^{-mu}, B_n^{-mu} [Olver, p.465, 469]
+ */
+
+inline
+static double olver_B0_xi(double mu, double xi)
+{
+ return (1.0 - 4.0*mu*mu)/(8.0*xi) * (1.0/tanh(xi) - 1.0/xi);
+}
+
+static double olver_A1_xi(double mu, double xi, double x)
+{
+ double B = olver_B0_xi(mu, xi);
+ double psi;
+ if(fabs(x - 1.0) < GSL_ROOT4_DBL_EPSILON) {
+ double y = x - 1.0;
+ double s = -1.0/3.0 + y*(2.0/15.0 - y *(61.0/945.0 - 452.0/14175.0*y));
+ psi = (4.0*mu*mu - 1.0)/16.0 * s;
+ }
+ else {
+ psi = (4.0*mu*mu - 1.0)/16.0 * (1.0/(x*x-1.0) - 1.0/(xi*xi));
+ }
+ return 0.5*xi*xi*B*B + (mu+0.5)*B - psi + mu/6.0*(0.25 - mu*mu);
+}
+
+inline
+static double olver_B0_th(double mu, double theta)
+{
+ return -(1.0 - 4.0*mu*mu)/(8.0*theta) * (1.0/tan(theta) - 1.0/theta);
+}
+
+static double olver_A1_th(double mu, double theta, double x)
+{
+ double B = olver_B0_th(mu, theta);
+ double psi;
+ if(fabs(x - 1.0) < GSL_ROOT4_DBL_EPSILON) {
+ double y = 1.0 - x;
+ double s = -1.0/3.0 + y*(2.0/15.0 - y *(61.0/945.0 - 452.0/14175.0*y));
+ psi = (4.0*mu*mu - 1.0)/16.0 * s;
+ }
+ else {
+ psi = (4.0*mu*mu - 1.0)/16.0 * (1.0/(x*x-1.0) + 1.0/(theta*theta));
+ }
+ return -0.5*theta*theta*B*B + (mu+0.5)*B - psi + mu/6.0*(0.25 - mu*mu);
+}
+
+
+/* Large tau uniform asymptotics
+ * P^{-mu}_{-1/2 + I tau}
+ * 1 < x
+ * tau -> Inf
+ * [Olver, p. 469]
+ */
+int
+gsl_sf_conicalP_xgt1_neg_mu_largetau_e(const double mu, const double tau,
+ const double x, double acosh_x,
+ gsl_sf_result * result, double * ln_multiplier)
+{
+ double xi = acosh_x;
+ double ln_xi_pre;
+ double ln_pre;
+ double sumA, sumB, sum;
+ double arg;
+ gsl_sf_result J_mup1;
+ gsl_sf_result J_mu;
+ double J_mum1;
+
+ if(xi < GSL_ROOT4_DBL_EPSILON) {
+ ln_xi_pre = -xi*xi/6.0; /* log(1.0 - xi*xi/6.0) */
+ }
+ else {
+ gsl_sf_result lnshxi;
+ gsl_sf_lnsinh_e(xi, &lnshxi);
+ ln_xi_pre = log(xi) - lnshxi.val; /* log(xi/sinh(xi) */
+ }
+
+ ln_pre = 0.5*ln_xi_pre - mu*log(tau);
+
+ arg = tau*xi;
+
+ gsl_sf_bessel_Jnu_e(mu + 1.0, arg, &J_mup1);
+ gsl_sf_bessel_Jnu_e(mu, arg, &J_mu);
+ J_mum1 = -J_mup1.val + 2.0*mu/arg*J_mu.val; /* careful of mu < 1 */
+
+ sumA = 1.0 - olver_A1_xi(-mu, xi, x)/(tau*tau);
+ sumB = olver_B0_xi(-mu, xi);
+ sum = J_mu.val * sumA - xi/tau * J_mum1 * sumB;
+
+ if(sum == 0.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ *ln_multiplier = 0.0;
+ return GSL_SUCCESS;
+ }
+ else {
+ int stat_e = gsl_sf_exp_mult_e(ln_pre, sum, result);
+ if(stat_e != GSL_SUCCESS) {
+ result->val = sum;
+ result->err = 2.0 * GSL_DBL_EPSILON * fabs(sum);
+ *ln_multiplier = ln_pre;
+ }
+ else {
+ *ln_multiplier = 0.0;
+ }
+ return GSL_SUCCESS;
+ }
+}
+
+
+/* Large tau uniform asymptotics
+ * P^{-mu}_{-1/2 + I tau}
+ * -1 < x < 1
+ * tau -> Inf
+ * [Olver, p. 473]
+ */
+int
+gsl_sf_conicalP_xlt1_neg_mu_largetau_e(const double mu, const double tau,
+ const double x, const double acos_x,
+ gsl_sf_result * result, double * ln_multiplier)
+{
+ double theta = acos_x;
+ double ln_th_pre;
+ double ln_pre;
+ double sumA, sumB, sum, sumerr;
+ double arg;
+ gsl_sf_result I_mup1, I_mu;
+ double I_mum1;
+
+ if(theta < GSL_ROOT4_DBL_EPSILON) {
+ ln_th_pre = theta*theta/6.0; /* log(1.0 + theta*theta/6.0) */
+ }
+ else {
+ ln_th_pre = log(theta/sin(theta));
+ }
+
+ ln_pre = 0.5 * ln_th_pre - mu * log(tau);
+
+ arg = tau*theta;
+ gsl_sf_bessel_Inu_e(mu + 1.0, arg, &I_mup1);
+ gsl_sf_bessel_Inu_e(mu, arg, &I_mu);
+ I_mum1 = I_mup1.val + 2.0*mu/arg * I_mu.val; /* careful of mu < 1 */
+
+ sumA = 1.0 - olver_A1_th(-mu, theta, x)/(tau*tau);
+ sumB = olver_B0_th(-mu, theta);
+ sum = I_mu.val * sumA - theta/tau * I_mum1 * sumB;
+ sumerr = fabs(I_mu.err * sumA);
+ sumerr += fabs(I_mup1.err * theta/tau * sumB);
+ sumerr += fabs(I_mu.err * theta/tau * sumB * 2.0 * mu/arg);
+
+ if(sum == 0.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ *ln_multiplier = 0.0;
+ return GSL_SUCCESS;
+ }
+ else {
+ int stat_e = gsl_sf_exp_mult_e(ln_pre, sum, result);
+ if(stat_e != GSL_SUCCESS) {
+ result->val = sum;
+ result->err = sumerr;
+ result->err += GSL_DBL_EPSILON * fabs(sum);
+ *ln_multiplier = ln_pre;
+ }
+ else {
+ *ln_multiplier = 0.0;
+ }
+ return GSL_SUCCESS;
+ }
+}
+
+
+/* Hypergeometric function which appears in the
+ * large x expansion below:
+ *
+ * 2F1(1/4 - mu/2 - I tau/2, 3/4 - mu/2 - I tau/2, 1 - I tau, y)
+ *
+ * Note that for the usage below y = 1/x^2;
+ */
+static
+int
+conicalP_hyperg_large_x(const double mu, const double tau, const double y,
+ double * reF, double * imF)
+{
+ const int kmax = 1000;
+ const double re_a = 0.25 - 0.5*mu;
+ const double re_b = 0.75 - 0.5*mu;
+ const double re_c = 1.0;
+ const double im_a = -0.5*tau;
+ const double im_b = -0.5*tau;
+ const double im_c = -tau;
+
+ double re_sum = 1.0;
+ double im_sum = 0.0;
+ double re_term = 1.0;
+ double im_term = 0.0;
+ int k;
+
+ for(k=1; k<=kmax; k++) {
+ double re_ak = re_a + k - 1.0;
+ double re_bk = re_b + k - 1.0;
+ double re_ck = re_c + k - 1.0;
+ double im_ak = im_a;
+ double im_bk = im_b;
+ double im_ck = im_c;
+ double den = re_ck*re_ck + im_ck*im_ck;
+ double re_multiplier = ((re_ak*re_bk - im_ak*im_bk)*re_ck + im_ck*(im_ak*re_bk + re_ak*im_bk)) / den;
+ double im_multiplier = ((im_ak*re_bk + re_ak*im_bk)*re_ck - im_ck*(re_ak*re_bk - im_ak*im_bk)) / den;
+ double re_tmp = re_multiplier*re_term - im_multiplier*im_term;
+ double im_tmp = im_multiplier*re_term + re_multiplier*im_term;
+ double asum = fabs(re_sum) + fabs(im_sum);
+ re_term = y/k * re_tmp;
+ im_term = y/k * im_tmp;
+ if(fabs(re_term/asum) < GSL_DBL_EPSILON && fabs(im_term/asum) < GSL_DBL_EPSILON) break;
+ re_sum += re_term;
+ im_sum += im_term;
+ }
+
+ *reF = re_sum;
+ *imF = im_sum;
+
+ if(k == kmax)
+ GSL_ERROR ("error", GSL_EMAXITER);
+ else
+ return GSL_SUCCESS;
+}
+
+
+/* P^{mu}_{-1/2 + I tau}
+ * x->Inf
+ */
+int
+gsl_sf_conicalP_large_x_e(const double mu, const double tau, const double x,
+ gsl_sf_result * result, double * ln_multiplier)
+{
+ /* 2F1 term
+ */
+ double y = ( x < 0.5*GSL_SQRT_DBL_MAX ? 1.0/(x*x) : 0.0 );
+ double reF, imF;
+ int stat_F = conicalP_hyperg_large_x(mu, tau, y, &reF, &imF);
+
+ /* f = Gamma(+i tau)/Gamma(1/2 - mu + i tau)
+ * FIXME: shift so it's better for tau-> 0
+ */
+ gsl_sf_result lgr_num, lgth_num;
+ gsl_sf_result lgr_den, lgth_den;
+ int stat_gn = gsl_sf_lngamma_complex_e(0.0,tau,&lgr_num,&lgth_num);
+ int stat_gd = gsl_sf_lngamma_complex_e(0.5-mu,tau,&lgr_den,&lgth_den);
+
+ double angle = lgth_num.val - lgth_den.val + atan2(imF,reF);
+
+ double lnx = log(x);
+ double lnxp1 = log(x+1.0);
+ double lnxm1 = log(x-1.0);
+ double lnpre_const = 0.5*M_LN2 - 0.5*M_LNPI;
+ double lnpre_comm = (mu-0.5)*lnx - 0.5*mu*(lnxp1 + lnxm1);
+ double lnpre_err = GSL_DBL_EPSILON * (0.5*M_LN2 + 0.5*M_LNPI)
+ + GSL_DBL_EPSILON * fabs((mu-0.5)*lnx)
+ + GSL_DBL_EPSILON * fabs(0.5*mu)*(fabs(lnxp1)+fabs(lnxm1));
+
+ /* result = pre*|F|*|f| * cos(angle - tau * (log(x)+M_LN2))
+ */
+ gsl_sf_result cos_result;
+ int stat_cos = gsl_sf_cos_e(angle + tau*(log(x) + M_LN2), &cos_result);
+ int status = GSL_ERROR_SELECT_4(stat_cos, stat_gd, stat_gn, stat_F);
+ if(cos_result.val == 0.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ return status;
+ }
+ else {
+ double lnFf_val = 0.5*log(reF*reF+imF*imF) + lgr_num.val - lgr_den.val;
+ double lnFf_err = lgr_num.err + lgr_den.err + GSL_DBL_EPSILON * fabs(lnFf_val);
+ double lnnoc_val = lnpre_const + lnpre_comm + lnFf_val;
+ double lnnoc_err = lnpre_err + lnFf_err + GSL_DBL_EPSILON * fabs(lnnoc_val);
+ int stat_e = gsl_sf_exp_mult_err_e(lnnoc_val, lnnoc_err,
+ cos_result.val, cos_result.err,
+ result);
+ if(stat_e == GSL_SUCCESS) {
+ *ln_multiplier = 0.0;
+ }
+ else {
+ result->val = cos_result.val;
+ result->err = cos_result.err;
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ *ln_multiplier = lnnoc_val;
+ }
+ return status;
+ }
+}
+
+
+/* P^{mu}_{-1/2 + I tau} first hypergeometric representation
+ * -1 < x < 1
+ * This is more effective for |x| small, however it will work w/o
+ * reservation for any x < 0 because everything is positive
+ * definite in that case.
+ *
+ * [Kolbig, (3)] (note typo in args of gamma functions)
+ * [Bateman, (22)] (correct form)
+ */
+static
+int
+conicalP_xlt1_hyperg_A(double mu, double tau, double x, gsl_sf_result * result)
+{
+ double x2 = x*x;
+ double err_amp = 1.0 + 1.0/(GSL_DBL_EPSILON + fabs(1.0-fabs(x)));
+ double pre_val = M_SQRTPI / pow(0.5*sqrt(1-x2), mu);
+ double pre_err = err_amp * GSL_DBL_EPSILON * (fabs(mu)+1.0) * fabs(pre_val) ;
+ gsl_sf_result ln_g1, ln_g2, arg_g1, arg_g2;
+ gsl_sf_result F1, F2;
+ gsl_sf_result pre1, pre2;
+ double t1_val, t1_err;
+ double t2_val, t2_err;
+
+ int stat_F1 = gsl_sf_hyperg_2F1_conj_e(0.25 - 0.5*mu, 0.5*tau, 0.5, x2, &F1);
+ int stat_F2 = gsl_sf_hyperg_2F1_conj_e(0.75 - 0.5*mu, 0.5*tau, 1.5, x2, &F2);
+ int status = GSL_ERROR_SELECT_2(stat_F1, stat_F2);
+
+ gsl_sf_lngamma_complex_e(0.75 - 0.5*mu, -0.5*tau, &ln_g1, &arg_g1);
+ gsl_sf_lngamma_complex_e(0.25 - 0.5*mu, -0.5*tau, &ln_g2, &arg_g2);
+
+ gsl_sf_exp_err_e(-2.0*ln_g1.val, 2.0*ln_g1.err, &pre1);
+ gsl_sf_exp_err_e(-2.0*ln_g2.val, 2.0*ln_g2.err, &pre2);
+ pre2.val *= -2.0*x;
+ pre2.err *= 2.0*fabs(x);
+ pre2.err += GSL_DBL_EPSILON * fabs(pre2.val);
+
+ t1_val = pre1.val * F1.val;
+ t1_err = fabs(pre1.val) * F1.err + pre1.err * fabs(F1.val);
+ t2_val = pre2.val * F2.val;
+ t2_err = fabs(pre2.val) * F2.err + pre2.err * fabs(F2.val);
+
+ result->val = pre_val * (t1_val + t2_val);
+ result->err = pre_val * (t1_err + t2_err);
+ result->err += pre_err * fabs(t1_val + t2_val);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+
+ return status;
+}
+
+
+/* P^{mu}_{-1/2 + I tau}
+ * defining hypergeometric representation
+ * [Abramowitz+Stegun, 8.1.2]
+ * 1 < x < 3
+ * effective for x near 1
+ *
+ */
+#if 0
+static
+int
+conicalP_def_hyperg(double mu, double tau, double x, double * result)
+{
+ double F;
+ int stat_F = gsl_sf_hyperg_2F1_conj_renorm_e(0.5, tau, 1.0-mu, 0.5*(1.0-x), &F);
+ *result = pow((x+1.0)/(x-1.0), 0.5*mu) * F;
+ return stat_F;
+}
+#endif /* 0 */
+
+
+/* P^{mu}_{-1/2 + I tau} second hypergeometric representation
+ * [Zhurina+Karmazina, (3.1)]
+ * -1 < x < 3
+ * effective for x near 1
+ *
+ */
+#if 0
+static
+int
+conicalP_xnear1_hyperg_C(double mu, double tau, double x, double * result)
+{
+ double ln_pre, arg_pre;
+ double ln_g1, arg_g1;
+ double ln_g2, arg_g2;
+ double F;
+
+ int stat_F = gsl_sf_hyperg_2F1_conj_renorm_e(0.5+mu, tau, 1.0+mu, 0.5*(1.0-x), &F);
+
+ gsl_sf_lngamma_complex_e(0.5+mu, tau, &ln_g1, &arg_g1);
+ gsl_sf_lngamma_complex_e(0.5-mu, tau, &ln_g2, &arg_g2);
+
+ ln_pre = mu*M_LN2 - 0.5*mu*log(fabs(x*x-1.0)) + ln_g1 - ln_g2;
+ arg_pre = arg_g1 - arg_g2;
+
+ *result = exp(ln_pre) * F;
+ return stat_F;
+}
+#endif /* 0 */
+
+
+/* V0, V1 from Kolbig, m = 0
+ */
+static
+int
+conicalP_0_V(const double t, const double f, const double tau, const double sgn,
+ double * V0, double * V1)
+{
+ double C[8];
+ double T[8];
+ double H[8];
+ double V[12];
+ int i;
+ T[0] = 1.0;
+ H[0] = 1.0;
+ V[0] = 1.0;
+ for(i=1; i<=7; i++) {
+ T[i] = T[i-1] * t;
+ H[i] = H[i-1] * (t*f);
+ }
+ for(i=1; i<=11; i++) {
+ V[i] = V[i-1] * tau;
+ }
+
+ C[0] = 1.0;
+ C[1] = (H[1]-1.0)/(8.0*T[1]);
+ C[2] = (9.0*H[2] + 6.0*H[1] - 15.0 - sgn*8.0*T[2])/(128.0*T[2]);
+ C[3] = 5.0*(15.0*H[3] + 27.0*H[2] + 21.0*H[1] - 63.0 - sgn*T[2]*(16.0*H[1]+24.0))/(1024.0*T[3]);
+ C[4] = 7.0*(525.0*H[4] + 1500.0*H[3] + 2430.0*H[2] + 1980.0*H[1] - 6435.0
+ + 192.0*T[4] - sgn*T[2]*(720.0*H[2]+1600.0*H[1]+2160.0)
+ ) / (32768.0*T[4]);
+ C[5] = 21.0*(2835.0*H[5] + 11025.0*H[4] + 24750.0*H[3] + 38610.0*H[2]
+ + 32175.0*H[1] - 109395.0 + T[4]*(1984.0*H[1]+4032.0)
+ - sgn*T[2]*(4800.0*H[3]+15120.0*H[2]+26400.0*H[1]+34320.0)
+ ) / (262144.0*T[5]);
+ C[6] = 11.0*(218295.0*H[6] + 1071630.0*H[5] + 3009825.0*H[4] + 6142500.0*H[3]
+ + 9398025.0*H[2] + 7936110.0*H[1] - 27776385.0
+ + T[4]*(254016.0*H[2]+749952.0*H[1]+1100736.0)
+ - sgn*T[2]*(441000.0*H[4] + 1814400.0*H[3] + 4127760.0*H[2]
+ + 6552000.0*H[1] + 8353800.0 + 31232.0*T[4]
+ )
+ ) / (4194304.0*T[6]);
+
+ *V0 = C[0] + (-4.0*C[3]/T[1]+C[4])/V[4]
+ + (-192.0*C[5]/T[3]+144.0*C[6]/T[2])/V[8]
+ + sgn * (-C[2]/V[2]
+ + (-24.0*C[4]/T[2]+12.0*C[5]/T[1]-C[6])/V[6]
+ + (-1920.0*C[6]/T[4])/V[10]
+ );
+ *V1 = C[1]/V[1] + (8.0*(C[3]/T[2]-C[4]/T[1])+C[5])/V[5]
+ + (384.0*C[5]/T[4] - 768.0*C[6]/T[3])/V[9]
+ + sgn * ((2.0*C[2]/T[1]-C[3])/V[3]
+ + (48.0*C[4]/T[3]-72.0*C[5]/T[2] + 18.0*C[6]/T[1])/V[7]
+ + (3840.0*C[6]/T[5])/V[11]
+ );
+
+ return GSL_SUCCESS;
+}
+
+
+/* V0, V1 from Kolbig, m = 1
+ */
+static
+int
+conicalP_1_V(const double t, const double f, const double tau, const double sgn,
+ double * V0, double * V1)
+{
+ double Cm1;
+ double C[8];
+ double T[8];
+ double H[8];
+ double V[12];
+ int i;
+ T[0] = 1.0;
+ H[0] = 1.0;
+ V[0] = 1.0;
+ for(i=1; i<=7; i++) {
+ T[i] = T[i-1] * t;
+ H[i] = H[i-1] * (t*f);
+ }
+ for(i=1; i<=11; i++) {
+ V[i] = V[i-1] * tau;
+ }
+
+ Cm1 = -1.0;
+ C[0] = 3.0*(1.0-H[1])/(8.0*T[1]);
+ C[1] = (-15.0*H[2]+6.0*H[1]+9.0+sgn*8.0*T[2])/(128.0*T[2]);
+ C[2] = 3.0*(-35.0*H[3] - 15.0*H[2] + 15.0*H[1] + 35.0 + sgn*T[2]*(32.0*H[1]+8.0))/(1024.0*T[3]);
+ C[3] = (-4725.0*H[4] - 6300.0*H[3] - 3150.0*H[2] + 3780.0*H[1] + 10395.0
+ -1216.0*T[4] + sgn*T[2]*(6000.0*H[2]+5760.0*H[1]+1680.0)) / (32768.0*T[4]);
+ C[4] = 7.0*(-10395.0*H[5] - 23625.0*H[4] - 28350.0*H[3] - 14850.0*H[2]
+ +19305.0*H[1] + 57915.0 - T[4]*(6336.0*H[1]+6080.0)
+ + sgn*T[2]*(16800.0*H[3] + 30000.0*H[2] + 25920.0*H[1] + 7920.0)
+ ) / (262144.0*T[5]);
+ C[5] = (-2837835.0*H[6] - 9168390.0*H[5] - 16372125.0*H[4] - 18918900*H[3]
+ -10135125.0*H[2] + 13783770.0*H[1] + 43648605.0
+ -T[4]*(3044160.0*H[2] + 5588352.0*H[1] + 4213440.0)
+ +sgn*T[2]*(5556600.0*H[4] + 14817600.0*H[3] + 20790000.0*H[2]
+ + 17297280.0*H[1] + 5405400.0 + 323072.0*T[4]
+ )
+ ) / (4194304.0*T[6]);
+ C[6] = 0.0;
+
+ *V0 = C[0] + (-4.0*C[3]/T[1]+C[4])/V[4]
+ + (-192.0*C[5]/T[3]+144.0*C[6]/T[2])/V[8]
+ + sgn * (-C[2]/V[2]
+ + (-24.0*C[4]/T[2]+12.0*C[5]/T[1]-C[6])/V[6]
+ );
+ *V1 = C[1]/V[1] + (8.0*(C[3]/T[2]-C[4]/T[1])+C[5])/V[5]
+ + (384.0*C[5]/T[4] - 768.0*C[6]/T[3])/V[9]
+ + sgn * (Cm1*V[1] + (2.0*C[2]/T[1]-C[3])/V[3]
+ + (48.0*C[4]/T[3]-72.0*C[5]/T[2] + 18.0*C[6]/T[1])/V[7]
+ );
+
+ return GSL_SUCCESS;
+}
+
+
+
+/*-*-*-*-*-*-*-*-*-*-*-* Functions with Error Codes *-*-*-*-*-*-*-*-*-*-*-*/
+
+/* P^0_{-1/2 + I lambda}
+ */
+int
+gsl_sf_conicalP_0_e(const double lambda, const double x, gsl_sf_result * result)
+{
+ /* CHECK_POINTER(result) */
+
+ if(x <= -1.0) {
+ DOMAIN_ERROR(result);
+ }
+ else if(x == 1.0) {
+ result->val = 1.0;
+ result->err = 0.0;
+ return GSL_SUCCESS;
+ }
+ else if(lambda == 0.0) {
+ gsl_sf_result K;
+ int stat_K;
+ if(x < 1.0) {
+ const double th = acos(x);
+ const double s = sin(0.5*th);
+ stat_K = gsl_sf_ellint_Kcomp_e(s, GSL_MODE_DEFAULT, &K);
+ result->val = 2.0/M_PI * K.val;
+ result->err = 2.0/M_PI * K.err;
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return stat_K;
+ }
+ else {
+ const double xi = acosh(x);
+ const double c = cosh(0.5*xi);
+ const double t = tanh(0.5*xi);
+ stat_K = gsl_sf_ellint_Kcomp_e(t, GSL_MODE_DEFAULT, &K);
+ result->val = 2.0/M_PI / c * K.val;
+ result->err = 2.0/M_PI / c * K.err;
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return stat_K;
+ }
+ }
+ else if( (x <= 0.0 && lambda < 1000.0)
+ || (x < 0.1 && lambda < 17.0)
+ || (x < 0.2 && lambda < 5.0 )
+ ) {
+ return conicalP_xlt1_hyperg_A(0.0, lambda, x, result);
+ }
+ else if( (x <= 0.2 && lambda < 17.0)
+ || (x <= 1.5 && lambda < 20.0)
+ ) {
+ return gsl_sf_hyperg_2F1_conj_e(0.5, lambda, 1.0, (1.0-x)/2, result);
+ }
+ else if(1.5 < x && lambda < GSL_MAX(x,20.0)) {
+ gsl_sf_result P;
+ double lm;
+ int stat_P = gsl_sf_conicalP_large_x_e(0.0, lambda, x,
+ &P, &lm
+ );
+ int stat_e = gsl_sf_exp_mult_err_e(lm, 2.0*GSL_DBL_EPSILON * fabs(lm),
+ P.val, P.err,
+ result);
+ return GSL_ERROR_SELECT_2(stat_e, stat_P);
+ }
+ else {
+ double V0, V1;
+ if(x < 1.0) {
+ double th = acos(x);
+ double sth = sqrt(1.0-x*x); /* sin(th) */
+ gsl_sf_result I0, I1;
+ int stat_I0 = gsl_sf_bessel_I0_scaled_e(th * lambda, &I0);
+ int stat_I1 = gsl_sf_bessel_I1_scaled_e(th * lambda, &I1);
+ int stat_I = GSL_ERROR_SELECT_2(stat_I0, stat_I1);
+ int stat_V = conicalP_0_V(th, x/sth, lambda, -1.0, &V0, &V1);
+ double bessterm = V0 * I0.val + V1 * I1.val;
+ double besserr = fabs(V0) * I0.err + fabs(V1) * I1.err;
+ double arg1 = th*lambda;
+ double sqts = sqrt(th/sth);
+ int stat_e = gsl_sf_exp_mult_err_e(arg1, 4.0 * GSL_DBL_EPSILON * fabs(arg1),
+ sqts * bessterm, sqts * besserr,
+ result);
+ return GSL_ERROR_SELECT_3(stat_e, stat_V, stat_I);
+ }
+ else {
+ double sh = sqrt(x-1.0)*sqrt(x+1.0); /* sinh(xi) */
+ double xi = log(x + sh); /* xi = acosh(x) */
+ gsl_sf_result J0, J1;
+ int stat_J0 = gsl_sf_bessel_J0_e(xi * lambda, &J0);
+ int stat_J1 = gsl_sf_bessel_J1_e(xi * lambda, &J1);
+ int stat_J = GSL_ERROR_SELECT_2(stat_J0, stat_J1);
+ int stat_V = conicalP_0_V(xi, x/sh, lambda, 1.0, &V0, &V1);
+ double bessterm = V0 * J0.val + V1 * J1.val;
+ double besserr = fabs(V0) * J0.err + fabs(V1) * J1.err;
+ double pre_val = sqrt(xi/sh);
+ double pre_err = 2.0 * fabs(pre_val);
+ result->val = pre_val * bessterm;
+ result->err = pre_val * besserr;
+ result->err += pre_err * fabs(bessterm);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return GSL_ERROR_SELECT_2(stat_V, stat_J);
+ }
+ }
+}
+
+
+/* P^1_{-1/2 + I lambda}
+ */
+int
+gsl_sf_conicalP_1_e(const double lambda, const double x, gsl_sf_result * result)
+{
+ /* CHECK_POINTER(result) */
+
+ if(x <= -1.0) {
+ DOMAIN_ERROR(result);
+ }
+ else if(lambda == 0.0) {
+ gsl_sf_result K, E;
+ int stat_K, stat_E;
+ if(x == 1.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ return GSL_SUCCESS;
+ }
+ else if(x < 1.0) {
+ if(1.0-x < GSL_SQRT_DBL_EPSILON) {
+ double err_amp = GSL_MAX_DBL(1.0, 1.0/(GSL_DBL_EPSILON + fabs(1.0-x)));
+ result->val = 0.25/M_SQRT2 * sqrt(1.0-x) * (1.0 + 5.0/16.0 * (1.0-x));
+ result->err = err_amp * 3.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return GSL_SUCCESS;
+ }
+ else {
+ const double th = acos(x);
+ const double s = sin(0.5*th);
+ const double c2 = 1.0 - s*s;
+ const double sth = sin(th);
+ const double pre = 2.0/(M_PI*sth);
+ stat_K = gsl_sf_ellint_Kcomp_e(s, GSL_MODE_DEFAULT, &K);
+ stat_E = gsl_sf_ellint_Ecomp_e(s, GSL_MODE_DEFAULT, &E);
+ result->val = pre * (E.val - c2 * K.val);
+ result->err = pre * (E.err + fabs(c2) * K.err);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return stat_K;
+ }
+ }
+ else {
+ if(x-1.0 < GSL_SQRT_DBL_EPSILON) {
+ double err_amp = GSL_MAX_DBL(1.0, 1.0/(GSL_DBL_EPSILON + fabs(1.0-x)));
+ result->val = -0.25/M_SQRT2 * sqrt(x-1.0) * (1.0 - 5.0/16.0 * (x-1.0));
+ result->err = err_amp * 3.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return GSL_SUCCESS;
+ }
+ else {
+ const double xi = acosh(x);
+ const double c = cosh(0.5*xi);
+ const double t = tanh(0.5*xi);
+ const double sxi = sinh(xi);
+ const double pre = 2.0/(M_PI*sxi) * c;
+ stat_K = gsl_sf_ellint_Kcomp_e(t, GSL_MODE_DEFAULT, &K);
+ stat_E = gsl_sf_ellint_Ecomp_e(t, GSL_MODE_DEFAULT, &E);
+ result->val = pre * (E.val - K.val);
+ result->err = pre * (E.err + K.err);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return stat_K;
+ }
+ }
+ }
+ else if( (x <= 0.0 && lambda < 1000.0)
+ || (x < 0.1 && lambda < 17.0)
+ || (x < 0.2 && lambda < 5.0 )
+ ) {
+ return conicalP_xlt1_hyperg_A(1.0, lambda, x, result);
+ }
+ else if( (x <= 0.2 && lambda < 17.0)
+ || (x < 1.5 && lambda < 20.0)
+ ) {
+ const double arg = fabs(x*x - 1.0);
+ const double sgn = GSL_SIGN(1.0 - x);
+ const double pre = 0.5*(lambda*lambda + 0.25) * sgn * sqrt(arg);
+ gsl_sf_result F;
+ int stat_F = gsl_sf_hyperg_2F1_conj_e(1.5, lambda, 2.0, (1.0-x)/2, &F);
+ result->val = pre * F.val;
+ result->err = fabs(pre) * F.err;
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return stat_F;
+ }
+ else if(1.5 <= x && lambda < GSL_MAX(x,20.0)) {
+ gsl_sf_result P;
+ double lm;
+ int stat_P = gsl_sf_conicalP_large_x_e(1.0, lambda, x,
+ &P, &lm
+ );
+ int stat_e = gsl_sf_exp_mult_err_e(lm, 2.0 * GSL_DBL_EPSILON * fabs(lm),
+ P.val, P.err,
+ result);
+ return GSL_ERROR_SELECT_2(stat_e, stat_P);
+ }
+ else {
+ double V0, V1;
+ if(x < 1.0) {
+ const double sqrt_1mx = sqrt(1.0 - x);
+ const double sqrt_1px = sqrt(1.0 + x);
+ const double th = acos(x);
+ const double sth = sqrt_1mx * sqrt_1px; /* sin(th) */
+ gsl_sf_result I0, I1;
+ int stat_I0 = gsl_sf_bessel_I0_scaled_e(th * lambda, &I0);
+ int stat_I1 = gsl_sf_bessel_I1_scaled_e(th * lambda, &I1);
+ int stat_I = GSL_ERROR_SELECT_2(stat_I0, stat_I1);
+ int stat_V = conicalP_1_V(th, x/sth, lambda, -1.0, &V0, &V1);
+ double bessterm = V0 * I0.val + V1 * I1.val;
+ double besserr = fabs(V0) * I0.err + fabs(V1) * I1.err
+ + 2.0 * GSL_DBL_EPSILON * fabs(V0 * I0.val)
+ + 2.0 * GSL_DBL_EPSILON * fabs(V1 * I1.val);
+ double arg1 = th * lambda;
+ double sqts = sqrt(th/sth);
+ int stat_e = gsl_sf_exp_mult_err_e(arg1, 2.0 * GSL_DBL_EPSILON * fabs(arg1),
+ sqts * bessterm, sqts * besserr,
+ result);
+ result->err *= 1.0/sqrt_1mx;
+ return GSL_ERROR_SELECT_3(stat_e, stat_V, stat_I);
+ }
+ else {
+ const double sqrt_xm1 = sqrt(x - 1.0);
+ const double sqrt_xp1 = sqrt(x + 1.0);
+ const double sh = sqrt_xm1 * sqrt_xp1; /* sinh(xi) */
+ const double xi = log(x + sh); /* xi = acosh(x) */
+ const double xi_lam = xi * lambda;
+ gsl_sf_result J0, J1;
+ const int stat_J0 = gsl_sf_bessel_J0_e(xi_lam, &J0);
+ const int stat_J1 = gsl_sf_bessel_J1_e(xi_lam, &J1);
+ const int stat_J = GSL_ERROR_SELECT_2(stat_J0, stat_J1);
+ const int stat_V = conicalP_1_V(xi, x/sh, lambda, 1.0, &V0, &V1);
+ const double bessterm = V0 * J0.val + V1 * J1.val;
+ const double besserr = fabs(V0) * J0.err + fabs(V1) * J1.err
+ + 512.0 * 2.0 * GSL_DBL_EPSILON * fabs(V0 * J0.val)
+ + 512.0 * 2.0 * GSL_DBL_EPSILON * fabs(V1 * J1.val)
+ + GSL_DBL_EPSILON * fabs(xi_lam * V0 * J1.val)
+ + GSL_DBL_EPSILON * fabs(xi_lam * V1 * J0.val);
+ const double pre = sqrt(xi/sh);
+ result->val = pre * bessterm;
+ result->err = pre * besserr * sqrt_xp1 / sqrt_xm1;
+ result->err += 4.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return GSL_ERROR_SELECT_2(stat_V, stat_J);
+ }
+ }
+}
+
+
+/* P^{1/2}_{-1/2 + I lambda} (x)
+ * [Abramowitz+Stegun 8.6.8, 8.6.12]
+ * checked OK [GJ] Fri May 8 12:24:36 MDT 1998
+ */
+int gsl_sf_conicalP_half_e(const double lambda, const double x,
+ gsl_sf_result * result
+ )
+{
+ /* CHECK_POINTER(result) */
+
+ if(x <= -1.0) {
+ DOMAIN_ERROR(result);
+ }
+ else if(x < 1.0) {
+ double err_amp = 1.0 + 1.0/(GSL_DBL_EPSILON + fabs(1.0-fabs(x)));
+ double ac = acos(x);
+ double den = sqrt(sqrt(1.0-x)*sqrt(1.0+x));
+ result->val = Root_2OverPi_ / den * cosh(ac * lambda);
+ result->err = err_amp * 3.0 * GSL_DBL_EPSILON * fabs(result->val);
+ result->err *= fabs(ac * lambda) + 1.0;
+ return GSL_SUCCESS;
+ }
+ else if(x == 1.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ return GSL_SUCCESS;
+ }
+ else {
+ /* x > 1 */
+ double err_amp = 1.0 + 1.0/(GSL_DBL_EPSILON + fabs(1.0-fabs(x)));
+ double sq_term = sqrt(x-1.0)*sqrt(x+1.0);
+ double ln_term = log(x + sq_term);
+ double den = sqrt(sq_term);
+ double carg_val = lambda * ln_term;
+ double carg_err = 2.0 * GSL_DBL_EPSILON * fabs(carg_val);
+ gsl_sf_result cos_result;
+ int stat_cos = gsl_sf_cos_err_e(carg_val, carg_err, &cos_result);
+ result->val = Root_2OverPi_ / den * cos_result.val;
+ result->err = err_amp * Root_2OverPi_ / den * cos_result.err;
+ result->err += 4.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return stat_cos;
+ }
+}
+
+
+/* P^{-1/2}_{-1/2 + I lambda} (x)
+ * [Abramowitz+Stegun 8.6.9, 8.6.14]
+ * checked OK [GJ] Fri May 8 12:24:43 MDT 1998
+ */
+int gsl_sf_conicalP_mhalf_e(const double lambda, const double x, gsl_sf_result * result)
+{
+ /* CHECK_POINTER(result) */
+
+ if(x <= -1.0) {
+ DOMAIN_ERROR(result);
+ }
+ else if(x < 1.0) {
+ double ac = acos(x);
+ double den = sqrt(sqrt(1.0-x)*sqrt(1.0+x));
+ double arg = ac * lambda;
+ double err_amp = 1.0 + 1.0/(GSL_DBL_EPSILON + fabs(1.0-fabs(x)));
+ if(fabs(arg) < GSL_SQRT_DBL_EPSILON) {
+ result->val = Root_2OverPi_ / den * ac;
+ result->err = 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ result->err *= err_amp;
+ }
+ else {
+ result->val = Root_2OverPi_ / (den*lambda) * sinh(arg);
+ result->err = GSL_DBL_EPSILON * (fabs(arg)+1.0) * fabs(result->val);
+ result->err *= err_amp;
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ }
+ return GSL_SUCCESS;
+ }
+ else if(x == 1.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ return GSL_SUCCESS;
+ }
+ else {
+ /* x > 1 */
+ double sq_term = sqrt(x-1.0)*sqrt(x+1.0);
+ double ln_term = log(x + sq_term);
+ double den = sqrt(sq_term);
+ double arg_val = lambda * ln_term;
+ double arg_err = 2.0 * GSL_DBL_EPSILON * fabs(arg_val);
+ if(arg_val < GSL_SQRT_DBL_EPSILON) {
+ result->val = Root_2OverPi_ / den * ln_term;
+ result->err = 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return GSL_SUCCESS;
+ }
+ else {
+ gsl_sf_result sin_result;
+ int stat_sin = gsl_sf_sin_err_e(arg_val, arg_err, &sin_result);
+ result->val = Root_2OverPi_ / (den*lambda) * sin_result.val;
+ result->err = Root_2OverPi_ / fabs(den*lambda) * sin_result.err;
+ result->err += 3.0 * GSL_DBL_EPSILON * fabs(result->val);
+ return stat_sin;
+ }
+ }
+}
+
+
+int gsl_sf_conicalP_sph_reg_e(const int l, const double lambda,
+ const double x,
+ gsl_sf_result * result
+ )
+{
+ /* CHECK_POINTER(result) */
+
+ if(x <= -1.0 || l < -1) {
+ DOMAIN_ERROR(result);
+ }
+ else if(l == -1) {
+ return gsl_sf_conicalP_half_e(lambda, x, result);
+ }
+ else if(l == 0) {
+ return gsl_sf_conicalP_mhalf_e(lambda, x, result);
+ }
+ else if(x == 1.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ return GSL_SUCCESS;
+ }
+ else if(x < 0.0) {
+ double c = 1.0/sqrt(1.0-x*x);
+ gsl_sf_result r_Pellm1;
+ gsl_sf_result r_Pell;
+ int stat_0 = gsl_sf_conicalP_half_e(lambda, x, &r_Pellm1); /* P^( 1/2) */
+ int stat_1 = gsl_sf_conicalP_mhalf_e(lambda, x, &r_Pell); /* P^(-1/2) */
+ int stat_P = GSL_ERROR_SELECT_2(stat_0, stat_1);
+ double Pellm1 = r_Pellm1.val;
+ double Pell = r_Pell.val;
+ double Pellp1;
+ int ell;
+
+ for(ell=0; ell<l; ell++) {
+ double d = (ell+1.0)*(ell+1.0) + lambda*lambda;
+ Pellp1 = (Pellm1 - (2.0*ell+1.0)*c*x * Pell) / d;
+ Pellm1 = Pell;
+ Pell = Pellp1;
+ }
+
+ result->val = Pell;
+ result->err = (0.5*l + 1.0) * GSL_DBL_EPSILON * fabs(Pell);
+ result->err += GSL_DBL_EPSILON * l * fabs(result->val);
+ return stat_P;
+ }
+ else if(x < 1.0) {
+ const double xi = x/(sqrt(1.0-x)*sqrt(1.0+x));
+ gsl_sf_result rat;
+ gsl_sf_result Phf;
+ int stat_CF1 = conicalP_negmu_xlt1_CF1(0.5, l, lambda, x, &rat);
+ int stat_Phf = gsl_sf_conicalP_half_e(lambda, x, &Phf);
+ double Pellp1 = rat.val * GSL_SQRT_DBL_MIN;
+ double Pell = GSL_SQRT_DBL_MIN;
+ double Pellm1;
+ int ell;
+
+ for(ell=l; ell>=0; ell--) {
+ double d = (ell+1.0)*(ell+1.0) + lambda*lambda;
+ Pellm1 = (2.0*ell+1.0)*xi * Pell + d * Pellp1;
+ Pellp1 = Pell;
+ Pell = Pellm1;
+ }
+
+ result->val = GSL_SQRT_DBL_MIN * Phf.val / Pell;
+ result->err = GSL_SQRT_DBL_MIN * Phf.err / fabs(Pell);
+ result->err += fabs(rat.err/rat.val) * (l + 1.0) * fabs(result->val);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+
+ return GSL_ERROR_SELECT_2(stat_Phf, stat_CF1);
+ }
+ else if(x == 1.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ return GSL_SUCCESS;
+ }
+ else {
+ /* x > 1.0 */
+
+ const double xi = x/sqrt((x-1.0)*(x+1.0));
+ gsl_sf_result rat;
+ int stat_CF1 = conicalP_negmu_xgt1_CF1(0.5, l, lambda, x, &rat);
+ int stat_P;
+ double Pellp1 = rat.val * GSL_SQRT_DBL_MIN;
+ double Pell = GSL_SQRT_DBL_MIN;
+ double Pellm1;
+ int ell;
+
+ for(ell=l; ell>=0; ell--) {
+ double d = (ell+1.0)*(ell+1.0) + lambda*lambda;
+ Pellm1 = (2.0*ell+1.0)*xi * Pell - d * Pellp1;
+ Pellp1 = Pell;
+ Pell = Pellm1;
+ }
+
+ if(fabs(Pell) > fabs(Pellp1)){
+ gsl_sf_result Phf;
+ stat_P = gsl_sf_conicalP_half_e(lambda, x, &Phf);
+ result->val = GSL_SQRT_DBL_MIN * Phf.val / Pell;
+ result->err = 2.0 * GSL_SQRT_DBL_MIN * Phf.err / fabs(Pell);
+ result->err += 2.0 * fabs(rat.err/rat.val) * (l + 1.0) * fabs(result->val);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ }
+ else {
+ gsl_sf_result Pmhf;
+ stat_P = gsl_sf_conicalP_mhalf_e(lambda, x, &Pmhf);
+ result->val = GSL_SQRT_DBL_MIN * Pmhf.val / Pellp1;
+ result->err = 2.0 * GSL_SQRT_DBL_MIN * Pmhf.err / fabs(Pellp1);
+ result->err += 2.0 * fabs(rat.err/rat.val) * (l + 1.0) * fabs(result->val);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ }
+
+ return GSL_ERROR_SELECT_2(stat_P, stat_CF1);
+ }
+}
+
+
+int gsl_sf_conicalP_cyl_reg_e(const int m, const double lambda,
+ const double x,
+ gsl_sf_result * result
+ )
+{
+ /* CHECK_POINTER(result) */
+
+ if(x <= -1.0 || m < -1) {
+ DOMAIN_ERROR(result);
+ }
+ else if(m == -1) {
+ return gsl_sf_conicalP_1_e(lambda, x, result);
+ }
+ else if(m == 0) {
+ return gsl_sf_conicalP_0_e(lambda, x, result);
+ }
+ else if(x == 1.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ return GSL_SUCCESS;
+ }
+ else if(x < 0.0) {
+ double c = 1.0/sqrt(1.0-x*x);
+ gsl_sf_result r_Pkm1;
+ gsl_sf_result r_Pk;
+ int stat_0 = gsl_sf_conicalP_1_e(lambda, x, &r_Pkm1); /* P^1 */
+ int stat_1 = gsl_sf_conicalP_0_e(lambda, x, &r_Pk); /* P^0 */
+ int stat_P = GSL_ERROR_SELECT_2(stat_0, stat_1);
+ double Pkm1 = r_Pkm1.val;
+ double Pk = r_Pk.val;
+ double Pkp1;
+ int k;
+
+ for(k=0; k<m; k++) {
+ double d = (k+0.5)*(k+0.5) + lambda*lambda;
+ Pkp1 = (Pkm1 - 2.0*k*c*x * Pk) / d;
+ Pkm1 = Pk;
+ Pk = Pkp1;
+ }
+
+ result->val = Pk;
+ result->err = (m + 2.0) * GSL_DBL_EPSILON * fabs(Pk);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+
+ return stat_P;
+ }
+ else if(x < 1.0) {
+ const double xi = x/(sqrt(1.0-x)*sqrt(1.0+x));
+ gsl_sf_result rat;
+ gsl_sf_result P0;
+ int stat_CF1 = conicalP_negmu_xlt1_CF1(0.0, m, lambda, x, &rat);
+ int stat_P0 = gsl_sf_conicalP_0_e(lambda, x, &P0);
+ double Pkp1 = rat.val * GSL_SQRT_DBL_MIN;
+ double Pk = GSL_SQRT_DBL_MIN;
+ double Pkm1;
+ int k;
+
+ for(k=m; k>0; k--) {
+ double d = (k+0.5)*(k+0.5) + lambda*lambda;
+ Pkm1 = 2.0*k*xi * Pk + d * Pkp1;
+ Pkp1 = Pk;
+ Pk = Pkm1;
+ }
+
+ result->val = GSL_SQRT_DBL_MIN * P0.val / Pk;
+ result->err = 2.0 * GSL_SQRT_DBL_MIN * P0.err / fabs(Pk);
+ result->err += 2.0 * fabs(rat.err/rat.val) * (m + 1.0) * fabs(result->val);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+
+ return GSL_ERROR_SELECT_2(stat_P0, stat_CF1);
+ }
+ else if(x == 1.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ return GSL_SUCCESS;
+ }
+ else {
+ /* x > 1.0 */
+
+ const double xi = x/sqrt((x-1.0)*(x+1.0));
+ gsl_sf_result rat;
+ int stat_CF1 = conicalP_negmu_xgt1_CF1(0.0, m, lambda, x, &rat);
+ int stat_P;
+ double Pkp1 = rat.val * GSL_SQRT_DBL_MIN;
+ double Pk = GSL_SQRT_DBL_MIN;
+ double Pkm1;
+ int k;
+
+ for(k=m; k>-1; k--) {
+ double d = (k+0.5)*(k+0.5) + lambda*lambda;
+ Pkm1 = 2.0*k*xi * Pk - d * Pkp1;
+ Pkp1 = Pk;
+ Pk = Pkm1;
+ }
+
+ if(fabs(Pk) > fabs(Pkp1)){
+ gsl_sf_result P1;
+ stat_P = gsl_sf_conicalP_1_e(lambda, x, &P1);
+ result->val = GSL_SQRT_DBL_MIN * P1.val / Pk;
+ result->err = 2.0 * GSL_SQRT_DBL_MIN * P1.err / fabs(Pk);
+ result->err += 2.0 * fabs(rat.err/rat.val) * (m+2.0) * fabs(result->val);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ }
+ else {
+ gsl_sf_result P0;
+ stat_P = gsl_sf_conicalP_0_e(lambda, x, &P0);
+ result->val = GSL_SQRT_DBL_MIN * P0.val / Pkp1;
+ result->err = 2.0 * GSL_SQRT_DBL_MIN * P0.err / fabs(Pkp1);
+ result->err += 2.0 * fabs(rat.err/rat.val) * (m+2.0) * fabs(result->val);
+ result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
+ }
+
+ return GSL_ERROR_SELECT_2(stat_P, stat_CF1);
+ }
+}
+
+
+/*-*-*-*-*-*-*-*-*-* Functions w/ Natural Prototypes *-*-*-*-*-*-*-*-*-*-*/
+
+#include "eval.h"
+
+double gsl_sf_conicalP_0(const double lambda, const double x)
+{
+ EVAL_RESULT(gsl_sf_conicalP_0_e(lambda, x, &result));
+}
+
+double gsl_sf_conicalP_1(const double lambda, const double x)
+{
+ EVAL_RESULT(gsl_sf_conicalP_1_e(lambda, x, &result));
+}
+
+double gsl_sf_conicalP_half(const double lambda, const double x)
+{
+ EVAL_RESULT(gsl_sf_conicalP_half_e(lambda, x, &result));
+}
+
+double gsl_sf_conicalP_mhalf(const double lambda, const double x)
+{
+ EVAL_RESULT(gsl_sf_conicalP_mhalf_e(lambda, x, &result));
+}
+
+double gsl_sf_conicalP_sph_reg(const int l, const double lambda, const double x)
+{
+ EVAL_RESULT(gsl_sf_conicalP_sph_reg_e(l, lambda, x, &result));
+}
+
+double gsl_sf_conicalP_cyl_reg(const int m, const double lambda, const double x)
+{
+ EVAL_RESULT(gsl_sf_conicalP_cyl_reg_e(m, lambda, x, &result));
+}