Skip to content

Implement sin and cos #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Implement sin and cos #4

wants to merge 1 commit into from

Conversation

tmcgrath325
Copy link
Collaborator

This implements sin and cos for GVar. Since the resulting distributions are not Gaussians, these will return a new GVar that approximates the target distribution by matching its mean and variance.

One thing to note is that the center of sin(a) is not necessarily equal to sin(a.center) (and the same goes for cos). A derivation and some tests of the result against empirical solutions can be found here.

@timholy
Copy link
Member

timholy commented Apr 18, 2025

Thanks! This looks great, the only things this needs are tests. I've added a general-purpose harness in #5 and improved it in #6. (Note that the implementation of exp also changed, and that might have an impact on some of the things you're using this for? In general I suspect the bounds are wider than previously.)

If you rebase this PR on current main, hopefully that should make the tests very easy to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants