Skip to content

Put a leftover reciprocal under the line, not on top of it - #712

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
fix/quotient-by-a-finite-divisor
Aug 5, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
fix/quotient-by-a-finite-divisor

Conversation

@Rafael-SOWNet

@Rafael-SOWNet Rafael-SOWNet commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

A bug in my own #710, found chasing the one case that PR left unanswered.

The rewrite that turns vanishing × diverging into a quotient multiplied every remaining factor into the numerator. But the children of a product arrive flattened through any division in it — tan(x) * ln(x) comes apart into sin(x), cos(x)^(-1) and ln(x) — so a leftover can itself be a reciprocal. Putting that on top rebuilt the very product the rewrite exists to take apart: the quotient simplified straight back to its own input, and the rule worked at it until something else stopped it.

Split into a numerator and a denominator instead.

before after
lim x->0+ (x * ln(x) / cos(x)) did not terminate in 30 s 0

The plain forms with no leftover — x * ln(x), sin(x) * ln(x), x * cotan(x) and the rest — go through the same path and are unchanged, which the tests pin.

Suite Failed: 0, Passed: 4675, Skipped: 14, Total: 4689; corpus 111/117, 0 wrong / 0 error / 0 timeout.

Still not fixed: lim x->0+ (tan(x) * ln(x)) is the case I was chasing, and it is still NaN. The rewrite now produces the right shape for it — ln(x) / (cos(x) / sin(x)), which answers 0 when handed to the limit machinery directly — so whatever turns it away is further down, in a guard l'Hopital's rule applies to the rewritten quotient. Recorded rather than left implied; I have not found it yet.

The rewrite that turns a vanishing factor against a diverging one into a
quotient multiplied every remaining factor into the numerator. The children of a
product arrive flattened through any division in it -- tan(x) * ln(x) comes
apart into sin(x), cos(x)^(-1) and ln(x) -- so a leftover could itself be a
reciprocal, and putting that on top rebuilt the very product the rewrite exists
to take apart. The quotient simplified straight back to its own input and the
rule worked at it until something else stopped it.

Split into a numerator and a denominator instead. lim x->0+ (x * ln(x) / cos(x))
went from not terminating inside thirty seconds to 0.

Suite 4675 passed, 0 failed; corpus unchanged at 111/117 with 0 wrong, 0 error
and 0 timeout.
@Rafael-SOWNet
Rafael-SOWNet merged commit 5f4269e into master Aug 5, 2026
24 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the fix/quotient-by-a-finite-divisor branch August 5, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant