Questions tagged [special-functions]

For questions about evaluating or implementing special functions, e.g. Bessel, hypergeometric, gamma, Lambert W.

The NIST Digital Library of Mathematical Functions provides a fairly comprehensive list of what might qualify as a "special function".

63 questions
17
votes
2 answers

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}^{\infty}…
David Z
  • 3,383
  • 2
  • 27
  • 34
8
votes
2 answers

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 there any general ways of generating highly…
Victor Liu
  • 4,480
  • 18
  • 28
8
votes
3 answers

Evaluating sine and cosine of an integer multiple of an angle

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 way to do this in C code? Currently, I just…
Victor Liu
  • 4,480
  • 18
  • 28
2
votes
0 answers

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}(\alpha,\beta)$ is the incomplete Beta function, defined…
a06e
  • 1,729
  • 15
  • 22
0
votes
2 answers

Calculations to constraint a value with only min and max functions

I have an X value that can go from 0.0000001 to infinite. I want, if this value is less than 0.8, get 0.8 And if that value is equal to or more than 0.8, get 0 How would you do that using only min and max functions (and of course basic +-/x…
Oliver
  • 111
  • 4