A lightweight CAS library with step-by-step human explanations and zero external dependencies.
Requires
- php: >=7.4
- ext-gmp: *
README
A lightweight, zero-dependency Computer Algebra System (CAS) library for PHP with step-by-step human-readable explanations.
ð About
CAS is a Computer Algebra System written entirely in PHP. Unlike numerical calculators that work with floating-point approximations, this library manipulates mathematical expressions symbolically â just like a human would when solving algebra problems by hand.
The killer feature? It explains every single step in plain, human-readable text (Persian & English). Whether you're building an educational platform, a math tutor bot, or simply need exact symbolic computation in your PHP application, this library has you covered â with absolutely zero external dependencies.
âĻ Key Features
| Category | Details |
|---|---|
| ðĪ Symbolic Computation | Exact arithmetic on integers, rationals, and complex numbers â no floating-point errors |
| ð Algebraic Simplification | Fully recursive simplification engine with convergence detection |
| ð§Đ Equation Solving | Symbolic & numeric solvers (currently linear; higher-order planned) |
| ð Step-by-Step Explanations | Every operation is recorded and explained in Persian & English |
| ðģ AST-Based Architecture | All expressions are parsed into a tree structure for easy manipulation |
| ðĒ Rich Numeric Support | Integers (GMP), Rationals, Complex numbers, Ï |
| ðŠķ Zero Dependencies | Pure PHP â only needs GMP extension (bundled with PHP by default) |
| ð PSR-4 Compliant | Clean, modern namespace structure |
| ⥠Lightweight | Minimal overhead; designed for embedding in larger projects |
ð Installation
Install via Composer:
composer require sobhanmohammadi/cas