Skip to content

Add TRIGSIN command for Pythagorean identity rewrites#1636

Open
duncanita wants to merge 1 commit intoc3d:devfrom
duncanita:feature/trigsin
Open

Add TRIGSIN command for Pythagorean identity rewrites#1636
duncanita wants to merge 1 commit intoc3d:devfrom
duncanita:feature/trigsin

Conversation

@duncanita
Copy link

Summary

  • Adds TRIGSIN command that rewrites cos(x)^2 to 1-sin(x)^2 using the expression rewrite engine
  • Removes dead constant-folding rules that could never fire in the trig_sin rewrite context
  • Fixes documentation to show actual output instead of overpromising sin²+cos² → 1 simplification
  • Adds 8 tests covering recursion into subexpressions, multiple cos² terms, and negative cases

Test plan

  • make sim compiles cleanly
  • Full test suite passes: 3313 tests, 0 failures
  • New tests verify: embedded cos², multiple cos² terms, cos³ passthrough, plain cos passthrough

Replaces cos(x)^2 with 1-sin(x)^2 using the expression rewrite engine.
Includes 8 tests covering recursion into subexpressions, multiple cos²
terms, and negative cases (cos³, plain cos). Documentation corrected to
show actual output rather than overpromising simplification.
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

Comments