Coverage for /usr/lib/python3/dist-packages/scipy/special/__init__.py: 100%
17 statements
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-14 15:55 +0200
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-14 15:55 +0200
1"""
2========================================
3Special functions (:mod:`scipy.special`)
4========================================
6.. currentmodule:: scipy.special
8Almost all of the functions below accept NumPy arrays as input
9arguments as well as single numbers. This means they follow
10broadcasting and automatic array-looping rules. Technically,
11they are `NumPy universal functions
12<https://numpy.org/doc/stable/user/basics.ufuncs.html#ufuncs-basics>`_.
13Functions which do not accept NumPy arrays are marked by a warning
14in the section description.
16.. seealso::
18 `scipy.special.cython_special` -- Typed Cython versions of special functions
21Error handling
22==============
24Errors are handled by returning NaNs or other appropriate values.
25Some of the special function routines can emit warnings or raise
26exceptions when an error occurs. By default this is disabled; to
27query and control the current error handling state the following
28functions are provided.
30.. autosummary::
31 :toctree: generated/
33 geterr -- Get the current way of handling special-function errors.
34 seterr -- Set how special-function errors are handled.
35 errstate -- Context manager for special-function error handling.
36 SpecialFunctionWarning -- Warning that can be emitted by special functions.
37 SpecialFunctionError -- Exception that can be raised by special functions.
39Available functions
40===================
42Airy functions
43--------------
45.. autosummary::
46 :toctree: generated/
48 airy -- Airy functions and their derivatives.
49 airye -- Exponentially scaled Airy functions and their derivatives.
50 ai_zeros -- Compute `nt` zeros and values of the Airy function Ai and its derivative.
51 bi_zeros -- Compute `nt` zeros and values of the Airy function Bi and its derivative.
52 itairy -- Integrals of Airy functions
55Elliptic functions and integrals
56--------------------------------
58.. autosummary::
59 :toctree: generated/
61 ellipj -- Jacobian elliptic functions.
62 ellipk -- Complete elliptic integral of the first kind.
63 ellipkm1 -- Complete elliptic integral of the first kind around `m` = 1.
64 ellipkinc -- Incomplete elliptic integral of the first kind.
65 ellipe -- Complete elliptic integral of the second kind.
66 ellipeinc -- Incomplete elliptic integral of the second kind.
67 elliprc -- Degenerate symmetric integral RC.
68 elliprd -- Symmetric elliptic integral of the second kind.
69 elliprf -- Completely-symmetric elliptic integral of the first kind.
70 elliprg -- Completely-symmetric elliptic integral of the second kind.
71 elliprj -- Symmetric elliptic integral of the third kind.
73Bessel functions
74----------------
76.. autosummary::
77 :toctree: generated/
79 jv -- Bessel function of the first kind of real order and \
80 complex argument.
81 jve -- Exponentially scaled Bessel function of order `v`.
82 yn -- Bessel function of the second kind of integer order and \
83 real argument.
84 yv -- Bessel function of the second kind of real order and \
85 complex argument.
86 yve -- Exponentially scaled Bessel function of the second kind \
87 of real order.
88 kn -- Modified Bessel function of the second kind of integer \
89 order `n`
90 kv -- Modified Bessel function of the second kind of real order \
91 `v`
92 kve -- Exponentially scaled modified Bessel function of the \
93 second kind.
94 iv -- Modified Bessel function of the first kind of real order.
95 ive -- Exponentially scaled modified Bessel function of the \
96 first kind.
97 hankel1 -- Hankel function of the first kind.
98 hankel1e -- Exponentially scaled Hankel function of the first kind.
99 hankel2 -- Hankel function of the second kind.
100 hankel2e -- Exponentially scaled Hankel function of the second kind.
101 wright_bessel -- Wright's generalized Bessel function.
103The following function does not accept NumPy arrays (it is not a
104universal function):
106.. autosummary::
107 :toctree: generated/
109 lmbda -- Jahnke-Emden Lambda function, Lambdav(x).
111Zeros of Bessel functions
112^^^^^^^^^^^^^^^^^^^^^^^^^
114The following functions do not accept NumPy arrays (they are not
115universal functions):
117.. autosummary::
118 :toctree: generated/
120 jnjnp_zeros -- Compute zeros of integer-order Bessel functions Jn and Jn'.
121 jnyn_zeros -- Compute nt zeros of Bessel functions Jn(x), Jn'(x), Yn(x), and Yn'(x).
122 jn_zeros -- Compute zeros of integer-order Bessel function Jn(x).
123 jnp_zeros -- Compute zeros of integer-order Bessel function derivative Jn'(x).
124 yn_zeros -- Compute zeros of integer-order Bessel function Yn(x).
125 ynp_zeros -- Compute zeros of integer-order Bessel function derivative Yn'(x).
126 y0_zeros -- Compute nt zeros of Bessel function Y0(z), and derivative at each zero.
127 y1_zeros -- Compute nt zeros of Bessel function Y1(z), and derivative at each zero.
128 y1p_zeros -- Compute nt zeros of Bessel derivative Y1'(z), and value at each zero.
130Faster versions of common Bessel functions
131^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133.. autosummary::
134 :toctree: generated/
136 j0 -- Bessel function of the first kind of order 0.
137 j1 -- Bessel function of the first kind of order 1.
138 y0 -- Bessel function of the second kind of order 0.
139 y1 -- Bessel function of the second kind of order 1.
140 i0 -- Modified Bessel function of order 0.
141 i0e -- Exponentially scaled modified Bessel function of order 0.
142 i1 -- Modified Bessel function of order 1.
143 i1e -- Exponentially scaled modified Bessel function of order 1.
144 k0 -- Modified Bessel function of the second kind of order 0, :math:`K_0`.
145 k0e -- Exponentially scaled modified Bessel function K of order 0
146 k1 -- Modified Bessel function of the second kind of order 1, :math:`K_1(x)`.
147 k1e -- Exponentially scaled modified Bessel function K of order 1.
149Integrals of Bessel functions
150^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152.. autosummary::
153 :toctree: generated/
155 itj0y0 -- Integrals of Bessel functions of order 0.
156 it2j0y0 -- Integrals related to Bessel functions of order 0.
157 iti0k0 -- Integrals of modified Bessel functions of order 0.
158 it2i0k0 -- Integrals related to modified Bessel functions of order 0.
159 besselpoly -- Weighted integral of a Bessel function.
161Derivatives of Bessel functions
162^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164.. autosummary::
165 :toctree: generated/
167 jvp -- Compute nth derivative of Bessel function Jv(z) with respect to `z`.
168 yvp -- Compute nth derivative of Bessel function Yv(z) with respect to `z`.
169 kvp -- Compute nth derivative of real-order modified Bessel function Kv(z)
170 ivp -- Compute nth derivative of modified Bessel function Iv(z) with respect to `z`.
171 h1vp -- Compute nth derivative of Hankel function H1v(z) with respect to `z`.
172 h2vp -- Compute nth derivative of Hankel function H2v(z) with respect to `z`.
174Spherical Bessel functions
175^^^^^^^^^^^^^^^^^^^^^^^^^^
177.. autosummary::
178 :toctree: generated/
180 spherical_jn -- Spherical Bessel function of the first kind or its derivative.
181 spherical_yn -- Spherical Bessel function of the second kind or its derivative.
182 spherical_in -- Modified spherical Bessel function of the first kind or its derivative.
183 spherical_kn -- Modified spherical Bessel function of the second kind or its derivative.
185Riccati-Bessel functions
186^^^^^^^^^^^^^^^^^^^^^^^^
188The following functions do not accept NumPy arrays (they are not
189universal functions):
191.. autosummary::
192 :toctree: generated/
194 riccati_jn -- Compute Ricatti-Bessel function of the first kind and its derivative.
195 riccati_yn -- Compute Ricatti-Bessel function of the second kind and its derivative.
197Struve functions
198----------------
200.. autosummary::
201 :toctree: generated/
203 struve -- Struve function.
204 modstruve -- Modified Struve function.
205 itstruve0 -- Integral of the Struve function of order 0.
206 it2struve0 -- Integral related to the Struve function of order 0.
207 itmodstruve0 -- Integral of the modified Struve function of order 0.
210Raw statistical functions
211-------------------------
213.. seealso:: :mod:`scipy.stats`: Friendly versions of these functions.
215Binomial distribution
216^^^^^^^^^^^^^^^^^^^^^
218.. autosummary::
219 :toctree: generated/
221 bdtr -- Binomial distribution cumulative distribution function.
222 bdtrc -- Binomial distribution survival function.
223 bdtri -- Inverse function to `bdtr` with respect to `p`.
224 bdtrik -- Inverse function to `bdtr` with respect to `k`.
225 bdtrin -- Inverse function to `bdtr` with respect to `n`.
227Beta distribution
228^^^^^^^^^^^^^^^^^
230.. autosummary::
231 :toctree: generated/
233 btdtr -- Cumulative distribution function of the beta distribution.
234 btdtri -- The `p`-th quantile of the beta distribution.
235 btdtria -- Inverse of `btdtr` with respect to `a`.
236 btdtrib -- btdtria(a, p, x).
238F distribution
239^^^^^^^^^^^^^^
241.. autosummary::
242 :toctree: generated/
244 fdtr -- F cumulative distribution function.
245 fdtrc -- F survival function.
246 fdtri -- The `p`-th quantile of the F-distribution.
247 fdtridfd -- Inverse to `fdtr` vs dfd.
249Gamma distribution
250^^^^^^^^^^^^^^^^^^
252.. autosummary::
253 :toctree: generated/
255 gdtr -- Gamma distribution cumulative distribution function.
256 gdtrc -- Gamma distribution survival function.
257 gdtria -- Inverse of `gdtr` vs a.
258 gdtrib -- Inverse of `gdtr` vs b.
259 gdtrix -- Inverse of `gdtr` vs x.
261Negative binomial distribution
262^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
264.. autosummary::
265 :toctree: generated/
267 nbdtr -- Negative binomial cumulative distribution function.
268 nbdtrc -- Negative binomial survival function.
269 nbdtri -- Inverse of `nbdtr` vs `p`.
270 nbdtrik -- Inverse of `nbdtr` vs `k`.
271 nbdtrin -- Inverse of `nbdtr` vs `n`.
273Noncentral F distribution
274^^^^^^^^^^^^^^^^^^^^^^^^^
276.. autosummary::
277 :toctree: generated/
279 ncfdtr -- Cumulative distribution function of the non-central F distribution.
280 ncfdtridfd -- Calculate degrees of freedom (denominator) for the noncentral F-distribution.
281 ncfdtridfn -- Calculate degrees of freedom (numerator) for the noncentral F-distribution.
282 ncfdtri -- Inverse cumulative distribution function of the non-central F distribution.
283 ncfdtrinc -- Calculate non-centrality parameter for non-central F distribution.
285Noncentral t distribution
286^^^^^^^^^^^^^^^^^^^^^^^^^
288.. autosummary::
289 :toctree: generated/
291 nctdtr -- Cumulative distribution function of the non-central `t` distribution.
292 nctdtridf -- Calculate degrees of freedom for non-central t distribution.
293 nctdtrit -- Inverse cumulative distribution function of the non-central t distribution.
294 nctdtrinc -- Calculate non-centrality parameter for non-central t distribution.
296Normal distribution
297^^^^^^^^^^^^^^^^^^^
299.. autosummary::
300 :toctree: generated/
302 nrdtrimn -- Calculate mean of normal distribution given other params.
303 nrdtrisd -- Calculate standard deviation of normal distribution given other params.
304 ndtr -- Normal cumulative distribution function.
305 log_ndtr -- Logarithm of normal cumulative distribution function.
306 ndtri -- Inverse of `ndtr` vs x.
307 ndtri_exp -- Inverse of `log_ndtr` vs x.
309Poisson distribution
310^^^^^^^^^^^^^^^^^^^^
312.. autosummary::
313 :toctree: generated/
315 pdtr -- Poisson cumulative distribution function.
316 pdtrc -- Poisson survival function.
317 pdtri -- Inverse to `pdtr` vs m.
318 pdtrik -- Inverse to `pdtr` vs k.
320Student t distribution
321^^^^^^^^^^^^^^^^^^^^^^
323.. autosummary::
324 :toctree: generated/
326 stdtr -- Student t distribution cumulative distribution function.
327 stdtridf -- Inverse of `stdtr` vs df.
328 stdtrit -- Inverse of `stdtr` vs `t`.
330Chi square distribution
331^^^^^^^^^^^^^^^^^^^^^^^
333.. autosummary::
334 :toctree: generated/
336 chdtr -- Chi square cumulative distribution function.
337 chdtrc -- Chi square survival function.
338 chdtri -- Inverse to `chdtrc`.
339 chdtriv -- Inverse to `chdtr` vs `v`.
341Non-central chi square distribution
342^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
344.. autosummary::
345 :toctree: generated/
347 chndtr -- Non-central chi square cumulative distribution function.
348 chndtridf -- Inverse to `chndtr` vs `df`.
349 chndtrinc -- Inverse to `chndtr` vs `nc`.
350 chndtrix -- Inverse to `chndtr` vs `x`.
352Kolmogorov distribution
353^^^^^^^^^^^^^^^^^^^^^^^
355.. autosummary::
356 :toctree: generated/
358 smirnov -- Kolmogorov-Smirnov complementary cumulative distribution function.
359 smirnovi -- Inverse to `smirnov`.
360 kolmogorov -- Complementary cumulative distribution function of Kolmogorov distribution.
361 kolmogi -- Inverse function to `kolmogorov`.
363Box-Cox transformation
364^^^^^^^^^^^^^^^^^^^^^^
366.. autosummary::
367 :toctree: generated/
369 boxcox -- Compute the Box-Cox transformation.
370 boxcox1p -- Compute the Box-Cox transformation of 1 + `x`.
371 inv_boxcox -- Compute the inverse of the Box-Cox transformation.
372 inv_boxcox1p -- Compute the inverse of the Box-Cox transformation.
375Sigmoidal functions
376^^^^^^^^^^^^^^^^^^^
378.. autosummary::
379 :toctree: generated/
381 logit -- Logit ufunc for ndarrays.
382 expit -- Logistic sigmoid function.
383 log_expit -- Logarithm of the logistic sigmoid function.
385Miscellaneous
386^^^^^^^^^^^^^
388.. autosummary::
389 :toctree: generated/
391 tklmbda -- Tukey-Lambda cumulative distribution function.
392 owens_t -- Owen's T Function.
395Information Theory functions
396----------------------------
398.. autosummary::
399 :toctree: generated/
401 entr -- Elementwise function for computing entropy.
402 rel_entr -- Elementwise function for computing relative entropy.
403 kl_div -- Elementwise function for computing Kullback-Leibler divergence.
404 huber -- Huber loss function.
405 pseudo_huber -- Pseudo-Huber loss function.
408Gamma and related functions
409---------------------------
411.. autosummary::
412 :toctree: generated/
414 gamma -- Gamma function.
415 gammaln -- Logarithm of the absolute value of the Gamma function for real inputs.
416 loggamma -- Principal branch of the logarithm of the Gamma function.
417 gammasgn -- Sign of the gamma function.
418 gammainc -- Regularized lower incomplete gamma function.
419 gammaincinv -- Inverse to `gammainc`.
420 gammaincc -- Regularized upper incomplete gamma function.
421 gammainccinv -- Inverse to `gammaincc`.
422 beta -- Beta function.
423 betaln -- Natural logarithm of absolute value of beta function.
424 betainc -- Incomplete beta integral.
425 betaincinv -- Inverse function to beta integral.
426 psi -- The digamma function.
427 rgamma -- Gamma function inverted.
428 polygamma -- Polygamma function n.
429 multigammaln -- Returns the log of multivariate gamma, also sometimes called the generalized gamma.
430 digamma -- psi(x[, out]).
431 poch -- Rising factorial (z)_m.
434Error function and Fresnel integrals
435------------------------------------
437.. autosummary::
438 :toctree: generated/
440 erf -- Returns the error function of complex argument.
441 erfc -- Complementary error function, ``1 - erf(x)``.
442 erfcx -- Scaled complementary error function, ``exp(x**2) * erfc(x)``.
443 erfi -- Imaginary error function, ``-i erf(i z)``.
444 erfinv -- Inverse function for erf.
445 erfcinv -- Inverse function for erfc.
446 wofz -- Faddeeva function.
447 dawsn -- Dawson's integral.
448 fresnel -- Fresnel sin and cos integrals.
449 fresnel_zeros -- Compute nt complex zeros of sine and cosine Fresnel integrals S(z) and C(z).
450 modfresnelp -- Modified Fresnel positive integrals.
451 modfresnelm -- Modified Fresnel negative integrals.
452 voigt_profile -- Voigt profile.
454The following functions do not accept NumPy arrays (they are not
455universal functions):
457.. autosummary::
458 :toctree: generated/
460 erf_zeros -- Compute nt complex zeros of error function erf(z).
461 fresnelc_zeros -- Compute nt complex zeros of cosine Fresnel integral C(z).
462 fresnels_zeros -- Compute nt complex zeros of sine Fresnel integral S(z).
464Legendre functions
465------------------
467.. autosummary::
468 :toctree: generated/
470 lpmv -- Associated Legendre function of integer order and real degree.
471 sph_harm -- Compute spherical harmonics.
473The following functions do not accept NumPy arrays (they are not
474universal functions):
476.. autosummary::
477 :toctree: generated/
479 clpmn -- Associated Legendre function of the first kind for complex arguments.
480 lpn -- Legendre function of the first kind.
481 lqn -- Legendre function of the second kind.
482 lpmn -- Sequence of associated Legendre functions of the first kind.
483 lqmn -- Sequence of associated Legendre functions of the second kind.
485Ellipsoidal harmonics
486---------------------
488.. autosummary::
489 :toctree: generated/
491 ellip_harm -- Ellipsoidal harmonic functions E^p_n(l).
492 ellip_harm_2 -- Ellipsoidal harmonic functions F^p_n(l).
493 ellip_normal -- Ellipsoidal harmonic normalization constants gamma^p_n.
495Orthogonal polynomials
496----------------------
498The following functions evaluate values of orthogonal polynomials:
500.. autosummary::
501 :toctree: generated/
503 assoc_laguerre -- Compute the generalized (associated) Laguerre polynomial of degree n and order k.
504 eval_legendre -- Evaluate Legendre polynomial at a point.
505 eval_chebyt -- Evaluate Chebyshev polynomial of the first kind at a point.
506 eval_chebyu -- Evaluate Chebyshev polynomial of the second kind at a point.
507 eval_chebyc -- Evaluate Chebyshev polynomial of the first kind on [-2, 2] at a point.
508 eval_chebys -- Evaluate Chebyshev polynomial of the second kind on [-2, 2] at a point.
509 eval_jacobi -- Evaluate Jacobi polynomial at a point.
510 eval_laguerre -- Evaluate Laguerre polynomial at a point.
511 eval_genlaguerre -- Evaluate generalized Laguerre polynomial at a point.
512 eval_hermite -- Evaluate physicist's Hermite polynomial at a point.
513 eval_hermitenorm -- Evaluate probabilist's (normalized) Hermite polynomial at a point.
514 eval_gegenbauer -- Evaluate Gegenbauer polynomial at a point.
515 eval_sh_legendre -- Evaluate shifted Legendre polynomial at a point.
516 eval_sh_chebyt -- Evaluate shifted Chebyshev polynomial of the first kind at a point.
517 eval_sh_chebyu -- Evaluate shifted Chebyshev polynomial of the second kind at a point.
518 eval_sh_jacobi -- Evaluate shifted Jacobi polynomial at a point.
520The following functions compute roots and quadrature weights for
521orthogonal polynomials:
523.. autosummary::
524 :toctree: generated/
526 roots_legendre -- Gauss-Legendre quadrature.
527 roots_chebyt -- Gauss-Chebyshev (first kind) quadrature.
528 roots_chebyu -- Gauss-Chebyshev (second kind) quadrature.
529 roots_chebyc -- Gauss-Chebyshev (first kind) quadrature.
530 roots_chebys -- Gauss-Chebyshev (second kind) quadrature.
531 roots_jacobi -- Gauss-Jacobi quadrature.
532 roots_laguerre -- Gauss-Laguerre quadrature.
533 roots_genlaguerre -- Gauss-generalized Laguerre quadrature.
534 roots_hermite -- Gauss-Hermite (physicst's) quadrature.
535 roots_hermitenorm -- Gauss-Hermite (statistician's) quadrature.
536 roots_gegenbauer -- Gauss-Gegenbauer quadrature.
537 roots_sh_legendre -- Gauss-Legendre (shifted) quadrature.
538 roots_sh_chebyt -- Gauss-Chebyshev (first kind, shifted) quadrature.
539 roots_sh_chebyu -- Gauss-Chebyshev (second kind, shifted) quadrature.
540 roots_sh_jacobi -- Gauss-Jacobi (shifted) quadrature.
542The functions below, in turn, return the polynomial coefficients in
543``orthopoly1d`` objects, which function similarly as `numpy.poly1d`.
544The ``orthopoly1d`` class also has an attribute ``weights``, which returns
545the roots, weights, and total weights for the appropriate form of Gaussian
546quadrature. These are returned in an ``n x 3`` array with roots in the first
547column, weights in the second column, and total weights in the final column.
548Note that ``orthopoly1d`` objects are converted to `~numpy.poly1d` when doing
549arithmetic, and lose information of the original orthogonal polynomial.
551.. autosummary::
552 :toctree: generated/
554 legendre -- Legendre polynomial.
555 chebyt -- Chebyshev polynomial of the first kind.
556 chebyu -- Chebyshev polynomial of the second kind.
557 chebyc -- Chebyshev polynomial of the first kind on :math:`[-2, 2]`.
558 chebys -- Chebyshev polynomial of the second kind on :math:`[-2, 2]`.
559 jacobi -- Jacobi polynomial.
560 laguerre -- Laguerre polynomial.
561 genlaguerre -- Generalized (associated) Laguerre polynomial.
562 hermite -- Physicist's Hermite polynomial.
563 hermitenorm -- Normalized (probabilist's) Hermite polynomial.
564 gegenbauer -- Gegenbauer (ultraspherical) polynomial.
565 sh_legendre -- Shifted Legendre polynomial.
566 sh_chebyt -- Shifted Chebyshev polynomial of the first kind.
567 sh_chebyu -- Shifted Chebyshev polynomial of the second kind.
568 sh_jacobi -- Shifted Jacobi polynomial.
570.. warning::
572 Computing values of high-order polynomials (around ``order > 20``) using
573 polynomial coefficients is numerically unstable. To evaluate polynomial
574 values, the ``eval_*`` functions should be used instead.
577Hypergeometric functions
578------------------------
580.. autosummary::
581 :toctree: generated/
583 hyp2f1 -- Gauss hypergeometric function 2F1(a, b; c; z).
584 hyp1f1 -- Confluent hypergeometric function 1F1(a, b; x).
585 hyperu -- Confluent hypergeometric function U(a, b, x) of the second kind.
586 hyp0f1 -- Confluent hypergeometric limit function 0F1.
589Parabolic cylinder functions
590----------------------------
592.. autosummary::
593 :toctree: generated/
595 pbdv -- Parabolic cylinder function D.
596 pbvv -- Parabolic cylinder function V.
597 pbwa -- Parabolic cylinder function W.
599The following functions do not accept NumPy arrays (they are not
600universal functions):
602.. autosummary::
603 :toctree: generated/
605 pbdv_seq -- Parabolic cylinder functions Dv(x) and derivatives.
606 pbvv_seq -- Parabolic cylinder functions Vv(x) and derivatives.
607 pbdn_seq -- Parabolic cylinder functions Dn(z) and derivatives.
609Mathieu and related functions
610-----------------------------
612.. autosummary::
613 :toctree: generated/
615 mathieu_a -- Characteristic value of even Mathieu functions.
616 mathieu_b -- Characteristic value of odd Mathieu functions.
618The following functions do not accept NumPy arrays (they are not
619universal functions):
621.. autosummary::
622 :toctree: generated/
624 mathieu_even_coef -- Fourier coefficients for even Mathieu and modified Mathieu functions.
625 mathieu_odd_coef -- Fourier coefficients for even Mathieu and modified Mathieu functions.
627The following return both function and first derivative:
629.. autosummary::
630 :toctree: generated/
632 mathieu_cem -- Even Mathieu function and its derivative.
633 mathieu_sem -- Odd Mathieu function and its derivative.
634 mathieu_modcem1 -- Even modified Mathieu function of the first kind and its derivative.
635 mathieu_modcem2 -- Even modified Mathieu function of the second kind and its derivative.
636 mathieu_modsem1 -- Odd modified Mathieu function of the first kind and its derivative.
637 mathieu_modsem2 -- Odd modified Mathieu function of the second kind and its derivative.
639Spheroidal wave functions
640-------------------------
642.. autosummary::
643 :toctree: generated/
645 pro_ang1 -- Prolate spheroidal angular function of the first kind and its derivative.
646 pro_rad1 -- Prolate spheroidal radial function of the first kind and its derivative.
647 pro_rad2 -- Prolate spheroidal radial function of the secon kind and its derivative.
648 obl_ang1 -- Oblate spheroidal angular function of the first kind and its derivative.
649 obl_rad1 -- Oblate spheroidal radial function of the first kind and its derivative.
650 obl_rad2 -- Oblate spheroidal radial function of the second kind and its derivative.
651 pro_cv -- Characteristic value of prolate spheroidal function.
652 obl_cv -- Characteristic value of oblate spheroidal function.
653 pro_cv_seq -- Characteristic values for prolate spheroidal wave functions.
654 obl_cv_seq -- Characteristic values for oblate spheroidal wave functions.
656The following functions require pre-computed characteristic value:
658.. autosummary::
659 :toctree: generated/
661 pro_ang1_cv -- Prolate spheroidal angular function pro_ang1 for precomputed characteristic value.
662 pro_rad1_cv -- Prolate spheroidal radial function pro_rad1 for precomputed characteristic value.
663 pro_rad2_cv -- Prolate spheroidal radial function pro_rad2 for precomputed characteristic value.
664 obl_ang1_cv -- Oblate spheroidal angular function obl_ang1 for precomputed characteristic value.
665 obl_rad1_cv -- Oblate spheroidal radial function obl_rad1 for precomputed characteristic value.
666 obl_rad2_cv -- Oblate spheroidal radial function obl_rad2 for precomputed characteristic value.
668Kelvin functions
669----------------
671.. autosummary::
672 :toctree: generated/
674 kelvin -- Kelvin functions as complex numbers.
675 kelvin_zeros -- Compute nt zeros of all Kelvin functions.
676 ber -- Kelvin function ber.
677 bei -- Kelvin function bei
678 berp -- Derivative of the Kelvin function `ber`.
679 beip -- Derivative of the Kelvin function `bei`.
680 ker -- Kelvin function ker.
681 kei -- Kelvin function ker.
682 kerp -- Derivative of the Kelvin function ker.
683 keip -- Derivative of the Kelvin function kei.
685The following functions do not accept NumPy arrays (they are not
686universal functions):
688.. autosummary::
689 :toctree: generated/
691 ber_zeros -- Compute nt zeros of the Kelvin function ber(x).
692 bei_zeros -- Compute nt zeros of the Kelvin function bei(x).
693 berp_zeros -- Compute nt zeros of the Kelvin function ber'(x).
694 beip_zeros -- Compute nt zeros of the Kelvin function bei'(x).
695 ker_zeros -- Compute nt zeros of the Kelvin function ker(x).
696 kei_zeros -- Compute nt zeros of the Kelvin function kei(x).
697 kerp_zeros -- Compute nt zeros of the Kelvin function ker'(x).
698 keip_zeros -- Compute nt zeros of the Kelvin function kei'(x).
700Combinatorics
701-------------
703.. autosummary::
704 :toctree: generated/
706 comb -- The number of combinations of N things taken k at a time.
707 perm -- Permutations of N things taken k at a time, i.e., k-permutations of N.
709Lambert W and related functions
710-------------------------------
712.. autosummary::
713 :toctree: generated/
715 lambertw -- Lambert W function.
716 wrightomega -- Wright Omega function.
718Other special functions
719-----------------------
721.. autosummary::
722 :toctree: generated/
724 agm -- Arithmetic, Geometric Mean.
725 bernoulli -- Bernoulli numbers B0..Bn (inclusive).
726 binom -- Binomial coefficient
727 diric -- Periodic sinc function, also called the Dirichlet function.
728 euler -- Euler numbers E0..En (inclusive).
729 expn -- Exponential integral E_n.
730 exp1 -- Exponential integral E_1 of complex argument z.
731 expi -- Exponential integral Ei.
732 factorial -- The factorial of a number or array of numbers.
733 factorial2 -- Double factorial.
734 factorialk -- Multifactorial of n of order k, n(!!...!).
735 shichi -- Hyperbolic sine and cosine integrals.
736 sici -- Sine and cosine integrals.
737 softmax -- Softmax function.
738 log_softmax -- Logarithm of softmax function.
739 spence -- Spence's function, also known as the dilogarithm.
740 zeta -- Riemann zeta function.
741 zetac -- Riemann zeta function minus 1.
743Convenience functions
744---------------------
746.. autosummary::
747 :toctree: generated/
749 cbrt -- Cube root of `x`.
750 exp10 -- 10**x.
751 exp2 -- 2**x.
752 radian -- Convert from degrees to radians.
753 cosdg -- Cosine of the angle `x` given in degrees.
754 sindg -- Sine of angle given in degrees.
755 tandg -- Tangent of angle x given in degrees.
756 cotdg -- Cotangent of the angle `x` given in degrees.
757 log1p -- Calculates log(1+x) for use when `x` is near zero.
758 expm1 -- ``exp(x) - 1`` for use when `x` is near zero.
759 cosm1 -- ``cos(x) - 1`` for use when `x` is near zero.
760 powm1 -- ``x**y - 1`` for use when `y` is near zero or `x` is near 1.
761 round -- Round to nearest integer.
762 xlogy -- Compute ``x*log(y)`` so that the result is 0 if ``x = 0``.
763 xlog1py -- Compute ``x*log1p(y)`` so that the result is 0 if ``x = 0``.
764 logsumexp -- Compute the log of the sum of exponentials of input elements.
765 exprel -- Relative error exponential, (exp(x)-1)/x, for use when `x` is near zero.
766 sinc -- Return the sinc function.
768"""
770from ._sf_error import SpecialFunctionWarning, SpecialFunctionError
772from . import _ufuncs
773from ._ufuncs import *
775from . import _basic
776from ._basic import *
778from ._logsumexp import logsumexp, softmax, log_softmax
780from . import _orthogonal
781from ._orthogonal import *
783from ._spfun_stats import multigammaln
784from ._ellip_harm import (
785 ellip_harm,
786 ellip_harm_2,
787 ellip_normal
788)
789from ._lambertw import lambertw
790from ._spherical_bessel import (
791 spherical_jn,
792 spherical_yn,
793 spherical_in,
794 spherical_kn
795)
797# Deprecated namespaces, to be removed in v2.0.0
798from . import add_newdocs, basic, orthogonal, specfun, sf_error, spfun_stats
800__all__ = _ufuncs.__all__ + _basic.__all__ + _orthogonal.__all__ + [
801 'SpecialFunctionWarning',
802 'SpecialFunctionError',
803 'logsumexp',
804 'softmax',
805 'log_softmax',
806 'multigammaln',
807 'ellip_harm',
808 'ellip_harm_2',
809 'ellip_normal',
810 'lambertw',
811 'spherical_jn',
812 'spherical_yn',
813 'spherical_in',
814 'spherical_kn',
815]
817from scipy._lib._testutils import PytestTester
818test = PytestTester(__name__)
819del PytestTester