Repository navigation
A logarithm of a perfect power takes the exponent out, so related logarithms collect - #1217
Merged
Merged
Conversation
…arithms collect ln(4/3) + ln(16/9) / 2 was left as written; it is 2 ln(4/3), which the metric then prefers as the single literal ln(16/9). The rule that reads log(a, b^n) as n log(a, b) could not see a rational literal that is a power without saying so, and 16/9 is (4/3)^2. A logarithm of a positive rational literal that is a perfect power is offered as the exponent times the logarithm of the root -- the largest exponent that fits, read exactly on numerators and denominators that fit 64 bits. A positive root only: -8 is (-2)^3, but ln(-8) is ln 8 + i pi where 3 ln(-2) is 3 ln 2 + 3 i pi, so nothing is assumed by refusing it. The form is longer on its own and the metric keeps the literal; it is what lets two logarithms of related literals collect. Both spellings of the rule, Sound and Expands; the census moves by one. Question I.5 of #1212's presentation: the integral answers ln(16/9). BREAKING-CHANGES.md has the rows, measured on both builds. Part of #1212. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1212 — the first of the small items in my comment there: question I.5's presentation.
What changes
ln(4/3) + ln(16/9) / 2was left as written; it is2 ln(4/3), which the metric then prefers as the single literalln(16/9). The rule that readslog(a, b^n)asn log(a, b)could not see a rational literal that is a power without saying so.A new rule in
Power, in both spellings: a logarithm of a positive rational literal that is a perfect power is offered as the exponent times the logarithm of the root —ln(16/9)as2 ln(4/3),ln(64)as6 ln(2),ln(1/8)as3 ln(1/2). The largest exponent that fits is read exactly, on numerators and denominators within 64 bits (TreeAnalyzer.TryPerfectPower). A positive root only:-8is(-2)^3, butln(-8)isln 8 + iπwhere3 ln(-2)is3 ln 2 + 3iπ, so a negative root is refused rather than assumed.Sound,Expands(+2 nodes), so it is offered to the metric and never taken on its own.integral((2x^2+x+1)/(x^3+x^2+x+1), x, 3/4, 4/3)— question I.5ln(4/3) + ln(16/9) / 2ln(16/9)ln(4/3) + ln(16/9) / 2ln(4/3) + ln(16/9) / 22 * ln(4/3)ln(8) - 3 ln(2),log(3, 81) / 40,1ln(16/9),ln(64)aloneChecks
LogarithmOfAPerfectPowerTest: five perfect powers read, five non-powers refused (including-8,1,0), the sheet's integral, three collections, two literals left alone. The rule census moves by one (WritingARule.md, the guide tests,ReversibleRuleTest, theSaturationremark). Full suite in two chunks: 9,715 passed, 0 failed (Calculus 1,355, the rest 8,360).🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura