#*****************************************************************************80 # ## secant_test tests secant. # # Licensing: # # Copyright 2016 James P. Howard, II # # The computer code and data files on this web page are distributed under # https://opensource.org/licenses/BSD-2-Clause, the BSD-2-Clause license. # # Modified: # # 14 March 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "secant_test\n" ) cat ( " ", version$version.string, "\n" ) cat ( " secant seeks the root of an equation using the secant method.\n" ) cat ( "\n" ) source ( "/home/burkardt/public_html/r_src/secant/secant.R" ) f <- function ( x ) { x^2 - 1.0 } x <- 1.25 value <- secant ( f, x, tol = 1.0e-3 ) cat ( " secant(x^2-1, x, 1.0-3) = ", value, "\n" ) # # Terminate. # cat ( "\n" ) cat ( "secant_test\n" ) cat ( " Normal end of execution.\n" ) cat ( date ( ), "\n" ) quit ( )