maths.dual_number_automatic_differentiation =========================================== .. py:module:: maths.dual_number_automatic_differentiation Classes ------- .. autoapisummary:: maths.dual_number_automatic_differentiation.Dual Functions --------- .. autoapisummary:: maths.dual_number_automatic_differentiation.differentiate maths.dual_number_automatic_differentiation.f Module Contents --------------- .. py:class:: Dual(real, rank) .. py:method:: __add__(other) .. py:method:: __floordiv__(other) .. py:method:: __mul__(other) .. py:method:: __pow__(n) .. py:method:: __repr__() .. py:method:: __sub__(other) .. py:method:: __truediv__(other) .. py:method:: reduce() .. py:attribute:: __radd__ .. py:attribute:: __rmul__ .. py:attribute:: real .. py:function:: differentiate(func, position, order) >>> differentiate(lambda x: x**2, 2, 2) 2 >>> differentiate(lambda x: x**2 * x**4, 9, 2) 196830 >>> differentiate(lambda y: 0.5 * (y + 3) ** 6, 3.5, 4) 7605.0 >>> differentiate(lambda y: y ** 2, 4, 3) 0 >>> differentiate(8, 8, 8) Traceback (most recent call last): ... ValueError: differentiate() requires a function as input for func >>> differentiate(lambda x: x **2, "", 1) Traceback (most recent call last): ... ValueError: differentiate() requires a float as input for position >>> differentiate(lambda x: x**2, 3, "") Traceback (most recent call last): ... ValueError: differentiate() requires an int as input for order .. py:function:: f(y)