Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luizperes/derivatives
Take simple derivatives in Haskell
https://github.com/luizperes/derivatives
Last synced: about 1 month ago
JSON representation
Take simple derivatives in Haskell
- Host: GitHub
- URL: https://github.com/luizperes/derivatives
- Owner: luizperes
- License: gpl-3.0
- Created: 2018-02-23T05:19:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-25T08:15:03.000Z (almost 7 years ago)
- Last Synced: 2024-11-05T11:54:40.144Z (3 months ago)
- Language: Haskell
- Size: 19.5 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Derivatives
> Take simple derivates in Haskell.### How does that work?
- `1`: Equation applied to var
- `2`: AST
- `3`: Derivative Rules
- `4`: AST simplifier
- `5`: New equation`(1) -> (2) -> (3) -> (4) -> (5)`
### Usage
- `ghc deriv.hs`
- `./derive ` _// see [Examples](#examples)_### Examples
`x^7*4` (canonical form: `4x^7`)
```
./deriv x**7*4 x
----- Output
28*x**6
````x^7*4^2` (canonical form: `16x^7`)
```
./deriv x**7*4**2 x
----- Output
112*x**6
````4-3*x` (canonical form: `-3x+4`
```
./deriv 4-3*x x
----- Output
-3
````4*x-3*x^3` (canonical form: `-3x^3+4x`)
```
./deriv 4*x-3*x**3 y
----- Output
0
````4*x*y-3*x^3` (canonical form: `4xy-3x^3`
```
./deriv 4*x*y-3*x**3 y
----- Output
4*x
```### Info
Many derivatives (such as trigonometric derivatives) are not (yet) implemented. Feel free to add them.### Help
Pull requests are welcome :)