1"""
2========================================
3Special functions (:mod:`scipy.special`)
4========================================
5
6.. currentmodule:: scipy.special
7
8Nearly all of the functions below are universal functions and follow
9broadcasting and automatic array-looping rules.
10
11.. seealso::
12
13   `scipy.special.cython_special` -- Typed Cython versions of special functions
14
15
16Error handling
17==============
18
19Errors are handled by returning NaNs or other appropriate values.
20Some of the special function routines can emit warnings or raise
21exceptions when an error occurs. By default this is disabled; to
22query and control the current error handling state the following
23functions are provided.
24
25.. autosummary::
26   :toctree: generated/
27
28   geterr                 -- Get the current way of handling special-function errors.
29   seterr                 -- Set how special-function errors are handled.
30   errstate               -- Context manager for special-function error handling.
31   SpecialFunctionWarning -- Warning that can be emitted by special functions.
32   SpecialFunctionError   -- Exception that can be raised by special functions.
33
34Available functions
35===================
36
37Airy functions
38--------------
39
40.. autosummary::
41   :toctree: generated/
42
43   airy     -- Airy functions and their derivatives.
44   airye    -- Exponentially scaled Airy functions and their derivatives.
45   ai_zeros -- Compute `nt` zeros and values of the Airy function Ai and its derivative.
46   bi_zeros -- Compute `nt` zeros and values of the Airy function Bi and its derivative.
47   itairy   -- Integrals of Airy functions
48
49
50Elliptic functions and integrals
51--------------------------------
52
53.. autosummary::
54   :toctree: generated/
55
56   ellipj    -- Jacobian elliptic functions.
57   ellipk    -- Complete elliptic integral of the first kind.
58   ellipkm1  -- Complete elliptic integral of the first kind around `m` = 1.
59   ellipkinc -- Incomplete elliptic integral of the first kind.
60   ellipe    -- Complete elliptic integral of the second kind.
61   ellipeinc -- Incomplete elliptic integral of the second kind.
62
63Bessel functions
64----------------
65
66.. autosummary::
67   :toctree: generated/
68
69   jv            -- Bessel function of the first kind of real order and \
70                    complex argument.
71   jve           -- Exponentially scaled Bessel function of order `v`.
72   yn            -- Bessel function of the second kind of integer order and \
73                    real argument.
74   yv            -- Bessel function of the second kind of real order and \
75                    complex argument.
76   yve           -- Exponentially scaled Bessel function of the second kind \
77                    of real order.
78   kn            -- Modified Bessel function of the second kind of integer \
79                    order `n`
80   kv            -- Modified Bessel function of the second kind of real order \
81                    `v`
82   kve           -- Exponentially scaled modified Bessel function of the \
83                    second kind.
84   iv            -- Modified Bessel function of the first kind of real order.
85   ive           -- Exponentially scaled modified Bessel function of the \
86                    first kind.
87   hankel1       -- Hankel function of the first kind.
88   hankel1e      -- Exponentially scaled Hankel function of the first kind.
89   hankel2       -- Hankel function of the second kind.
90   hankel2e      -- Exponentially scaled Hankel function of the second kind.
91   wright_bessel -- Wright's generalized Bessel function.
92
93The following is not a universal function:
94
95.. autosummary::
96   :toctree: generated/
97
98   lmbda -- Jahnke-Emden Lambda function, Lambdav(x).
99
100Zeros of Bessel functions
101^^^^^^^^^^^^^^^^^^^^^^^^^
102
103These are not universal functions:
104
105.. autosummary::
106   :toctree: generated/
107
108   jnjnp_zeros -- Compute zeros of integer-order Bessel functions Jn and Jn'.
109   jnyn_zeros  -- Compute nt zeros of Bessel functions Jn(x), Jn'(x), Yn(x), and Yn'(x).
110   jn_zeros    -- Compute zeros of integer-order Bessel function Jn(x).
111   jnp_zeros   -- Compute zeros of integer-order Bessel function derivative Jn'(x).
112   yn_zeros    -- Compute zeros of integer-order Bessel function Yn(x).
113   ynp_zeros   -- Compute zeros of integer-order Bessel function derivative Yn'(x).
114   y0_zeros    -- Compute nt zeros of Bessel function Y0(z), and derivative at each zero.
115   y1_zeros    -- Compute nt zeros of Bessel function Y1(z), and derivative at each zero.
116   y1p_zeros   -- Compute nt zeros of Bessel derivative Y1'(z), and value at each zero.
117
118Faster versions of common Bessel functions
119^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120
121.. autosummary::
122   :toctree: generated/
123
124   j0  -- Bessel function of the first kind of order 0.
125   j1  -- Bessel function of the first kind of order 1.
126   y0  -- Bessel function of the second kind of order 0.
127   y1  -- Bessel function of the second kind of order 1.
128   i0  -- Modified Bessel function of order 0.
129   i0e -- Exponentially scaled modified Bessel function of order 0.
130   i1  -- Modified Bessel function of order 1.
131   i1e -- Exponentially scaled modified Bessel function of order 1.
132   k0  -- Modified Bessel function of the second kind of order 0, :math:`K_0`.
133   k0e -- Exponentially scaled modified Bessel function K of order 0
134   k1  -- Modified Bessel function of the second kind of order 1, :math:`K_1(x)`.
135   k1e -- Exponentially scaled modified Bessel function K of order 1.
136
137Integrals of Bessel functions
138^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139
140.. autosummary::
141   :toctree: generated/
142
143   itj0y0     -- Integrals of Bessel functions of order 0.
144   it2j0y0    -- Integrals related to Bessel functions of order 0.
145   iti0k0     -- Integrals of modified Bessel functions of order 0.
146   it2i0k0    -- Integrals related to modified Bessel functions of order 0.
147   besselpoly -- Weighted integral of a Bessel function.
148
149Derivatives of Bessel functions
150^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151
152.. autosummary::
153   :toctree: generated/
154
155   jvp  -- Compute nth derivative of Bessel function Jv(z) with respect to `z`.
156   yvp  -- Compute nth derivative of Bessel function Yv(z) with respect to `z`.
157   kvp  -- Compute nth derivative of real-order modified Bessel function Kv(z)
158   ivp  -- Compute nth derivative of modified Bessel function Iv(z) with respect to `z`.
159   h1vp -- Compute nth derivative of Hankel function H1v(z) with respect to `z`.
160   h2vp -- Compute nth derivative of Hankel function H2v(z) with respect to `z`.
161
162Spherical Bessel functions
163^^^^^^^^^^^^^^^^^^^^^^^^^^
164
165.. autosummary::
166   :toctree: generated/
167
168   spherical_jn -- Spherical Bessel function of the first kind or its derivative.
169   spherical_yn -- Spherical Bessel function of the second kind or its derivative.
170   spherical_in -- Modified spherical Bessel function of the first kind or its derivative.
171   spherical_kn -- Modified spherical Bessel function of the second kind or its derivative.
172
173Riccati-Bessel functions
174^^^^^^^^^^^^^^^^^^^^^^^^
175
176These are not universal functions:
177
178.. autosummary::
179   :toctree: generated/
180
181   riccati_jn -- Compute Ricatti-Bessel function of the first kind and its derivative.
182   riccati_yn -- Compute Ricatti-Bessel function of the second kind and its derivative.
183
184Struve functions
185----------------
186
187.. autosummary::
188   :toctree: generated/
189
190   struve       -- Struve function.
191   modstruve    -- Modified Struve function.
192   itstruve0    -- Integral of the Struve function of order 0.
193   it2struve0   -- Integral related to the Struve function of order 0.
194   itmodstruve0 -- Integral of the modified Struve function of order 0.
195
196
197Raw statistical functions
198-------------------------
199
200.. seealso:: :mod:`scipy.stats`: Friendly versions of these functions.
201
202.. autosummary::
203   :toctree: generated/
204
205   bdtr         -- Binomial distribution cumulative distribution function.
206   bdtrc        -- Binomial distribution survival function.
207   bdtri        -- Inverse function to `bdtr` with respect to `p`.
208   bdtrik       -- Inverse function to `bdtr` with respect to `k`.
209   bdtrin       -- Inverse function to `bdtr` with respect to `n`.
210   btdtr        -- Cumulative distribution function of the beta distribution.
211   btdtri       -- The `p`-th quantile of the beta distribution.
212   btdtria      -- Inverse of `btdtr` with respect to `a`.
213   btdtrib      -- btdtria(a, p, x).
214   fdtr         -- F cumulative distribution function.
215   fdtrc        -- F survival function.
216   fdtri        -- The `p`-th quantile of the F-distribution.
217   fdtridfd     -- Inverse to `fdtr` vs dfd.
218   gdtr         -- Gamma distribution cumulative distribution function.
219   gdtrc        -- Gamma distribution survival function.
220   gdtria       -- Inverse of `gdtr` vs a.
221   gdtrib       -- Inverse of `gdtr` vs b.
222   gdtrix       -- Inverse of `gdtr` vs x.
223   nbdtr        -- Negative binomial cumulative distribution function.
224   nbdtrc       -- Negative binomial survival function.
225   nbdtri       -- Inverse of `nbdtr` vs `p`.
226   nbdtrik      -- Inverse of `nbdtr` vs `k`.
227   nbdtrin      -- Inverse of `nbdtr` vs `n`.
228   ncfdtr       -- Cumulative distribution function of the non-central F distribution.
229   ncfdtridfd   -- Calculate degrees of freedom (denominator) for the noncentral F-distribution.
230   ncfdtridfn   -- Calculate degrees of freedom (numerator) for the noncentral F-distribution.
231   ncfdtri      -- Inverse cumulative distribution function of the non-central F distribution.
232   ncfdtrinc    -- Calculate non-centrality parameter for non-central F distribution.
233   nctdtr       -- Cumulative distribution function of the non-central `t` distribution.
234   nctdtridf    -- Calculate degrees of freedom for non-central t distribution.
235   nctdtrit     -- Inverse cumulative distribution function of the non-central t distribution.
236   nctdtrinc    -- Calculate non-centrality parameter for non-central t distribution.
237   nrdtrimn     -- Calculate mean of normal distribution given other params.
238   nrdtrisd     -- Calculate standard deviation of normal distribution given other params.
239   pdtr         -- Poisson cumulative distribution function.
240   pdtrc        -- Poisson survival function.
241   pdtri        -- Inverse to `pdtr` vs m.
242   pdtrik       -- Inverse to `pdtr` vs k.
243   stdtr        -- Student t distribution cumulative distribution function.
244   stdtridf     -- Inverse of `stdtr` vs df.
245   stdtrit      -- Inverse of `stdtr` vs `t`.
246   chdtr        -- Chi square cumulative distribution function.
247   chdtrc       -- Chi square survival function.
248   chdtri       -- Inverse to `chdtrc`.
249   chdtriv      -- Inverse to `chdtr` vs `v`.
250   ndtr         -- Gaussian cumulative distribution function.
251   log_ndtr     -- Logarithm of Gaussian cumulative distribution function.
252   ndtri        -- Inverse of `ndtr` vs x.
253   ndtri_exp    -- Inverse of `log_ndtr` vs x.
254   chndtr       -- Non-central chi square cumulative distribution function.
255   chndtridf    -- Inverse to `chndtr` vs `df`.
256   chndtrinc    -- Inverse to `chndtr` vs `nc`.
257   chndtrix     -- Inverse to `chndtr` vs `x`.
258   smirnov      -- Kolmogorov-Smirnov complementary cumulative distribution function.
259   smirnovi     -- Inverse to `smirnov`.
260   kolmogorov   -- Complementary cumulative distribution function of Kolmogorov distribution.
261   kolmogi      -- Inverse function to `kolmogorov`.
262   tklmbda      -- Tukey-Lambda cumulative distribution function.
263   logit        -- Logit ufunc for ndarrays.
264   expit        -- Expit ufunc for ndarrays.
265   boxcox       -- Compute the Box-Cox transformation.
266   boxcox1p     -- Compute the Box-Cox transformation of 1 + `x`.
267   inv_boxcox   -- Compute the inverse of the Box-Cox transformation.
268   inv_boxcox1p -- Compute the inverse of the Box-Cox transformation.
269   owens_t      -- Owen's T Function.
270
271
272Information Theory functions
273----------------------------
274
275.. autosummary::
276   :toctree: generated/
277
278   entr         -- Elementwise function for computing entropy.
279   rel_entr     -- Elementwise function for computing relative entropy.
280   kl_div       -- Elementwise function for computing Kullback-Leibler divergence.
281   huber        -- Huber loss function.
282   pseudo_huber -- Pseudo-Huber loss function.
283
284
285Gamma and related functions
286---------------------------
287
288.. autosummary::
289   :toctree: generated/
290
291   gamma        -- Gamma function.
292   gammaln      -- Logarithm of the absolute value of the Gamma function for real inputs.
293   loggamma     -- Principal branch of the logarithm of the Gamma function.
294   gammasgn     -- Sign of the gamma function.
295   gammainc     -- Regularized lower incomplete gamma function.
296   gammaincinv  -- Inverse to `gammainc`.
297   gammaincc    -- Regularized upper incomplete gamma function.
298   gammainccinv -- Inverse to `gammaincc`.
299   beta         -- Beta function.
300   betaln       -- Natural logarithm of absolute value of beta function.
301   betainc      -- Incomplete beta integral.
302   betaincinv   -- Inverse function to beta integral.
303   psi          -- The digamma function.
304   rgamma       -- Gamma function inverted.
305   polygamma    -- Polygamma function n.
306   multigammaln -- Returns the log of multivariate gamma, also sometimes called the generalized gamma.
307   digamma      -- psi(x[, out]).
308   poch         -- Rising factorial (z)_m.
309
310
311Error function and Fresnel integrals
312------------------------------------
313
314.. autosummary::
315   :toctree: generated/
316
317   erf           -- Returns the error function of complex argument.
318   erfc          -- Complementary error function, ``1 - erf(x)``.
319   erfcx         -- Scaled complementary error function, ``exp(x**2) * erfc(x)``.
320   erfi          -- Imaginary error function, ``-i erf(i z)``.
321   erfinv        -- Inverse function for erf.
322   erfcinv       -- Inverse function for erfc.
323   wofz          -- Faddeeva function.
324   dawsn         -- Dawson's integral.
325   fresnel       -- Fresnel sin and cos integrals.
326   fresnel_zeros -- Compute nt complex zeros of sine and cosine Fresnel integrals S(z) and C(z).
327   modfresnelp   -- Modified Fresnel positive integrals.
328   modfresnelm   -- Modified Fresnel negative integrals.
329   voigt_profile -- Voigt profile.
330
331These are not universal functions:
332
333.. autosummary::
334   :toctree: generated/
335
336   erf_zeros      -- Compute nt complex zeros of error function erf(z).
337   fresnelc_zeros -- Compute nt complex zeros of cosine Fresnel integral C(z).
338   fresnels_zeros -- Compute nt complex zeros of sine Fresnel integral S(z).
339
340Legendre functions
341------------------
342
343.. autosummary::
344   :toctree: generated/
345
346   lpmv     -- Associated Legendre function of integer order and real degree.
347   sph_harm -- Compute spherical harmonics.
348
349These are not universal functions:
350
351.. autosummary::
352   :toctree: generated/
353
354   clpmn -- Associated Legendre function of the first kind for complex arguments.
355   lpn   -- Legendre function of the first kind.
356   lqn   -- Legendre function of the second kind.
357   lpmn  -- Sequence of associated Legendre functions of the first kind.
358   lqmn  -- Sequence of associated Legendre functions of the second kind.
359
360Ellipsoidal harmonics
361---------------------
362
363.. autosummary::
364   :toctree: generated/
365
366   ellip_harm   -- Ellipsoidal harmonic functions E^p_n(l).
367   ellip_harm_2 -- Ellipsoidal harmonic functions F^p_n(l).
368   ellip_normal -- Ellipsoidal harmonic normalization constants gamma^p_n.
369
370Orthogonal polynomials
371----------------------
372
373The following functions evaluate values of orthogonal polynomials:
374
375.. autosummary::
376   :toctree: generated/
377
378   assoc_laguerre   -- Compute the generalized (associated) Laguerre polynomial of degree n and order k.
379   eval_legendre    -- Evaluate Legendre polynomial at a point.
380   eval_chebyt      -- Evaluate Chebyshev polynomial of the first kind at a point.
381   eval_chebyu      -- Evaluate Chebyshev polynomial of the second kind at a point.
382   eval_chebyc      -- Evaluate Chebyshev polynomial of the first kind on [-2, 2] at a point.
383   eval_chebys      -- Evaluate Chebyshev polynomial of the second kind on [-2, 2] at a point.
384   eval_jacobi      -- Evaluate Jacobi polynomial at a point.
385   eval_laguerre    -- Evaluate Laguerre polynomial at a point.
386   eval_genlaguerre -- Evaluate generalized Laguerre polynomial at a point.
387   eval_hermite     -- Evaluate physicist's Hermite polynomial at a point.
388   eval_hermitenorm -- Evaluate probabilist's (normalized) Hermite polynomial at a point.
389   eval_gegenbauer  -- Evaluate Gegenbauer polynomial at a point.
390   eval_sh_legendre -- Evaluate shifted Legendre polynomial at a point.
391   eval_sh_chebyt   -- Evaluate shifted Chebyshev polynomial of the first kind at a point.
392   eval_sh_chebyu   -- Evaluate shifted Chebyshev polynomial of the second kind at a point.
393   eval_sh_jacobi   -- Evaluate shifted Jacobi polynomial at a point.
394
395The following functions compute roots and quadrature weights for
396orthogonal polynomials:
397
398.. autosummary::
399   :toctree: generated/
400
401   roots_legendre    -- Gauss-Legendre quadrature.
402   roots_chebyt      -- Gauss-Chebyshev (first kind) quadrature.
403   roots_chebyu      -- Gauss-Chebyshev (second kind) quadrature.
404   roots_chebyc      -- Gauss-Chebyshev (first kind) quadrature.
405   roots_chebys      -- Gauss-Chebyshev (second kind) quadrature.
406   roots_jacobi      -- Gauss-Jacobi quadrature.
407   roots_laguerre    -- Gauss-Laguerre quadrature.
408   roots_genlaguerre -- Gauss-generalized Laguerre quadrature.
409   roots_hermite     -- Gauss-Hermite (physicst's) quadrature.
410   roots_hermitenorm -- Gauss-Hermite (statistician's) quadrature.
411   roots_gegenbauer  -- Gauss-Gegenbauer quadrature.
412   roots_sh_legendre -- Gauss-Legendre (shifted) quadrature.
413   roots_sh_chebyt   -- Gauss-Chebyshev (first kind, shifted) quadrature.
414   roots_sh_chebyu   -- Gauss-Chebyshev (second kind, shifted) quadrature.
415   roots_sh_jacobi   -- Gauss-Jacobi (shifted) quadrature.
416
417The functions below, in turn, return the polynomial coefficients in
418``orthopoly1d`` objects, which function similarly as `numpy.poly1d`.
419The ``orthopoly1d`` class also has an attribute ``weights``, which returns
420the roots, weights, and total weights for the appropriate form of Gaussian
421quadrature. These are returned in an ``n x 3`` array with roots in the first
422column, weights in the second column, and total weights in the final column.
423Note that ``orthopoly1d`` objects are converted to `~numpy.poly1d` when doing
424arithmetic, and lose information of the original orthogonal polynomial.
425
426.. autosummary::
427   :toctree: generated/
428
429   legendre    -- Legendre polynomial.
430   chebyt      -- Chebyshev polynomial of the first kind.
431   chebyu      -- Chebyshev polynomial of the second kind.
432   chebyc      -- Chebyshev polynomial of the first kind on :math:`[-2, 2]`.
433   chebys      -- Chebyshev polynomial of the second kind on :math:`[-2, 2]`.
434   jacobi      -- Jacobi polynomial.
435   laguerre    -- Laguerre polynomial.
436   genlaguerre -- Generalized (associated) Laguerre polynomial.
437   hermite     -- Physicist's Hermite polynomial.
438   hermitenorm -- Normalized (probabilist's) Hermite polynomial.
439   gegenbauer  -- Gegenbauer (ultraspherical) polynomial.
440   sh_legendre -- Shifted Legendre polynomial.
441   sh_chebyt   -- Shifted Chebyshev polynomial of the first kind.
442   sh_chebyu   -- Shifted Chebyshev polynomial of the second kind.
443   sh_jacobi   -- Shifted Jacobi polynomial.
444
445.. warning::
446
447   Computing values of high-order polynomials (around ``order > 20``) using
448   polynomial coefficients is numerically unstable. To evaluate polynomial
449   values, the ``eval_*`` functions should be used instead.
450
451
452Hypergeometric functions
453------------------------
454
455.. autosummary::
456   :toctree: generated/
457
458   hyp2f1 -- Gauss hypergeometric function 2F1(a, b; c; z).
459   hyp1f1 -- Confluent hypergeometric function 1F1(a, b; x).
460   hyperu -- Confluent hypergeometric function U(a, b, x) of the second kind.
461   hyp0f1 -- Confluent hypergeometric limit function 0F1.
462
463
464Parabolic cylinder functions
465----------------------------
466
467.. autosummary::
468   :toctree: generated/
469
470   pbdv -- Parabolic cylinder function D.
471   pbvv -- Parabolic cylinder function V.
472   pbwa -- Parabolic cylinder function W.
473
474These are not universal functions:
475
476.. autosummary::
477   :toctree: generated/
478
479   pbdv_seq -- Parabolic cylinder functions Dv(x) and derivatives.
480   pbvv_seq -- Parabolic cylinder functions Vv(x) and derivatives.
481   pbdn_seq -- Parabolic cylinder functions Dn(z) and derivatives.
482
483Mathieu and related functions
484-----------------------------
485
486.. autosummary::
487   :toctree: generated/
488
489   mathieu_a -- Characteristic value of even Mathieu functions.
490   mathieu_b -- Characteristic value of odd Mathieu functions.
491
492These are not universal functions:
493
494.. autosummary::
495   :toctree: generated/
496
497   mathieu_even_coef -- Fourier coefficients for even Mathieu and modified Mathieu functions.
498   mathieu_odd_coef  -- Fourier coefficients for even Mathieu and modified Mathieu functions.
499
500The following return both function and first derivative:
501
502.. autosummary::
503   :toctree: generated/
504
505   mathieu_cem     -- Even Mathieu function and its derivative.
506   mathieu_sem     -- Odd Mathieu function and its derivative.
507   mathieu_modcem1 -- Even modified Mathieu function of the first kind and its derivative.
508   mathieu_modcem2 -- Even modified Mathieu function of the second kind and its derivative.
509   mathieu_modsem1 -- Odd modified Mathieu function of the first kind and its derivative.
510   mathieu_modsem2 -- Odd modified Mathieu function of the second kind and its derivative.
511
512Spheroidal wave functions
513-------------------------
514
515.. autosummary::
516   :toctree: generated/
517
518   pro_ang1   -- Prolate spheroidal angular function of the first kind and its derivative.
519   pro_rad1   -- Prolate spheroidal radial function of the first kind and its derivative.
520   pro_rad2   -- Prolate spheroidal radial function of the secon kind and its derivative.
521   obl_ang1   -- Oblate spheroidal angular function of the first kind and its derivative.
522   obl_rad1   -- Oblate spheroidal radial function of the first kind and its derivative.
523   obl_rad2   -- Oblate spheroidal radial function of the second kind and its derivative.
524   pro_cv     -- Characteristic value of prolate spheroidal function.
525   obl_cv     -- Characteristic value of oblate spheroidal function.
526   pro_cv_seq -- Characteristic values for prolate spheroidal wave functions.
527   obl_cv_seq -- Characteristic values for oblate spheroidal wave functions.
528
529The following functions require pre-computed characteristic value:
530
531.. autosummary::
532   :toctree: generated/
533
534   pro_ang1_cv -- Prolate spheroidal angular function pro_ang1 for precomputed characteristic value.
535   pro_rad1_cv -- Prolate spheroidal radial function pro_rad1 for precomputed characteristic value.
536   pro_rad2_cv -- Prolate spheroidal radial function pro_rad2 for precomputed characteristic value.
537   obl_ang1_cv -- Oblate spheroidal angular function obl_ang1 for precomputed characteristic value.
538   obl_rad1_cv -- Oblate spheroidal radial function obl_rad1 for precomputed characteristic value.
539   obl_rad2_cv -- Oblate spheroidal radial function obl_rad2 for precomputed characteristic value.
540
541Kelvin functions
542----------------
543
544.. autosummary::
545   :toctree: generated/
546
547   kelvin       -- Kelvin functions as complex numbers.
548   kelvin_zeros -- Compute nt zeros of all Kelvin functions.
549   ber          -- Kelvin function ber.
550   bei          -- Kelvin function bei
551   berp         -- Derivative of the Kelvin function `ber`.
552   beip         -- Derivative of the Kelvin function `bei`.
553   ker          -- Kelvin function ker.
554   kei          -- Kelvin function ker.
555   kerp         -- Derivative of the Kelvin function ker.
556   keip         -- Derivative of the Kelvin function kei.
557
558These are not universal functions:
559
560.. autosummary::
561   :toctree: generated/
562
563   ber_zeros  -- Compute nt zeros of the Kelvin function ber(x).
564   bei_zeros  -- Compute nt zeros of the Kelvin function bei(x).
565   berp_zeros -- Compute nt zeros of the Kelvin function ber'(x).
566   beip_zeros -- Compute nt zeros of the Kelvin function bei'(x).
567   ker_zeros  -- Compute nt zeros of the Kelvin function ker(x).
568   kei_zeros  -- Compute nt zeros of the Kelvin function kei(x).
569   kerp_zeros -- Compute nt zeros of the Kelvin function ker'(x).
570   keip_zeros -- Compute nt zeros of the Kelvin function kei'(x).
571
572Combinatorics
573-------------
574
575.. autosummary::
576   :toctree: generated/
577
578   comb -- The number of combinations of N things taken k at a time.
579   perm -- Permutations of N things taken k at a time, i.e., k-permutations of N.
580
581Lambert W and related functions
582-------------------------------
583
584.. autosummary::
585   :toctree: generated/
586
587   lambertw    -- Lambert W function.
588   wrightomega -- Wright Omega function.
589
590Other special functions
591-----------------------
592
593.. autosummary::
594   :toctree: generated/
595
596   agm         -- Arithmetic, Geometric Mean.
597   bernoulli   -- Bernoulli numbers B0..Bn (inclusive).
598   binom       -- Binomial coefficient
599   diric       -- Periodic sinc function, also called the Dirichlet function.
600   euler       -- Euler numbers E0..En (inclusive).
601   expn        -- Exponential integral E_n.
602   exp1        -- Exponential integral E_1 of complex argument z.
603   expi        -- Exponential integral Ei.
604   factorial   -- The factorial of a number or array of numbers.
605   factorial2  -- Double factorial.
606   factorialk  -- Multifactorial of n of order k, n(!!...!).
607   shichi      -- Hyperbolic sine and cosine integrals.
608   sici        -- Sine and cosine integrals.
609   softmax     -- Softmax function.
610   log_softmax -- Logarithm of softmax function.
611   spence      -- Spence's function, also known as the dilogarithm.
612   zeta        -- Riemann zeta function.
613   zetac       -- Riemann zeta function minus 1.
614
615Convenience functions
616---------------------
617
618.. autosummary::
619   :toctree: generated/
620
621   cbrt      -- Cube root of `x`.
622   exp10     -- 10**x.
623   exp2      -- 2**x.
624   radian    -- Convert from degrees to radians.
625   cosdg     -- Cosine of the angle `x` given in degrees.
626   sindg     -- Sine of angle given in degrees.
627   tandg     -- Tangent of angle x given in degrees.
628   cotdg     -- Cotangent of the angle `x` given in degrees.
629   log1p     -- Calculates log(1+x) for use when `x` is near zero.
630   expm1     -- exp(x) - 1 for use when `x` is near zero.
631   cosm1     -- cos(x) - 1 for use when `x` is near zero.
632   round     -- Round to nearest integer.
633   xlogy     -- Compute ``x*log(y)`` so that the result is 0 if ``x = 0``.
634   xlog1py   -- Compute ``x*log1p(y)`` so that the result is 0 if ``x = 0``.
635   logsumexp -- Compute the log of the sum of exponentials of input elements.
636   exprel    -- Relative error exponential, (exp(x)-1)/x, for use when `x` is near zero.
637   sinc      -- Return the sinc function.
638
639"""
640
641from .sf_error import SpecialFunctionWarning, SpecialFunctionError
642
643from . import _ufuncs
644from ._ufuncs import *
645
646from . import _basic
647from ._basic import *
648
649from ._logsumexp import logsumexp, softmax, log_softmax
650
651from . import orthogonal
652from .orthogonal import *
653
654from .spfun_stats import multigammaln
655from ._ellip_harm import (
656    ellip_harm,
657    ellip_harm_2,
658    ellip_normal
659)
660from ._lambertw import lambertw
661from ._spherical_bessel import (
662    spherical_jn,
663    spherical_yn,
664    spherical_in,
665    spherical_kn
666)
667
668__all__ = _ufuncs.__all__ + _basic.__all__ + orthogonal.__all__ + [
669    'SpecialFunctionWarning',
670    'SpecialFunctionError',
671    'orthogonal',  # Not public, but kept in __all__ for back-compat
672    'logsumexp',
673    'softmax',
674    'log_softmax',
675    'multigammaln',
676    'ellip_harm',
677    'ellip_harm_2',
678    'ellip_normal',
679    'lambertw',
680    'spherical_jn',
681    'spherical_yn',
682    'spherical_in',
683    'spherical_kn',
684]
685
686from scipy._lib._testutils import PytestTester
687test = PytestTester(__name__)
688del PytestTester
689