$ show davidedc/Algebrite
Algebrite is a symbolic mathematics library (Computer Algebra System) written in TypeScript. It provides a comprehensive set of operations including symbolic differentiation, integration, polynomial factorization, root finding, matrix/tensor algebra, arbitrary-precision arithmetic, and expression simplification. Internally, it uses an S-expression representation (Cons cells) and a recursive-descent parser to convert string expressions into algebraic trees. The library exposes both a string-based `run()` API for evaluating expressions and direct method calls (e.g., `Algebrite.factor`). It was originally forked from EigenMath and retains some CoffeeScript legacy in test files and debug logging. The codebase is large and monolithic, with many modules tightly coupled through shared global state (the `defs` object). Despite this, the implementation is functional and covers a wide range of mathematical operations, making it suitable for embedding in interactive notebooks or computational tools.
The LLM identified 1 files worth highlighting for reuse:
Provides `run_test` (compares expected and actual string outputs) and `test` (assertion-based) functions for unit testing. Includes setup/teardown logic (`clearall`, `test_flag`) to reset global state and isolate test cases. The `run_shardable_test` variant supports parallel test execution. This module is self-contained and could be extracted as a generic test framework for any library that needs to validate string-formatted outputs, especially expression evaluators.