Menu

#4802 Maxima should know that zeroa, zerob are very small

None
open
nobody
5
4 days ago
4 days ago
No

There's code for it in compar.lisp currently commented out because it potentially causes trouble:

(defun initialize-zeroab (c)
  "Adds database assumptions for $zeroa and $zerob to the global context"
  (let ((context '$global) (%initiallearnflag t))
    (cond
      ((eq c '$zeroa)
        (learn `((mgreaterp) $zeroa 0) t)
        ;; The following line is still commented out, because it causes a
        ;; stack overflow in this test from rtestint.mac:
        ;; assume(l > 0, x > 0)$
        ;; integrate(integrate((acos(x/l)+acos(y/l)-%pi/2)/(2*%pi),y,0,sqrt(l^2-x^2)),x,0,l);
        ;(learn `((mlessp) $zeroa ,+least-positive-flonum+) t)
        )
      ((eq c '$zerob)
        (learn `((mlessp) $zerob 0) t)
        ;; See above.
        ;(learn `((mgreaterp) $zerob ,+least-negative-flonum+) t)
        ))))

A nice side-effect of adding these assumptions: sign(sin(zeroa)) is pos, not pnz.

Discussion


Log in to post a comment.

Auth0 Logo