\[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\]
↓
\[\mathsf{fma}\left(J \cdot 2, \sinh \ell \cdot \cos \left(K \cdot 0.5\right), U\right)
\]
(FPCore (J l K U)
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
↓
(FPCore (J l K U)
:precision binary64
(fma (* J 2.0) (* (sinh l) (cos (* K 0.5))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
↓
double code(double J, double l, double K, double U) {
return fma((J * 2.0), (sinh(l) * cos((K * 0.5))), U);
}
function code(J, l, K, U)
return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U)
end
↓
function code(J, l, K, U)
return fma(Float64(J * 2.0), Float64(sinh(l) * cos(Float64(K * 0.5))), U)
end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
↓
code[J_, l_, K_, U_] := N[(N[(J * 2.0), $MachinePrecision] * N[(N[Sinh[l], $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
↓
\mathsf{fma}\left(J \cdot 2, \sinh \ell \cdot \cos \left(K \cdot 0.5\right), U\right)
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 13504 |
|---|
\[U + \cos \left(K \cdot 0.5\right) \cdot \left(\sinh \ell \cdot \left(J + J\right)\right)
\]
| Alternative 2 |
|---|
| Error | 8.9 |
|---|
| Cost | 7240 |
|---|
\[\begin{array}{l}
\mathbf{if}\;J \leq 2.2391028067941813 \cdot 10^{+111}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \sinh \ell\right)\\
\mathbf{elif}\;J \leq 2.532952835702173 \cdot 10^{+140}:\\
\;\;\;\;\ell \cdot \left(J \cdot \left(2 \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right) + 2 \cdot \ell\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 8.9 |
|---|
| Cost | 7240 |
|---|
\[\begin{array}{l}
\mathbf{if}\;J \leq 2.2391028067941813 \cdot 10^{+111}:\\
\;\;\;\;U + J \cdot \left(2 \cdot \sinh \ell\right)\\
\mathbf{elif}\;J \leq 2.532952835702173 \cdot 10^{+140}:\\
\;\;\;\;\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot \left(J \cdot \ell\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right) + 2 \cdot \ell\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.6 |
|---|
| Cost | 7104 |
|---|
\[U + 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\right)
\]
| Alternative 5 |
|---|
| Error | 8.5 |
|---|
| Cost | 6848 |
|---|
\[U + J \cdot \left(2 \cdot \sinh \ell\right)
\]
| Alternative 6 |
|---|
| Error | 8.7 |
|---|
| Cost | 960 |
|---|
\[U + J \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right) + 2 \cdot \ell\right)
\]
| Alternative 7 |
|---|
| Error | 17.8 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;U \leq -3.6946638497656255 \cdot 10^{-264}:\\
\;\;\;\;U\\
\mathbf{elif}\;U \leq 3.859746936840123 \cdot 10^{-262}:\\
\;\;\;\;2 \cdot \left(J \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 8.8 |
|---|
| Cost | 448 |
|---|
\[U + J \cdot \left(2 \cdot \ell\right)
\]
| Alternative 9 |
|---|
| Error | 18.4 |
|---|
| Cost | 64 |
|---|
\[U
\]