AngouriMath

Navigation

← Back to list of members

SimplifyALongLeftSpineFirst​(AngouriMath.​Entity,​System.​Boolean)

 Method (no overloads)

Summary

Simplifies a long chain of sums from the bottom up before sum is
simplified, so that no recursion through it goes deeper than
SpineCheckpointSpacing.

Remarks

A sum simplifies its left operand first, and that operand's left operand, and so on, so
a chain of n sums nested to the left is simplified by a recursion n deep. A sum built
one term at a time is that shape. CollectLikeTerms builds one, and so does
anything that adds terms up in a loop. The integrals of
(q + p x)/(c + b x + a x^2)^3 simplified one about 900 deep, which overflowed a
1 MB stack in a Debug build and 384 KB in Release.
https://github.com/asc-community/AngouriMath/issues/2166
Every node's simplification is cached, so simplifying every
SpineCheckpointSpacingth node of the spine first, deepest first, leaves
each of those recursions stopping at the one below it, and then the sum's own. The
same nodes are simplified as before, each once, in another order. Under twice the
spacing nothing is done, so an ordinary sum pays for a walk of a few nodes and nothing
else.

























Angouri © 2019-2026 · Project's repo · Site's repo · Octicons · Transparency · 5629 pages online