Horner’s method. Write a class Horner with a method evaluate() that takes a floating-point number x and array p[] as arguments and returns the result of evaluating the polynomial whose coefficients are the elements in p[] at x:
Use Horner’s method, an efficient way to perform the computations that is suggested by the following parenthesization:
Write a test client with a static method exp() that uses evaluate() to compute an approximation to e x, using the first n terms of the Taylor series expansion e x = 1 + x + x 2/2! + x 3/3! + .... Your client should take a command-line argument x and compare your result against that computed by Math.exp(x)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here