dual-summary: Summary group generic for dual numbers

dual-summaryR Documentation

Summary group generic for dual numbers

Description

Implements sum, prod, min, max, range, any, and all for dual numbers. Derivatives are propagated correctly through sum (additive) and prod (multiplicative).

Usage

## S4 method for signature 'dualr'
Summary(x, ..., na.rm = FALSE)

Arguments

x

A dual number.

...

Additional dual or numeric values.

na.rm

Logical; ignored (present for generic compatibility).

Value

A dual for sum/prod/min/max; a dual_vector for range; logical for any/all.

Examples

x <- dual_variable(2)
y <- dual_variable(5)
value(sum(x, y))
value(prod(x, y))


nabla documentation built on Feb. 11, 2026, 1:06 a.m.