R/dual-math.R
dual-maxmin.Rd
Compares on value and propagates the derivative of the selected branch.
# S4 method for class 'dualr' max(x, ..., na.rm = FALSE) # S4 method for class 'dualr' min(x, ..., na.rm = FALSE)
A dual number.
Additional dual or numeric values.
Ignored.
A dual representing the max or min.
dual
x <- dual_variable(3) y <- dual_variable(5) value(max(x, y)) # 5 #> [1] 5 value(min(x, y)) # 3 #> [1] 3