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 3.69% Cost 41033
\[\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 -\infty \lor \neg \left(t_1 \leq \infty\right):\\
\;\;\;\;z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 2 Error 12.24% Cost 13513
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.62 \cdot 10^{-31} \lor \neg \left(t \leq 5.8 \cdot 10^{-63}\right):\\
\;\;\;\;\mathsf{fma}\left(z, y \cdot \tanh \left(\frac{t}{y}\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y \cdot \left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right)\right)\\
\end{array}
\]
Alternative 3 Error 27.94% Cost 7769
\[\begin{array}{l}
t_1 := x + z \cdot \left(t - x\right)\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{-12}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-269}:\\
\;\;\;\;y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right)\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-182}:\\
\;\;\;\;x + \frac{\frac{z \cdot y}{y}}{\frac{1}{t - x}}\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-72} \lor \neg \left(x \leq 4 \cdot 10^{-31}\right):\\
\;\;\;\;x - z \cdot \left(y \cdot \tanh \left(\frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 18.09% Cost 7496
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-82}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-31}:\\
\;\;\;\;x + \left(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(y \cdot \tanh \left(\frac{x}{y}\right)\right)\\
\end{array}
\]
Alternative 5 Error 30.69% Cost 7244
\[\begin{array}{l}
t_1 := x + z \cdot \left(t - x\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{-12}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-269}:\\
\;\;\;\;y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right)\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-185}:\\
\;\;\;\;x + \frac{\frac{z \cdot y}{y}}{\frac{1}{t - x}}\\
\mathbf{elif}\;x \leq 10^{-74}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 6 Error 30.79% Cost 977
\[\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-12}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.3 \cdot 10^{-183} \lor \neg \left(x \leq 8 \cdot 10^{-72}\right) \land x \leq 9.8 \cdot 10^{-29}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 7 Error 27.54% Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+48} \lor \neg \left(y \leq 1.18 \cdot 10^{+48}\right):\\
\;\;\;\;x + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 8 Error 35.18% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-153}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.48 \cdot 10^{-269}:\\
\;\;\;\;z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 9 Error 35.8% Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-154}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-269}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 10 Error 34.96% Cost 64
\[x
\]