Menu

#4779 the simplim%signum function

None
open
nobody
5
2026-06-20
2026-06-15
No

Wrong--toward infinity, 2+5/x+sin(x) is positive, so the output %o8 should be 1, not ind:

(%i7) xxx : signum(42+5/x+sin(x));
(%o7) signum(sin(x)+5/x+42)

(%i8) limit(xxx,x,inf);
(%o8) ind

Discussion

  • Barton Willis

    Barton Willis - 2026-06-15

    Assuming that x >> 1, Maxima is unable to determine that sin(x)+5/x+42 is positive. Until this is corrected, I think that a fix for this bug is requires more than tweaking simplim%signum.

     
  • David Scherfgen

    David Scherfgen - 2026-06-20

    We need some kind of interval arithmetic.
    If Maxima was able to determine a lower and upper bound for an expression, then it could easily determine the sign of 2+5/x+sin(x) for big enough x.

     
    • Stavros Macrakis

      There are two basic ways we can perform interval arithmetic in Maxima:

      • Build a special-purpose interval arithmetic calculator to use internally, and with some special external interfaces.
      • Add intervals as a new basic numeric data type.

      Although the second approach would have many advantages, there are many difficulties with it. After all, here we are after 50+ years of Maxima development, and we still don't allow bfloats everywhere we allow floats (notably in CREs), and we still simplify inf-inf => 0. Intervals would be even worse. Another problem with intervals is that they don't have the usual algebraic properties, starting with Trichotomy, which are assumed by many parts of Maxima. Of course, if we can come up with a general framework that covers extended arithmetic types, that would be ideal. The framework should support at least linear intervals, complex regions (circular or rectangular?), differentiation arithmetic ("automatic differentiation"). Maybe Gemini/Claude/... can help us get there, because almost every basic Maxima function will have to be changed.

      So I think that the first approach is what we should focus on for now. The first-order approach would just be a simple recursion, ignoring correlations, so that I(x^2) => I(0,inf); I(x^2+1) => I(1,inf); I(x^2/(x^2+1)) => I(0,inf) where of course the tight bound is I(0,1) (how do we indicate closed vs. open endpoints?). It's always possible to improve on this using all sorts of techniques such as ratsimp, ratsimp(1/ex), taylor, ..., but the general philosophy of Maxima is not to perform "expensive" operations during simplification. Maybe we can do something along the lines of maxmin_effort?

       

Log in to post a comment.

Auth0 Logo