* Is `expr` a polynomial (no radicals, and every power has a non-negative * integer exponent)? Used to gate the square-root extraction so it never * introduces `Sqrt`/`Abs`/`Root` or fractional powers — e.g. `√(x³) = x·√x` * is rejected (ROADMAP B4).
(expr: Expression)
| 134 | * yields the LCD (product / gcd **is** the LCD), so no separate LCD pass is |
| 135 | * needed. |
| 136 | * |
| 137 | * Used by the `Together` **operator** only. The same-denominator simplify rule |
| 138 | * calls `together()` directly and deliberately keeps the unreduced result: it |
| 139 | * runs inside the simplify fixpoint, where output stability and cost matter |
| 140 | * more than presentation. |
| 141 | * |
| 142 | * IMPORTANT: does not call `.simplify()` — `cancelCommonFactors` is itself |
| 143 | * reachable from simplification rules. |
| 144 | */ |
| 145 | export function togetherReduced(op: Expression): Expression { |
| 146 | const t = together(op); |
| 147 | if (!isFunction(t, 'Divide')) return t; |
| 148 |
no test coverage detected