# /usr/share/sagemath/bin/sage-python: line 2: 96052 Killed sage -python "$@" It looks the Python gets killed during running a long loop and task didn't finish. [354, -70, 185, -239] 3.1415926589061544881 j = -48 /usr/share/sagemath/bin/sage-python: line 2: 96052 Killed sage -python "$@"


I hope to upload the run-file here... But I just paste it below:

eps=2^-52
digits=[2,3,5,7]
ndig=len(digits)
eran=[ceil(30*log(1/eps)/log(digits[i])) for i in range(1,ndig)]
eran2=[2*eran[i-1]+1 for i in range(1,ndig)]
nel=prod(eran2[0:ndig-2])
x=list(range(0,nel));
s=[x[i]%eran2 for i in range(0,nel)]
x=[(x[i]-s[i])/eran2 for i in range(0,nel)]
s=[(s[i]-eran) for i in range(0,nel)]
s=[[(x[i]%eran2-eran) for i in range(0,nel)],s]
ldigits=[N(log(digits[i]),digits=25) for i in range(0,ndig)]
a=[ldigits*s[i]+ldigits*s[i] for i in range(0,nel)]
val=3.141592653589793238462643383279502884197
lval=N(log(val),digits=25)

bmm=[1 for k in range(0,eran2)]
r=[1 for k in range(0,eran2)]
t=[1 for k in range(0,eran2)]

# If the code crashes, set 'crash' to the last value of 'k' shown on the screen before the crash and rerun to finish the search
# Normally it should be set crash=0
crash=0
for k in range(crash,eran2):
j=k-eran
print("j,k =",j,k)
am=[a[i]+ldigits*j for i in range(0,nel)]
b=[round((lval-am[i])/ldigits) for i in range(0,nel)]
b1=[am[i]+b[i]*ldigits for i in range(0,nel)]
bm=[abs(b1[i]-lval) for i in range(0,nel)]
m=min(bm)
f=bm.index(m)
bmm[k]=bm[f]
t[k]=[b[f],s[f],s[f],j]
r[k]=digits^t[k]*digits^t[k]*digits^t[k]*digits^t[k]
m=min(bmm)
f=bmm.index(m)
print(t[f])
print(N(r[f],digits=20))

print("Final result:")

m=min(bmm)
f=bmm.index(m)

print(r[f])
print(t[f])

print(N(r[f],digits=20))

edit retag close merge delete