Statistiques
| Révision :

root / pobysoPythonSage / src / sageSLZ / runSLZ-04.sage @ 214

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

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