TrigToExp for Sinh/Cosh: rewrite Sinh/Cosh[w] → exp form in E^(±w), with the * ½ coefficient DISTRIBUTED into the two terms so a power base stays a pure Add * (CE's Expand will not pull a scalar out of a power base). The argument w is * kept symbolic; all other heads — including the reciprocal
(ce: ComputeEngine, u: Expression)
| 3610 | x: string, |
| 3611 | st: FoeState |
| 3612 | ): boolean { |
| 3613 | const ce = base.engine; |
| 3614 | if (st.base === null) { |
| 3615 | st.base = base; |
| 3616 | st.expon = expon; |
| 3617 | return true; |
| 3618 | } |
| 3619 | // tmp = Log[base]·Coeff[expon,x,1] / (Log[$base$]·Coeff[$expon$,x,1]). |
| 3620 | // The exponentials share a common base iff tmp is rational. |
| 3621 | let tmp = safeSimplify( |
| 3622 | base |
| 3623 | .ln() |
| 3624 | .mul(coeffX(expon, x, 1)) |
| 3625 | .div(st.base.ln().mul(coeffX(st.expon!, x, 1))) |
| 3626 | ); |
| 3627 | if (!(tmp.isNumberLiteral && tmp.isRational === true)) return false; |
| 3628 | |
| 3629 | // Do the constant terms share the same ratio? (skip when $expon$ has none) |
| 3630 | const e0 = coeffX(st.expon!, x, 0); |
| 3631 | let constCommensurate = false; |
| 3632 | if (!zeroQ(e0)) { |
no test coverage detected