Math FPCore C Java Python Julia MATLAB Wolfram TeX \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\]
↓
\[\begin{array}{l}
t_1 := z \cdot \left(t - x\right)\\
t_2 := \tanh \left(\frac{t}{y}\right)\\
t_3 := \tanh \left(\frac{x}{y}\right)\\
t_4 := x + \left(t_2 - t_3\right) \cdot \left(y \cdot z\right)\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_4 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;x + \left(t_2 \cdot \left(y \cdot z\right) - t_3 \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
(FPCore (x y z t)
:precision binary64
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y)))))) ↓
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t x)))
(t_2 (tanh (/ t y)))
(t_3 (tanh (/ x y)))
(t_4 (+ x (* (- t_2 t_3) (* y z)))))
(if (<= t_4 (- INFINITY))
t_1
(if (<= t_4 2e+304) (+ x (- (* t_2 (* y z)) (* t_3 (* y z)))) t_1)))) 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) {
double t_1 = z * (t - x);
double t_2 = tanh((t / y));
double t_3 = tanh((x / y));
double t_4 = x + ((t_2 - t_3) * (y * z));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_4 <= 2e+304) {
tmp = x + ((t_2 * (y * z)) - (t_3 * (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
↓
public static double code(double x, double y, double z, double t) {
double t_1 = z * (t - x);
double t_2 = Math.tanh((t / y));
double t_3 = Math.tanh((x / y));
double t_4 = x + ((t_2 - t_3) * (y * z));
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_4 <= 2e+304) {
tmp = x + ((t_2 * (y * z)) - (t_3 * (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t):
return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
↓
def code(x, y, z, t):
t_1 = z * (t - x)
t_2 = math.tanh((t / y))
t_3 = math.tanh((x / y))
t_4 = x + ((t_2 - t_3) * (y * z))
tmp = 0
if t_4 <= -math.inf:
tmp = t_1
elif t_4 <= 2e+304:
tmp = x + ((t_2 * (y * z)) - (t_3 * (y * z)))
else:
tmp = t_1
return tmp
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)
t_1 = Float64(z * Float64(t - x))
t_2 = tanh(Float64(t / y))
t_3 = tanh(Float64(x / y))
t_4 = Float64(x + Float64(Float64(t_2 - t_3) * Float64(y * z)))
tmp = 0.0
if (t_4 <= Float64(-Inf))
tmp = t_1;
elseif (t_4 <= 2e+304)
tmp = Float64(x + Float64(Float64(t_2 * Float64(y * z)) - Float64(t_3 * Float64(y * z))));
else
tmp = t_1;
end
return tmp
end
function tmp = code(x, y, z, t)
tmp = x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
end
↓
function tmp_2 = code(x, y, z, t)
t_1 = z * (t - x);
t_2 = tanh((t / y));
t_3 = tanh((x / y));
t_4 = x + ((t_2 - t_3) * (y * z));
tmp = 0.0;
if (t_4 <= -Inf)
tmp = t_1;
elseif (t_4 <= 2e+304)
tmp = x + ((t_2 * (y * z)) - (t_3 * (y * z)));
else
tmp = t_1;
end
tmp_2 = tmp;
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_] := Block[{t$95$1 = N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(x + N[(N[(t$95$2 - t$95$3), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$1, If[LessEqual[t$95$4, 2e+304], N[(x + N[(N[(t$95$2 * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(t$95$3 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
↓
\begin{array}{l}
t_1 := z \cdot \left(t - x\right)\\
t_2 := \tanh \left(\frac{t}{y}\right)\\
t_3 := \tanh \left(\frac{x}{y}\right)\\
t_4 := x + \left(t_2 - t_3\right) \cdot \left(y \cdot z\right)\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_4 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;x + \left(t_2 \cdot \left(y \cdot z\right) - t_3 \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
Alternatives Alternative 1 Error 1.0 Cost 41032
\[\begin{array}{l}
t_1 := z \cdot \left(t - x\right)\\
t_2 := x + \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot \left(y \cdot z\right)\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 2 Error 1.7 Cost 19904
\[\mathsf{fma}\left(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), z, x\right)
\]
Alternative 3 Error 10.8 Cost 13896
\[\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+98}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq 3.6712928990852255 \cdot 10^{+25}:\\
\;\;\;\;x + z \cdot \left(y \cdot \left(\tanh \left(\frac{t}{y}\right) + \tanh \left(\frac{x}{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\
\end{array}
\]
Alternative 4 Error 12.8 Cost 7760
\[\begin{array}{l}
t_1 := x + \left(\tanh \left(\frac{t}{y}\right) \cdot \left(y \cdot z\right) - x \cdot z\right)\\
\mathbf{if}\;y \leq -5 \cdot 10^{+91}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq -1.984073577184792 \cdot 10^{-103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.6633035098895167 \cdot 10^{-149}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 10^{+72}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\
\end{array}
\]
Alternative 5 Error 15.1 Cost 7628
\[\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+91}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq 4.83856897880989 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.892076011332116 \cdot 10^{+23}:\\
\;\;\;\;x + \left(y \cdot z\right) \cdot \left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\
\end{array}
\]
Alternative 6 Error 15.1 Cost 6984
\[\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+91}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq 0.49900884014679986:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\
\end{array}
\]
Alternative 7 Error 18.8 Cost 848
\[\begin{array}{l}
t_1 := x - x \cdot z\\
t_2 := x + t \cdot z\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+196}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{+98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.9107770814651894 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 8 Error 19.4 Cost 848
\[\begin{array}{l}
t_1 := x - x \cdot z\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{+251}:\\
\;\;\;\;z \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{+98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.9107770814651894 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot z\\
\end{array}
\]
Alternative 9 Error 15.1 Cost 712
\[\begin{array}{l}
t_1 := x + z \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+91}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 0.49900884014679986:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 10 Error 23.1 Cost 588
\[\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+251}:\\
\;\;\;\;t \cdot z\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+262}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+294}:\\
\;\;\;\;t \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 11 Error 18.4 Cost 584
\[\begin{array}{l}
t_1 := x + t \cdot z\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+141}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 12 Error 22.8 Cost 64
\[x
\]