Skip to content

Commit

Permalink
Fix to issue #1052: algebraic equivalence with inf.
Browse files Browse the repository at this point in the history
  • Loading branch information
sangwinc committed Nov 6, 2023
1 parent 900434f commit 9a98322
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stack/maxima/assessment.mac
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,8 @@ numerical_not_alg_equiv(p1, p2):= block([pvars, pval, lv, sz, pnum, stack_mtell_
if is(pval = []) then (print("STACK: ignore previous error. (2)"), return(false)),
/* User functions without a function rule cannot be evaluated numerically */
if recurse_userfunctionp(first(pval)) then return(false),
/* If we have no variables, and not a number, then bail here. */
if is(emptyp(lv)) and not(numberp(first(pval))) then return(false),
pval:errcatch(ev(is(abs(first(pval)) > 1/10000), simp)),
if is(pval = []) then (print("STACK: ignore previous error. (3)"), return(false)),
if first(pval) then return(true),
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/answertestfixtures.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class stack_answertest_test_data {
array('AlgEquiv', '', 'inf', '-inf', 0, '', ''),
array('AlgEquiv', '', '2*inf', 'inf', 0, '', ''),
array('AlgEquiv', '', '0*inf', '0', 1, '', ''),
array('AlgEquiv', '', 'exp(-%i)', 'inf', 0, '', ''),

array('AlgEquiv', '', 'x^(1/2)', 'sqrt(x)', 1, '', 'Powers and roots'),
array('AlgEquiv', '', 'x', 'sqrt(x^2)', 0, '', ''),
Expand Down

0 comments on commit 9a98322

Please sign in to comment.