Exact representations of roots and methods for projecting them to line or plane with arbitrary precision, hyperdimensional algebras and other techniques to remove irrationality from algebraic numbers.
This code is not highly optimized and may contain bugs which make it unsuitable for production environments. Correct bug fixes and suggestions to improve readability, concision and pythonicity are always most welcome. Performance tweaks invited if new bugs avoided and gains are substantial enough to justify any loss of clarity.