Math FPCore C Julia Wolfram TeX \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\]
↓
\[\mathsf{fma}\left(z, y \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), x\right)
\]
(FPCore (x y z t)
:precision binary64
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y)))))) ↓
(FPCore (x y z t)
:precision binary64
(fma z (* y (- (tanh (/ t y)) (tanh (/ x y)))) x)) double code(double x, double y, double z, double t) {
return x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
}
↓
double code(double x, double y, double z, double t) {
return fma(z, (y * (tanh((t / y)) - tanh((x / y)))), x);
}
function code(x, y, z, t)
return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))
end
↓
function code(x, y, z, t)
return fma(z, Float64(y * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))), x)
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_] := N[(z * N[(y * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
↓
\mathsf{fma}\left(z, y \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), x\right)
Alternatives Alternative 1 Error 2.7 Cost 27332
\[\begin{array}{l}
t_1 := x + \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot \left(z \cdot y\right)\\
\mathbf{if}\;t_1 \leq 4 \cdot 10^{+302}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t - x\right)\\
\end{array}
\]
Alternative 2 Error 9.1 Cost 7497
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+26} \lor \neg \left(t \leq 2.2 \cdot 10^{-163}\right):\\
\;\;\;\;x + \tanh \left(\frac{t}{y}\right) \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot t - z \cdot \left(y \cdot \tanh \left(\frac{x}{y}\right)\right)\right)\\
\end{array}
\]
Alternative 3 Error 8.4 Cost 7497
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+26} \lor \neg \left(t \leq 1.75 \cdot 10^{-163}\right):\\
\;\;\;\;\frac{1}{\frac{1}{x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot t - z \cdot \left(y \cdot \tanh \left(\frac{x}{y}\right)\right)\right)\\
\end{array}
\]
Alternative 4 Error 16.2 Cost 7248
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{+114}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-133}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-145}:\\
\;\;\;\;\tanh \left(\frac{t}{y}\right) \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
\end{array}
\]
Alternative 5 Error 10.6 Cost 7241
\[\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{-168} \lor \neg \left(t \leq 3.4 \cdot 10^{-167}\right):\\
\;\;\;\;x + \tanh \left(\frac{t}{y}\right) \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(z \cdot \tanh \left(\frac{x}{y}\right)\right)\\
\end{array}
\]
Alternative 6 Error 11.6 Cost 7240
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+214}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+53}:\\
\;\;\;\;x + \tanh \left(\frac{t}{y}\right) \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t + x}{\frac{\left(-t\right) - x}{z}} \cdot \left(x - t\right)\\
\end{array}
\]
Alternative 7 Error 15.8 Cost 6984
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+114}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq 4.25 \cdot 10^{+18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
\end{array}
\]
Alternative 8 Error 22.8 Cost 717
\[\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+215} \lor \neg \left(y \leq 9.5 \cdot 10^{+150}\right) \land y \leq 1.15 \cdot 10^{+239}:\\
\;\;\;\;z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 9 Error 15.8 Cost 713
\[\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+113} \lor \neg \left(y \leq 2.25 \cdot 10^{+18}\right):\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 10 Error 18.6 Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+113} \lor \neg \left(y \leq 1.6 \cdot 10^{+19}\right):\\
\;\;\;\;x + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 11 Error 23.9 Cost 520
\[\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-193}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -7.2 \cdot 10^{-225}:\\
\;\;\;\;-z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 12 Error 23.1 Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{-187}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-299}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 13 Error 23.2 Cost 64
\[x
\]