「OverflowError: math range error」が発生し続けます。何を入力しても結果は同じです。私は Python 3.3 を実行していますが、最後の行で問題を見つけています。これを修正するにはどうすればよいですか? (また、括弧の使いすぎについては何も聞きたくありません。これほど多くの括弧があることが私の好みです。):
import math
a=float(input('a=?'))
b=float(input('b=?'))
c=float(input('c=?'))
d=float(input('d=?'))
critical_point_n=((-2*b)-math.sqrt(abs((4*(math.pow(b, 2)))-(12*a*c))))/(6*a)
first_root=critical_point_n-1
if first_root==0 and c==0:
first_root+=(-0.01)
for x in range(10):
first_root=first_root-((a*(math.pow(first_root, 3)))+(b*(math.pow(first_root, 2))+(c*first_root)+d)/(3*(a*(math.pow(first_root, 2))))+(2*(b*first_root))+c)