tests/testthat/test-derivative.R

test_that("derivative", {
  f <- function(x, y, z) {
    (x + 2*y^2 - 3*z^3) / (3*x^3 - 2*y^2 + z + 5) + (x/y)^2 + z + 3
  }
  roq <- f(qlone(1), qlone(2), qlone(3))
  droq1 <- dRatioOfQsprays(roq, c(0, 1, 2))
  droq2 <- derivRatioOfQsprays(
    derivRatioOfQsprays(roq, i = 2),
    i = 3, derivative = 2
  )
  expect_true(droq1 == droq2)
})

Try the ratioOfQsprays package in your browser

Any scripts or data that you put into this service are public.

ratioOfQsprays documentation built on Sept. 11, 2024, 8:45 p.m.