I am attempting to describe the Riemann Xi function in python for visualization. It is an entire function, with no holes or poles. When converting the math to some simple python code, I notice that there is an infinity*zero cancellation, and obviously, Python cannot deal with that.
My current code is this, using the mpmath library:
def xi(s):
return 1/2*s*(s-1)*cmath.pi**(-s/2)*mpmath.gamma(s/2)*mpmath.zeta(s)
Nothing special, but the point is that it doesn't work because of how infinity and zero are multiplied. Is there a good library or way of programming the Riemann Xi function?
Thank you.
In essence, I had to use the reflection law of the Xi function, and then hard-code two outputs myself. This code was sort of quickly cobbled together, but it works just fine: