Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\]
↓
\[\begin{array}{l}
t_1 := x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\
t_2 := 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\\
\mathbf{if}\;x \cdot x \leq 5.6 \cdot 10^{-68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot x \leq 1.85 \cdot 10^{+37}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot x \leq 3.8 \cdot 10^{+264}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t)))) ↓
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x x) (* z (* z (* y 4.0)))))
(t_2 (* 4.0 (* y (- t (* z z))))))
(if (<= (* x x) 5.6e-68)
t_2
(if (<= (* x x) 5e-5)
t_1
(if (<= (* x x) 1.85e+37)
t_2
(if (<= (* x x) 3.8e+264) t_1 (* x x))))))) double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
↓
double code(double x, double y, double z, double t) {
double t_1 = (x * x) - (z * (z * (y * 4.0)));
double t_2 = 4.0 * (y * (t - (z * z)));
double tmp;
if ((x * x) <= 5.6e-68) {
tmp = t_2;
} else if ((x * x) <= 5e-5) {
tmp = t_1;
} else if ((x * x) <= 1.85e+37) {
tmp = t_2;
} else if ((x * x) <= 3.8e+264) {
tmp = t_1;
} else {
tmp = x * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * x) - ((y * 4.0d0) * ((z * z) - t))
end function
↓
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * x) - (z * (z * (y * 4.0d0)))
t_2 = 4.0d0 * (y * (t - (z * z)))
if ((x * x) <= 5.6d-68) then
tmp = t_2
else if ((x * x) <= 5d-5) then
tmp = t_1
else if ((x * x) <= 1.85d+37) then
tmp = t_2
else if ((x * x) <= 3.8d+264) then
tmp = t_1
else
tmp = x * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
↓
public static double code(double x, double y, double z, double t) {
double t_1 = (x * x) - (z * (z * (y * 4.0)));
double t_2 = 4.0 * (y * (t - (z * z)));
double tmp;
if ((x * x) <= 5.6e-68) {
tmp = t_2;
} else if ((x * x) <= 5e-5) {
tmp = t_1;
} else if ((x * x) <= 1.85e+37) {
tmp = t_2;
} else if ((x * x) <= 3.8e+264) {
tmp = t_1;
} else {
tmp = x * x;
}
return tmp;
}
def code(x, y, z, t):
return (x * x) - ((y * 4.0) * ((z * z) - t))
↓
def code(x, y, z, t):
t_1 = (x * x) - (z * (z * (y * 4.0)))
t_2 = 4.0 * (y * (t - (z * z)))
tmp = 0
if (x * x) <= 5.6e-68:
tmp = t_2
elif (x * x) <= 5e-5:
tmp = t_1
elif (x * x) <= 1.85e+37:
tmp = t_2
elif (x * x) <= 3.8e+264:
tmp = t_1
else:
tmp = x * x
return tmp
function code(x, y, z, t)
return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t)))
end
↓
function code(x, y, z, t)
t_1 = Float64(Float64(x * x) - Float64(z * Float64(z * Float64(y * 4.0))))
t_2 = Float64(4.0 * Float64(y * Float64(t - Float64(z * z))))
tmp = 0.0
if (Float64(x * x) <= 5.6e-68)
tmp = t_2;
elseif (Float64(x * x) <= 5e-5)
tmp = t_1;
elseif (Float64(x * x) <= 1.85e+37)
tmp = t_2;
elseif (Float64(x * x) <= 3.8e+264)
tmp = t_1;
else
tmp = Float64(x * x);
end
return tmp
end
function tmp = code(x, y, z, t)
tmp = (x * x) - ((y * 4.0) * ((z * z) - t));
end
↓
function tmp_2 = code(x, y, z, t)
t_1 = (x * x) - (z * (z * (y * 4.0)));
t_2 = 4.0 * (y * (t - (z * z)));
tmp = 0.0;
if ((x * x) <= 5.6e-68)
tmp = t_2;
elseif ((x * x) <= 5e-5)
tmp = t_1;
elseif ((x * x) <= 1.85e+37)
tmp = t_2;
elseif ((x * x) <= 3.8e+264)
tmp = t_1;
else
tmp = x * x;
end
tmp_2 = tmp;
end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] - N[(z * N[(z * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(y * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 5.6e-68], t$95$2, If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], t$95$1, If[LessEqual[N[(x * x), $MachinePrecision], 1.85e+37], t$95$2, If[LessEqual[N[(x * x), $MachinePrecision], 3.8e+264], t$95$1, N[(x * x), $MachinePrecision]]]]]]]
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
↓
\begin{array}{l}
t_1 := x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\
t_2 := 4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\\
\mathbf{if}\;x \cdot x \leq 5.6 \cdot 10^{-68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot x \leq 1.85 \cdot 10^{+37}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot x \leq 3.8 \cdot 10^{+264}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
Alternatives Alternative 1 Accuracy 39.7% Cost 7368
\[\begin{array}{l}
\mathbf{if}\;z \leq 1.65 \cdot 10^{+167}:\\
\;\;\;\;-4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(-4 \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\
\end{array}
\]
Alternative 2 Accuracy 86.1% Cost 1096
\[\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{+42}:\\
\;\;\;\;x \cdot x - t \cdot \left(-4 \cdot y\right)\\
\mathbf{elif}\;z \cdot z \leq 10^{+265}:\\
\;\;\;\;4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\\
\end{array}
\]
Alternative 3 Accuracy 39.7% Cost 1096
\[\begin{array}{l}
\mathbf{if}\;z \leq 1.65 \cdot 10^{+167}:\\
\;\;\;\;-4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+136}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - z \cdot \left(z \cdot \left(y \cdot 4\right)\right)\\
\end{array}
\]
Alternative 4 Accuracy 39.5% Cost 976
\[\begin{array}{l}
t_1 := -4 \cdot \left(z \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq 1.4 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-141}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{-182}:\\
\;\;\;\;t \cdot \left(y \cdot 4\right)\\
\mathbf{elif}\;z \leq 4.05 \cdot 10^{+18}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Accuracy 41.6% Cost 840
\[\begin{array}{l}
\mathbf{if}\;x \leq 10^{+132}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+19}:\\
\;\;\;\;4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
Alternative 6 Accuracy 41.6% Cost 585
\[\begin{array}{l}
\mathbf{if}\;x \leq 3.5 \cdot 10^{+43} \lor \neg \left(x \leq 1.45 \cdot 10^{+19}\right):\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \left(y \cdot t\right)\\
\end{array}
\]
Alternative 7 Accuracy 41.6% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq 3.4 \cdot 10^{+43}:\\
\;\;\;\;x \cdot x\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+21}:\\
\;\;\;\;t \cdot \left(y \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\]
Alternative 8 Accuracy 41.6% Cost 192
\[x \cdot x
\]