Copyright | Copyright 2024 Yoo Chung |
---|---|
License | Apache-2.0 |
Maintainer | dev@chungyc.org |
Safe Haskell | None |
Language | GHC2021 |
Differentiate symbolic representations of mathematical expressions.
This module does not actually implement differentiation,
but is rather a thin wrapper over Numeric.AD providing
derivatives for Expression
with some simplification applied.
Synopsis
- differentiate :: Text -> Expression -> Expression
Documentation
:: Text | Symbol representing the variable. |
-> Expression | Symbolic representation of the mathematical expression to differentiate. |
-> Expression | The derivative. |
Differentiates a mathematical expression.
>>>
toHaskell $ differentiate "x" $ "x" ** 2
"2 * x">>>
toHaskell $ differentiate "x" $ "a" * sin "x"
"a * cos x"
This uses Numeric.AD.