Repository navigation
Reduce the double angle over the single one (#557) - #693
Merged
Rafael-SOWNet merged 2 commits intoAug 4, 2026
Merged
Rafael-SOWNet merged 2 commits into
Rafael-SOWNet merged 2 commits into
Conversation
sin(2u) csc(u) is 2 cos(u), and nothing reduced it. Opening sin(2u) up leaves 2 sin(u) cos(u) csc(u), whose sine and cosecant are no longer adjacent in the product, and the rules that cancel those match a pair of factors. So (sin(2t) csc(t))^2/4 - cos(2t) - sin(t)^2 came down to (sin(2t) csc(t))^2/4 - cos(t)^2 and stopped, one step short of the zero #557 asks for. A rule of its own, matching before the double angle is opened up and the two pieces are scattered. The cosecant's condition is carried rather than dropped. 2cos(u) is a number where sin(u) is zero and sin(2u) csc(u) is not, so an unconditional answer would speak for a point the expression does not reach. It is the same condition the cancellation of sin(u) csc(u) already comes back with. 17 tests, 7 of which fail without the change, including that the rewrite is the same number wherever both sides are defined. 4026 in all, 127 F#, corpus 102/117 with simp:trig at 100% from 67%, and 1320 property checks.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #693 +/- ##
==========================================
+ Coverage 80.99% 81.60% +0.60%
==========================================
Files 155 157 +2
Lines 13687 13362 -325
Branches 1957 2200 +243
==========================================
- Hits 11086 10904 -182
+ Misses 1990 1851 -139
+ Partials 611 607 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
conflicted |
Both sides add independent trigonometric rules to the same table; kept both.
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.
Closes the last part of #557.
That second one is the expression from the issue, and it is zero.
Why it stopped one step short
sin(2u) csc(u)is2 cos(u). Openingsin(2u)up — which the multiple-angle expansion from the earlier part of this issue does — leaves2 sin(u) cos(u) csc(u), whose sine and cosecant are no longer adjacent in the product. The rules that cancel those match a pair of factors, so they never meet.Hence a rule of its own, matching before the double angle is opened and the pieces are scattered.
The condition is carried
2cos(u)is a number wheresin(u)is zero andsin(2u) csc(u)is not, so an unconditional answer would speak for a point the expression does not reach:Same condition the neighbouring cancellation already comes back with.
Verification
17 tests, 7 of which fail without the change — including that the rewrite is the same number wherever both sides are defined, checked at six points. Nothing outside the identity is claimed: a different argument (
sin(2x) csc(y)) and a multiplier it does not cover (sin(3x) csc(x)) are left alone and pinned as such.4026 unit tests and 127 F# tests on both target frameworks, none failing. 117-problem self-verifying corpus at 102/117 —
simp:triggoes from 67% to 100% — with nothing wrong, in error or timing out. 1320 property checks over 151 expressions, none failing.