Statistiques
| Révision :

root / pobysoPythonSage / src / sageSLZ / runSLZ-05-06-02.sage @ 230

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

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