MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / cleanTrig

Function cleanTrig

src/compute-engine/rubi/driver.ts:107–115  ·  view source on GitHub ↗

Bottom-up application of the engine's trig simplifier — folds the * `sin(θ+π/2) → cos(θ)` cofunction shifts the cosine→sine normalization * introduces (and other sound trig identities) so results read cleanly.

(ce: ComputeEngine, e: Expression)

Source from the content-addressed store, hash-verified

105// fallback (irreducible-quadratic denominators split over complex-conjugate
106// linear roots), keeping the R15 all-linear path. A/B measures the quadratic
107// extension's effect on the 4.1.11 benchmark.
108const NO_SICI_COMPLEX = process.env.RUBI_NO_SICI_COMPLEX !== undefined;
109// RUBI_NO_TRIGSQ: disable the R16 poly×csc(u)²/sec(u)² integration-by-parts
110// fallback (A/B measuring its effect on the 4.1.10 benchmark).
111const NO_TRIGSQ = process.env.RUBI_NO_TRIGSQ !== undefined;
112// RUBI_NO_TRIGEXP: disable the R17 single-angle trig-rational → single-
113// exponential normalization fallback (A/B measuring its effect on 4.1.10).
114const NO_TRIGEXP = process.env.RUBI_NO_TRIGEXP !== undefined;
115// RUBI_NO_TRIGSUB: disable the R22 subproblem trig-bridge (engage the inert-trig
116// bridge for a subproblem that introduces ACTIVE trig into a non-trig top-level
117// integrand — the inverse-trig `Subst[∫f(x)·Cot[x],…]` reductions). A/B measures
118// its effect on the ch5/ch7 (d+e·x²)^p·(a+b·arcsin/arccos)^n families.

Callers 1

activateMethod · 0.85

Calls 3

simplifyTrigFunction · 0.90
mapMethod · 0.65
functionMethod · 0.65

Tested by

no test coverage detected