Skip to content
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

New sum for better stability #15

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

New sum for better stability #15

wants to merge 12 commits into from

Conversation

moble
Copy link
Owner

@moble moble commented Dec 4, 2014

As mentioned in issue #12, the calculations suddenly get very bad for ell>29. I also noticed that the errors are growing exponentially from low ell, for certain rotations. I've replaced the key (alternating) sum with what should be a much stabler algorithm. The basic idea is that you can rewrite any rotation as the product of two rotations for which that alternating sum has a special form. In this case, the magnitudes of the R.a and R.b components are equal for each of the two rotations. We can evaluate the sums exactly offline, and store them for retrieval when needed (as the new Delta function).

I can still use Horner form for fast and accurate evaluations. In fact, I even managed to fold that loop onto itself, saving ~1/2 the iterations, by using a symmetry of the Delta.

These changes make the evaluation substantially slower (~20% slower for ell=8), but far more accurate. In particular, I've been able to tighten the tolerances on the tests, so that errors of roughly 2*ell times machine precision are expected.

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