Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //TODO: explain this eval method
- public double eval(double at) {
- double val = 0;
- for (double coefficient : coefficients) {
- val = val * at + coefficient;
- }
- return val;
- }
- public double eval1(double at) {
- double val = 0;
- for (int i=0; i<coefficients.length; i++) {
- val += coefficients[i] * Math.pow(at, i);
- }
- return val;
- }
Advertisement
Add Comment
Please, Sign In to add comment