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

Function powOrOne

src/compute-engine/rubi/rubi-utils.ts:4332–4336  ·  view source on GitHub ↗
(base: Expression, exp: Expression)

Source from the content-addressed store, hash-verified

4330function trigToExp(ce: ComputeEngine, u: Expression): Expression {
4331 const ops = u.ops;
4332 if (ops?.length === 1 && (u.operator === 'sin' || u.operator === 'cos')) {
4333 const w = trigToExp(ce, ops[0]);
4334 const i = ce.I;
4335 const ewPos = ce.E.pow(i.mul(w)); // E^(i·w)
4336 const ewNeg = ce.E.pow(i.neg().mul(w)); // E^(−i·w)
4337 const half = ce.number([1, 2]);
4338 if (u.operator === 'cos') return half.mul(ewPos).add(half.mul(ewNeg));
4339 // sin[w] = (E^(i·w) − E^(−i·w))/(2i) = −(i/2)E^(i·w) + (i/2)E^(−i·w)

Callers 2

expandPolyOverLinearFunction · 0.85
expandPartialFractionsFunction · 0.85

Calls 2

isSameMethod · 0.65
powMethod · 0.65

Tested by

no test coverage detected