SyMALα

Symbolic Math Array Language

SyMAL is a programming language designed to perform algebraic&mathematical calculations.
Here you can access a simple and free online interface to perform calculations via SyMAL.
It can: evaluate, simplify and solve algebraic expessions/equations (see quicks and examples below for more information).


Status not connected



Shift+Ctrl – run;
Alt+N – clean up;
Alt+P – run previous input.
Click at a bold number between square brackets to run that input again.
You can use the URL to share/save your input.

Quicks

Adding fractions: 1/5 + 1/6
Multiplying fractions: 6/4 * 7/5
Multiplying polynomials: (x + 1)(x - 2)
Adding polynomials: 5x↑2 + 6x + y + 3y*x
Pulling out like terms: Expand[x↑2(1/a - √x + Sin[b])]
Solving equations: Solve[2x + 3 = 15], Solve[Sqrt[2x+8] = Sqrt[8x+25]], Solve[{x + y = 7, x + 2y = 11}]
Canceling out: Cancel[(x**2 + 2*x + 1)/(x**2 + x)]
Finding discriminant: D[x**2 - 4x + 5]
Factoring trinomials: Factor[(4x^2+16x+12)(x+3)]
Collecting common powers: Collect[x*y + x - 3 + 2*x**2 - z*x**2 + x**3;x]
Trigonometric: Sin[π ÷ 3], Cos[2+3j]

Examples

NB. some basic expressions
2 + 2                  --> 4   <|
2 + 2 * 2              --> 6    |
2 * 2                  --> 4 <| |
Out[] * 2              --> 8 >| | 
Run[0]                 --> 4   >|
5 % 2                  --> 1
2 × 2                  --> 4
2 * x                  --> 2.0⋅x
3y                     --> 3.0⋅y
5!                     --> 120
√2                     --> √2
Sqrt[2]                --/
∛5                     --> 3 ___
                          ╲╱ 5
Cbrt[5]                --/
See[√2]                --> 1.41421356237310
5 ** 2                 --> 25
5 ^  2                 --/                           
5^x                    --> x
                          5                     
¯5                     --> -5
-5                     --/
6 ÷ 3                  --> 3
6 : 3                  --/
Log[x^2]               --> ⎛ 2⎞
                        log⎝x ⎠
'Hello, world!'        --> 'Hello, world!'

NB. gcf/lcm
a ≕ x^2 - 1
b ≕ x^2 - 3x + 2 
Gcf[a;b]               --> x - 1
Lcm[a;b]               --> 3      2
                          x  - 2⋅x  - x + 2

NB. constants
π                      --> π
pi                     --/
See[π]                 --> 3.14159265358979
ℯ                      --> ℯ
E                      --/
See[ℯ]                 --> 2.71828182845905
∞                      --> ∞
oo                     --/
∅                     --> ∅
{}                     --/

NB. variables
a =: 6
a + 4                  --> 10
b =: a
x ≕ 2

NB. simplification
Expand[(x + 1)⋅(x + 2)] --> 2          
                          x + 3⋅x + 2
Simplify[Sin[x]^2 + Cos[x]^2]
                       --> 1
Factor[x^2 * z + 4x*y*z + 4y^2*z]
                       -->  ⎛ 2               2⎞
                          z⋅⎝x  + 4⋅x⋅y + 16⋅y ⎠

NB. functions
|x| x ** 5             --> |x| x
                              5
(|x, y|x + y)[5;5]     --> 10
twice|x| =: 2x     
twice[5]               --> 10
f|x| ≕ x

NB. note that a function in SyMAL is rather a substitution rule than a normal function,
NB. so this doesn't work as expected:
i|x| ≕ ToString[x]
i[5]                   --> sub error 
                       NB. because ToString function evaluates in place what leads to a substitution failure.
NB. explanation: in fact when you're applying a function, the interpreter just performs substitution of symbols denoted in the RHS by corresponding parameters.
NB. so `(|x, y| x + y)[5;5]` expands into `x + y -> 5 + y -> 5 + 5' and only here evaluation is performed.

NB. substitution in-place
Sub[x+1;x;3]           --> 4
Sub[x+y;{{x, 2}, {y, 8}}]
                       --> 10
NB. equations
x + 3 = 5              --> x + 3 = 5
2 = 2                  --> 1
2 = 3                  --> 0
Solve[x + 3 = 5]       --> 2
Solve[3x + 2 = 14]     --> 4

NB. matrices
M =: Matrix[{{1, 2}, {6, 9}}]
M                      --> ⎡1  2⎤
                           ⎢    ⎥
                           ⎣6  9⎦
Shape[M]               --> {2, 2}
Length[M]              --> 4
Transpose[M]           --> ⎡1  6⎤
                           ⎢    ⎥
                           ⎣2  9⎦
Inverse[M]             --> ⎡-3  2/3 ⎤
                           ⎢        ⎥
                           ⎣2   -1/3⎦
At[M;{1, 1}]           --> 1
Zeros[2;2]             --> ⎡0  0⎤
                           ⎢    ⎥
                           ⎣0  0⎦
Ones[2;2]              --> ⎡1  1⎤
                           ⎢    ⎥
                           ⎣1  1⎦
Eye[2]                 --> ⎡1  0⎤
                           ⎢    ⎥
                           ⎣0  1⎦
N =: Matrix[{{9, 7}, {3, 5}}]
M + N                  --> ⎡10  9 ⎤
                           ⎢      ⎥
                           ⎣9   14⎦

NB. imaginary numbers
ⅈ                       --> ⅈ
I                      --/
5j                     --> 5.0⋅ⅈ
5j + 23                --> 23 + 5.0⋅ⅈ
5j + 7j                --> 12.0⋅ⅈ

NB. fractions
1/3 + 1/4              --> 7/12
5/x                    --> 5
                           ─
                           x 

NB. lists
{1, 2, 3}              --> {1, 2, 3}
1 + {1, 2, 3}          --> {2, 3, 4}
{1, 2, 3} + {3, 8, 7}  --> {4, 10, 10}
Iota[5]                --> {1, 2, 3, 4, 5}
ι5                     --/
Reduce[|x, y|x * y;ι5] --> 120
At[{6,8,5};1]          --> 6
At[{6,8,5};-1]         --> 5
2…5                    --> {2, 3, 4, 5}
2—5                    --/
Range[2;5]             --|
2 ? {1, 2, 3}          --> 1
2 ∈ {1, 2, 3}          --/
2 ~ {1, 2, 3}          --> 0
2 ∉ {1, 2, 3}          --/
Mean[1…5]              --> 3

NB. output
Show['Hello, world!']  --> Hello, world!
                           nan
Display['yay!']        --> yay!nan
Show[1;2;3]            --> 1
                           2
                           3
                           nan