Statistiques
| Révision :

root / pobysoPythonSage / src / sageSLZ / runSLZ-02.sage @ 205

Historique | Voir | Annoter | Télécharger (2,67 ko)

1 202 storres
#! /opt/sage/sage
2 202 storres
#from scipy.constants.codata import precision
3 202 storres
def initialize_env():
4 202 storres
    """
5 202 storres
    Load all necessary modules.
6 202 storres
    """
7 202 storres
    if not 'mpfi' in sage.misc.cython.standard_libs:
8 202 storres
        sage.misc.cython.standard_libs.append('mpfi')
9 202 storres
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sollya_lib.sage")
10 202 storres
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageMpfr.spyx")
11 202 storres
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/pobyso.py")
12 202 storres
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageSLZ.sage")
13 202 storres
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageNumericalOperations.sage")
14 202 storres
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageRationalOperations.sage")
15 202 storres
    # Matrix operations are loaded by polynomial operations.
16 202 storres
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sagePolynomialOperations.sage")
17 202 storres
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageRunSLZ.sage")
18 202 storres
19 202 storres
20 202 storres
print "Running SLZ..."
21 202 storres
initialize_env()
22 202 storres
x = var('x')
23 202 storres
func(x) = exp(x)
24 202 storres
precision = 53
25 202 storres
RRR = RealField(precision)
26 202 storres
intervalCenter      = RRR("1.9E9CBBFD6080B",16)  * 2^-31
27 202 storres
icUlp               = intervalCenter.ulp()
28 202 storres
intervalRadiusInUlp = 2^49 + 2^45
29 202 storres
srs_run_SLZ_v02(inputFunction=func,
30 202 storres
                inputLowerBound = RRR(1) * 2^-31,
31 202 storres
                inputUpperBound = RRR(1) * 2^-30 - icUlp,
32 202 storres
                alpha           = 2,
33 202 storres
                degree          = 2,
34 202 storres
                precision       = 53,
35 202 storres
                emin            = -1022,
36 202 storres
                emax            = 1023,
37 202 storres
                targetHardnessToRound =  precision+50,
38 202 storres
                debug           = True)
39 202 storres
#
40 202 storres
"""
41 202 storres
srs_run_SLZ_v02(inputFunction=func,
42 202 storres
                inputLowerBound = intervalCenter - icUlp * intervalRadiusInUlp,
43 202 storres
                inputUpperBound = intervalCenter + icUlp * intervalRadiusInUlp,
44 202 storres
                alpha           = 2,
45 202 storres
                degree          = 2,
46 202 storres
                precision       = 53,
47 202 storres
                emin            = -1022,
48 202 storres
                emax            = 1023,
49 202 storres
                targetHardnessToRound =  precision+50,
50 202 storres
                debug           = True)
51 202 storres
"""
52 202 storres
"""
53 202 storres
srs_run_SLZ_v01(inputFunction=func,
54 202 storres
                inputLowerBound = 402653184/1073741824,
55 202 storres
                inputUpperBound = 402653185/1073741824,
56 202 storres
                alpha = 2,
57 202 storres
                degree = 10,
58 202 storres
                precision = 53,
59 202 storres
                emin = -1022,
60 202 storres
                emax = 1023,
61 202 storres
                targetHardnessToRound =  precision+50,
62 202 storres
                debug = True)
63 202 storres
64 202 storres
#inputUpperBound = RRR(1/2) - RRR(1/4).ulp(),
65 202 storres
RR("1.9E9CBBFD6080B",16)  * 2^-31]
66 202 storres
"""