#library(ingaasp2rcpp)
#context("Bisection")
#TODO correct, this was the tests of bisection written in R
# test_that("x^2-3x+1", {
# expect_equal(root_bisection(function(x){x^2-3*x+1},0,1,1e-8,100,debug=0), (3-sqrt(5))/2) #confirming convergence on simple case
# })
#
# test_that("many roots", {
# # curve(x^4+5*x^3+1*x^2+3*x-1+sin(12*x),0,1)
# expect_equal(root_bisection(function(x){x^4+5*x^3+1*x^2+3*x-1+sin(12*x)},0,1,1e-8,100,debug=0), (3-sqrt(5))/2) #confirming convergence on simple case
# })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.