pub(crate) static Y1_COEFFS: [[(u64, u64); 28]; 32]Expand description
Taylor series for Y1 in extremums and zeros.
Generated by SageMath:
mp.prec = 115
terms = 28
print(f"pub(crate) static Y1_COEFFS: [[(u64, u64); {terms}]; {len(y1_zeros)}] = [")
def get_constant_term(poly, y):
for term in poly.operands():
if term.is_constant():
return term
def print_taylor_coeffs(poly, n):
print("[")
for i in range(0, n):
coeff = poly[i]
print_double_double("", RealField(115)(coeff))
# print(f"{double_to_hex(coeff)},")
print("],")
prev_zero = 0
for i in range(0, len(y1_zeros)):
k_range = y1_zeros[i]
range_diff = k_range - prev_zero
x0 = mp.mpf(k_range)
from mpmath import mp, bessely, taylor
poly = taylor(lambda val: bessely(1, val), x0, terms)
# print(poly)
print_taylor_coeffs(poly, terms)
prev_zero = y1_zeros[i]
print("];")