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