Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}
\]
↓
\[\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := x + \left(y + y\right)\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+102}:\\
\;\;\;\;\frac{t_1}{x}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-162}:\\
\;\;\;\;2 \cdot \frac{x \cdot x - t_0}{y \cdot \left(y \cdot 8\right) + x \cdot \left(x \cdot 2\right)}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-100}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+111}:\\
\;\;\;\;\left(1 - \frac{y + \left(y - x\right)}{\frac{x \cdot x + t_0}{t_1}}\right) + -1\\
\mathbf{elif}\;x \leq 10^{+129}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
(FPCore (x y)
:precision binary64
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y)))) ↓
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y 4.0))) (t_1 (+ x (+ y y))))
(if (<= x -1.4e+102)
(/ t_1 x)
(if (<= x -4.8e-162)
(* 2.0 (/ (- (* x x) t_0) (+ (* y (* y 8.0)) (* x (* x 2.0)))))
(if (<= x 1.3e-100)
-1.0
(if (<= x 5.2e+111)
(+ (- 1.0 (/ (+ y (- y x)) (/ (+ (* x x) t_0) t_1))) -1.0)
(if (<= x 1e+129) -1.0 1.0))))))) double code(double x, double y) {
return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
}
↓
double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = x + (y + y);
double tmp;
if (x <= -1.4e+102) {
tmp = t_1 / x;
} else if (x <= -4.8e-162) {
tmp = 2.0 * (((x * x) - t_0) / ((y * (y * 8.0)) + (x * (x * 2.0))));
} else if (x <= 1.3e-100) {
tmp = -1.0;
} else if (x <= 5.2e+111) {
tmp = (1.0 - ((y + (y - x)) / (((x * x) + t_0) / t_1))) + -1.0;
} else if (x <= 1e+129) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x * x) - ((y * 4.0d0) * y)) / ((x * x) + ((y * 4.0d0) * y))
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * (y * 4.0d0)
t_1 = x + (y + y)
if (x <= (-1.4d+102)) then
tmp = t_1 / x
else if (x <= (-4.8d-162)) then
tmp = 2.0d0 * (((x * x) - t_0) / ((y * (y * 8.0d0)) + (x * (x * 2.0d0))))
else if (x <= 1.3d-100) then
tmp = -1.0d0
else if (x <= 5.2d+111) then
tmp = (1.0d0 - ((y + (y - x)) / (((x * x) + t_0) / t_1))) + (-1.0d0)
else if (x <= 1d+129) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
}
↓
public static double code(double x, double y) {
double t_0 = y * (y * 4.0);
double t_1 = x + (y + y);
double tmp;
if (x <= -1.4e+102) {
tmp = t_1 / x;
} else if (x <= -4.8e-162) {
tmp = 2.0 * (((x * x) - t_0) / ((y * (y * 8.0)) + (x * (x * 2.0))));
} else if (x <= 1.3e-100) {
tmp = -1.0;
} else if (x <= 5.2e+111) {
tmp = (1.0 - ((y + (y - x)) / (((x * x) + t_0) / t_1))) + -1.0;
} else if (x <= 1e+129) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y):
return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y))
↓
def code(x, y):
t_0 = y * (y * 4.0)
t_1 = x + (y + y)
tmp = 0
if x <= -1.4e+102:
tmp = t_1 / x
elif x <= -4.8e-162:
tmp = 2.0 * (((x * x) - t_0) / ((y * (y * 8.0)) + (x * (x * 2.0))))
elif x <= 1.3e-100:
tmp = -1.0
elif x <= 5.2e+111:
tmp = (1.0 - ((y + (y - x)) / (((x * x) + t_0) / t_1))) + -1.0
elif x <= 1e+129:
tmp = -1.0
else:
tmp = 1.0
return tmp
function code(x, y)
return Float64(Float64(Float64(x * x) - Float64(Float64(y * 4.0) * y)) / Float64(Float64(x * x) + Float64(Float64(y * 4.0) * y)))
end
↓
function code(x, y)
t_0 = Float64(y * Float64(y * 4.0))
t_1 = Float64(x + Float64(y + y))
tmp = 0.0
if (x <= -1.4e+102)
tmp = Float64(t_1 / x);
elseif (x <= -4.8e-162)
tmp = Float64(2.0 * Float64(Float64(Float64(x * x) - t_0) / Float64(Float64(y * Float64(y * 8.0)) + Float64(x * Float64(x * 2.0)))));
elseif (x <= 1.3e-100)
tmp = -1.0;
elseif (x <= 5.2e+111)
tmp = Float64(Float64(1.0 - Float64(Float64(y + Float64(y - x)) / Float64(Float64(Float64(x * x) + t_0) / t_1))) + -1.0);
elseif (x <= 1e+129)
tmp = -1.0;
else
tmp = 1.0;
end
return tmp
end
function tmp = code(x, y)
tmp = ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
end
↓
function tmp_2 = code(x, y)
t_0 = y * (y * 4.0);
t_1 = x + (y + y);
tmp = 0.0;
if (x <= -1.4e+102)
tmp = t_1 / x;
elseif (x <= -4.8e-162)
tmp = 2.0 * (((x * x) - t_0) / ((y * (y * 8.0)) + (x * (x * 2.0))));
elseif (x <= 1.3e-100)
tmp = -1.0;
elseif (x <= 5.2e+111)
tmp = (1.0 - ((y + (y - x)) / (((x * x) + t_0) / t_1))) + -1.0;
elseif (x <= 1e+129)
tmp = -1.0;
else
tmp = 1.0;
end
tmp_2 = tmp;
end
code[x_, y_] := N[(N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e+102], N[(t$95$1 / x), $MachinePrecision], If[LessEqual[x, -4.8e-162], N[(2.0 * N[(N[(N[(x * x), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(N[(y * N[(y * 8.0), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-100], -1.0, If[LessEqual[x, 5.2e+111], N[(N[(1.0 - N[(N[(y + N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(x * x), $MachinePrecision] + t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[x, 1e+129], -1.0, 1.0]]]]]]]
\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}
↓
\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := x + \left(y + y\right)\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+102}:\\
\;\;\;\;\frac{t_1}{x}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-162}:\\
\;\;\;\;2 \cdot \frac{x \cdot x - t_0}{y \cdot \left(y \cdot 8\right) + x \cdot \left(x \cdot 2\right)}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-100}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+111}:\\
\;\;\;\;\left(1 - \frac{y + \left(y - x\right)}{\frac{x \cdot x + t_0}{t_1}}\right) + -1\\
\mathbf{elif}\;x \leq 10^{+129}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
Alternatives Alternative 1 Error 12.3 Cost 1936
\[\begin{array}{l}
t_0 := x + \left(y + y\right)\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+101}:\\
\;\;\;\;\frac{t_0}{x}\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-162}:\\
\;\;\;\;\frac{\left(\left(y + y\right) + x\right) \cdot \left(x - \left(y + y\right)\right)}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{-102}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+111}:\\
\;\;\;\;\frac{y + \left(y - x\right)}{\frac{x \cdot x + y \cdot \left(y \cdot 4\right)}{-t_0}}\\
\mathbf{elif}\;x \leq 10^{+129}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 2 Error 12.4 Cost 1936
\[\begin{array}{l}
t_0 := y \cdot \left(y \cdot 4\right)\\
t_1 := x + \left(y + y\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+103}:\\
\;\;\;\;\frac{t_1}{x}\\
\mathbf{elif}\;x \leq -5.3 \cdot 10^{-162}:\\
\;\;\;\;2 \cdot \frac{x \cdot x - t_0}{y \cdot \left(y \cdot 8\right) + x \cdot \left(x \cdot 2\right)}\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-100}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+111}:\\
\;\;\;\;\frac{y + \left(y - x\right)}{\frac{x \cdot x + t_0}{-t_1}}\\
\mathbf{elif}\;x \leq 10^{+129}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 3 Error 12.4 Cost 1872
\[\begin{array}{l}
t_0 := \left(y \cdot 4\right) \cdot y\\
\mathbf{if}\;x \leq -1.72 \cdot 10^{+103}:\\
\;\;\;\;\frac{x + \left(y + y\right)}{x}\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-162}:\\
\;\;\;\;\frac{x \cdot x - t_0}{x \cdot x + t_0}\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-101}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+111}:\\
\;\;\;\;\frac{y + \left(y + x\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)} \cdot \left(x - \left(y + y\right)\right)\\
\mathbf{elif}\;x \leq 10^{+129}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 4 Error 12.4 Cost 1872
\[\begin{array}{l}
t_0 := x - \left(y + y\right)\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+103}:\\
\;\;\;\;\frac{x + \left(y + y\right)}{x}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-162}:\\
\;\;\;\;\frac{\left(\left(y + y\right) + x\right) \cdot t_0}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{-103}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+111}:\\
\;\;\;\;\frac{y + \left(y + x\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)} \cdot t_0\\
\mathbf{elif}\;x \leq 10^{+129}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 5 Error 12.5 Cost 1744
\[\begin{array}{l}
t_0 := \left(y \cdot 4\right) \cdot y\\
t_1 := \frac{x \cdot x - t_0}{x \cdot x + t_0}\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+102}:\\
\;\;\;\;\frac{x + \left(y + y\right)}{x}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-162}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-90}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 10^{+129}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 6 Error 18.5 Cost 1372
\[\begin{array}{l}
t_0 := \frac{x + \left(y + y\right)}{x}\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.42 \cdot 10^{-52}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -5.9 \cdot 10^{-161}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-53}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-29}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-9}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+111}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 10^{+129}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 7 Error 16.2 Cost 328
\[\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-15}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+74}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
Alternative 8 Error 32.5 Cost 64
\[-1
\]