WhittakerM¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
WhittakerM[k, m, z]
gives the Whittaker function M_{k,m}(z).
Notes
Related to the Kummer confluent hypergeometric function by M\_{k,m}(z) = E^(-z/2) z^(m+1/2) Hypergeometric1F1\[m-k+1/2, 2m+1, z\]. With an inexact argument it evaluates numerically at machine or arbitrary (MPFR) precision, real or complex, through that confluent form; a real machine argument uses a shared double kernel that also drives the NDArray/packed fast path and Compile\[\]. Special value: M\_{k,m}(0) = 0 for Re(m) \> -1/2. D\[WhittakerM\[k,m,z\],z\] = (1/2-k/z) WhittakerM\[k,m,z\] + ((1/2+k+m)/z) WhittakerM\[k+1,m,z\]. Series at the origin (the z^(1/2+m) Puiseux form) is supported; Series at Infinity only for the terminating (elementary) case. Listable.Examples (13)¶
Every input below was run against the current Mathilda build and its output recorded.
Basic examples (3)¶
In[1]:= WhittakerM[2, 3, 4.5]
Out[1]= 68.967
In[2]:= D[WhittakerM[k, m, z], z]
Out[2]= ((1/2 + k + m) WhittakerM[1 + k, m, z])/z + (1/2 - k/z) WhittakerM[k, m, z]
In[3]:= Series[WhittakerM[2, 1/2, x], {x, 0, 6}]
Out[3]= x - x^2 + 3/8 x^3 - 1/12 x^4 + 5/384 x^5 - 1/640 x^6 + O[x]^7
Applications (10)¶
Machine value
The same value from the defining 1F1 form
Checked against M_{0,1/2}(z) = 2 sinh(z/2)
Arbitrary precision through Hypergeometric1F1
Negative z: the principal branch of z^(m+1/2)
Complex order
Zero at the origin when Re m > -1/2
DLMF 13.4.27
In[11]:= D[WhittakerM[k, m, z], z]
Out[11]= ((1/2 + k + m) WhittakerM[1 + k, m, z])/z + (1/2 - k/z) WhittakerM[k, m, z]
Origin series
In[12]:= Series[WhittakerM[2, 1/2, x], {x, 0, 6}]
Out[12]= x - x^2 + 3/8 x^3 - 1/12 x^4 + 5/384 x^5 - 1/640 x^6 + O[x]^7
At infinity only the terminating case is expanded: here the exact closed form
Algorithm¶
Mathilda -- WhittakerM, the Whittaker M function M_{k,m}(z).
Evaluation is layered so each argument shape takes the cheapest numeric route (mirroring the LaguerreL / HermiteH confluent-hypergeometric design):
z == 0 (exact), Re(m) > -1/2 -> exact 0 (M_{k,m} ~ z^(m+1/2) near 0).
machine-precision call -> the shared double helpers
(k, m exact or machine real; sf_machine_whittaker_m (real z > 0) /
z machine real or complex) sf_machine_whittaker_m_c (complex z, or
real z < 0 on the principal branch),
bit-for-bit with the NDArray element-wise
buffer loop and the Compile[] VM.
Declines (2m+1 pole, cancellation,
overflow) -> template.
some inexact argument -> the confluent-hypergeometric form built as
e^(-z/2) z^(m+1/2) Hypergeometric1F1[...],
evaluated so it inherits 1F1's machine +
MPFR, real + complex numerics. Kept only
if it collapses to a number.
everything else (symbolic) -> stays symbolic (return NULL).
WhittakerM is a single growing PRODUCT (prefactor * 1F1), not a difference, so it adds no cancellation over 1F1 itself and needs no guard digits (unlike HermiteH): bad 1F1 cancellation is declined inside sf_machine_pfq / re-summed in MPFR by the 1F1 evaluator.
Attributes: Listable, NumericFunction, Protected.
Deferred / best-effort, as the sibling special functions: tight Interval enclosures (the generic NumericFunction + D[] interval threading in eval.c declines here because D[WhittakerM,z] mentions WhittakerM itself -- the self-referential-derivative guard), the general asymptotic Series at infinity (a two-scale Stokes transseries; only the terminating/elementary case is emitted, in calculus/series.c), symbolic FunctionExpand, and general-n SeriesCoefficient. The D[] rule and the origin Series live in src/calculus/deriv.c and src/calculus/series.c respectively.
Implementation notes¶
Algorithm. builtin_whittaker_m runs three stages in order.
whit_ndarraythreads the machine kernels over a buffer z, holding k and m constant.whit_machinehandles a scalar machine call. It applies when k and m are exact or machine reals and z is a machine real or complex number, and it callssf_machine_whittaker_m. That kernel computese^(−z/2) z^(m+1/2) · sf_machine_hyper1f1(m−k+1/2, 2m+1, z)and declines inside the 1F1 when cancellation is too large. For a real z < 0, or a complex z, the call goes to the complex twinsf_machine_whittaker_m_c, which takes the principal branch.whittaker_m_evalreturns the exact0at z = 0 when Re m > −1/2. For any other inexact input,whittaker_m_numeric_hypbuildsExp[−z/2] z^(m+1/2) Hypergeometric1F1[m−k+1/2, 2m+1, z]and evaluates it. The result inherits 1F1's MPFR and complex numerics, and it is kept only if it collapses to a number.
D in z comes from DLMF 13.4.27, implemented in deriv.c. series.c emits the Puiseux origin series z^(1/2+m)(...), and at Infinity it emits only the terminating closed form, which arises when m−k+1/2 is a non-positive integer.
Data structures. The machine path keeps no state; it takes doubles in and returns doubles or complex doubles. The function pointer typedefs WhitReal and WhitCplx let WhittakerM and WhittakerW share the scalar and buffer drivers. A real buffer gets a fast pass that stays real. A point on the cut promotes the whole output buffer to complex. REG_N(WhittakerM) registers the n-ary kernel for the Compile VM.
Complexity / limits. Machine cost is one 1F1 evaluation plus exp and pow. The documented timings are 0.2 µs for a real argument and 0.4 µs for a complex one. Precision above machine costs whatever Hypergeometric1F1 costs. Compile[] lowers scalar arguments (real and complex). The rank-1 array shape is not lowered: CompileDiagnostics[{{v,_Real,1}}, WhittakerM[1,1/2,v]] reports Compiled -> False. The general Stokes asymptotic at infinity is not implemented, and neither is FunctionExpand. An Interval argument stays unevaluated, because the derivative refers back to WhittakerM.
Attributes: Listable, NumericFunction, Protected.
References¶
See also: SeriesCoefficient, FunctionExpand
- DLMF §13.14 — Whittaker functions, M_{k,m}(z) = e^(−z/2) z^(m+1/2) M(m−k+1/2, 1+2m, z) (§13.14.2).
- DLMF §13.4.27 (the derivative recurrence used for D).
- Source:
src/special_functions/whittaker.c - Specification:
docs/spec/builtins/special-functions.md - Tests:
tests/test_dsolve_m19_stress.c - Tests:
tests/test_dsolve_m55_stress.c - Tests:
tests/test_sf_machine_hyper.c - Tests:
tests/test_whittaker.c
Notes & additional examples¶
Notes¶
Listable,NumericFunction,Protected. The definition isM_{k,m}(z) = e^(−z/2) z^(m+1/2) 1F1(m−k+1/2; 2m+1; z).- Exact input stays symbolic, with one exception:
M_{k,m}(0) = 0when Re m > −1/2. - Machine input (k and m real; z real or complex) runs the shared double kernel
sf_machine_whittaker_mor its complex twin, and so do buffers. A real z < 0 gives the principal complex value. If the kernel declines, or for complex k, m or precision above machine, the 1F1 form is evaluated at the input precision. Din z follows DLMF 13.4.27. Derivatives in k and m stay inert.Seriesat 0 gives thez^(m+1/2)Puiseux form, for symbolic m as well. AtInfinityonly the terminating (elementary) case is expanded.FunctionExpanddoes not expandWhittakerM, and anIntervalargument stays unevaluated.- See also:
WhittakerW,Hypergeometric1F1.