Repository navigation
A sine or cosine with no real radical form stays as written - #2308
Merged
Rafael-SOWNet merged 1 commit intoNov 1, 2026
Merged
Rafael-SOWNet merged 1 commit into
Rafael-SOWNet merged 1 commit into
Conversation
Simplify wrote sin(pi/7) as the half angle of the table's cos(2pi/7), sqrt((1 - 1/6 * (-1 + ((7 + 21 sqrt(-3))/2)^(1/3) + ((7 - 21 sqrt(-3))/2)^(1/3))) / 2), many times longer than the input. That is casus irreducibilis: the value is real and no real radical form of it exists, so the only one goes through the complex numbers. cos(2pi/9) and sin(pi/18) were written the same way. A table value written through a number that is not real, i or a square root of a negative number, is now passed over, and the call is left as written. Every angle in the tables is real, so such a value is exactly one of these. The entries stay in the tables, so the closed forms stay on record. A value with a real radical form, sin(pi/5) among them, still takes it. TrigonometricTableTest's sweep counted 690 angles resolved, against a floor meant to catch entries lost silently; these are lost on purpose and 642 resolve, so the floor is 642. CasusIrreducibilisTest takes seven such values, six of which master rewrote, three that still take their radicals, and sin(pi/7)^2 + cos(pi/7)^2. The suite, the trio, F#, AOT and the eight harnesses pass. Fixes #2143. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2308 +/- ##
==========================================
- Coverage 86.77% 86.76% -0.01%
==========================================
Files 311 311
Lines 68025 68027 +2
Branches 19758 19759 +1
==========================================
- Hits 59028 59024 -4
- Misses 4875 4882 +7
+ Partials 4122 4121 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
deleted the
a-trigonometric-value-with-no-real-radical-stays-as-written
branch
November 1, 2026 00:37
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.
A sine or cosine whose only radical form goes through the complex numbers (casus irreducibilis) now stays as the function of its angle. A value with a real radical form still takes it.
Simplifysin(pi/7)sqrt((1 - 1/6 * (-1 + ((7 + 21 * sqrt(-3)) / 2) ^ (1/3) + ((7 - 21 * sqrt(-3)) / 2) ^ (1/3))) / 2)sin(pi / 7)cos(2 pi/9)(((sqrt(-3) - 1) / 2) ^ (1/3) + (-(sqrt(-3) + 1) / 2) ^ (1/3)) / 2cos(2/9 * pi)sin(pi/18)sqrt((1 - 1/4 * ((4 + 4 * sqrt(-3)) ^ (1/3) + (4 - 4 * sqrt(-3)) ^ (1/3))) / 2)sin(pi / 18)sin(pi/5)1/4 * sqrt(10 - 2 * sqrt(5))ior the square root of a negative number, is now passed over. Every angle in the tables is real, so those are exactly the casus irreducibilis entries. They stay in the tables, so the closed forms stay on record.TrigonometricTableTest's sweep has a floor on how many angles resolve, to catch entries being lost silently. These are lost on purpose, so the floor moves from 690 to 642.CasusIrreducibilisTest's cases fail on master. The suite, the trio, F#, AOT and the eight harnesses pass.Fixes #2143.
🤖 Generated with Claude Code