Unformatted text preview: ( x 1 − x ) f ( x 1 ) f ( x 1 ) − f ( x ) = 1 − (1 − 0) f (1) f (1) − f (0) = 1 − (1 − 0)( − 0.4597) − 0.4597 − 1 = 0.6851 , x 3 = x 2 − ( x 2 − x 1 ) f ( x 2 ) f ( x 2 ) − f ( x 1 ) = 0.6851 − (0.6851 − 1) f (0.6851) f (0.6851) − f (1) = 0.6851 − (0.6851 − 1)(0.0893) 0.0893 − ( − 0.4597) = 0.7363 , and so on. Using a calculator is not very e±fcient and will lead to rounding errors. A better way to implement the algorithm is with a computer. Listing 6.1 below shows the code (secant.java) ±or solving cos x = x with the secant method, using the Java programming language:...
View
Full Document
 Fall '11
 Dr.Cheun
 Calculus, Addition, Java programming language, X1, Pick initial points

Click to edit the document details