Implements sum, prod, min, max, range,
any, and all for dual numbers. Derivatives are propagated
correctly through sum (additive) and prod (multiplicative).
# S4 method for class 'dualr'
Summary(x, ..., na.rm = FALSE)A dual for sum/prod/min/max; a dual_vector for range;
logical for any/all.
x <- dual_variable(2)
y <- dual_variable(5)
value(sum(x, y)) # 7
#> [1] 7
value(prod(x, y)) # 10
#> [1] 10