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