Révision 199

pobysoPythonSage/src/sageSLZ/runSLZ-03.sage (revision 199)
1
#! /opt/sage/sage
2
# @file runSLZ-03.sage
3
#
4
def initialize_env():
5
    """
6
    Load all necessary modules.
7
    """
8
    if not 'mpfi' in sage.misc.cython.standard_libs:
9
        sage.misc.cython.standard_libs.append('mpfi')
10
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sollya_lib.sage")
11
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageMpfr.spyx")
12
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/pobyso.py")
13
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageSLZ.sage")
14
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageNumericalOperations.sage")
15
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageRationalOperations.sage")
16
    # Matrix operations are loaded by polynomial operations.
17
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sagePolynomialOperations.sage")
18
    load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageRunSLZ.sage")
19

  
20

  
21
print "Running SLZ..."
22
initialize_env()
23
x = var('x')
24
func(x) = exp(x)
25
precision = 53
26
RRR = RealField(precision)
27
intervalCenter      = RRR("1.9E9CBBFD6080B",16)  * 2^-31
28
icUlp               = intervalCenter.ulp()
29
intervalRadiusInUlp = 2^50          
30
#intervalRadiusInUlp = 2^49 + 2^45          
31
srs_run_SLZ_v02(inputFunction=func, 
32
                inputLowerBound = intervalCenter - icUlp * (intervalRadiusInUlp+128), 
33
                inputUpperBound = intervalCenter + icUlp * (intervalRadiusInUlp+128), 
34
                alpha           = 2, 
35
                degree          = 2, 
36
                precision       = 53, 
37
                emin            = -1022, 
38
                emax            = 1023, 
39
                targetHardnessToRound =  precision+50, 
40
                debug           = True)
41
#
42
"""
43
srs_run_SLZ_v02(inputFunction=func, 
44
                inputLowerBound = RRR(1) * 2^-31, 
45
                inputUpperBound = RRR(1) * 2^-30 - icUlp, 
46
                alpha           = 2, 
47
                degree          = 2, 
48
                precision       = 53, 
49
                emin            = -1022, 
50
                emax            = 1023, 
51
                targetHardnessToRound =  precision+50, 
52
                debug           = True)
53
"""
54
"""
55
srs_run_SLZ_v01(inputFunction=func, 
56
                inputLowerBound = 402653184/1073741824, 
57
                inputUpperBound = 402653185/1073741824, 
58
                alpha = 2, 
59
                degree = 10, 
60
                precision = 53, 
61
                emin = -1022, 
62
                emax = 1023, 
63
                targetHardnessToRound =  precision+50, 
64
                debug = True)
65

  
66
#inputUpperBound = RRR(1/2) - RRR(1/4).ulp(), 
67
RR("1.9E9CBBFD6080B",16)  * 2^-31]
68
"""
0 69

  

Formats disponibles : Unified diff