TaschenrechnerComputer-Algebra-System :leftwardsarrowwith_hook:

A CAS is an advanced symbolic calculator. It can evaluate, simplify, differentiate, integrate and solve algebraic expressions. This is a crate written in Rust.

Features

Warning: This is not yet feature-complete. See libqalculate for a better alternative.

TODO

Eval

The current eval is not very sophisticated. It is functional, but can't simplify any expressions, if a subexpression remains unresolved.

REPL

This crate comes with an interactive comand-line-interface: Read-Eval-Print-Loop.

```Rust use cas::prelude::*;

fn main() { REPL::start(); } ```

Built-in functions and constants

(for a full complete list see default_env.txt)

How to build see Cargo for Rust

Technical

Also see my blog post!

Algebraic expressions

4.3 - π^2 = sin y is an algebraic expression. It consists of atoms (4.3, π, 2, y) and operators (-, ^, =, sin). Operators manipulate atoms. We normally write such expressions in infix-notaion, where one has to know the precedence and associativity of an operator. The exponent (^) must be evaluated before the the substraction (-), evon though it appears later. To evaluate the expression linearly, it has to be converted into polish noation, which is basicly a single function call of function calls (= - 4.3 ^ π 2 sin y).

Lexer and parser

To evaluate the string of an expression, it undergoes 3 steps: