Library for calculating derivatives using dual numbers