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

Add Horner's Method #575

Merged
merged 4 commits into from
Dec 8, 2020
Merged

Add Horner's Method #575

merged 4 commits into from
Dec 8, 2020

Conversation

MatheusBonavite
Copy link
Contributor

@MatheusBonavite MatheusBonavite commented Nov 17, 2020

Added Horner's Method into algorithms/math. Horner's method is a clever solution named after William George Horner, to evaluate polynomial functions given a certain point. I think it would be an interesting addition since it can be used in many hardware/software applications.

@MatheusBonavite MatheusBonavite marked this pull request as draft November 30, 2020 05:16
@MatheusBonavite MatheusBonavite marked this pull request as ready for review November 30, 2020 05:18
Comment on lines 4 to 5
With this method, it is possible to evaluate a polynomial with only n additions and n multiplications.
Also, its storage requirements are only n times the number of bits of x.

Choose a reason for hiding this comment

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

I think the description would highly benefit from a comparison between Horner's scheme to a regular by-definition approach; it would also give meaning to the repeated words “only” in both sentences.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, Lazar. I've added your suggestions. I removed the repeated "only" words and tried to make the text more clear. Also, gave comparison scenarios for a specific polynomial showing that Horner's rule would use a smaller number of mathematical operations when compared to a simple by-definition approach.

@trekhleb trekhleb changed the base branch from master to merge December 8, 2020 07:58
@trekhleb
Copy link
Owner

trekhleb commented Dec 8, 2020

@MatheusBonavite, thanks for your contribution!

@trekhleb trekhleb merged commit fb6a1fa into trekhleb:merge Dec 8, 2020
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.

3 participants