(u: Expression, x: string)
| 2199 | if (classes.length !== 2) return null; |
| 2200 | const [c1, c2] = classes; |
| 2201 | if (c1.exp.isSame(0) || c2.exp.isSame(0)) return null; |
| 2202 | // n is the "larger" exponent (PosQ[n−q]) |
| 2203 | const nFirst = posQ(safeSimplify(c1.exp.sub(c2.exp))); |
| 2204 | const [qc, nc] = nFirst ? [c2, c1] : [c1, c2]; |
| 2205 | return { a: qc.coef, b: nc.coef, n: nc.exp, q: qc.exp }; |
| 2206 | } |
| 2207 | // unexpanded product s·x^m·v with v (generalized) binomial |
| 2208 | const split = splitMonoFactor(u, x); |
| 2209 | if (split === null) return null; |
| 2210 | const { scale, exp: mExp, rest } = split; |
| 2211 | if (rest === null) return null; |
no test coverage detected