I'm doing complex division in a context where numerical precision really matters. I find that dividing two complex128 numbers with no imaginary part gives a different result beyond 15 decimal digits that dividing the same two numbers as float64.
a = np.float64(1.501)
b = np.float64(1.337)
print('{:.20f}'.format(a / b))
# 1.12266267763649962852
a_com = np.complex128(1.501)
b_com = np.complex128(1.337)
print('{:.20f}'.format((a_com / b_com).real))
# 1.12266267763649940647
I have a C++ reference implementation where complex division agrees with NumPy float division beyond 15 decimal digits. I'd like to use NumPy complex division with the same precision. Is there a way to accomplish that?