Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
doctests fixes, except fricas(1/2).sage() in axiom.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed Aug 11, 2016
1 parent 68bbc30 commit 2ee5bbf
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/sage/interfaces/axiom.py
Expand Up @@ -430,9 +430,9 @@ def _eval_line(self, line, reformat=True, allow_use_file=False,
sage: print(fricas._eval_line("2+2")) # optional - fricas
$$
4
\leqno(11)
\leqno(3)
$$
Type: PositiveInteger
Type: PositiveInteger
sage: fricas._eval_line(")set output tex off") #optional - fricas
''
sage: fricas._eval_line(")set output algebra on") #optional - fricas
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/infinity.py
Expand Up @@ -283,7 +283,7 @@ def _fricas_init_(self):
TESTS::
sage: fricas(-oo) # optional - fricas
%minusInfinity
- infinity
sage: [x._fricas_init_() for x in [unsigned_infinity, oo, -oo]] # optional - fricas
['%infinity', '%plusInfinity', '%minusInfinity']
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/real_mpfr.pyx
Expand Up @@ -3032,7 +3032,7 @@ cdef class RealNumber(sage.structure.element.RingElement):
sage: axiom(R(pi)) # optional - axiom # indirect doctest
3.1415926535 8979323846 26433833
sage: fricas(R(pi)) # optional - fricas
3.1415926535 8979323846 26433833
3.1415926535_8979323846_26433833
"""
prec = self.parent().prec()
Expand Down
4 changes: 2 additions & 2 deletions src/sage/symbolic/integration/external.py
Expand Up @@ -88,9 +88,9 @@ def fricas_integrator(expression, v, a=None, b=None):
sage: fricas_integrator(cos(x), x) # optional - fricas
sin(x)
sage: fricas_integrator(1/(x^2-2), x, 0, 1) # optional - fricas
1/4*(log(3*sqrt(2) - 4) - log(sqrt(2)))*sqrt(2)
1/4*sqrt(2)*(log(3*sqrt(2) - 4) - log(sqrt(2)))
sage: fricas_integrator(1/(x^2+6), x, -oo, oo) # optional - fricas
1/6*pi*sqrt(6)
1/6*sqrt(6)*pi
"""
if not isinstance(expression, Expression):
expression = SR(expression)
Expand Down
5 changes: 2 additions & 3 deletions src/sage/symbolic/integration/integral.py
Expand Up @@ -528,8 +528,7 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
sage: f(x) = sqrt(x+sqrt(1+x^2))/x
sage: integrate(f(x), x, algorithm="fricas") # optional - fricas
2*sqrt(x + sqrt(x^2 + 1)) + log(sqrt(x + sqrt(x^2 + 1)) - 1)
- log(sqrt(x + sqrt(x^2 + 1)) + 1) - 2*arctan(sqrt(x + sqrt(x^2 + 1)))
2*sqrt(x + sqrt(x^2 + 1)) - 2*arctan(sqrt(x + sqrt(x^2 + 1))) - log(sqrt(x + sqrt(x^2 + 1)) + 1) + log(sqrt(x + sqrt(x^2 + 1)) - 1)
The following definite integral is not found with the
default integrator::
Expand All @@ -541,7 +540,7 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
Both fricas and sympy give the correct result::
sage: integrate(f(x), x, 1, 2, algorithm="fricas") # optional - fricas
-1/2*pi + arctan(1/2) + arctan(2) + arctan(5) + arctan(8)
-1/2*pi + arctan(8) + arctan(5) + arctan(2) + arctan(1/2)
sage: integrate(f(x), x, 1, 2, algorithm="sympy")
-1/2*pi + arctan(8) + arctan(5) + arctan(2) + arctan(1/2)
Expand Down

0 comments on commit 2ee5bbf

Please sign in to comment.