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 11.1 Cost 13768
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.805478926720618 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.414686757759661 \cdot 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right), z, x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 2 Error 2.1 Cost 13632
\[x + y \cdot \left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z\right)
\]
Alternative 3 Error 11.8 Cost 7496
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.805478926720618 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.414686757759661 \cdot 10^{+120}:\\
\;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 4 Error 15.7 Cost 712
\[\begin{array}{l}
t_1 := x + z \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -2.8807858028713334 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.0494659012161057 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Error 18.3 Cost 584
\[\begin{array}{l}
t_1 := x + t \cdot z\\
\mathbf{if}\;y \leq -2.8807858028713334 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.7613012540897884 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 6 Error 22.3 Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.082092851470914 \cdot 10^{-254}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.1486194476681686 \cdot 10^{-232}:\\
\;\;\;\;t \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 7 Error 23.3 Cost 64
\[x
\]