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