Hi all,
I need to intensively use the following function :
import numpy as np
def besselk_ratio( order:np.int16, z:np.complex128, \
r:np.float64=1.0, dorder:np.int16=0, \
ctx=mpmath.mp) :
ratio = ctx.besselk( order+dorder, r*z ) \ / ctx.besselk( order, z )
return np.complex128(
ratio
)
It is not possible to directly use numpy.special.kv (or kve) function because the order can be more than 250 and abs(besselk( order, z )) is over the max float64 value, since the ratio can be coded in
complex128.
Thus, how can I create a ufunc (or a compiled function) from the mpmath.besselk function (or its source)?
Kind regards,
Eric Ducasse
Associate Professor
Mechanical and Engineering Institute of Bordeaux (I2M)
Ecole Nat. Sup. d'Arts et Metiers