Skip to content

Print small integer powers as divisions/multiplications

Daniel Bauer requested to merge terraneo/pystencils:bauerd/print-pow into master

Fixes #72 (closed).

After a longer discussion we decided to reintroduce the special logic into the printer after it was removed in 939241f2. The problem is that it is simply impossible to keep Muls unevaluated in cut_loops. Neither deep_copy nor func(*args) works.

A logic-free printer simply goes against how SymPy works. We can have it, but first we must switch to a SymPy free ast datastructure.

Merge request reports