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
|
- To: "pari-users@pari.math.u-bordeaux.fr" <pari-users@pari.math.u-bordeaux.fr>
- Subject: Verification of floating-point equalities
- From: Jacques Gélinas <jacquesg00@hotmail.com>
- Date: Sun, 17 Dec 2017 21:45:05 +0000
- Accept-language: fr-CA, en-US
- Delivery-date: Sun, 17 Dec 2017 22:45:14 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aImJDLwVki7LtLoD6+wth+fVXbodlYPfak6676YxEHk=; b=Lg0UaIOu45LHsz/xvpRoQt9ouNC4arDsHCAl3a169NcwQzDS8sKMBUXFoNDbCP6LMVBY+BjPV7DQ//j+C498SjNq8Fd3u6rhej3grMfIelo5hfj0N2923oapySLd2oX/ZWdH8Dzy1M31Vioy/is5LFjHyUPULwKUv6KZDDmmXH/3icm4INGkLumXSWuLLItwtCtYJSbDSTEreXv4NR08qQkisdHHuajRzYfRI6BulYTCV28JN3v98YQt/fnEgkdUSH4HicOYzQZ2xEP1f+IK67yX946GxhlrOJ8nN1NSVDeA4WpWxH9PacCM5HijQlku3I7UEPRuuq7RGFsab/GJtw==
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
- Thread-index: AQHTd4AJ4+2YnHdBLEylFOY2aXWcZQ==
- Thread-topic: 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