
(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 (+ -1.0 (/ y x))) (t_1 (/ y (- y 2.0))))
(if (<= x -1.95e+15)
t_0
(if (<= x -8.8e-41)
t_1
(if (<= x -3.2e-56)
(* x 0.5)
(if (<= x 3.7e-37)
t_1
(if (<= x 6.5e-16) (* x 0.5) (if (<= x 9.6e+42) 1.0 t_0))))))))
double code(double x, double y) {
double t_0 = -1.0 + (y / x);
double t_1 = y / (y - 2.0);
double tmp;
if (x <= -1.95e+15) {
tmp = t_0;
} else if (x <= -8.8e-41) {
tmp = t_1;
} else if (x <= -3.2e-56) {
tmp = x * 0.5;
} else if (x <= 3.7e-37) {
tmp = t_1;
} else if (x <= 6.5e-16) {
tmp = x * 0.5;
} else if (x <= 9.6e+42) {
tmp = 1.0;
} else {
tmp = t_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 = (-1.0d0) + (y / x)
t_1 = y / (y - 2.0d0)
if (x <= (-1.95d+15)) then
tmp = t_0
else if (x <= (-8.8d-41)) then
tmp = t_1
else if (x <= (-3.2d-56)) then
tmp = x * 0.5d0
else if (x <= 3.7d-37) then
tmp = t_1
else if (x <= 6.5d-16) then
tmp = x * 0.5d0
else if (x <= 9.6d+42) then
tmp = 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = -1.0 + (y / x);
double t_1 = y / (y - 2.0);
double tmp;
if (x <= -1.95e+15) {
tmp = t_0;
} else if (x <= -8.8e-41) {
tmp = t_1;
} else if (x <= -3.2e-56) {
tmp = x * 0.5;
} else if (x <= 3.7e-37) {
tmp = t_1;
} else if (x <= 6.5e-16) {
tmp = x * 0.5;
} else if (x <= 9.6e+42) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = -1.0 + (y / x) t_1 = y / (y - 2.0) tmp = 0 if x <= -1.95e+15: tmp = t_0 elif x <= -8.8e-41: tmp = t_1 elif x <= -3.2e-56: tmp = x * 0.5 elif x <= 3.7e-37: tmp = t_1 elif x <= 6.5e-16: tmp = x * 0.5 elif x <= 9.6e+42: tmp = 1.0 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(-1.0 + Float64(y / x)) t_1 = Float64(y / Float64(y - 2.0)) tmp = 0.0 if (x <= -1.95e+15) tmp = t_0; elseif (x <= -8.8e-41) tmp = t_1; elseif (x <= -3.2e-56) tmp = Float64(x * 0.5); elseif (x <= 3.7e-37) tmp = t_1; elseif (x <= 6.5e-16) tmp = Float64(x * 0.5); elseif (x <= 9.6e+42) tmp = 1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = -1.0 + (y / x); t_1 = y / (y - 2.0); tmp = 0.0; if (x <= -1.95e+15) tmp = t_0; elseif (x <= -8.8e-41) tmp = t_1; elseif (x <= -3.2e-56) tmp = x * 0.5; elseif (x <= 3.7e-37) tmp = t_1; elseif (x <= 6.5e-16) tmp = x * 0.5; elseif (x <= 9.6e+42) tmp = 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(-1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e+15], t$95$0, If[LessEqual[x, -8.8e-41], t$95$1, If[LessEqual[x, -3.2e-56], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 3.7e-37], t$95$1, If[LessEqual[x, 6.5e-16], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 9.6e+42], 1.0, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 + \frac{y}{x}\\
t_1 := \frac{y}{y - 2}\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{+15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -8.8 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-56}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-16}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+42}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.95e15 or 9.5999999999999994e42 < x Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
clear-num100.0%
associate-/r/99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 75.2%
Taylor expanded in x around 0 75.4%
if -1.95e15 < x < -8.7999999999999999e-41 or -3.19999999999999986e-56 < x < 3.7e-37Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 82.3%
if -8.7999999999999999e-41 < x < -3.19999999999999986e-56 or 3.7e-37 < x < 6.50000000000000011e-16Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 99.4%
associate-*r/99.4%
mul-1-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
*-commutative99.4%
Simplified99.4%
if 6.50000000000000011e-16 < x < 9.5999999999999994e42Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 58.8%
Final simplification79.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (- x) (+ x -2.0))))
(if (<= y -2.2e-60)
(/ y (- y 2.0))
(if (<= y 9.5e-18)
t_0
(if (<= y 5.6e+41)
(* y (/ 1.0 (+ y -2.0)))
(if (<= y 2.6e+52) t_0 (+ 1.0 (* -2.0 (/ x y)))))))))
double code(double x, double y) {
double t_0 = -x / (x + -2.0);
double tmp;
if (y <= -2.2e-60) {
tmp = y / (y - 2.0);
} else if (y <= 9.5e-18) {
tmp = t_0;
} else if (y <= 5.6e+41) {
tmp = y * (1.0 / (y + -2.0));
} else if (y <= 2.6e+52) {
tmp = t_0;
} else {
tmp = 1.0 + (-2.0 * (x / y));
}
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 / (x + (-2.0d0))
if (y <= (-2.2d-60)) then
tmp = y / (y - 2.0d0)
else if (y <= 9.5d-18) then
tmp = t_0
else if (y <= 5.6d+41) then
tmp = y * (1.0d0 / (y + (-2.0d0)))
else if (y <= 2.6d+52) then
tmp = t_0
else
tmp = 1.0d0 + ((-2.0d0) * (x / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = -x / (x + -2.0);
double tmp;
if (y <= -2.2e-60) {
tmp = y / (y - 2.0);
} else if (y <= 9.5e-18) {
tmp = t_0;
} else if (y <= 5.6e+41) {
tmp = y * (1.0 / (y + -2.0));
} else if (y <= 2.6e+52) {
tmp = t_0;
} else {
tmp = 1.0 + (-2.0 * (x / y));
}
return tmp;
}
def code(x, y): t_0 = -x / (x + -2.0) tmp = 0 if y <= -2.2e-60: tmp = y / (y - 2.0) elif y <= 9.5e-18: tmp = t_0 elif y <= 5.6e+41: tmp = y * (1.0 / (y + -2.0)) elif y <= 2.6e+52: tmp = t_0 else: tmp = 1.0 + (-2.0 * (x / y)) return tmp
function code(x, y) t_0 = Float64(Float64(-x) / Float64(x + -2.0)) tmp = 0.0 if (y <= -2.2e-60) tmp = Float64(y / Float64(y - 2.0)); elseif (y <= 9.5e-18) tmp = t_0; elseif (y <= 5.6e+41) tmp = Float64(y * Float64(1.0 / Float64(y + -2.0))); elseif (y <= 2.6e+52) tmp = t_0; else tmp = Float64(1.0 + Float64(-2.0 * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y) t_0 = -x / (x + -2.0); tmp = 0.0; if (y <= -2.2e-60) tmp = y / (y - 2.0); elseif (y <= 9.5e-18) tmp = t_0; elseif (y <= 5.6e+41) tmp = y * (1.0 / (y + -2.0)); elseif (y <= 2.6e+52) tmp = t_0; else tmp = 1.0 + (-2.0 * (x / y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[((-x) / N[(x + -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e-60], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e-18], t$95$0, If[LessEqual[y, 5.6e+41], N[(y * N[(1.0 / N[(y + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+52], t$95$0, N[(1.0 + N[(-2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{x + -2}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{-60}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+41}:\\
\;\;\;\;y \cdot \frac{1}{y + -2}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+52}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1 + -2 \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -2.1999999999999999e-60Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 75.5%
if -2.1999999999999999e-60 < y < 9.5000000000000003e-18 or 5.5999999999999999e41 < y < 2.6e52Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 84.1%
associate-*r/84.1%
mul-1-neg84.1%
sub-neg84.1%
metadata-eval84.1%
Simplified84.1%
if 9.5000000000000003e-18 < y < 5.5999999999999999e41Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 72.6%
div-inv72.8%
sub-neg72.8%
metadata-eval72.8%
Applied egg-rr72.8%
if 2.6e52 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 84.4%
associate--l+84.4%
+-commutative84.4%
mul-1-neg84.4%
unsub-neg84.4%
associate-*r/84.4%
metadata-eval84.4%
Simplified84.4%
Taylor expanded in x around inf 84.4%
*-commutative84.4%
Simplified84.4%
Final simplification81.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (- y 2.0))))
(if (<= y -6.9e-59)
t_0
(if (<= y 9e-17)
(/ (- x) (+ x -2.0))
(if (<= y 2.3e+44) t_0 (if (<= y 4.6e+55) (+ -1.0 (/ -2.0 x)) 1.0))))))
double code(double x, double y) {
double t_0 = y / (y - 2.0);
double tmp;
if (y <= -6.9e-59) {
tmp = t_0;
} else if (y <= 9e-17) {
tmp = -x / (x + -2.0);
} else if (y <= 2.3e+44) {
tmp = t_0;
} else if (y <= 4.6e+55) {
tmp = -1.0 + (-2.0 / x);
} 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 / (y - 2.0d0)
if (y <= (-6.9d-59)) then
tmp = t_0
else if (y <= 9d-17) then
tmp = -x / (x + (-2.0d0))
else if (y <= 2.3d+44) then
tmp = t_0
else if (y <= 4.6d+55) then
tmp = (-1.0d0) + ((-2.0d0) / x)
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 tmp;
if (y <= -6.9e-59) {
tmp = t_0;
} else if (y <= 9e-17) {
tmp = -x / (x + -2.0);
} else if (y <= 2.3e+44) {
tmp = t_0;
} else if (y <= 4.6e+55) {
tmp = -1.0 + (-2.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): t_0 = y / (y - 2.0) tmp = 0 if y <= -6.9e-59: tmp = t_0 elif y <= 9e-17: tmp = -x / (x + -2.0) elif y <= 2.3e+44: tmp = t_0 elif y <= 4.6e+55: tmp = -1.0 + (-2.0 / x) else: tmp = 1.0 return tmp
function code(x, y) t_0 = Float64(y / Float64(y - 2.0)) tmp = 0.0 if (y <= -6.9e-59) tmp = t_0; elseif (y <= 9e-17) tmp = Float64(Float64(-x) / Float64(x + -2.0)); elseif (y <= 2.3e+44) tmp = t_0; elseif (y <= 4.6e+55) tmp = Float64(-1.0 + Float64(-2.0 / x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y - 2.0); tmp = 0.0; if (y <= -6.9e-59) tmp = t_0; elseif (y <= 9e-17) tmp = -x / (x + -2.0); elseif (y <= 2.3e+44) tmp = t_0; elseif (y <= 4.6e+55) tmp = -1.0 + (-2.0 / x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.9e-59], t$95$0, If[LessEqual[y, 9e-17], N[((-x) / N[(x + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+44], t$95$0, If[LessEqual[y, 4.6e+55], N[(-1.0 + N[(-2.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y - 2}\\
\mathbf{if}\;y \leq -6.9 \cdot 10^{-59}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-17}:\\
\;\;\;\;\frac{-x}{x + -2}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+55}:\\
\;\;\;\;-1 + \frac{-2}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -6.89999999999999982e-59 or 8.99999999999999957e-17 < y < 2.30000000000000004e44Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 74.5%
if -6.89999999999999982e-59 < y < 8.99999999999999957e-17Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 84.1%
associate-*r/84.1%
mul-1-neg84.1%
sub-neg84.1%
metadata-eval84.1%
Simplified84.1%
if 2.30000000000000004e44 < y < 4.59999999999999975e55Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 83.6%
associate-*r/83.6%
mul-1-neg83.6%
sub-neg83.6%
metadata-eval83.6%
Simplified83.6%
Taylor expanded in x around inf 84.7%
distribute-neg-in84.7%
metadata-eval84.7%
associate-*r/84.7%
metadata-eval84.7%
distribute-neg-frac84.7%
metadata-eval84.7%
Simplified84.7%
if 4.59999999999999975e55 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 85.2%
Final simplification81.1%
(FPCore (x y)
:precision binary64
(if (<= y -4.6e-59)
(/ y (- y 2.0))
(if (<= y 1.04e-16)
(/ (- x) (+ x -2.0))
(if (<= y 5.6e+41)
(* y (/ 1.0 (+ y -2.0)))
(if (<= y 2.45e+58) (+ -1.0 (/ -2.0 x)) 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -4.6e-59) {
tmp = y / (y - 2.0);
} else if (y <= 1.04e-16) {
tmp = -x / (x + -2.0);
} else if (y <= 5.6e+41) {
tmp = y * (1.0 / (y + -2.0));
} else if (y <= 2.45e+58) {
tmp = -1.0 + (-2.0 / x);
} 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 <= (-4.6d-59)) then
tmp = y / (y - 2.0d0)
else if (y <= 1.04d-16) then
tmp = -x / (x + (-2.0d0))
else if (y <= 5.6d+41) then
tmp = y * (1.0d0 / (y + (-2.0d0)))
else if (y <= 2.45d+58) then
tmp = (-1.0d0) + ((-2.0d0) / x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -4.6e-59) {
tmp = y / (y - 2.0);
} else if (y <= 1.04e-16) {
tmp = -x / (x + -2.0);
} else if (y <= 5.6e+41) {
tmp = y * (1.0 / (y + -2.0));
} else if (y <= 2.45e+58) {
tmp = -1.0 + (-2.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -4.6e-59: tmp = y / (y - 2.0) elif y <= 1.04e-16: tmp = -x / (x + -2.0) elif y <= 5.6e+41: tmp = y * (1.0 / (y + -2.0)) elif y <= 2.45e+58: tmp = -1.0 + (-2.0 / x) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -4.6e-59) tmp = Float64(y / Float64(y - 2.0)); elseif (y <= 1.04e-16) tmp = Float64(Float64(-x) / Float64(x + -2.0)); elseif (y <= 5.6e+41) tmp = Float64(y * Float64(1.0 / Float64(y + -2.0))); elseif (y <= 2.45e+58) tmp = Float64(-1.0 + Float64(-2.0 / x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -4.6e-59) tmp = y / (y - 2.0); elseif (y <= 1.04e-16) tmp = -x / (x + -2.0); elseif (y <= 5.6e+41) tmp = y * (1.0 / (y + -2.0)); elseif (y <= 2.45e+58) tmp = -1.0 + (-2.0 / x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -4.6e-59], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.04e-16], N[((-x) / N[(x + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e+41], N[(y * N[(1.0 / N[(y + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e+58], N[(-1.0 + N[(-2.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{elif}\;y \leq 1.04 \cdot 10^{-16}:\\
\;\;\;\;\frac{-x}{x + -2}\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+41}:\\
\;\;\;\;y \cdot \frac{1}{y + -2}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+58}:\\
\;\;\;\;-1 + \frac{-2}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -4.59999999999999959e-59Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 75.5%
if -4.59999999999999959e-59 < y < 1.04000000000000001e-16Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 84.1%
associate-*r/84.1%
mul-1-neg84.1%
sub-neg84.1%
metadata-eval84.1%
Simplified84.1%
if 1.04000000000000001e-16 < y < 5.5999999999999999e41Initial program 99.9%
+-commutative99.9%
remove-double-neg99.9%
unsub-neg99.9%
distribute-neg-in99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
sub-neg99.9%
div-sub99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 72.6%
div-inv72.8%
sub-neg72.8%
metadata-eval72.8%
Applied egg-rr72.8%
if 5.5999999999999999e41 < y < 2.45000000000000009e58Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 75.9%
associate-*r/75.9%
mul-1-neg75.9%
sub-neg75.9%
metadata-eval75.9%
Simplified75.9%
Taylor expanded in x around inf 76.1%
distribute-neg-in76.1%
metadata-eval76.1%
associate-*r/76.1%
metadata-eval76.1%
distribute-neg-frac76.1%
metadata-eval76.1%
Simplified76.1%
if 2.45000000000000009e58 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 85.2%
Final simplification81.1%
(FPCore (x y)
:precision binary64
(if (<= y -2.0)
1.0
(if (<= y -4.4e-67)
(* y -0.5)
(if (<= y -2.85e-241)
-1.0
(if (<= y 1.3e-237) (* x 0.5) (if (<= y 4e+52) -1.0 1.0))))))
double code(double x, double y) {
double tmp;
if (y <= -2.0) {
tmp = 1.0;
} else if (y <= -4.4e-67) {
tmp = y * -0.5;
} else if (y <= -2.85e-241) {
tmp = -1.0;
} else if (y <= 1.3e-237) {
tmp = x * 0.5;
} else if (y <= 4e+52) {
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 <= (-4.4d-67)) then
tmp = y * (-0.5d0)
else if (y <= (-2.85d-241)) then
tmp = -1.0d0
else if (y <= 1.3d-237) then
tmp = x * 0.5d0
else if (y <= 4d+52) 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 <= -4.4e-67) {
tmp = y * -0.5;
} else if (y <= -2.85e-241) {
tmp = -1.0;
} else if (y <= 1.3e-237) {
tmp = x * 0.5;
} else if (y <= 4e+52) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.0: tmp = 1.0 elif y <= -4.4e-67: tmp = y * -0.5 elif y <= -2.85e-241: tmp = -1.0 elif y <= 1.3e-237: tmp = x * 0.5 elif y <= 4e+52: 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 <= -4.4e-67) tmp = Float64(y * -0.5); elseif (y <= -2.85e-241) tmp = -1.0; elseif (y <= 1.3e-237) tmp = Float64(x * 0.5); elseif (y <= 4e+52) 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 <= -4.4e-67) tmp = y * -0.5; elseif (y <= -2.85e-241) tmp = -1.0; elseif (y <= 1.3e-237) tmp = x * 0.5; elseif (y <= 4e+52) 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, -4.4e-67], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -2.85e-241], -1.0, If[LessEqual[y, 1.3e-237], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 4e+52], -1.0, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-67}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -2.85 \cdot 10^{-241}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-237}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+52}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2 or 4e52 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 80.9%
if -2 < y < -4.4000000000000002e-67Initial program 99.8%
+-commutative99.8%
remove-double-neg99.8%
unsub-neg99.8%
distribute-neg-in99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
+-commutative99.8%
sub-neg99.8%
div-sub99.8%
metadata-eval99.8%
metadata-eval99.8%
sub-neg99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
metadata-eval99.8%
/-rgt-identity99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 66.0%
Taylor expanded in y around 0 57.2%
*-commutative57.2%
Simplified57.2%
if -4.4000000000000002e-67 < y < -2.8499999999999999e-241 or 1.3000000000000001e-237 < y < 4e52Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 62.9%
if -2.8499999999999999e-241 < y < 1.3000000000000001e-237Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 97.3%
associate-*r/97.3%
mul-1-neg97.3%
sub-neg97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in x around 0 78.5%
*-commutative78.5%
Simplified78.5%
Final simplification72.5%
(FPCore (x y)
:precision binary64
(if (<= y -2.0)
1.0
(if (<= y -7.8e-67)
(* y -0.5)
(if (<= y -1.02e-240)
(+ -1.0 (/ y x))
(if (<= y 1.5e-237) (* x 0.5) (if (<= y 4.6e+52) -1.0 1.0))))))
double code(double x, double y) {
double tmp;
if (y <= -2.0) {
tmp = 1.0;
} else if (y <= -7.8e-67) {
tmp = y * -0.5;
} else if (y <= -1.02e-240) {
tmp = -1.0 + (y / x);
} else if (y <= 1.5e-237) {
tmp = x * 0.5;
} else if (y <= 4.6e+52) {
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 <= (-7.8d-67)) then
tmp = y * (-0.5d0)
else if (y <= (-1.02d-240)) then
tmp = (-1.0d0) + (y / x)
else if (y <= 1.5d-237) then
tmp = x * 0.5d0
else if (y <= 4.6d+52) 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 <= -7.8e-67) {
tmp = y * -0.5;
} else if (y <= -1.02e-240) {
tmp = -1.0 + (y / x);
} else if (y <= 1.5e-237) {
tmp = x * 0.5;
} else if (y <= 4.6e+52) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.0: tmp = 1.0 elif y <= -7.8e-67: tmp = y * -0.5 elif y <= -1.02e-240: tmp = -1.0 + (y / x) elif y <= 1.5e-237: tmp = x * 0.5 elif y <= 4.6e+52: 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 <= -7.8e-67) tmp = Float64(y * -0.5); elseif (y <= -1.02e-240) tmp = Float64(-1.0 + Float64(y / x)); elseif (y <= 1.5e-237) tmp = Float64(x * 0.5); elseif (y <= 4.6e+52) 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 <= -7.8e-67) tmp = y * -0.5; elseif (y <= -1.02e-240) tmp = -1.0 + (y / x); elseif (y <= 1.5e-237) tmp = x * 0.5; elseif (y <= 4.6e+52) 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, -7.8e-67], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, -1.02e-240], N[(-1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-237], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 4.6e+52], -1.0, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -7.8 \cdot 10^{-67}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{-240}:\\
\;\;\;\;-1 + \frac{y}{x}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-237}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+52}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2 or 4.6e52 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 80.9%
if -2 < y < -7.7999999999999997e-67Initial program 99.8%
+-commutative99.8%
remove-double-neg99.8%
unsub-neg99.8%
distribute-neg-in99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
+-commutative99.8%
sub-neg99.8%
div-sub99.8%
metadata-eval99.8%
metadata-eval99.8%
sub-neg99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
metadata-eval99.8%
/-rgt-identity99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 66.0%
Taylor expanded in y around 0 57.2%
*-commutative57.2%
Simplified57.2%
if -7.7999999999999997e-67 < y < -1.02e-240Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
clear-num99.9%
associate-/r/99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 65.1%
Taylor expanded in x around 0 65.3%
if -1.02e-240 < y < 1.50000000000000012e-237Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 97.3%
associate-*r/97.3%
mul-1-neg97.3%
sub-neg97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in x around 0 78.5%
*-commutative78.5%
Simplified78.5%
if 1.50000000000000012e-237 < y < 4.6e52Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 61.8%
Final simplification72.5%
(FPCore (x y)
:precision binary64
(if (<= y -6.5e+35)
1.0
(if (<= y -2.8e-238)
-1.0
(if (<= y 6e-236) (* x 0.5) (if (<= y 5.2e+53) -1.0 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -6.5e+35) {
tmp = 1.0;
} else if (y <= -2.8e-238) {
tmp = -1.0;
} else if (y <= 6e-236) {
tmp = x * 0.5;
} else if (y <= 5.2e+53) {
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 <= (-6.5d+35)) then
tmp = 1.0d0
else if (y <= (-2.8d-238)) then
tmp = -1.0d0
else if (y <= 6d-236) then
tmp = x * 0.5d0
else if (y <= 5.2d+53) 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 <= -6.5e+35) {
tmp = 1.0;
} else if (y <= -2.8e-238) {
tmp = -1.0;
} else if (y <= 6e-236) {
tmp = x * 0.5;
} else if (y <= 5.2e+53) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -6.5e+35: tmp = 1.0 elif y <= -2.8e-238: tmp = -1.0 elif y <= 6e-236: tmp = x * 0.5 elif y <= 5.2e+53: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -6.5e+35) tmp = 1.0; elseif (y <= -2.8e-238) tmp = -1.0; elseif (y <= 6e-236) tmp = Float64(x * 0.5); elseif (y <= 5.2e+53) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -6.5e+35) tmp = 1.0; elseif (y <= -2.8e-238) tmp = -1.0; elseif (y <= 6e-236) tmp = x * 0.5; elseif (y <= 5.2e+53) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -6.5e+35], 1.0, If[LessEqual[y, -2.8e-238], -1.0, If[LessEqual[y, 6e-236], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 5.2e+53], -1.0, 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+35}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-238}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-236}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+53}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -6.5000000000000003e35 or 5.19999999999999996e53 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 82.8%
if -6.5000000000000003e35 < y < -2.80000000000000004e-238 or 6.00000000000000027e-236 < y < 5.19999999999999996e53Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 56.9%
if -2.80000000000000004e-238 < y < 6.00000000000000027e-236Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 97.3%
associate-*r/97.3%
mul-1-neg97.3%
sub-neg97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in x around 0 78.5%
*-commutative78.5%
Simplified78.5%
Final simplification70.7%
(FPCore (x y) :precision binary64 (if (<= y -6e+38) 1.0 (if (<= y 2.2e+52) -1.0 1.0)))
double code(double x, double y) {
double tmp;
if (y <= -6e+38) {
tmp = 1.0;
} else if (y <= 2.2e+52) {
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 <= (-6d+38)) then
tmp = 1.0d0
else if (y <= 2.2d+52) 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 <= -6e+38) {
tmp = 1.0;
} else if (y <= 2.2e+52) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -6e+38: tmp = 1.0 elif y <= 2.2e+52: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -6e+38) tmp = 1.0; elseif (y <= 2.2e+52) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -6e+38) tmp = 1.0; elseif (y <= 2.2e+52) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -6e+38], 1.0, If[LessEqual[y, 2.2e+52], -1.0, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+38}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+52}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -6.0000000000000002e38 or 2.2e52 < y Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 82.8%
if -6.0000000000000002e38 < y < 2.2e52Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 50.1%
Final simplification64.9%
(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%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
+-commutative100.0%
sub-neg100.0%
div-sub100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
distribute-frac-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 34.8%
Final simplification34.8%
(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 2023311
(FPCore (x y)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, C"
:precision binary64
:herbie-target
(- (/ x (- 2.0 (+ x y))) (/ y (- 2.0 (+ x y))))
(/ (- x y) (- 2.0 (+ x y))))