( angle: Expression, fn: (x: number) => number | Complex | Expression, bigFn?: (x: BigDecimal) => BigDecimal | Complex | number | Expression, complexFn?: (x: Complex) => number | Complex )
| 223 | ], |
| 224 | ]; |
| 225 | |
| 226 | function applyAngle( |
| 227 | angle: Expression, |
| 228 | fn: (x: number) => number | Complex | Expression, |
| 229 | bigFn?: (x: BigDecimal) => BigDecimal | Complex | number | Expression, |
| 230 | complexFn?: (x: Complex) => number | Complex |
| 231 | ): Expression | undefined { |
| 232 | const angle0 = canonicalAngle(angle); |
| 233 | if (angle0 === undefined) return undefined; |
| 234 | // `apply` below declines anything that is not a number LITERAL, and an |
| 235 | // expression with unknowns cannot become one — so numericizing it first is |
| 236 | // waste, and on a nested tree of user-function applications an exponential |
| 237 | // one. (This is the same walk `constructibleValues` skips on the exact path; |
| 238 | // `applyAngle` is the `.N()` path's copy of it.) |
| 239 | if (angle0.unknowns.length > 0) return undefined; |
| 240 | const theta = angle0.N(); |
| 241 | // `apply`'s machine/bignum handlers can also yield an already-boxed |
| 242 | // expression (e.g. `ce.ComplexInfinity` for a `Tan` pole), which it boxes |
| 243 | // through `ce.number`; its public signature is narrower, so cast here. |
| 244 | return apply( |
| 245 | theta, |
no test coverage detected