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(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), z, 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 (* y (- (tanh (/ t y)) (tanh (/ x y)))) z 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((y * (tanh((t / y)) - tanh((x / y)))), z, 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(Float64(y * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))), z, 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[(N[(y * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z + 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(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), z, x\right)
Alternatives Alternative 1 Error 2.8 Cost 27332
\[\begin{array}{l}
t_1 := x + \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot \left(y \cdot z\right)\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\end{array}
\]
Alternative 2 Error 10.1 Cost 7496
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.6705875733924433 \cdot 10^{+22}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.062643558919461 \cdot 10^{+63}:\\
\;\;\;\;x + \left(y \cdot \left(\tanh \left(\frac{t}{y}\right) \cdot z\right) - x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 3 Error 15.8 Cost 712
\[\begin{array}{l}
t_1 := x + z \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.8953312110840713 \cdot 10^{-26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 18.1 Cost 584
\[\begin{array}{l}
t_1 := x + t \cdot z\\
\mathbf{if}\;y \leq -6.7 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 357.2826943109959:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Error 22.1 Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.213982893426432 \cdot 10^{-196}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.415251238573077 \cdot 10^{-224}:\\
\;\;\;\;t \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 6 Error 22.2 Cost 64
\[x
\]