tests/test-prod.r

require(salad)

A <- prod(dual(1:5))
A0 <- new("dual", x = 120, d = structure(list(x1 = 120, x2 = 60, x3 = 40, 
    x4 = 30, x5 = 24), class = "differential"))

stopifnot(salad:::test_near_equality(A, A0, 0))

# mb <- microbenchmark::microbenchmark(prod(dual(1:5)), times = 1000)
# print(mb)

Try the salad package in your browser

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

salad documentation built on April 4, 2025, 1:06 a.m.