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 := \tanh \left(\frac{x}{y}\right)\\
t_2 := \left(t - x\right) \cdot z\\
t_3 := \tanh \left(\frac{t}{y}\right)\\
t_4 := x + \left(y \cdot z\right) \cdot \left(t_3 - t_1\right)\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;x + \left(\left(y \cdot z\right) \cdot t_3 + y \cdot \left(t_1 \cdot \left(-z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\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 (tanh (/ x y)))
(t_2 (* (- t x) z))
(t_3 (tanh (/ t y)))
(t_4 (+ x (* (* y z) (- t_3 t_1)))))
(if (<= t_4 (- INFINITY))
t_2
(if (<= t_4 2e+306) (+ x (+ (* (* y z) t_3) (* y (* t_1 (- z))))) t_2)))) 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 = tanh((x / y));
double t_2 = (t - x) * z;
double t_3 = tanh((t / y));
double t_4 = x + ((y * z) * (t_3 - t_1));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_4 <= 2e+306) {
tmp = x + (((y * z) * t_3) + (y * (t_1 * -z)));
} else {
tmp = t_2;
}
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 = Math.tanh((x / y));
double t_2 = (t - x) * z;
double t_3 = Math.tanh((t / y));
double t_4 = x + ((y * z) * (t_3 - t_1));
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_4 <= 2e+306) {
tmp = x + (((y * z) * t_3) + (y * (t_1 * -z)));
} else {
tmp = t_2;
}
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 = math.tanh((x / y))
t_2 = (t - x) * z
t_3 = math.tanh((t / y))
t_4 = x + ((y * z) * (t_3 - t_1))
tmp = 0
if t_4 <= -math.inf:
tmp = t_2
elif t_4 <= 2e+306:
tmp = x + (((y * z) * t_3) + (y * (t_1 * -z)))
else:
tmp = t_2
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 = tanh(Float64(x / y))
t_2 = Float64(Float64(t - x) * z)
t_3 = tanh(Float64(t / y))
t_4 = Float64(x + Float64(Float64(y * z) * Float64(t_3 - t_1)))
tmp = 0.0
if (t_4 <= Float64(-Inf))
tmp = t_2;
elseif (t_4 <= 2e+306)
tmp = Float64(x + Float64(Float64(Float64(y * z) * t_3) + Float64(y * Float64(t_1 * Float64(-z)))));
else
tmp = t_2;
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 = tanh((x / y));
t_2 = (t - x) * z;
t_3 = tanh((t / y));
t_4 = x + ((y * z) * (t_3 - t_1));
tmp = 0.0;
if (t_4 <= -Inf)
tmp = t_2;
elseif (t_4 <= 2e+306)
tmp = x + (((y * z) * t_3) + (y * (t_1 * -z)));
else
tmp = t_2;
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[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$3 = N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(x + N[(N[(y * z), $MachinePrecision] * N[(t$95$3 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$2, If[LessEqual[t$95$4, 2e+306], N[(x + N[(N[(N[(y * z), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(y * N[(t$95$1 * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
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 := \tanh \left(\frac{x}{y}\right)\\
t_2 := \left(t - x\right) \cdot z\\
t_3 := \tanh \left(\frac{t}{y}\right)\\
t_4 := x + \left(y \cdot z\right) \cdot \left(t_3 - t_1\right)\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;x + \left(\left(y \cdot z\right) \cdot t_3 + y \cdot \left(t_1 \cdot \left(-z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
Alternatives Alternative 1 Error 0.9 Cost 41032
\[\begin{array}{l}
t_1 := \left(t - x\right) \cdot z\\
t_2 := x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 2 Error 11.3 Cost 7496
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.82 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+69}:\\
\;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 3 Error 14.3 Cost 7368
\[\begin{array}{l}
t_1 := x + z \cdot \left(t - y \cdot \tanh \left(\frac{x}{y}\right)\right)\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{-131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 24.1 Cost 848
\[\begin{array}{l}
t_1 := \left(t - x\right) \cdot z\\
\mathbf{if}\;t \leq -1.65 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{-184}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-150}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 5 Error 15.3 Cost 712
\[\begin{array}{l}
t_1 := x + z \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 6 Error 18.3 Cost 584
\[\begin{array}{l}
t_1 := t \cdot z + x\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 7 Error 22.8 Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-235}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-187}:\\
\;\;\;\;t \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 8 Error 22.9 Cost 64
\[x
\]