
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
(FPCore (x y) :precision binary64 (let* ((t_0 (+ y (+ -2.0 x)))) (- (/ y t_0) (/ x t_0))))
double code(double x, double y) {
double t_0 = y + (-2.0 + x);
return (y / t_0) - (x / t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = y + ((-2.0d0) + x)
code = (y / t_0) - (x / t_0)
end function
public static double code(double x, double y) {
double t_0 = y + (-2.0 + x);
return (y / t_0) - (x / t_0);
}
def code(x, y): t_0 = y + (-2.0 + x) return (y / t_0) - (x / t_0)
function code(x, y) t_0 = Float64(y + Float64(-2.0 + x)) return Float64(Float64(y / t_0) - Float64(x / t_0)) end
function tmp = code(x, y) t_0 = y + (-2.0 + x); tmp = (y / t_0) - (x / t_0); end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(-2.0 + x), $MachinePrecision]), $MachinePrecision]}, N[(N[(y / t$95$0), $MachinePrecision] - N[(x / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(-2 + x\right)\\
\frac{y}{t\_0} - \frac{x}{t\_0}
\end{array}
\end{array}
Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
div-sub100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= x -1.25e+111)
-1.0
(if (<= x -2.25e+86)
1.0
(if (<= x -2400000.0)
-1.0
(if (<= x -1.35e-212)
1.0
(if (<= x -1.4e-263)
(* y -0.5)
(if (<= x 6.5e-126)
1.0
(if (<= x 3.1e-81) (* x 0.5) (if (<= x 1.65e+20) 1.0 -1.0)))))))))
double code(double x, double y) {
double tmp;
if (x <= -1.25e+111) {
tmp = -1.0;
} else if (x <= -2.25e+86) {
tmp = 1.0;
} else if (x <= -2400000.0) {
tmp = -1.0;
} else if (x <= -1.35e-212) {
tmp = 1.0;
} else if (x <= -1.4e-263) {
tmp = y * -0.5;
} else if (x <= 6.5e-126) {
tmp = 1.0;
} else if (x <= 3.1e-81) {
tmp = x * 0.5;
} else if (x <= 1.65e+20) {
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
real(8) :: tmp
if (x <= (-1.25d+111)) then
tmp = -1.0d0
else if (x <= (-2.25d+86)) then
tmp = 1.0d0
else if (x <= (-2400000.0d0)) then
tmp = -1.0d0
else if (x <= (-1.35d-212)) then
tmp = 1.0d0
else if (x <= (-1.4d-263)) then
tmp = y * (-0.5d0)
else if (x <= 6.5d-126) then
tmp = 1.0d0
else if (x <= 3.1d-81) then
tmp = x * 0.5d0
else if (x <= 1.65d+20) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.25e+111) {
tmp = -1.0;
} else if (x <= -2.25e+86) {
tmp = 1.0;
} else if (x <= -2400000.0) {
tmp = -1.0;
} else if (x <= -1.35e-212) {
tmp = 1.0;
} else if (x <= -1.4e-263) {
tmp = y * -0.5;
} else if (x <= 6.5e-126) {
tmp = 1.0;
} else if (x <= 3.1e-81) {
tmp = x * 0.5;
} else if (x <= 1.65e+20) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.25e+111: tmp = -1.0 elif x <= -2.25e+86: tmp = 1.0 elif x <= -2400000.0: tmp = -1.0 elif x <= -1.35e-212: tmp = 1.0 elif x <= -1.4e-263: tmp = y * -0.5 elif x <= 6.5e-126: tmp = 1.0 elif x <= 3.1e-81: tmp = x * 0.5 elif x <= 1.65e+20: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -1.25e+111) tmp = -1.0; elseif (x <= -2.25e+86) tmp = 1.0; elseif (x <= -2400000.0) tmp = -1.0; elseif (x <= -1.35e-212) tmp = 1.0; elseif (x <= -1.4e-263) tmp = Float64(y * -0.5); elseif (x <= 6.5e-126) tmp = 1.0; elseif (x <= 3.1e-81) tmp = Float64(x * 0.5); elseif (x <= 1.65e+20) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.25e+111) tmp = -1.0; elseif (x <= -2.25e+86) tmp = 1.0; elseif (x <= -2400000.0) tmp = -1.0; elseif (x <= -1.35e-212) tmp = 1.0; elseif (x <= -1.4e-263) tmp = y * -0.5; elseif (x <= 6.5e-126) tmp = 1.0; elseif (x <= 3.1e-81) tmp = x * 0.5; elseif (x <= 1.65e+20) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.25e+111], -1.0, If[LessEqual[x, -2.25e+86], 1.0, If[LessEqual[x, -2400000.0], -1.0, If[LessEqual[x, -1.35e-212], 1.0, If[LessEqual[x, -1.4e-263], N[(y * -0.5), $MachinePrecision], If[LessEqual[x, 6.5e-126], 1.0, If[LessEqual[x, 3.1e-81], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 1.65e+20], 1.0, -1.0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+111}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -2.25 \cdot 10^{+86}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -2400000:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-212}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-263}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-126}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-81}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+20}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -1.2499999999999999e111 or -2.24999999999999996e86 < x < -2.4e6 or 1.65e20 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 84.6%
if -1.2499999999999999e111 < x < -2.24999999999999996e86 or -2.4e6 < x < -1.34999999999999991e-212 or -1.4e-263 < x < 6.50000000000000014e-126 or 3.09999999999999988e-81 < x < 1.65e20Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 63.2%
if -1.34999999999999991e-212 < x < -1.4e-263Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 82.7%
Taylor expanded in y around 0 69.8%
*-commutative69.8%
Simplified69.8%
if 6.50000000000000014e-126 < x < 3.09999999999999988e-81Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 74.2%
mul-1-neg74.2%
distribute-neg-frac274.2%
neg-sub074.2%
associate-+l-74.2%
neg-sub074.2%
+-commutative74.2%
unsub-neg74.2%
Simplified74.2%
Taylor expanded in x around 0 74.2%
*-commutative74.2%
Simplified74.2%
Final simplification73.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (- 2.0 x)))
(t_1 (- -1.0 (/ (* y -2.0) x)))
(t_2 (/ y (- y 2.0))))
(if (<= x -5e+110)
t_1
(if (<= x -2.25e+86)
1.0
(if (<= x -45.0)
t_0
(if (<= x 8.5e-126)
t_2
(if (<= x 1.95e-81) t_0 (if (<= x 5.8e+19) t_2 t_1))))))))
double code(double x, double y) {
double t_0 = x / (2.0 - x);
double t_1 = -1.0 - ((y * -2.0) / x);
double t_2 = y / (y - 2.0);
double tmp;
if (x <= -5e+110) {
tmp = t_1;
} else if (x <= -2.25e+86) {
tmp = 1.0;
} else if (x <= -45.0) {
tmp = t_0;
} else if (x <= 8.5e-126) {
tmp = t_2;
} else if (x <= 1.95e-81) {
tmp = t_0;
} else if (x <= 5.8e+19) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
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) :: t_2
real(8) :: tmp
t_0 = x / (2.0d0 - x)
t_1 = (-1.0d0) - ((y * (-2.0d0)) / x)
t_2 = y / (y - 2.0d0)
if (x <= (-5d+110)) then
tmp = t_1
else if (x <= (-2.25d+86)) then
tmp = 1.0d0
else if (x <= (-45.0d0)) then
tmp = t_0
else if (x <= 8.5d-126) then
tmp = t_2
else if (x <= 1.95d-81) then
tmp = t_0
else if (x <= 5.8d+19) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (2.0 - x);
double t_1 = -1.0 - ((y * -2.0) / x);
double t_2 = y / (y - 2.0);
double tmp;
if (x <= -5e+110) {
tmp = t_1;
} else if (x <= -2.25e+86) {
tmp = 1.0;
} else if (x <= -45.0) {
tmp = t_0;
} else if (x <= 8.5e-126) {
tmp = t_2;
} else if (x <= 1.95e-81) {
tmp = t_0;
} else if (x <= 5.8e+19) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = x / (2.0 - x) t_1 = -1.0 - ((y * -2.0) / x) t_2 = y / (y - 2.0) tmp = 0 if x <= -5e+110: tmp = t_1 elif x <= -2.25e+86: tmp = 1.0 elif x <= -45.0: tmp = t_0 elif x <= 8.5e-126: tmp = t_2 elif x <= 1.95e-81: tmp = t_0 elif x <= 5.8e+19: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(x / Float64(2.0 - x)) t_1 = Float64(-1.0 - Float64(Float64(y * -2.0) / x)) t_2 = Float64(y / Float64(y - 2.0)) tmp = 0.0 if (x <= -5e+110) tmp = t_1; elseif (x <= -2.25e+86) tmp = 1.0; elseif (x <= -45.0) tmp = t_0; elseif (x <= 8.5e-126) tmp = t_2; elseif (x <= 1.95e-81) tmp = t_0; elseif (x <= 5.8e+19) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (2.0 - x); t_1 = -1.0 - ((y * -2.0) / x); t_2 = y / (y - 2.0); tmp = 0.0; if (x <= -5e+110) tmp = t_1; elseif (x <= -2.25e+86) tmp = 1.0; elseif (x <= -45.0) tmp = t_0; elseif (x <= 8.5e-126) tmp = t_2; elseif (x <= 1.95e-81) tmp = t_0; elseif (x <= 5.8e+19) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 - N[(N[(y * -2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e+110], t$95$1, If[LessEqual[x, -2.25e+86], 1.0, If[LessEqual[x, -45.0], t$95$0, If[LessEqual[x, 8.5e-126], t$95$2, If[LessEqual[x, 1.95e-81], t$95$0, If[LessEqual[x, 5.8e+19], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{2 - x}\\
t_1 := -1 - \frac{y \cdot -2}{x}\\
t_2 := \frac{y}{y - 2}\\
\mathbf{if}\;x \leq -5 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.25 \cdot 10^{+86}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -45:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-126}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-81}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.99999999999999978e110 or 5.8e19 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 86.2%
sub-neg86.2%
+-commutative86.2%
distribute-neg-in86.2%
metadata-eval86.2%
mul-1-neg86.2%
remove-double-neg86.2%
associate-+l+86.3%
remove-double-neg86.3%
mul-1-neg86.3%
neg-sub086.3%
associate--r-86.3%
associate-*r/86.3%
sub-neg86.3%
metadata-eval86.3%
+-commutative86.3%
distribute-lft-in86.3%
metadata-eval86.3%
div-sub86.3%
Simplified86.3%
Taylor expanded in y around inf 86.3%
associate-*r/86.3%
*-commutative86.3%
Simplified86.3%
if -4.99999999999999978e110 < x < -2.24999999999999996e86Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
if -2.24999999999999996e86 < x < -45 or 8.49999999999999938e-126 < x < 1.94999999999999992e-81Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 78.7%
mul-1-neg78.7%
distribute-neg-frac278.7%
neg-sub078.7%
associate-+l-78.7%
neg-sub078.7%
+-commutative78.7%
unsub-neg78.7%
Simplified78.7%
if -45 < x < 8.49999999999999938e-126 or 1.94999999999999992e-81 < x < 5.8e19Initial program 99.9%
remove-double-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 82.1%
Final simplification83.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (- y 2.0))) (t_1 (/ x (- 2.0 x))))
(if (<= x -4.5e+110)
-1.0
(if (<= x -2e+86)
1.0
(if (<= x -6.5e-15)
t_1
(if (<= x 8.5e-126)
t_0
(if (<= x 1.75e-81) t_1 (if (<= x 3e+29) t_0 -1.0))))))))
double code(double x, double y) {
double t_0 = y / (y - 2.0);
double t_1 = x / (2.0 - x);
double tmp;
if (x <= -4.5e+110) {
tmp = -1.0;
} else if (x <= -2e+86) {
tmp = 1.0;
} else if (x <= -6.5e-15) {
tmp = t_1;
} else if (x <= 8.5e-126) {
tmp = t_0;
} else if (x <= 1.75e-81) {
tmp = t_1;
} else if (x <= 3e+29) {
tmp = t_0;
} else {
tmp = -1.0;
}
return tmp;
}
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 - 2.0d0)
t_1 = x / (2.0d0 - x)
if (x <= (-4.5d+110)) then
tmp = -1.0d0
else if (x <= (-2d+86)) then
tmp = 1.0d0
else if (x <= (-6.5d-15)) then
tmp = t_1
else if (x <= 8.5d-126) then
tmp = t_0
else if (x <= 1.75d-81) then
tmp = t_1
else if (x <= 3d+29) then
tmp = t_0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (y - 2.0);
double t_1 = x / (2.0 - x);
double tmp;
if (x <= -4.5e+110) {
tmp = -1.0;
} else if (x <= -2e+86) {
tmp = 1.0;
} else if (x <= -6.5e-15) {
tmp = t_1;
} else if (x <= 8.5e-126) {
tmp = t_0;
} else if (x <= 1.75e-81) {
tmp = t_1;
} else if (x <= 3e+29) {
tmp = t_0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): t_0 = y / (y - 2.0) t_1 = x / (2.0 - x) tmp = 0 if x <= -4.5e+110: tmp = -1.0 elif x <= -2e+86: tmp = 1.0 elif x <= -6.5e-15: tmp = t_1 elif x <= 8.5e-126: tmp = t_0 elif x <= 1.75e-81: tmp = t_1 elif x <= 3e+29: tmp = t_0 else: tmp = -1.0 return tmp
function code(x, y) t_0 = Float64(y / Float64(y - 2.0)) t_1 = Float64(x / Float64(2.0 - x)) tmp = 0.0 if (x <= -4.5e+110) tmp = -1.0; elseif (x <= -2e+86) tmp = 1.0; elseif (x <= -6.5e-15) tmp = t_1; elseif (x <= 8.5e-126) tmp = t_0; elseif (x <= 1.75e-81) tmp = t_1; elseif (x <= 3e+29) tmp = t_0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y - 2.0); t_1 = x / (2.0 - x); tmp = 0.0; if (x <= -4.5e+110) tmp = -1.0; elseif (x <= -2e+86) tmp = 1.0; elseif (x <= -6.5e-15) tmp = t_1; elseif (x <= 8.5e-126) tmp = t_0; elseif (x <= 1.75e-81) tmp = t_1; elseif (x <= 3e+29) tmp = t_0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.5e+110], -1.0, If[LessEqual[x, -2e+86], 1.0, If[LessEqual[x, -6.5e-15], t$95$1, If[LessEqual[x, 8.5e-126], t$95$0, If[LessEqual[x, 1.75e-81], t$95$1, If[LessEqual[x, 3e+29], t$95$0, -1.0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y - 2}\\
t_1 := \frac{x}{2 - x}\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{+110}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{+86}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-126}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+29}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -4.5000000000000003e110 or 2.9999999999999999e29 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 85.8%
if -4.5000000000000003e110 < x < -2e86Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
if -2e86 < x < -6.49999999999999991e-15 or 8.49999999999999938e-126 < x < 1.74999999999999993e-81Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 78.7%
mul-1-neg78.7%
distribute-neg-frac278.7%
neg-sub078.7%
associate-+l-78.7%
neg-sub078.7%
+-commutative78.7%
unsub-neg78.7%
Simplified78.7%
if -6.49999999999999991e-15 < x < 8.49999999999999938e-126 or 1.74999999999999993e-81 < x < 2.9999999999999999e29Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 81.7%
Final simplification83.3%
(FPCore (x y)
:precision binary64
(if (<= x -4.5e+110)
-1.0
(if (<= x -7.5e+83)
1.0
(if (<= x -3250000.0)
-1.0
(if (<= x 1.2e-126)
1.0
(if (<= x 1.75e-81) (* x 0.5) (if (<= x 2.4e+19) 1.0 -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= -4.5e+110) {
tmp = -1.0;
} else if (x <= -7.5e+83) {
tmp = 1.0;
} else if (x <= -3250000.0) {
tmp = -1.0;
} else if (x <= 1.2e-126) {
tmp = 1.0;
} else if (x <= 1.75e-81) {
tmp = x * 0.5;
} else if (x <= 2.4e+19) {
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
real(8) :: tmp
if (x <= (-4.5d+110)) then
tmp = -1.0d0
else if (x <= (-7.5d+83)) then
tmp = 1.0d0
else if (x <= (-3250000.0d0)) then
tmp = -1.0d0
else if (x <= 1.2d-126) then
tmp = 1.0d0
else if (x <= 1.75d-81) then
tmp = x * 0.5d0
else if (x <= 2.4d+19) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.5e+110) {
tmp = -1.0;
} else if (x <= -7.5e+83) {
tmp = 1.0;
} else if (x <= -3250000.0) {
tmp = -1.0;
} else if (x <= 1.2e-126) {
tmp = 1.0;
} else if (x <= 1.75e-81) {
tmp = x * 0.5;
} else if (x <= 2.4e+19) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.5e+110: tmp = -1.0 elif x <= -7.5e+83: tmp = 1.0 elif x <= -3250000.0: tmp = -1.0 elif x <= 1.2e-126: tmp = 1.0 elif x <= 1.75e-81: tmp = x * 0.5 elif x <= 2.4e+19: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -4.5e+110) tmp = -1.0; elseif (x <= -7.5e+83) tmp = 1.0; elseif (x <= -3250000.0) tmp = -1.0; elseif (x <= 1.2e-126) tmp = 1.0; elseif (x <= 1.75e-81) tmp = Float64(x * 0.5); elseif (x <= 2.4e+19) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.5e+110) tmp = -1.0; elseif (x <= -7.5e+83) tmp = 1.0; elseif (x <= -3250000.0) tmp = -1.0; elseif (x <= 1.2e-126) tmp = 1.0; elseif (x <= 1.75e-81) tmp = x * 0.5; elseif (x <= 2.4e+19) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.5e+110], -1.0, If[LessEqual[x, -7.5e+83], 1.0, If[LessEqual[x, -3250000.0], -1.0, If[LessEqual[x, 1.2e-126], 1.0, If[LessEqual[x, 1.75e-81], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 2.4e+19], 1.0, -1.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+110}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{+83}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -3250000:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-126}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-81}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+19}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -4.5000000000000003e110 or -7.49999999999999989e83 < x < -3.25e6 or 2.4e19 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 84.6%
if -4.5000000000000003e110 < x < -7.49999999999999989e83 or -3.25e6 < x < 1.20000000000000003e-126 or 1.74999999999999993e-81 < x < 2.4e19Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.0%
if 1.20000000000000003e-126 < x < 1.74999999999999993e-81Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 74.2%
mul-1-neg74.2%
distribute-neg-frac274.2%
neg-sub074.2%
associate-+l-74.2%
neg-sub074.2%
+-commutative74.2%
unsub-neg74.2%
Simplified74.2%
Taylor expanded in x around 0 74.2%
*-commutative74.2%
Simplified74.2%
Final simplification71.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (- 2.0 x))))
(if (<= y -4e+84)
1.0
(if (<= y -1.6e-160)
t_0
(if (<= y -4.6e-196) (* y -0.5) (if (<= y 1.2e+42) t_0 1.0))))))
double code(double x, double y) {
double t_0 = x / (2.0 - x);
double tmp;
if (y <= -4e+84) {
tmp = 1.0;
} else if (y <= -1.6e-160) {
tmp = t_0;
} else if (y <= -4.6e-196) {
tmp = y * -0.5;
} else if (y <= 1.2e+42) {
tmp = t_0;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (2.0d0 - x)
if (y <= (-4d+84)) then
tmp = 1.0d0
else if (y <= (-1.6d-160)) then
tmp = t_0
else if (y <= (-4.6d-196)) then
tmp = y * (-0.5d0)
else if (y <= 1.2d+42) then
tmp = t_0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (2.0 - x);
double tmp;
if (y <= -4e+84) {
tmp = 1.0;
} else if (y <= -1.6e-160) {
tmp = t_0;
} else if (y <= -4.6e-196) {
tmp = y * -0.5;
} else if (y <= 1.2e+42) {
tmp = t_0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): t_0 = x / (2.0 - x) tmp = 0 if y <= -4e+84: tmp = 1.0 elif y <= -1.6e-160: tmp = t_0 elif y <= -4.6e-196: tmp = y * -0.5 elif y <= 1.2e+42: tmp = t_0 else: tmp = 1.0 return tmp
function code(x, y) t_0 = Float64(x / Float64(2.0 - x)) tmp = 0.0 if (y <= -4e+84) tmp = 1.0; elseif (y <= -1.6e-160) tmp = t_0; elseif (y <= -4.6e-196) tmp = Float64(y * -0.5); elseif (y <= 1.2e+42) tmp = t_0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (2.0 - x); tmp = 0.0; if (y <= -4e+84) tmp = 1.0; elseif (y <= -1.6e-160) tmp = t_0; elseif (y <= -4.6e-196) tmp = y * -0.5; elseif (y <= 1.2e+42) tmp = t_0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e+84], 1.0, If[LessEqual[y, -1.6e-160], t$95$0, If[LessEqual[y, -4.6e-196], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 1.2e+42], t$95$0, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{2 - x}\\
\mathbf{if}\;y \leq -4 \cdot 10^{+84}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{-160}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-196}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+42}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -4.00000000000000023e84 or 1.1999999999999999e42 < y Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 83.1%
if -4.00000000000000023e84 < y < -1.60000000000000004e-160 or -4.6000000000000004e-196 < y < 1.1999999999999999e42Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 72.5%
mul-1-neg72.5%
distribute-neg-frac272.5%
neg-sub072.5%
associate-+l-72.5%
neg-sub072.5%
+-commutative72.5%
unsub-neg72.5%
Simplified72.5%
if -1.60000000000000004e-160 < y < -4.6000000000000004e-196Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 86.0%
Taylor expanded in y around 0 86.0%
*-commutative86.0%
Simplified86.0%
Final simplification76.8%
(FPCore (x y)
:precision binary64
(if (<= x -1e+111)
-1.0
(if (<= x -2.1e+86)
1.0
(if (<= x -3300000.0) -1.0 (if (<= x 1.95e+23) 1.0 -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1e+111) {
tmp = -1.0;
} else if (x <= -2.1e+86) {
tmp = 1.0;
} else if (x <= -3300000.0) {
tmp = -1.0;
} else if (x <= 1.95e+23) {
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
real(8) :: tmp
if (x <= (-1d+111)) then
tmp = -1.0d0
else if (x <= (-2.1d+86)) then
tmp = 1.0d0
else if (x <= (-3300000.0d0)) then
tmp = -1.0d0
else if (x <= 1.95d+23) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1e+111) {
tmp = -1.0;
} else if (x <= -2.1e+86) {
tmp = 1.0;
} else if (x <= -3300000.0) {
tmp = -1.0;
} else if (x <= 1.95e+23) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1e+111: tmp = -1.0 elif x <= -2.1e+86: tmp = 1.0 elif x <= -3300000.0: tmp = -1.0 elif x <= 1.95e+23: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -1e+111) tmp = -1.0; elseif (x <= -2.1e+86) tmp = 1.0; elseif (x <= -3300000.0) tmp = -1.0; elseif (x <= 1.95e+23) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1e+111) tmp = -1.0; elseif (x <= -2.1e+86) tmp = 1.0; elseif (x <= -3300000.0) tmp = -1.0; elseif (x <= 1.95e+23) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1e+111], -1.0, If[LessEqual[x, -2.1e+86], 1.0, If[LessEqual[x, -3300000.0], -1.0, If[LessEqual[x, 1.95e+23], 1.0, -1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+111}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{+86}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -3300000:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+23}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -9.99999999999999957e110 or -2.0999999999999999e86 < x < -3.3e6 or 1.95e23 < x Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 84.6%
if -9.99999999999999957e110 < x < -2.0999999999999999e86 or -3.3e6 < x < 1.95e23Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 55.9%
Final simplification68.8%
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ y x))))
double code(double x, double y) {
return (x - y) / (2.0 - (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (y + x))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (y + x));
}
def code(x, y): return (x - y) / (2.0 - (y + x))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(y + x))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (y + x)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(y + x\right)}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 -1.0)
double code(double x, double y) {
return -1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -1.0d0
end function
public static double code(double x, double y) {
return -1.0;
}
def code(x, y): return -1.0
function code(x, y) return -1.0 end
function tmp = code(x, y) tmp = -1.0; end
code[x_, y_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 100.0%
remove-double-neg100.0%
+-commutative100.0%
distribute-neg-frac2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 39.9%
Final simplification39.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (- 2.0 (+ x y)))) (- (/ x t_0) (/ y t_0))))
double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = 2.0d0 - (x + y)
code = (x / t_0) - (y / t_0)
end function
public static double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
def code(x, y): t_0 = 2.0 - (x + y) return (x / t_0) - (y / t_0)
function code(x, y) t_0 = Float64(2.0 - Float64(x + y)) return Float64(Float64(x / t_0) - Float64(y / t_0)) end
function tmp = code(x, y) t_0 = 2.0 - (x + y); tmp = (x / t_0) - (y / t_0); end
code[x_, y_] := Block[{t$95$0 = N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]}, N[(N[(x / t$95$0), $MachinePrecision] - N[(y / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 - \left(x + y\right)\\
\frac{x}{t\_0} - \frac{y}{t\_0}
\end{array}
\end{array}
herbie shell --seed 2024054
(FPCore (x y)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, C"
:precision binary64
:alt
(- (/ x (- 2.0 (+ x y))) (/ y (- 2.0 (+ x y))))
(/ (- x y) (- 2.0 (+ x y))))