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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Assuming that
x >> 1, Maxima is unable to determine thatsin(x)+5/x+42is positive. Until this is corrected, I think that a fix for this bug is requires more than tweakingsimplim%signum.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 enoughx.There are two basic ways we can perform interval arithmetic in Maxima:
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 isI(0,1)(how do we indicate closed vs. open endpoints?). It's always possible to improve on this using all sorts of techniques such asratsimp, 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 ofmaxmin_effort?