AngouriMath

Navigation

← Back to list of members

DeepestDescent

 Field

Summary

How deep the recursive descent may go before it declines to go further.

Remarks

Without this the descent has **no bound at all**, and a stack overflow is not an
exception a caller can handle: it takes the process down, so anything the process had
not finished is lost. Found by work/intbench against Rubi's independent test
suites, where the run died with SIGABRT partway through; the trace was thousands
of frames alternating ComputeIndefiniteIntegral(AngouriMath.Entity,AngouriMath.Entity.Variable,System.Boolean) with
SolveBySubstitution(AngouriMath.Entity,AngouriMath.Entity.Variable,System.Boolean).
https://github.com/asc-community/AngouriMath/issues/1232
Why the memo above does not already stop it, which is the part worth stating.SolveBySubstitution names its new variable with
Variable.CreateUnique, so every level integrates with respect to a *fresh*
variable. The key (expr, x, integrateByParts) therefore differs at every level
even when the level is the same problem renamed, and answered can never
fire on a cycle. Neither could a set of shapes already visited, for the same reason —
the shapes are alpha-equivalent rather than equal. A depth bound does not care what
the levels are called.
The number, which is measured rather than picked. Instrumenting the descent over
twenty-three integrands chosen from the hard end of the corpus — the ones that take
substitutions, by-parts chains and partial fractions — the deepest any *answered*
integral reaches is 13, for x^5*cosh(x). Next are x^2*sqrt(5-x^2) at 8 and e^(x^(1/3)) at 7; everything else sits at 4 or less. 32 is therefore
about two and a half times the deepest real descent seen.
Why not far more, since a bound only has to stop the overflow. Because this
descent branches: the remark on answered above records a single call
entering the integrator 5,330 times for 23 distinct integrands. Depth that is never
legitimately used is still searched before it is abandoned, so a bound of 64 stopped
the crash and left the run crawling. A bound has to be tight enough to be a bound.
Declining is a legitimate answer here and a wrong one is not: an unevaluated
integral(...) says "I could not settle this", which is true, where an aborted
process says nothing at all.

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online