Statistiques
| Révision :

root / pobysoPythonSage / src / sageSLZ / runSLZ-03.sage @ 199

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

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