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

Implemented Horner's scheme for evaluating UnivariatePolynomial #899

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@CodeMaxx
Copy link
Contributor

CodeMaxx commented Apr 1, 2016

@CodeMaxx CodeMaxx force-pushed the CodeMaxx:poly-horner branch from 9dcf1da to dc1958c Apr 1, 2016

}
return ans;
x_pow = pow_ex(x, last_deg);
result = expand(result * x_pow);

This comment has been minimized.

@isuruf

isuruf Apr 1, 2016

Member

Why is the expand function called here?

This comment has been minimized.

@CodeMaxx

CodeMaxx Apr 1, 2016

Contributor

For handling a result like 1/2(31 + 4*a). It should be changed to (31/2 + 2*a) .

@CodeMaxx CodeMaxx force-pushed the CodeMaxx:poly-horner branch 2 times, most recently from 27147b3 to cbf81b8 Apr 1, 2016

@isuruf

This comment has been minimized.

Copy link
Member

isuruf commented Apr 3, 2016

I think this PR should be closed, as expand is expensive and it is called on the coefficient itself, which is not needed

@CodeMaxx

This comment has been minimized.

Copy link
Contributor

CodeMaxx commented Apr 3, 2016

Closing. See the example here

@CodeMaxx CodeMaxx closed this Apr 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment