tests/testthat/test-Newton_Raphson.R

context("test to two dim")

test_that("work two dim function", {
  target_func1 <- function(x) {x^3 + 3*x^2 + 8*x - 10}
  res <- Newton_Raphson(func = target_func1, x0 = 10)
  expect_equal(res$root, 0.877134, tolerance = 1e-3)
})
wasabi1989/NewtonRaphson documentation built on Nov. 14, 2019, 12:18 a.m.