Jacques Gélinas on Sun, 17 Dec 2017 22:45:14 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Verification of floating-point equalities


With its multiple precision accuracy, Pari/GP can be used to check simple equalities, 
such as this one proven last week for the golden ratio \phi (arXiv 1712.04856) :

    2/(sqrt(5)-1) == 2^(2/5)*sqrt(5)*gamma(1/5)^4/gamma(1/10)^2/gamma(3/10)^2

For this I have used two methods,

fleq(aprx, xact, N=2/3*precision(1.)) = abs( if(!xact, aprx,1 - aprx/xact) ) < 1/10^N;
fleq( sin(1000*Pi) )
fleq( zeta(-1), -1/12)

phi = (sqrt(5)+1)/2;
lindep( log([phi,2,5,gamma(1/10),gamma(2/10),gamma(3/10)]) ) == [-10, 4, 5, -20, 40, -20]~

Question: How do you verify such floating-point equalities ?

Jacques Gélinas