# Questions tagged [special-functions]

The tag has no usage guidance.

55 questions
Filter by
Sorted by
Tagged with
115 views

212 views

### Numerical integration of a hypergeometric function

The Task Let $z_1, z_2, z_3$ be positive real numbers and define $$r(\mathbf{z}):= \int_0 ^\infty (t+z_1)^{-3/2}(t+z_2)^{-3/2}(t+z_3)^{-1/2}\text{d}t.$$ The task is to compute $r$ numerically in ...
I'm looking to numerically evaluate $\log f_p(z)$ and its derivative $f^\prime_p(z)/f_p(z)$ accurately and efficiently in floating-point, where $$f_p(z)=\int_0^\infty r^{p-1} \exp\left(-\tfrac{1}{2} ... 1answer 193 views ### Numerical evaluation of the Exponential Integral Ei by rational Chebyshev approximations fails I am trying to evaluate the Exponential Integral Ei(x)=-\int^{\infty}_{-x}\frac{e^{-t}}{t}dt for x>0 (interpreted as the Cauchy principal value) by using rational Chebyshev approximations, ... 0answers 279 views ### Numerical integration using interval arithmetic, nowadays Is there now a package for rigorous numerical integration that uses interval arithmetic and has access to a well-developed library of special functions? By "well-developed", I mean something that, at ... 1answer 96 views ### Numerical computation of the complex elliptic integral E(k) for medium |k| I have implemented Carlson's algorithm for E(k) from Numerical computation of real or complex elliptic integrals (available from ArXiv eprint, see also DLMF). It is essentially his formula (46) ... 2answers 422 views ### Interpolation with the roots of orthogonal polynomials & Spectral expansion I'm a bit confused about the relationships between these two approximation methods mentioned in the title. Does this kind of interpolation also belongs to the field of spectral methods? Are the ... 2answers 930 views ### I am searching for a C++ code implementing the complex polygamma function I googled about some code on the complex polygamma function especially C++ code, but can't find anything. Does anyone know where to find such code? The complex digamma function does exist but not the ... 1answer 7k views ### Python Vectorizing a Function Returning an Array I have the following function that has been vectorized so that for every element in input array t, an array is output: ... 1answer 155 views ### How do I develop numerical routines for the evaluation of my own special functions? This question was previously posted to Math.SE here and had received no answers at the time of this posting. When performing computational work, I often come across a univariate function, defined in ... 2answers 442 views ### overflow upper incomplete gamma function I want to calculate the following equation:$$\frac{\theta \Gamma \left(\kappa+1,\frac{o}{\theta }\right)-o \Gamma \left(\kappa,\frac{o}{\theta }\right)}{\Gamma (\kappa)}+o+s$$with s>0, o>0, ... 2answers 1k views ### Kummer's confluent hypergeometric for complex arguments in C/C++? I need to evaluate Kummer's confluent hypergeometric function for imaginary arguments:$$_1F_1(a,b;ix)$$where i is the imaginary unit, a,b,x are real, and a,b>0. Is there a routine ... 1answer 518 views ### Using Log Gamma function to avoid overflow I have to do some numerical calculus using gamma functions. I am using the tgamma incluided in the C++ cmath library. The ... 3answers 4k views ### What is the fastest opensource implementation of Bessel functions computation? I'm looking for an open-source (to use and learn from) software which computes Bessel functions of integer order of real argument to double precision the fastest among all such implementations. ... 1answer 2k views ### Newton iteration for cube root without division It's a fairly well known trick to avoid division in calculating square-roots to apply Newton's method to finding 1/\sqrt{x}, and probably better known, using Newton's method to find reciprocals ... 2answers 511 views ### Bessel EVP and fzero I am trying to solve the Eigenvalue problem$$ x^2 y''+ x y' + x^2 y = \lambda^2 y\,,\quad x\in(0,1)\,,\quad y(0)=0\,,\quad y'(1)=y(1) $$The differential equation is the Bessel equation. The solution ... 0answers 66 views ### Accurate computation of \frac{\mathrm{B}_{x,y}(\alpha + 1,\beta)}{\mathrm{B}_{x,y}(\alpha,\beta)} for large paramers? I need to calculate these ratios:$$\frac{\mathrm{B}_{x,y}(\alpha + 1,\beta)}{\mathrm{B}_{x,y}(\alpha,\beta)} \tag{1}$$where \alpha,\beta > 0 and 0\le x\le y \le 1. Here \mathrm{B}_{x,y}(\... 0answers 23 views ### Compute hypergeometric function ratio: \frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}, for large positive a,b,c? [duplicate] I need a numerically stable way to compute the following ratio:$$\frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}$$All the parameters are real positive numbers, with 0 < a,b,c and 0 < x &... 1answer 180 views ### Compute hypergeometric function ratio: \frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}? I need a numerically stable way to compute the following ratio:$$\frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}$$All the parameters are real numbers, with a< 0,\  b,c > 0 and 0<x&... 1answer 405 views ### Appell function implementation in C++? Is there a C++/C implementation of the Appell series? GSL and Boost do not seem to have this function. 1answer 175 views ### Radial integration of expensive function with Bessel weights I need to calculate the integral$$I = \int_0^R f(r)J_n\left(\frac{z_{nm}r}{R}\right)rdr$$where J_n is the n^{\mathrm{th}} order Bessel functions of the first kind, z_{nm} is its m^{\mathrm{... 1answer 727 views ### Second derivative of the Associated Legendre functions I would like to compute, as part of the solution of the Laplace equation using the Fast Multipole Method, the second derivative of the associated legendre functions of the first kind . Specifically, I ... 1answer 120 views ### Efficient computation of tangent of fraction of angle I want to compute a = \tan(f \theta) for f\in [0,1], given g = \tan\theta. Obviously, I can compute a = \tan(f\tan^{-1}g), but I'm wondering if there's a more efficient way that avoids having ... 3answers 3k views ### How to use polylogarithm function in c++? Is there any preprocessor directives that could be used to use the polylog function? Or is it included in cmath? If so, do you call it by Li or by polylog? EDIT: What I really am trying to do is give ... 5answers 285 views ### Evaluate the sum I want to evaluate the sum$$\sum_{k=1}^\infty \left(\frac{i+1}{\sqrt{2}}\right)^k\cdot k^{-\alpha}$$where i=\sqrt{-1} and \alpha\in[\frac{3}{4},1] with 8 digits accuracy. If I am willing to ... 1answer 327 views ### Does transforming J_0(x)\to\int\cos(x\sin\theta) help with numerical integration? I've heard anecdotally that when one is trying to numerically do an integral of the form$$\int_0^\infty f(x) J_0(x)\,\mathrm{d}x$$with f(x) smooth and well-behaved (e.g. not itself highly ... 4answers 9k views ### Method for numerical integration of difficult oscillatory integral I need to numerically evaluate the integral below:$$\int_0^\infty \mathrm{sinc}'(xr) r \sqrt{E(r)} dr$$where E(r) = r^4 (\lambda\sqrt{\kappa^2+r^2})^{-\nu-5/2} K_{-\nu-5/2}(\lambda\sqrt{\kappa^2+... 2answers 144 views ### Computing ratio of trigonometric functions I have need to compute the functions:$$ f(x) = \frac{\sin^{-1}x}{x}$$and$$ g(x) = \frac{\sin a x}{\sin x} $$where a\in[0,1] and  x\in[0,\frac{\pi}{2}] and is often very small (x\ll 1). Are ... 2answers 1k views ### What are the efficient, accurate algorithms for evaluation of hypergeometric functions? I'm curious to know what good numerical algorithms exist for evaluation of the generalized hypergeometric function (or series), defined as$${}_pF_q(a_1,\ldots,a_p;b_1,\ldots,b_q;z) = \sum_{k=0}^{\...
When evaluating cylindrical harmonics, one needs to evaluate trigonometric functions $\cos(m\theta)$ and $\sin(m\theta)$, potentially for large integer $m$ and $\theta\in[-\pi,\pi]$. What is the best ...