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

Dr/fib switch to iterative #86

Merged
merged 3 commits into from
Mar 8, 2024
Merged

Dr/fib switch to iterative #86

merged 3 commits into from
Mar 8, 2024

Conversation

dr-frmr
Copy link
Member

@dr-frmr dr-frmr commented Feb 19, 2024

Problem

Recursive fibonacci impl good for testing perf, bad for proving (which we wanna use this template for!)

Solution

Swap fib function to iterative

Docs Update

N/A

Notes

Copy link
Collaborator

@nick1udwig nick1udwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a nit; otherwise LGTM 👍

} else {
trial - mean
}
}) / number_trials as u128;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The above was much more readable to me as the one-liner

ad + if mean >= trial { mean - trial } else { trial - mean }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustfmt automatically puts it on 4 lines :(

@dr-frmr dr-frmr merged commit 72bc282 into develop Mar 8, 2024
@dr-frmr dr-frmr deleted the dr/fib-switch-to-iterative branch March 8, 2024 20:20
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.

2 participants