Alessandro Languasco on Sun, 26 Sep 2021 09:36:26 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Correctness of derivnum(X=1/2,zeta(X),41) |
Dear Georgi Guniski,
that is wierd; using python as an interface to mpmath it gives languasc@languasc-macmini Desktop % python3 conj.py 70 ------ precision 70 value = 3.0 languasc@languasc-macmini Desktop % python3 conj.py 80 ------ precision 80 value = 3.0 The point is that these quantities are large (their order of magnitude is about 10^62) but their sum is tiny. So you need to choose a sufficiently large precision to perform the computation. The python-mpmath script I wrote is at the bottom of this file. An alternative code for gp is the following ? \p100 realprecision = 115 significant digits (100 digits displayed) ? K=41 %2 = 41 ? B=2 %3 = 2 ? round(zetahurwitz(1-1/B,1, K))+B^(K+1)*factorial(K) %5 = 3.000000000000000000000000000000000000000000000000000000000 Best regards Alessandro Languasco but pari agrees the counterexample is correct: -------------------------------------------------------------- import sys defaultprecision = sys.argv[1] import mpmath as mp # function z def z(s,a,k): y = mp.zeta(s,a,k) return y # print("Give me the desired accuracy (# of decimal digits): ") # defaultprecision = input(); defaultprecision = int(defaultprecision); #print(defaultprecision); mp.mp.dps = defaultprecision; mp.mp.pretty = True print("------ "); print("precision ", defaultprecision); B=2 K=41 print("value = ", mp.nint(z(1-1/B,1,K))+ mp.power(B,K+1)*mp.fac(K)); |