root / pobysoPythonSage / src / sageSLZ / runSLZ-06.sage @ 230
Historique | Voir | Annoter | Télécharger (2,09 ko)
1 | 224 | storres | #! /opt/sage/sage |
---|---|---|---|
2 | 224 | storres | # @file runSLZ-05.sage |
3 | 224 | storres | #from scipy.constants.codata import precision |
4 | 224 | storres | def initialize_env(): |
5 | 224 | storres | """ |
6 | 224 | storres | Load all necessary modules. |
7 | 224 | storres | """ |
8 | 227 | storres | compiledSpyxDir = "/home/storres/recherche/arithmetique/pobysoPythonSage/compiledSpyx" |
9 | 227 | storres | if compiledSpyxDir not in sys.path: |
10 | 227 | storres | sys.path.append(compiledSpyxDir) |
11 | 224 | storres | if not 'mpfi' in sage.misc.cython.standard_libs: |
12 | 224 | storres | sage.misc.cython.standard_libs.append('mpfi') |
13 | 224 | storres | load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sollya_lib.sage") |
14 | 227 | storres | #load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageMpfr.spyx") |
15 | 224 | storres | load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/pobyso.py") |
16 | 224 | storres | load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageSLZ.sage") |
17 | 224 | storres | load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageNumericalOperations.sage") |
18 | 224 | storres | load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageRationalOperations.sage") |
19 | 224 | storres | # Matrix operations are loaded by polynomial operations. |
20 | 224 | storres | load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sagePolynomialOperations.sage") |
21 | 224 | storres | load("/home/storres/recherche/arithmetique/pobysoPythonSage/src/sageSLZ/sageRunSLZ.sage") |
22 | 224 | storres | |
23 | 224 | storres | |
24 | 224 | storres | print "Running SLZ..." |
25 | 224 | storres | initialize_env() |
26 | 227 | storres | from sageMpfr import * |
27 | 227 | storres | from sageGMP import * |
28 | 227 | storres | # |
29 | 224 | storres | x = var('x') |
30 | 224 | storres | func(x) = exp(x) |
31 | 227 | storres | precision = 53 |
32 | 224 | storres | RRR = RealField(precision) |
33 | 227 | storres | intervalCenter = RRR(3/2) |
34 | 224 | storres | icUlp = intervalCenter.ulp() |
35 | 227 | storres | intervalRadiusInUlp = 2^8 |
36 | 224 | storres | intervalRadius = RRR(2^(-35)) |
37 | 227 | storres | srs_run_SLZ_v06(inputFunction = func, |
38 | 227 | storres | inputLowerBound = intervalCenter - intervalRadiusInUlp * icUlp, |
39 | 227 | storres | inputUpperBound = intervalCenter + intervalRadiusInUlp * icUlp, |
40 | 227 | storres | alpha = 2, |
41 | 227 | storres | degree = 2, |
42 | 224 | storres | precision = precision, |
43 | 227 | storres | emin = -1022, |
44 | 227 | storres | emax = 1023, |
45 | 227 | storres | targetHardnessToRound = precision + 10, |
46 | 224 | storres | debug = True) |
47 | 224 | storres | # |