
(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 10 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 (/ (- 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}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (- 2.0 x))) (t_1 (* (- y x) -0.5)))
(if (<= y -0.68)
1.0
(if (<= y -2.9e-80)
t_1
(if (<= y 5e-130)
t_0
(if (<= y 5.9e-108)
t_1
(if (or (<= y 6.5e+46) (and (not (<= y 8.5e+91)) (<= y 8e+154)))
t_0
1.0)))))))
double code(double x, double y) {
double t_0 = x / (2.0 - x);
double t_1 = (y - x) * -0.5;
double tmp;
if (y <= -0.68) {
tmp = 1.0;
} else if (y <= -2.9e-80) {
tmp = t_1;
} else if (y <= 5e-130) {
tmp = t_0;
} else if (y <= 5.9e-108) {
tmp = t_1;
} else if ((y <= 6.5e+46) || (!(y <= 8.5e+91) && (y <= 8e+154))) {
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 = x / (2.0d0 - x)
t_1 = (y - x) * (-0.5d0)
if (y <= (-0.68d0)) then
tmp = 1.0d0
else if (y <= (-2.9d-80)) then
tmp = t_1
else if (y <= 5d-130) then
tmp = t_0
else if (y <= 5.9d-108) then
tmp = t_1
else if ((y <= 6.5d+46) .or. (.not. (y <= 8.5d+91)) .and. (y <= 8d+154)) 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 t_1 = (y - x) * -0.5;
double tmp;
if (y <= -0.68) {
tmp = 1.0;
} else if (y <= -2.9e-80) {
tmp = t_1;
} else if (y <= 5e-130) {
tmp = t_0;
} else if (y <= 5.9e-108) {
tmp = t_1;
} else if ((y <= 6.5e+46) || (!(y <= 8.5e+91) && (y <= 8e+154))) {
tmp = t_0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): t_0 = x / (2.0 - x) t_1 = (y - x) * -0.5 tmp = 0 if y <= -0.68: tmp = 1.0 elif y <= -2.9e-80: tmp = t_1 elif y <= 5e-130: tmp = t_0 elif y <= 5.9e-108: tmp = t_1 elif (y <= 6.5e+46) or (not (y <= 8.5e+91) and (y <= 8e+154)): tmp = t_0 else: tmp = 1.0 return tmp
function code(x, y) t_0 = Float64(x / Float64(2.0 - x)) t_1 = Float64(Float64(y - x) * -0.5) tmp = 0.0 if (y <= -0.68) tmp = 1.0; elseif (y <= -2.9e-80) tmp = t_1; elseif (y <= 5e-130) tmp = t_0; elseif (y <= 5.9e-108) tmp = t_1; elseif ((y <= 6.5e+46) || (!(y <= 8.5e+91) && (y <= 8e+154))) tmp = t_0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (2.0 - x); t_1 = (y - x) * -0.5; tmp = 0.0; if (y <= -0.68) tmp = 1.0; elseif (y <= -2.9e-80) tmp = t_1; elseif (y <= 5e-130) tmp = t_0; elseif (y <= 5.9e-108) tmp = t_1; elseif ((y <= 6.5e+46) || (~((y <= 8.5e+91)) && (y <= 8e+154))) 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]}, Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[y, -0.68], 1.0, If[LessEqual[y, -2.9e-80], t$95$1, If[LessEqual[y, 5e-130], t$95$0, If[LessEqual[y, 5.9e-108], t$95$1, If[Or[LessEqual[y, 6.5e+46], And[N[Not[LessEqual[y, 8.5e+91]], $MachinePrecision], LessEqual[y, 8e+154]]], t$95$0, 1.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{2 - x}\\
t_1 := \left(y - x\right) \cdot -0.5\\
\mathbf{if}\;y \leq -0.68:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-130}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 5.9 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+46} \lor \neg \left(y \leq 8.5 \cdot 10^{+91}\right) \land y \leq 8 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -0.680000000000000049 or 6.50000000000000008e46 < y < 8.4999999999999995e91 or 8.0000000000000003e154 < 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 86.2%
if -0.680000000000000049 < y < -2.89999999999999998e-80 or 4.9999999999999996e-130 < y < 5.89999999999999965e-108Initial 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%
clear-num99.7%
associate-/r/100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 76.1%
Taylor expanded in y around 0 71.9%
if -2.89999999999999998e-80 < y < 4.9999999999999996e-130 or 5.89999999999999965e-108 < y < 6.50000000000000008e46 or 8.4999999999999995e91 < y < 8.0000000000000003e154Initial 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 81.3%
mul-1-neg81.3%
distribute-neg-frac281.3%
neg-sub081.3%
associate-+l-81.3%
neg-sub081.3%
+-commutative81.3%
unsub-neg81.3%
Simplified81.3%
Final simplification82.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (- y x) -0.5)))
(if (<= x -7e+86)
-1.0
(if (<= x -2.2e-128)
1.0
(if (<= x 5.8e-193)
t_0
(if (<= x 1.7e-62) 1.0 (if (<= x 2.0) t_0 -1.0)))))))
double code(double x, double y) {
double t_0 = (y - x) * -0.5;
double tmp;
if (x <= -7e+86) {
tmp = -1.0;
} else if (x <= -2.2e-128) {
tmp = 1.0;
} else if (x <= 5.8e-193) {
tmp = t_0;
} else if (x <= 1.7e-62) {
tmp = 1.0;
} else if (x <= 2.0) {
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 = (y - x) * (-0.5d0)
if (x <= (-7d+86)) then
tmp = -1.0d0
else if (x <= (-2.2d-128)) then
tmp = 1.0d0
else if (x <= 5.8d-193) then
tmp = t_0
else if (x <= 1.7d-62) then
tmp = 1.0d0
else if (x <= 2.0d0) 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 - x) * -0.5;
double tmp;
if (x <= -7e+86) {
tmp = -1.0;
} else if (x <= -2.2e-128) {
tmp = 1.0;
} else if (x <= 5.8e-193) {
tmp = t_0;
} else if (x <= 1.7e-62) {
tmp = 1.0;
} else if (x <= 2.0) {
tmp = t_0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): t_0 = (y - x) * -0.5 tmp = 0 if x <= -7e+86: tmp = -1.0 elif x <= -2.2e-128: tmp = 1.0 elif x <= 5.8e-193: tmp = t_0 elif x <= 1.7e-62: tmp = 1.0 elif x <= 2.0: tmp = t_0 else: tmp = -1.0 return tmp
function code(x, y) t_0 = Float64(Float64(y - x) * -0.5) tmp = 0.0 if (x <= -7e+86) tmp = -1.0; elseif (x <= -2.2e-128) tmp = 1.0; elseif (x <= 5.8e-193) tmp = t_0; elseif (x <= 1.7e-62) tmp = 1.0; elseif (x <= 2.0) tmp = t_0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) t_0 = (y - x) * -0.5; tmp = 0.0; if (x <= -7e+86) tmp = -1.0; elseif (x <= -2.2e-128) tmp = 1.0; elseif (x <= 5.8e-193) tmp = t_0; elseif (x <= 1.7e-62) tmp = 1.0; elseif (x <= 2.0) tmp = t_0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[x, -7e+86], -1.0, If[LessEqual[x, -2.2e-128], 1.0, If[LessEqual[x, 5.8e-193], t$95$0, If[LessEqual[x, 1.7e-62], 1.0, If[LessEqual[x, 2.0], t$95$0, -1.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot -0.5\\
\mathbf{if}\;x \leq -7 \cdot 10^{+86}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-128}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-62}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -7.00000000000000038e86 or 2 < 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 80.5%
if -7.00000000000000038e86 < x < -2.20000000000000009e-128 or 5.80000000000000013e-193 < x < 1.69999999999999994e-62Initial 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 64.8%
if -2.20000000000000009e-128 < x < 5.80000000000000013e-193 or 1.69999999999999994e-62 < x < 2Initial 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%
clear-num99.8%
associate-/r/99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 98.1%
Taylor expanded in y around 0 68.7%
Final simplification73.2%
(FPCore (x y)
:precision binary64
(if (<= y -2.0)
1.0
(if (<= y -5.8e-81)
(* y -0.5)
(if (<= y -2.25e-240)
-1.0
(if (<= y 3.6e-306) (* x 0.5) (if (<= y 1.5e+19) -1.0 1.0))))))
double code(double x, double y) {
double tmp;
if (y <= -2.0) {
tmp = 1.0;
} else if (y <= -5.8e-81) {
tmp = y * -0.5;
} else if (y <= -2.25e-240) {
tmp = -1.0;
} else if (y <= 3.6e-306) {
tmp = x * 0.5;
} else if (y <= 1.5e+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 (y <= (-2.0d0)) then
tmp = 1.0d0
else if (y <= (-5.8d-81)) then
tmp = y * (-0.5d0)
else if (y <= (-2.25d-240)) then
tmp = -1.0d0
else if (y <= 3.6d-306) then
tmp = x * 0.5d0
else if (y <= 1.5d+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 (y <= -2.0) {
tmp = 1.0;
} else if (y <= -5.8e-81) {
tmp = y * -0.5;
} else if (y <= -2.25e-240) {
tmp = -1.0;
} else if (y <= 3.6e-306) {
tmp = x * 0.5;
} else if (y <= 1.5e+19) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.0: tmp = 1.0 elif y <= -5.8e-81: tmp = y * -0.5 elif y <= -2.25e-240: tmp = -1.0 elif y <= 3.6e-306: tmp = x * 0.5 elif y <= 1.5e+19: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -2.0) tmp = 1.0; elseif (y <= -5.8e-81) tmp = Float64(y * -0.5); elseif (y <= -2.25e-240) tmp = -1.0; elseif (y <= 3.6e-306) tmp = Float64(x * 0.5); elseif (y <= 1.5e+19) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.0) tmp = 1.0; elseif (y <= -5.8e-81) tmp = y * -0.5; elseif (y <= -2.25e-240) tmp = -1.0; elseif (y <= 3.6e-306) tmp = x * 0.5; elseif (y <= 1.5e+19) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.0], 1.0, If[LessEqual[y, -5.8e-81], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -2.25e-240], -1.0, If[LessEqual[y, 3.6e-306], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 1.5e+19], -1.0, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{-81}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-240}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-306}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+19}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2 or 1.5e19 < 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 78.4%
if -2 < y < -5.79999999999999978e-81Initial 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 62.6%
Taylor expanded in y around 0 57.0%
*-commutative57.0%
Simplified57.0%
if -5.79999999999999978e-81 < y < -2.2500000000000001e-240 or 3.59999999999999991e-306 < y < 1.5e19Initial 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 65.3%
if -2.2500000000000001e-240 < y < 3.59999999999999991e-306Initial 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 100.0%
mul-1-neg100.0%
distribute-neg-frac2100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 68.5%
*-commutative68.5%
Simplified68.5%
Final simplification70.3%
(FPCore (x y)
:precision binary64
(if (<= y -1e+26)
1.0
(if (<= y 1.75e+19)
-1.0
(if (<= y 1.6e+100) 1.0 (if (<= y 3e+134) -1.0 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -1e+26) {
tmp = 1.0;
} else if (y <= 1.75e+19) {
tmp = -1.0;
} else if (y <= 1.6e+100) {
tmp = 1.0;
} else if (y <= 3e+134) {
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 (y <= (-1d+26)) then
tmp = 1.0d0
else if (y <= 1.75d+19) then
tmp = -1.0d0
else if (y <= 1.6d+100) then
tmp = 1.0d0
else if (y <= 3d+134) 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 (y <= -1e+26) {
tmp = 1.0;
} else if (y <= 1.75e+19) {
tmp = -1.0;
} else if (y <= 1.6e+100) {
tmp = 1.0;
} else if (y <= 3e+134) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1e+26: tmp = 1.0 elif y <= 1.75e+19: tmp = -1.0 elif y <= 1.6e+100: tmp = 1.0 elif y <= 3e+134: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1e+26) tmp = 1.0; elseif (y <= 1.75e+19) tmp = -1.0; elseif (y <= 1.6e+100) tmp = 1.0; elseif (y <= 3e+134) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1e+26) tmp = 1.0; elseif (y <= 1.75e+19) tmp = -1.0; elseif (y <= 1.6e+100) tmp = 1.0; elseif (y <= 3e+134) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1e+26], 1.0, If[LessEqual[y, 1.75e+19], -1.0, If[LessEqual[y, 1.6e+100], 1.0, If[LessEqual[y, 3e+134], -1.0, 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+26}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+19}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+100}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+134}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.00000000000000005e26 or 1.75e19 < y < 1.5999999999999999e100 or 2.99999999999999997e134 < 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.5%
if -1.00000000000000005e26 < y < 1.75e19 or 1.5999999999999999e100 < y < 2.99999999999999997e134Initial 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 58.4%
Final simplification68.0%
(FPCore (x y)
:precision binary64
(if (<= y -2.1e+18)
1.0
(if (<= y -2.25e-240)
-1.0
(if (<= y 6.5e-303) (* x 0.5) (if (<= y 1.5e+19) -1.0 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -2.1e+18) {
tmp = 1.0;
} else if (y <= -2.25e-240) {
tmp = -1.0;
} else if (y <= 6.5e-303) {
tmp = x * 0.5;
} else if (y <= 1.5e+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 (y <= (-2.1d+18)) then
tmp = 1.0d0
else if (y <= (-2.25d-240)) then
tmp = -1.0d0
else if (y <= 6.5d-303) then
tmp = x * 0.5d0
else if (y <= 1.5d+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 (y <= -2.1e+18) {
tmp = 1.0;
} else if (y <= -2.25e-240) {
tmp = -1.0;
} else if (y <= 6.5e-303) {
tmp = x * 0.5;
} else if (y <= 1.5e+19) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.1e+18: tmp = 1.0 elif y <= -2.25e-240: tmp = -1.0 elif y <= 6.5e-303: tmp = x * 0.5 elif y <= 1.5e+19: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -2.1e+18) tmp = 1.0; elseif (y <= -2.25e-240) tmp = -1.0; elseif (y <= 6.5e-303) tmp = Float64(x * 0.5); elseif (y <= 1.5e+19) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.1e+18) tmp = 1.0; elseif (y <= -2.25e-240) tmp = -1.0; elseif (y <= 6.5e-303) tmp = x * 0.5; elseif (y <= 1.5e+19) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.1e+18], 1.0, If[LessEqual[y, -2.25e-240], -1.0, If[LessEqual[y, 6.5e-303], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 1.5e+19], -1.0, 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-240}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-303}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+19}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.1e18 or 1.5e19 < 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 78.4%
if -2.1e18 < y < -2.2500000000000001e-240 or 6.50000000000000028e-303 < y < 1.5e19Initial 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 60.4%
if -2.2500000000000001e-240 < y < 6.50000000000000028e-303Initial 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 100.0%
mul-1-neg100.0%
distribute-neg-frac2100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 68.5%
*-commutative68.5%
Simplified68.5%
Final simplification68.4%
(FPCore (x y) :precision binary64 (if (<= x -6.8e+86) (- -1.0 (* (/ y x) -2.0)) (if (<= x 0.0044) (/ (- y x) (+ y -2.0)) (/ x (- 2.0 x)))))
double code(double x, double y) {
double tmp;
if (x <= -6.8e+86) {
tmp = -1.0 - ((y / x) * -2.0);
} else if (x <= 0.0044) {
tmp = (y - x) / (y + -2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-6.8d+86)) then
tmp = (-1.0d0) - ((y / x) * (-2.0d0))
else if (x <= 0.0044d0) then
tmp = (y - x) / (y + (-2.0d0))
else
tmp = x / (2.0d0 - x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -6.8e+86) {
tmp = -1.0 - ((y / x) * -2.0);
} else if (x <= 0.0044) {
tmp = (y - x) / (y + -2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.8e+86: tmp = -1.0 - ((y / x) * -2.0) elif x <= 0.0044: tmp = (y - x) / (y + -2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) tmp = 0.0 if (x <= -6.8e+86) tmp = Float64(-1.0 - Float64(Float64(y / x) * -2.0)); elseif (x <= 0.0044) tmp = Float64(Float64(y - x) / Float64(y + -2.0)); else tmp = Float64(x / Float64(2.0 - x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.8e+86) tmp = -1.0 - ((y / x) * -2.0); elseif (x <= 0.0044) tmp = (y - x) / (y + -2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.8e+86], N[(-1.0 - N[(N[(y / x), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.0044], N[(N[(y - x), $MachinePrecision] / N[(y + -2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+86}:\\
\;\;\;\;-1 - \frac{y}{x} \cdot -2\\
\mathbf{elif}\;x \leq 0.0044:\\
\;\;\;\;\frac{y - x}{y + -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -6.7999999999999995e86Initial 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 87.1%
sub-neg87.1%
+-commutative87.1%
distribute-neg-in87.1%
metadata-eval87.1%
mul-1-neg87.1%
remove-double-neg87.1%
associate-+l+87.1%
remove-double-neg87.1%
mul-1-neg87.1%
neg-sub087.1%
associate--r-87.1%
associate-*r/87.1%
sub-neg87.1%
metadata-eval87.1%
+-commutative87.1%
distribute-lft-in87.1%
metadata-eval87.1%
div-sub87.1%
Simplified87.1%
Taylor expanded in y around inf 87.1%
*-commutative87.1%
Simplified87.1%
if -6.7999999999999995e86 < x < 0.00440000000000000027Initial 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%
clear-num99.8%
associate-/r/99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 92.1%
Taylor expanded in x around 0 92.3%
+-commutative92.3%
sub-neg92.3%
metadata-eval92.3%
mul-1-neg92.3%
sub-neg92.3%
metadata-eval92.3%
sub-neg92.3%
div-sub92.3%
Simplified92.3%
if 0.00440000000000000027 < x Initial 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 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%
Final simplification87.4%
(FPCore (x y) :precision binary64 (if (<= x -6.8e+86) -1.0 (if (<= x 1.55e-62) (/ y (- y 2.0)) (/ x (- 2.0 x)))))
double code(double x, double y) {
double tmp;
if (x <= -6.8e+86) {
tmp = -1.0;
} else if (x <= 1.55e-62) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-6.8d+86)) then
tmp = -1.0d0
else if (x <= 1.55d-62) then
tmp = y / (y - 2.0d0)
else
tmp = x / (2.0d0 - x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -6.8e+86) {
tmp = -1.0;
} else if (x <= 1.55e-62) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.8e+86: tmp = -1.0 elif x <= 1.55e-62: tmp = y / (y - 2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) tmp = 0.0 if (x <= -6.8e+86) tmp = -1.0; elseif (x <= 1.55e-62) tmp = Float64(y / Float64(y - 2.0)); else tmp = Float64(x / Float64(2.0 - x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.8e+86) tmp = -1.0; elseif (x <= 1.55e-62) tmp = y / (y - 2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.8e+86], -1.0, If[LessEqual[x, 1.55e-62], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+86}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -6.7999999999999995e86Initial 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%
if -6.7999999999999995e86 < x < 1.55e-62Initial 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 78.3%
if 1.55e-62 < x Initial 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 y around 0 78.0%
mul-1-neg78.0%
distribute-neg-frac278.0%
neg-sub078.0%
associate-+l-78.0%
neg-sub078.0%
+-commutative78.0%
unsub-neg78.0%
Simplified78.0%
Final simplification79.5%
(FPCore (x y) :precision binary64 (if (<= x -1.1e+87) (- -1.0 (* (/ y x) -2.0)) (if (<= x 9e-60) (/ y (- y 2.0)) (/ x (- 2.0 x)))))
double code(double x, double y) {
double tmp;
if (x <= -1.1e+87) {
tmp = -1.0 - ((y / x) * -2.0);
} else if (x <= 9e-60) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.1d+87)) then
tmp = (-1.0d0) - ((y / x) * (-2.0d0))
else if (x <= 9d-60) then
tmp = y / (y - 2.0d0)
else
tmp = x / (2.0d0 - x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.1e+87) {
tmp = -1.0 - ((y / x) * -2.0);
} else if (x <= 9e-60) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.1e+87: tmp = -1.0 - ((y / x) * -2.0) elif x <= 9e-60: tmp = y / (y - 2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.1e+87) tmp = Float64(-1.0 - Float64(Float64(y / x) * -2.0)); elseif (x <= 9e-60) tmp = Float64(y / Float64(y - 2.0)); else tmp = Float64(x / Float64(2.0 - x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.1e+87) tmp = -1.0 - ((y / x) * -2.0); elseif (x <= 9e-60) tmp = y / (y - 2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.1e+87], N[(-1.0 - N[(N[(y / x), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e-60], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+87}:\\
\;\;\;\;-1 - \frac{y}{x} \cdot -2\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-60}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -1.1e87Initial 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 87.1%
sub-neg87.1%
+-commutative87.1%
distribute-neg-in87.1%
metadata-eval87.1%
mul-1-neg87.1%
remove-double-neg87.1%
associate-+l+87.1%
remove-double-neg87.1%
mul-1-neg87.1%
neg-sub087.1%
associate--r-87.1%
associate-*r/87.1%
sub-neg87.1%
metadata-eval87.1%
+-commutative87.1%
distribute-lft-in87.1%
metadata-eval87.1%
div-sub87.1%
Simplified87.1%
Taylor expanded in y around inf 87.1%
*-commutative87.1%
Simplified87.1%
if -1.1e87 < x < 9.00000000000000001e-60Initial 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 78.3%
if 9.00000000000000001e-60 < x Initial 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 y around 0 78.0%
mul-1-neg78.0%
distribute-neg-frac278.0%
neg-sub078.0%
associate-+l-78.0%
neg-sub078.0%
+-commutative78.0%
unsub-neg78.0%
Simplified78.0%
Final simplification79.6%
(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 42.4%
Final simplification42.4%
(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 2024077
(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))))