Module arithmetic

Module arithmetic 

Source
Expand description

Arithmetic operation simplification

Handles simplification of basic arithmetic operations: addition, multiplication, and powers. Implements ultra-fast paths for common cases while maintaining mathematical correctness.

Functionsยง

simplify_addition
Simplify addition expressions with minimal overhead
simplify_multiplication
Simplify multiplication with minimal overhead and flattening
simplify_power
Power simplification
try_matrix_add
Try to simplify A + B for matrices directly without building expression tree
try_matrix_multiply
Try to simplify A * B for matrices directly without building expression tree