autodiff.Dual.__rsub__

Dual.__rsub__(other)

Return the difference between two numbers, when the left operand is not a Dual number.

Parameters
selfDual
otherint, float
Returns
outDual

Examples

Scalar and dual number (univariate):

>>> 1.2 - ad.Dual(42)
Dual(-40.8, array([-1.]))

Scalar and dual number (multivariate):

>>> -3.6 - ad.Dual(42, [1, 2])
Dual(-45.6, array([-1., -2.]))