def jvp(v,z,n=1): """Return the nth derivative of Jv(z) with respect to z. """ if not isinstance(n,types.IntType) or (n<0): raise ValueError("n must be a non-negative integer.") if n == 0: return jv(v,z) else: return bessel_diff_formula(v, z, n, jv, -1)
def hyp0f1(v,z): """Confluent hypergeometric limit function 0F1. Limit as q->infinity of 1F1(q;a;z/q) """ z = asarray(z) if issubdtype(z.dtype, complexfloating): arg = 2*sqrt(abs(z)) num = where(z>=0, iv(v-1,arg), jv(v-1,arg)) den = abs(z)**((v-1.0)/2) else: num = iv(v-1,2*sqrt(z)) den = z**((v-1.0)/2.0) num *= gamma(v) return where(z==0,1.0,num/ asarray(den))