|
| std::complex< double > | eval_complex_in_polar (double r, double theta) |
| | Evaluate a complex number \( r e^{i \theta} \) in the polar form.
|
| |
| double | get_vec3d_magnitude (std::vector< double > vec) |
| | Return the magnitude of a 3-d vector.
|
| |
| double | get_vec3d_magnitude (double *vec) |
| | Return the magnitude of a 3-d vector.
|
| |
| std::complex< double > | eval_lanczos_approx_series (std::complex< double > z) |
| | Evaluate the Lanczos approximation series \( A_g(z) \) for the gamma function.
|
| |
| std::complex< double > | eval_gamma_lanczos (std::complex< double > z) |
| | Evaluate the gamma function \( \Gamma(z) \) on the complex plane using the Lanczos approximation.
|
| |
| void | get_lngamma_parts (double x, double y, double &lnr, double &theta) |
| | Get the real and imaginary parts of the log-gamma function \( \ln\Gamma(z = x + \mathrm{i}\,y) \).
|
| |
| std::complex< double > | eval_gamma_lnratio (double mu, std::complex< double > nu) |
| | Evaluate the logarithm of the ratio of two gamma functions.
|
| |
| double | wigner_3j (int j1, int j2, int j3, int m1, int m2, int m3) |
| | Calculate Wigner 3-j symbol.
|
| |
| std::complex< double > trv::maths::eval_lanczos_approx_series |
( |
std::complex< double > | z | ) |
|
Evaluate the Lanczos approximation series \( A_g(z) \) for the gamma function.
The series approximate the gamma function by
\[
\Gamma(z + 1) = \sqrt{2\pi}
(z + g + 1/2)^{z + 1/2} \mathrm{e}^{- z - g - 1/2} A_g(z)
\]
where \( g \) is the Lanczos constant.
Here \( g = 7 \) is chosen with \( N = 9 \) terms in the series \( A_g(z) \).
- Parameters
-
- Returns
- Value of \( A_g(z) \).
Definition at line 71 of file maths.cpp.
| std::complex< double > trv::maths::eval_gamma_lnratio |
( |
double | mu, |
|
|
std::complex< double > | nu ) |
Evaluate the logarithm of the ratio of two gamma functions.
The ratio is of the form \(
\Gamma\big(\frac{\mu + \nu + 1}{2}\big)
\big/ \Gamma\big(\frac{\mu - \nu + 1}{2}\big) \,,
\) where \( \mu \) and \( \mathrm{Re}\,\{\nu\} \) are small, while \( \mathrm{Im}\,\{\nu\} \) may be large, in which case the Stirling approximation is used.
- Parameters
-
| mu | Real variable. |
| nu | Complex variable. |
- Returns
- Logarithmic ratio.
Definition at line 128 of file maths.cpp.