Sign error in Tools/rysroots/genab.py
I tried to use the file
Tools/rysroots/genab.py
to reproduce the file
data/abdata.ascii
and found this to be impossible. The code crashes on line 59 in the loop
for i in range(tabini, tabend+1):
for i=170, as then the square root in line 59 becomes negative. I believe the problem is that line 59:
x = mp.mpf(mp.sqrt(72900-(260+i)*i)+i-270)/10
as well as the quoted formula in line 45:
T = (sqrt(72900-(260+ITAB)*ITAB)+ITAB-270)/10
are incorrect. Inverting the equation on line 45 (supposedly the inverse of the above equation) actually yields
T = (sqrt(72900-(260-ITAB)*ITAB)+ITAB-270)/10
or
x = mp.mpf(mp.sqrt(72900-(260-i)*i)+i-270)/10
Fixing the sign then yields the output suggested by
data/abdata.ascii