context("test to existing function `uniroot`")
test_that("same result", {
target_func2 <- function(x) {x^4 + 3*x^3 - 6*x^2 + 8*x - 10}
res <- Newton_Raphson(func = target_func2, x0 = 10)
res_uniroot <- uniroot(target_func2, c(0, 10))
expect_equal(res$root, res_uniroot$root, tolerance = 1e-3)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.