#*****************************************************************************80 # ## bisection_test tests bisection. # # 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. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 13 March 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "bisection_test\n" ) cat ( " ", version$version.string, "\n" ) cat ( " bisection seeks the root of an equation using the bisection method.\n" ) cat ( "\n" ) source ( "/home/burkardt/public_html/r_src/bisection/bisection.R" ) f <- function ( x ) { x^2 - 1.0 } a = 0.5 b = 1.25 value <- bisection ( f, a, b, tol = 1.0e-3 ) cat ( " bisection(x^2-1, 0.5, 1.25, 1.0-3) = ", value, "\n" ) # # Terminate. # cat ( "\n" ) cat ( "bisection_test\n" ) cat ( " Normal end of execution.\n" ) cat ( date ( ), "\n" ) quit ( )