* Does this formula instance involve an *approximating* numeric operation — * quadrature, numeric limit extraction, or an infinite series truncated at * MAX_ITERATION? Their results carry approximation error far above REL_TOL.
(formula: unknown)
| 108 | |
| 109 | /** |
| 110 | * Does this formula instance involve an *approximating* numeric operation — |
| 111 | * quadrature, numeric limit extraction, or an infinite series truncated at |
| 112 | * MAX_ITERATION? Their results carry approximation error far above REL_TOL. |
| 113 | */ |
| 114 | function isApproximateInstance(formula: unknown): boolean { |
| 115 | const s = JSON.stringify(formula); |
| 116 | if (/"(Limit|NLimit|Integrate|NIntegrate)"/.test(s)) return true; |
| 117 | return ( |
| 118 | /"(Sum|Product)"/.test(s) && |
| 119 | /"(PositiveInfinity|NegativeInfinity)"/.test(s) |
| 120 | ); |