# HG changeset patch
# User Francois Bissey <francois.bissey@canterbury.ac.nz>
# Date 1297380460 -46800
# Node ID f00392fe6abc82913da8fb4e07b36a56dd67a060
# Parent b995f0056e8f09421b141a642b0ef312807befd1
trac_10766: Fix doctests broken by updating to ecl-11.1.1
diff -r b995f0056e8f -r f00392fe6abc sage/calculus/calculus.py
a
|
b
|
|
675 | 675 | Now numerically integrating, we see why the answer is wrong:: |
676 | 676 | |
677 | 677 | sage: f.nintegrate(x,0,1) |
678 | | (-480.00000000000011, 5.3290705182007538e-12, 21, 0) |
| 678 | (-480.00000000000006, 5.3290705182007538e-12, 21, 0) |
679 | 679 | |
680 | 680 | It is just because every floating point evaluation of return -480.0 |
681 | 681 | in floating point. |
diff -r b995f0056e8f -r f00392fe6abc sage/interfaces/lisp.py
a
|
b
|
|
376 | 376 | |
377 | 377 | EXAMPLES: |
378 | 378 | sage: lisp.function_call('sin', ['2']) |
379 | | 0.90929741 |
| 379 | 0.9092974 |
380 | 380 | sage: lisp.sin(2) |
381 | | 0.90929741 |
| 381 | 0.9092974 |
382 | 382 | """ |
383 | 383 | args, kwds = self._convert_args_kwds(args, kwds) |
384 | 384 | self._check_valid_function_name(function) |
diff -r b995f0056e8f -r f00392fe6abc sage/interfaces/maxima.py
a
|
b
|
|
908 | 908 | p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, |
909 | 909 | stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
910 | 910 | res = p.stdout.read() |
911 | | # we are now getting five lines of commented verbosity |
| 911 | # ecl-10.2 : 3 lines |
| 912 | # ecl-10.4 : 5 lines |
| 913 | # ecl-11.1 : 4 lines fancy a tango? |
| 914 | # We now get 4 lines of commented verbosity |
912 | 915 | # every time Maxima starts, so we need to get rid of them |
913 | | for _ in range(5): |
| 916 | for _ in range(4): |
914 | 917 | res = res[res.find('\n')+1:] |
915 | 918 | return AsciiArtString(res) |
916 | 919 | else: |
… |
… |
|
1126 | 1129 | |
1127 | 1130 | sage: f = maxima.function('x', 'sin(x)') |
1128 | 1131 | sage: f(3.2) |
1129 | | -.05837414342758009 |
| 1132 | -.058374143427580... |
1130 | 1133 | sage: f = maxima.function('x,y', 'sin(x)+cos(y)') |
1131 | 1134 | sage: f(2,3.5) |
1132 | 1135 | sin(2)-.9364566872907963 |
… |
… |
|
1923 | 1926 | EXAMPLES:: |
1924 | 1927 | |
1925 | 1928 | sage: a = maxima('sqrt(2)').numer(); a |
1926 | | 1.414213562373095 |
| 1929 | 1.41421356237309... |
1927 | 1930 | sage: type(a) |
1928 | 1931 | <class 'sage.interfaces.maxima.MaximaElement'> |
1929 | 1932 | """ |
… |
… |
|
2075 | 2078 | EXAMPLES:: |
2076 | 2079 | |
2077 | 2080 | sage: maxima('exp(-sqrt(x))').nintegral('x',0,1) |
2078 | | (.5284822353142306, 4.163314137883845e-11, 231, 0) |
| 2081 | (.5284822353142306, 4.16331413788384...e-11, 231, 0) |
2079 | 2082 | |
2080 | 2083 | Note that GP also does numerical integration, and can do so to very |
2081 | 2084 | high precision very quickly:: |
… |
… |
|
2129 | 2132 | sage: f = maxima('exp(x^2)').integral('x',0,1); f |
2130 | 2133 | -sqrt(%pi)*%i*erf(%i)/2 |
2131 | 2134 | sage: f.numer() |
2132 | | 1.462651745907182 |
| 2135 | 1.46265174590718... |
2133 | 2136 | """ |
2134 | 2137 | I = ExpectElement.__getattr__(self, 'integrate') |
2135 | 2138 | if min is None: |
… |
… |
|
2249 | 2252 | EXAMPLES:: |
2250 | 2253 | |
2251 | 2254 | sage: maxima('sqrt(2) + I').comma('numer') |
2252 | | I+1.414213562373095 |
| 2255 | I+1.41421356237309... |
2253 | 2256 | sage: maxima('sqrt(2) + I*a').comma('a=5') |
2254 | 2257 | 5*I+sqrt(2) |
2255 | 2258 | """ |
diff -r b995f0056e8f -r f00392fe6abc sage/modules/free_module_element.pyx
a
|
b
|
|
2485 | 2485 | sage: type(vec) |
2486 | 2486 | <type 'sage.modules.vector_real_double_dense.Vector_real_double_dense'> |
2487 | 2487 | sage: answers |
2488 | | [(0.5, 5.5511151231257843e-15, 21, 0), |
2489 | | (0.33333333333333343, 3.7007434154171903e-15, 21, 0), |
2490 | | (0.45969769413186018, 5.1036696439228408e-15, 21, 0)] |
| 2488 | [(0.5, 5.5511151231257843e-15, 21, 0), (0.3333333333333..., 3.7007434154171903e-15, 21, 0), (0.45969769413186..., 5.1036696439228408e-15, 21, 0)] |
2491 | 2489 | |
2492 | 2490 | sage: r=vector([t,0,1], sparse=True) |
2493 | 2491 | sage: r.nintegral(t,0,1) |
2494 | | ((0.5, 0.0, 1.0), |
2495 | | {0: (0.5, 5.5511151231257843e-15, 21, 0), |
2496 | | 2: (1.0, 1.110223024625157e-14, 21, 0)}) |
| 2492 | ((0.5, 0.0, 1.0), {0: (0.5, 5.5511151231257843e-15, 21, 0), 2: (1.0, 1.11022302462515...e-14, 21, 0)}) |
2497 | 2493 | |
2498 | 2494 | """ |
2499 | 2495 | # If Cython supported lambda functions, we would just do |
diff -r b995f0056e8f -r f00392fe6abc sage/symbolic/expression.pyx
a
|
b
|
|
5515 | 5515 | sage: SR(1.0).cosh() |
5516 | 5516 | 1.54308063481524 |
5517 | 5517 | sage: maxima('cosh(1.0)') |
5518 | | 1.543080634815244 |
| 5518 | 1.54308063481524... |
5519 | 5519 | sage: SR(1.00000000000000000000000000).cosh() |
5520 | 5520 | 1.5430806348152437784779056 |
5521 | 5521 | sage: SR(RIF(1)).cosh() |
… |
… |
|
5624 | 5624 | sage: SR(1.0).arcsinh() |
5625 | 5625 | 0.881373587019543 |
5626 | 5626 | sage: maxima('asinh(2.0)') |
5627 | | 1.44363547517881 |
| 5627 | 1.4436354751788... |
5628 | 5628 | |
5629 | 5629 | Sage automatically applies certain identities:: |
5630 | 5630 | |
… |
… |
|
5678 | 5678 | sage: SR(CDF(1/2)).arccosh() |
5679 | 5679 | 1.0471975512*I |
5680 | 5680 | sage: maxima('acosh(0.5)') |
5681 | | 1.047197551196598*%i |
| 5681 | 1.04719755119659...*%i |
5682 | 5682 | |
5683 | 5683 | To prevent automatic evaluation use the ``hold`` argument:: |
5684 | 5684 | |