tests/testthat/test-intersection.R

test_that("Correctly locate intersection points.", {
  f1 <- function(x) -0.2*x - 0.8
  f2 <- function(x) x^3 - x - 1
  expect_true(all.equal(intersections(f1,f2), c(1,-0.7236068,-0.2763932), tolerance = 1e-3)) # Computed analytically
})
dfcorbin/MABsim documentation built on April 26, 2020, 8:26 a.m.