Skip to content

Instantly share code, notes, and snippets.

@5outh
Last active December 16, 2015 20:19
Show Gist options
  • Save 5outh/5491555 to your computer and use it in GitHub Desktop.
Save 5outh/5491555 to your computer and use it in GitHub Desktop.
More derivative stuff
ddx :: (Floating a, Eq a) => Expr a -> Expr a
ddx = fullSimplify . derivative
ddxs :: (Floating a, Eq a) => Expr a -> [Expr a]
ddxs = iterate ddx
nthDerivative :: (Floating a, Eq a) => Int -> Expr a -> Expr a
nthDerivative n = foldr1 (.) (replicate n ddx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment