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

Search radius as a parameter for preimage simplification #9

Open
frostburn opened this issue Jul 9, 2024 · 3 comments
Open

Search radius as a parameter for preimage simplification #9

frostburn opened this issue Jul 9, 2024 · 3 comments

Comments

@frostburn
Copy link

Babai's nearest plane isn't guaranteed to give the simplest form.

Add an optional "search radius" parameter to iteratively search for simpler forms inside local "bubbles" of comma space. In SonicWeave this seems to provide further reductions not found by Babai's.

@Sin-tel
Copy link
Owner

Sin-tel commented Jul 10, 2024

Interesting, this algorithm went through like 3 iterations before I settled on Babai's, since it gave me best results in all of my test cases. Of course you can never guarantee optimality in the strict sense if you want an efficient algorithm.

What is your suggested search algorithm? Just trying all possible combinations of vectors has some nasty combinatorial explosion but it might be worth it if it pays off.

On a side note, this feature can benefit from some test or benchmark set so we can compare algorithms more easily.

@frostburn
Copy link
Author

Here's my implementation: https://github.com/xenharmonic-devs/sonic-weave/blob/e2afbff41b4c76802d3947f6f6bfe20b36131599/src/stdlib/builtin/temper.ts#L505

It builds all k-combinations of the commas and their inverses based on the "radius" k and iteratively brute-forces with those trying to simplify the fraction. It also has stuff related to eliminating nth-rooths, but you probably don't need to worry about that.

As a test case I try to simplify 60/49 to 49/40 using miracle's comma list [225/224, 1029/1024].

@frostburn
Copy link
Author

That code was bad. The fixed version uses a solid hypercube of LLL reduced commas.

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

No branches or pull requests

2 participants