Implement forward-mode automatic differentiation with dual numbers carrying both values and derivatives.