NiceSqrtQ body for non-rational u: would Rt[u,2] be free of fractional * powers and complex factors? Mathematica's RtAux extracts even powers * (Rt[b²,2] = b); CE's sound Power fold keeps √(b²), so test the even-power * structure directly instead of inspecting the folded root.
(u: Expression)
| 2106 | acc = next; |
| 2107 | continue; |
| 2108 | } |
| 2109 | acc = combineTriSum(acc, next); |
| 2110 | if (acc === null) return null; |
| 2111 | } |
| 2112 | if (acc === null || acc.kind !== 'tri') return null; |
| 2113 | return { |
| 2114 | a: acc.p.a.add(constA).evaluate(), |
| 2115 | b: acc.p.b, |
| 2116 | c: acc.p.c, |
| 2117 | n: acc.p.n, |
| 2118 | }; |
| 2119 | } |
| 2120 | } |
no test coverage detected