root / pobysoPythonSage / src / sageSLZ / runSLZ-04.sage @ 214
Historique | Voir | Annoter | Télécharger (2,7 ko)
1 |
#! /opt/sage/sage |
---|---|
2 |
# @file runSLZ-04.sage |
3 |
#from scipy.constants.codata import precision |
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^49 + 2^45 |
30 |
srs_run_SLZ_v04(inputFunction=func, |
31 |
inputLowerBound = RRR(1) * 2^-31, |
32 |
inputUpperBound = RRR(1) * 2^-30 - icUlp, |
33 |
alpha = 2, |
34 |
degree = 2, |
35 |
precision = 53, |
36 |
emin = -1022, |
37 |
emax = 1023, |
38 |
targetHardnessToRound = precision+50, |
39 |
debug = True) |
40 |
# |
41 |
""" |
42 |
srs_run_SLZ_v01(inputFunction=func, |
43 |
inputLowerBound = intervalCenter - icUlp * intervalRadiusInUlp, |
44 |
inputUpperBound = intervalCenter + icUlp * intervalRadiusInUlp, |
45 |
alpha = 2, |
46 |
degree = 2, |
47 |
precision = 53, |
48 |
emin = -1022, |
49 |
emax = 1023, |
50 |
targetHardnessToRound = precision+50, |
51 |
debug = True) |
52 |
""" |
53 |
""" |
54 |
srs_run_SLZ_v01(inputFunction=func, |
55 |
inputLowerBound = 402653184/1073741824, |
56 |
inputUpperBound = 402653185/1073741824, |
57 |
alpha = 2, |
58 |
degree = 10, |
59 |
precision = 53, |
60 |
emin = -1022, |
61 |
emax = 1023, |
62 |
targetHardnessToRound = precision+50, |
63 |
debug = True) |
64 |
|
65 |
#inputUpperBound = RRR(1/2) - RRR(1/4).ulp(), |
66 |
RR("1.9E9CBBFD6080B",16) * 2^-31] |
67 |
""" |