Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 793 Bytes

README.md

File metadata and controls

49 lines (37 loc) · 793 Bytes

derivation

A OCaml program to derivate functions.

Usage

derivation [-v VARIABLE] [-e EXPRESSION] [-h]

Options

Option Description Default
-v Variable to derivate
-e Expression to derivate
-h Show help

Default

If no option is given, the program will read from stdin. And the default derivation variable is x.

Examples

$ derivation -v x -e "x^2 + 2*x + 1"
2x + 2
$ derivation -v x -e "x^2 + 2*x + 1" | derivation -v x
2
$ derivation -v x -e "(x*y)^2 + 2 * x * y + 1" | derivation -v y
2 * x * y + 2y * x + 2

Functions

The program can derivate the following functions:

  • sin
  • cos
  • tan
  • exp
  • ln
  • sqrt
  • asin
  • acos
  • atan
  • log10
  • log2
  • abs