Skip to content

Commit

Permalink
src/sage/tests: fix another "Computational Math..." doctest
Browse files Browse the repository at this point in the history
One doctest for the Computational Math book fails for me,

  Failed example:
    limit(f(t * cos(theta), t * sin(theta)) / t, t=0)
  Expected:
    cos(theta)^2/sin(theta)
  Got:
    -1/2*(sin(3*theta) + sin(theta))/(cos(2*theta) - 1)

These results are equivalent, and the ugly one simplifies to the
pretty one. We add a full_simplify() to the test to support both
outputs. The discrepancy is most likely due to the version of Giac
installed on the system.
  • Loading branch information
orlitzky committed Sep 3, 2023
1 parent 6ea1fe9 commit bcd71cd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,13 @@
sage: plot3d(h, (u,-1,1), (v,-1,1), aspect_ratio=[1,1,1])
Graphics3d Object
Sage example in ./graphique.tex, line 1833::
Sage example in ./graphique.tex, line 1833. Sometimes the result
needs to be simplified to obtain a nice short expression::
sage: f(x, y) = x^2 * y / (x^4 + y^2)
sage: t, theta = var('t, theta')
sage: limit(f(t * cos(theta), t * sin(theta)) / t, t=0)
sage: result = limit(f(t * cos(theta), t * sin(theta)) / t, t=0)
sage: result.full_simplify()
cos(theta)^2/sin(theta)
Sage example in ./graphique.tex, line 1847::
Expand Down

0 comments on commit bcd71cd

Please sign in to comment.