The Raphson(5)
call returns a large negative number:
>>> Raphson(5)
-5501.616437351696
This is passed on to the recursive call:
return Q1_6_Raphson(Raphson(rx0),Iter=Iter+1)
so Q1_6_Raphson()
is called with -5501.616437351696
as the rx0
argument. This is then passed on to fdiv()
:
elif fdiv(rx0)==0:
which throws the exception because that number is larger than what math.cosh()
can handle:
>>> fdiv(-5501.616437351696)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in fdiv
OverflowError: math range error
Any value outside of the range [-710, +710] would throw that exception; within that range you'd get a different exception:
>>> fdiv(-710)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in fdiv
OverflowError: (34, 'Result too large')
because you are still exceeding the limits of your platform floating point support.
Only values in the range [-177, +177] give a result.