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

log: Find out exactly where the precision is lost and what #99

Open
github-actions bot opened this issue May 31, 2022 · 0 comments
Open

log: Find out exactly where the precision is lost and what #99

github-actions bot opened this issue May 31, 2022 · 0 comments
Assignees
Labels
optimize Potential optimization opportunity tracker Issue tracked by bot

Comments

@github-actions
Copy link

On 2022-05-31 @recmo wrote in c1a0c34 “Merge pull request #97 from recmo/isqrt”:

Find out exactly where the precision is lost and what
the bounds are.

                let log = value.approx_log2();
                let pow = U::approx_pow2(log).unwrap();
                let error = value.abs_diff(pow);
                let correct_bits = value.bit_len() - error.bit_len();
                // The maximum precision we could expect here is 53 bits.
                // OPT: Find out exactly where the precision is lost and what
                // the bounds are.
                assert!(correct_bits == value.bit_len() || correct_bits >= 42);
            });
        });
    }

From src/log.rs:150

@github-actions github-actions bot added optimize Potential optimization opportunity tracker Issue tracked by bot labels May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimize Potential optimization opportunity tracker Issue tracked by bot
Projects
None yet
Development

No branches or pull requests

1 participant