scipy.special.yve(v, z, out=None) = <ufunc 'yve'>#

Exponentially scaled Bessel function of the second kind of real order.

Returns the exponentially scaled Bessel function of the second kind of real order v at complex z:

yve(v, z) = yv(v, z) * exp(-abs(z.imag))

Order (float).


Argument (float or complex).

outndarray, optional

Optional output array for the function results

Yscalar or ndarray

Value of the exponentially scaled Bessel function.

See also


Unscaled Bessel function of the second kind of real order.


For positive v values, the computation is carried out using the AMOS [1] zbesy routine, which exploits the connection to the Hankel Bessel functions \(H_v^{(1)}\) and \(H_v^{(2)}\),

\[Y_v(z) = \frac{1}{2\imath} (H_v^{(1)} - H_v^{(2)}).\]

For negative v values the formula,

\[Y_{-v}(z) = Y_v(z) \cos(\pi v) + J_v(z) \sin(\pi v)\]

is used, where \(J_v(z)\) is the Bessel function of the first kind, computed using the AMOS routine zbesj. Note that the second term is exactly zero for integer v; to improve accuracy the second term is explicitly omitted for v values such that v = floor(v).

Exponentially scaled Bessel functions are useful for large z: for these, the unscaled Bessel functions can easily under-or overflow.



Donald E. Amos, “AMOS, A Portable Package for Bessel Functions of a Complex Argument and Nonnegative Order”,


Compare the output of yv and yve for large complex arguments for z by computing their values for order v=1 at z=1000j. We see that yv returns nan but yve returns a finite number:

>>> import numpy as np
>>> from scipy.special import yv, yve
>>> v = 1
>>> z = 1000j
>>> yv(v, z), yve(v, z)
((nan+nanj), (-0.012610930256928629+7.721967686709076e-19j))

For real arguments for z, yve returns the same as yv up to floating point errors.

>>> v, z = 1, 1000
>>> yv(v, z), yve(v, z)
(-0.02478433129235178, -0.02478433129235179)

The function can be evaluated for several orders at the same time by providing a list or NumPy array for v:

>>> yve([1, 2, 3], 1j)
array([-0.20791042+0.14096627j,  0.38053618-0.04993878j,

In the same way, the function can be evaluated at several points in one call by providing a list or NumPy array for z:

>>> yve(1, np.array([1j, 2j, 3j]))
array([-0.20791042+0.14096627j, -0.21526929+0.01205044j,

It is also possible to evaluate several orders at several points at the same time by providing arrays for v and z with broadcasting compatible shapes. Compute yve for two different orders v and three points z resulting in a 2x3 array.

>>> v = np.array([[1], [2]])
>>> z = np.array([3j, 4j, 5j])
>>> v.shape, z.shape
((2, 1), (3,))
>>> yve(v, z)
array([[-1.96826713e-01+1.27277544e-03j, -1.78750840e-01+1.45558819e-04j,
       [1.94960056e-03-1.11782545e-01j,  2.02902325e-04-1.17626501e-01j,