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

1""" 

2======================================== 

3Special functions (:mod:`scipy.special`) 

4======================================== 

5 

6.. currentmodule:: scipy.special 

7 

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. 

15 

16.. seealso:: 

17 

18 `scipy.special.cython_special` -- Typed Cython versions of special functions 

19 

20 

21Error handling 

22============== 

23 

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. 

29 

30.. autosummary:: 

31 :toctree: generated/ 

32 

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. 

38 

39Available functions 

40=================== 

41 

42Airy functions 

43-------------- 

44 

45.. autosummary:: 

46 :toctree: generated/ 

47 

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 

53 

54 

55Elliptic functions and integrals 

56-------------------------------- 

57 

58.. autosummary:: 

59 :toctree: generated/ 

60 

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. 

72 

73Bessel functions 

74---------------- 

75 

76.. autosummary:: 

77 :toctree: generated/ 

78 

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. 

102 

103The following function does not accept NumPy arrays (it is not a 

104universal function): 

105 

106.. autosummary:: 

107 :toctree: generated/ 

108 

109 lmbda -- Jahnke-Emden Lambda function, Lambdav(x). 

110 

111Zeros of Bessel functions 

112^^^^^^^^^^^^^^^^^^^^^^^^^ 

113 

114The following functions do not accept NumPy arrays (they are not 

115universal functions): 

116 

117.. autosummary:: 

118 :toctree: generated/ 

119 

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. 

129 

130Faster versions of common Bessel functions 

131^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

132 

133.. autosummary:: 

134 :toctree: generated/ 

135 

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. 

148 

149Integrals of Bessel functions 

150^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

151 

152.. autosummary:: 

153 :toctree: generated/ 

154 

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. 

160 

161Derivatives of Bessel functions 

162^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

163 

164.. autosummary:: 

165 :toctree: generated/ 

166 

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`. 

173 

174Spherical Bessel functions 

175^^^^^^^^^^^^^^^^^^^^^^^^^^ 

176 

177.. autosummary:: 

178 :toctree: generated/ 

179 

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. 

184 

185Riccati-Bessel functions 

186^^^^^^^^^^^^^^^^^^^^^^^^ 

187 

188The following functions do not accept NumPy arrays (they are not 

189universal functions): 

190 

191.. autosummary:: 

192 :toctree: generated/ 

193 

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. 

196 

197Struve functions 

198---------------- 

199 

200.. autosummary:: 

201 :toctree: generated/ 

202 

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. 

208 

209 

210Raw statistical functions 

211------------------------- 

212 

213.. seealso:: :mod:`scipy.stats`: Friendly versions of these functions. 

214 

215Binomial distribution 

216^^^^^^^^^^^^^^^^^^^^^ 

217 

218.. autosummary:: 

219 :toctree: generated/ 

220 

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`. 

226 

227Beta distribution 

228^^^^^^^^^^^^^^^^^ 

229 

230.. autosummary:: 

231 :toctree: generated/ 

232 

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). 

237 

238F distribution 

239^^^^^^^^^^^^^^ 

240 

241.. autosummary:: 

242 :toctree: generated/ 

243 

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. 

248 

249Gamma distribution 

250^^^^^^^^^^^^^^^^^^ 

251 

252.. autosummary:: 

253 :toctree: generated/ 

254 

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. 

260 

261Negative binomial distribution 

262^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

263 

264.. autosummary:: 

265 :toctree: generated/ 

266 

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`. 

272 

273Noncentral F distribution 

274^^^^^^^^^^^^^^^^^^^^^^^^^ 

275 

276.. autosummary:: 

277 :toctree: generated/ 

278 

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. 

284 

285Noncentral t distribution 

286^^^^^^^^^^^^^^^^^^^^^^^^^ 

287 

288.. autosummary:: 

289 :toctree: generated/ 

290 

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. 

295 

296Normal distribution 

297^^^^^^^^^^^^^^^^^^^ 

298 

299.. autosummary:: 

300 :toctree: generated/ 

301 

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. 

308 

309Poisson distribution 

310^^^^^^^^^^^^^^^^^^^^ 

311 

312.. autosummary:: 

313 :toctree: generated/ 

314 

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. 

319 

320Student t distribution 

321^^^^^^^^^^^^^^^^^^^^^^ 

322 

323.. autosummary:: 

324 :toctree: generated/ 

325 

326 stdtr -- Student t distribution cumulative distribution function. 

327 stdtridf -- Inverse of `stdtr` vs df. 

328 stdtrit -- Inverse of `stdtr` vs `t`. 

329 

330Chi square distribution 

331^^^^^^^^^^^^^^^^^^^^^^^ 

332 

333.. autosummary:: 

334 :toctree: generated/ 

335 

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`. 

340 

341Non-central chi square distribution 

342^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

343 

344.. autosummary:: 

345 :toctree: generated/ 

346 

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`. 

351 

352Kolmogorov distribution 

353^^^^^^^^^^^^^^^^^^^^^^^ 

354 

355.. autosummary:: 

356 :toctree: generated/ 

357 

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`. 

362 

363Box-Cox transformation 

364^^^^^^^^^^^^^^^^^^^^^^ 

365 

366.. autosummary:: 

367 :toctree: generated/ 

368 

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. 

373 

374 

375Sigmoidal functions 

376^^^^^^^^^^^^^^^^^^^ 

377 

378.. autosummary:: 

379 :toctree: generated/ 

380 

381 logit -- Logit ufunc for ndarrays. 

382 expit -- Logistic sigmoid function. 

383 log_expit -- Logarithm of the logistic sigmoid function. 

384 

385Miscellaneous 

386^^^^^^^^^^^^^ 

387 

388.. autosummary:: 

389 :toctree: generated/ 

390 

391 tklmbda -- Tukey-Lambda cumulative distribution function. 

392 owens_t -- Owen's T Function. 

393 

394 

395Information Theory functions 

396---------------------------- 

397 

398.. autosummary:: 

399 :toctree: generated/ 

400 

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. 

406 

407 

408Gamma and related functions 

409--------------------------- 

410 

411.. autosummary:: 

412 :toctree: generated/ 

413 

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. 

432 

433 

434Error function and Fresnel integrals 

435------------------------------------ 

436 

437.. autosummary:: 

438 :toctree: generated/ 

439 

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. 

453 

454The following functions do not accept NumPy arrays (they are not 

455universal functions): 

456 

457.. autosummary:: 

458 :toctree: generated/ 

459 

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). 

463 

464Legendre functions 

465------------------ 

466 

467.. autosummary:: 

468 :toctree: generated/ 

469 

470 lpmv -- Associated Legendre function of integer order and real degree. 

471 sph_harm -- Compute spherical harmonics. 

472 

473The following functions do not accept NumPy arrays (they are not 

474universal functions): 

475 

476.. autosummary:: 

477 :toctree: generated/ 

478 

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. 

484 

485Ellipsoidal harmonics 

486--------------------- 

487 

488.. autosummary:: 

489 :toctree: generated/ 

490 

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. 

494 

495Orthogonal polynomials 

496---------------------- 

497 

498The following functions evaluate values of orthogonal polynomials: 

499 

500.. autosummary:: 

501 :toctree: generated/ 

502 

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. 

519 

520The following functions compute roots and quadrature weights for 

521orthogonal polynomials: 

522 

523.. autosummary:: 

524 :toctree: generated/ 

525 

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. 

541 

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. 

550 

551.. autosummary:: 

552 :toctree: generated/ 

553 

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. 

569 

570.. warning:: 

571 

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. 

575 

576 

577Hypergeometric functions 

578------------------------ 

579 

580.. autosummary:: 

581 :toctree: generated/ 

582 

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. 

587 

588 

589Parabolic cylinder functions 

590---------------------------- 

591 

592.. autosummary:: 

593 :toctree: generated/ 

594 

595 pbdv -- Parabolic cylinder function D. 

596 pbvv -- Parabolic cylinder function V. 

597 pbwa -- Parabolic cylinder function W. 

598 

599The following functions do not accept NumPy arrays (they are not 

600universal functions): 

601 

602.. autosummary:: 

603 :toctree: generated/ 

604 

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. 

608 

609Mathieu and related functions 

610----------------------------- 

611 

612.. autosummary:: 

613 :toctree: generated/ 

614 

615 mathieu_a -- Characteristic value of even Mathieu functions. 

616 mathieu_b -- Characteristic value of odd Mathieu functions. 

617 

618The following functions do not accept NumPy arrays (they are not 

619universal functions): 

620 

621.. autosummary:: 

622 :toctree: generated/ 

623 

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. 

626 

627The following return both function and first derivative: 

628 

629.. autosummary:: 

630 :toctree: generated/ 

631 

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. 

638 

639Spheroidal wave functions 

640------------------------- 

641 

642.. autosummary:: 

643 :toctree: generated/ 

644 

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. 

655 

656The following functions require pre-computed characteristic value: 

657 

658.. autosummary:: 

659 :toctree: generated/ 

660 

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. 

667 

668Kelvin functions 

669---------------- 

670 

671.. autosummary:: 

672 :toctree: generated/ 

673 

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. 

684 

685The following functions do not accept NumPy arrays (they are not 

686universal functions): 

687 

688.. autosummary:: 

689 :toctree: generated/ 

690 

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). 

699 

700Combinatorics 

701------------- 

702 

703.. autosummary:: 

704 :toctree: generated/ 

705 

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. 

708 

709Lambert W and related functions 

710------------------------------- 

711 

712.. autosummary:: 

713 :toctree: generated/ 

714 

715 lambertw -- Lambert W function. 

716 wrightomega -- Wright Omega function. 

717 

718Other special functions 

719----------------------- 

720 

721.. autosummary:: 

722 :toctree: generated/ 

723 

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. 

742 

743Convenience functions 

744--------------------- 

745 

746.. autosummary:: 

747 :toctree: generated/ 

748 

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. 

767 

768""" 

769 

770from ._sf_error import SpecialFunctionWarning, SpecialFunctionError 

771 

772from . import _ufuncs 

773from ._ufuncs import * 

774 

775from . import _basic 

776from ._basic import * 

777 

778from ._logsumexp import logsumexp, softmax, log_softmax 

779 

780from . import _orthogonal 

781from ._orthogonal import * 

782 

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) 

796 

797# Deprecated namespaces, to be removed in v2.0.0 

798from . import add_newdocs, basic, orthogonal, specfun, sf_error, spfun_stats 

799 

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] 

816 

817from scipy._lib._testutils import PytestTester 

818test = PytestTester(__name__) 

819del PytestTester