Statistiques
| Révision :

root / pobysoPythonSage / src / sageSLZ / runSLZ-01.sage @ 230

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

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