1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Command-line entry point.
//!
//! Usage:
//! mathr "sin(pi/4) + 2^3" evaluate an expression
//! mathr "diff x^3" symbolic derivative
//! mathr "solve x^2 - 4" find roots
//! mathr "int sin(x) 0 pi" numerical integral
//! mathr "gcd 48 36" number theory
//! mathr "is-prime 97" primality test
//! mathr "gamma(0.5)" special functions (as expressions)
//! echo "sin(pi/4)" | mathr read from stdin
//! mathr interactive REPL
use Result;
use Parser as ClapParser;
use Context;