
(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 11 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 99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(if (<= x -6.5e+147)
-1.0
(if (<= x -6e+129)
1.0
(if (<= x -6.2e+64)
-1.0
(if (<= x -1.75e-68)
1.0
(if (<= x -1.3e-136)
(* x 0.5)
(if (<= x 1.65e-63) 1.0 (if (<= x 14.0) (* x 0.5) -1.0))))))))
double code(double x, double y) {
double tmp;
if (x <= -6.5e+147) {
tmp = -1.0;
} else if (x <= -6e+129) {
tmp = 1.0;
} else if (x <= -6.2e+64) {
tmp = -1.0;
} else if (x <= -1.75e-68) {
tmp = 1.0;
} else if (x <= -1.3e-136) {
tmp = x * 0.5;
} else if (x <= 1.65e-63) {
tmp = 1.0;
} else if (x <= 14.0) {
tmp = x * 0.5;
} 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 <= (-6.5d+147)) then
tmp = -1.0d0
else if (x <= (-6d+129)) then
tmp = 1.0d0
else if (x <= (-6.2d+64)) then
tmp = -1.0d0
else if (x <= (-1.75d-68)) then
tmp = 1.0d0
else if (x <= (-1.3d-136)) then
tmp = x * 0.5d0
else if (x <= 1.65d-63) then
tmp = 1.0d0
else if (x <= 14.0d0) then
tmp = x * 0.5d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -6.5e+147) {
tmp = -1.0;
} else if (x <= -6e+129) {
tmp = 1.0;
} else if (x <= -6.2e+64) {
tmp = -1.0;
} else if (x <= -1.75e-68) {
tmp = 1.0;
} else if (x <= -1.3e-136) {
tmp = x * 0.5;
} else if (x <= 1.65e-63) {
tmp = 1.0;
} else if (x <= 14.0) {
tmp = x * 0.5;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.5e+147: tmp = -1.0 elif x <= -6e+129: tmp = 1.0 elif x <= -6.2e+64: tmp = -1.0 elif x <= -1.75e-68: tmp = 1.0 elif x <= -1.3e-136: tmp = x * 0.5 elif x <= 1.65e-63: tmp = 1.0 elif x <= 14.0: tmp = x * 0.5 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -6.5e+147) tmp = -1.0; elseif (x <= -6e+129) tmp = 1.0; elseif (x <= -6.2e+64) tmp = -1.0; elseif (x <= -1.75e-68) tmp = 1.0; elseif (x <= -1.3e-136) tmp = Float64(x * 0.5); elseif (x <= 1.65e-63) tmp = 1.0; elseif (x <= 14.0) tmp = Float64(x * 0.5); else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.5e+147) tmp = -1.0; elseif (x <= -6e+129) tmp = 1.0; elseif (x <= -6.2e+64) tmp = -1.0; elseif (x <= -1.75e-68) tmp = 1.0; elseif (x <= -1.3e-136) tmp = x * 0.5; elseif (x <= 1.65e-63) tmp = 1.0; elseif (x <= 14.0) tmp = x * 0.5; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.5e+147], -1.0, If[LessEqual[x, -6e+129], 1.0, If[LessEqual[x, -6.2e+64], -1.0, If[LessEqual[x, -1.75e-68], 1.0, If[LessEqual[x, -1.3e-136], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 1.65e-63], 1.0, If[LessEqual[x, 14.0], N[(x * 0.5), $MachinePrecision], -1.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+147}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+129}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{+64}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-68}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-136}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-63}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 14:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -6.5e147 or -6.0000000000000006e129 < x < -6.1999999999999998e64 or 14 < 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 x around inf 81.4%
if -6.5e147 < x < -6.0000000000000006e129 or -6.1999999999999998e64 < x < -1.75000000000000006e-68 or -1.29999999999999998e-136 < x < 1.64999999999999997e-63Initial 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 58.4%
if -1.75000000000000006e-68 < x < -1.29999999999999998e-136 or 1.64999999999999997e-63 < x < 14Initial 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 70.4%
mul-1-neg70.4%
distribute-neg-frac270.4%
neg-sub070.4%
associate-+l-70.4%
neg-sub070.4%
+-commutative70.4%
unsub-neg70.4%
Simplified70.4%
Taylor expanded in x around 0 64.1%
*-commutative64.1%
Simplified64.1%
Final simplification67.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- -1.0 (/ (* y -2.0) x))))
(if (<= x -1.25e+148)
t_0
(if (<= x -6e+129)
(+ 1.0 (/ (* x -2.0) y))
(if (<= x -2.8e+85)
t_0
(if (<= x 5e-6) (* (/ 1.0 (- y 2.0)) (- y x)) (/ x (- 2.0 x))))))))
double code(double x, double y) {
double t_0 = -1.0 - ((y * -2.0) / x);
double tmp;
if (x <= -1.25e+148) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0 + ((x * -2.0) / y);
} else if (x <= -2.8e+85) {
tmp = t_0;
} else if (x <= 5e-6) {
tmp = (1.0 / (y - 2.0)) * (y - x);
} 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) :: t_0
real(8) :: tmp
t_0 = (-1.0d0) - ((y * (-2.0d0)) / x)
if (x <= (-1.25d+148)) then
tmp = t_0
else if (x <= (-6d+129)) then
tmp = 1.0d0 + ((x * (-2.0d0)) / y)
else if (x <= (-2.8d+85)) then
tmp = t_0
else if (x <= 5d-6) then
tmp = (1.0d0 / (y - 2.0d0)) * (y - x)
else
tmp = x / (2.0d0 - x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = -1.0 - ((y * -2.0) / x);
double tmp;
if (x <= -1.25e+148) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0 + ((x * -2.0) / y);
} else if (x <= -2.8e+85) {
tmp = t_0;
} else if (x <= 5e-6) {
tmp = (1.0 / (y - 2.0)) * (y - x);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): t_0 = -1.0 - ((y * -2.0) / x) tmp = 0 if x <= -1.25e+148: tmp = t_0 elif x <= -6e+129: tmp = 1.0 + ((x * -2.0) / y) elif x <= -2.8e+85: tmp = t_0 elif x <= 5e-6: tmp = (1.0 / (y - 2.0)) * (y - x) else: tmp = x / (2.0 - x) return tmp
function code(x, y) t_0 = Float64(-1.0 - Float64(Float64(y * -2.0) / x)) tmp = 0.0 if (x <= -1.25e+148) tmp = t_0; elseif (x <= -6e+129) tmp = Float64(1.0 + Float64(Float64(x * -2.0) / y)); elseif (x <= -2.8e+85) tmp = t_0; elseif (x <= 5e-6) tmp = Float64(Float64(1.0 / Float64(y - 2.0)) * Float64(y - x)); else tmp = Float64(x / Float64(2.0 - x)); end return tmp end
function tmp_2 = code(x, y) t_0 = -1.0 - ((y * -2.0) / x); tmp = 0.0; if (x <= -1.25e+148) tmp = t_0; elseif (x <= -6e+129) tmp = 1.0 + ((x * -2.0) / y); elseif (x <= -2.8e+85) tmp = t_0; elseif (x <= 5e-6) tmp = (1.0 / (y - 2.0)) * (y - x); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(-1.0 - N[(N[(y * -2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+148], t$95$0, If[LessEqual[x, -6e+129], N[(1.0 + N[(N[(x * -2.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.8e+85], t$95$0, If[LessEqual[x, 5e-6], N[(N[(1.0 / N[(y - 2.0), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - \frac{y \cdot -2}{x}\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+148}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+129}:\\
\;\;\;\;1 + \frac{x \cdot -2}{y}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{+85}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{y - 2} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -1.25000000000000006e148 or -6.0000000000000006e129 < x < -2.7999999999999999e85Initial 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.0%
sub-neg86.0%
+-commutative86.0%
distribute-neg-in86.0%
metadata-eval86.0%
mul-1-neg86.0%
remove-double-neg86.0%
associate-+l+86.0%
remove-double-neg86.0%
mul-1-neg86.0%
neg-sub086.0%
associate--r-86.0%
associate-*r/86.0%
sub-neg86.0%
metadata-eval86.0%
+-commutative86.0%
distribute-lft-in86.0%
metadata-eval86.0%
div-sub86.0%
Simplified86.0%
Taylor expanded in y around inf 86.0%
associate-*r/86.0%
*-commutative86.0%
Simplified86.0%
if -1.25000000000000006e148 < x < -6.0000000000000006e129Initial program 99.8%
remove-double-neg99.8%
+-commutative99.8%
distribute-neg-frac299.8%
distribute-frac-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 86.7%
associate--l+86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
associate-*r/86.7%
metadata-eval86.7%
div-sub86.7%
unsub-neg86.7%
mul-1-neg86.7%
div-sub86.7%
mul-1-neg86.7%
associate--l+86.7%
sub-neg86.7%
mul-1-neg86.7%
mul-1-neg86.7%
distribute-rgt-out86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in x around inf 86.7%
associate-*r/86.7%
*-commutative86.7%
Simplified86.7%
if -2.7999999999999999e85 < x < 5.00000000000000041e-6Initial 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.9%
associate-/r/99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 94.9%
if 5.00000000000000041e-6 < 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 83.1%
mul-1-neg83.1%
distribute-neg-frac283.1%
neg-sub083.1%
associate-+l-83.1%
neg-sub083.1%
+-commutative83.1%
unsub-neg83.1%
Simplified83.1%
Final simplification90.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- -1.0 (/ (* y -2.0) x))))
(if (<= x -6.5e+147)
t_0
(if (<= x -6e+129)
(+ 1.0 (/ (* x -2.0) y))
(if (<= x -2.7e+85)
t_0
(if (<= x 260000.0)
(* (/ 1.0 (- y 2.0)) (- y x))
(- -1.0 (/ (+ 2.0 (* y -2.0)) x))))))))
double code(double x, double y) {
double t_0 = -1.0 - ((y * -2.0) / x);
double tmp;
if (x <= -6.5e+147) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0 + ((x * -2.0) / y);
} else if (x <= -2.7e+85) {
tmp = t_0;
} else if (x <= 260000.0) {
tmp = (1.0 / (y - 2.0)) * (y - x);
} else {
tmp = -1.0 - ((2.0 + (y * -2.0)) / x);
}
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 = (-1.0d0) - ((y * (-2.0d0)) / x)
if (x <= (-6.5d+147)) then
tmp = t_0
else if (x <= (-6d+129)) then
tmp = 1.0d0 + ((x * (-2.0d0)) / y)
else if (x <= (-2.7d+85)) then
tmp = t_0
else if (x <= 260000.0d0) then
tmp = (1.0d0 / (y - 2.0d0)) * (y - x)
else
tmp = (-1.0d0) - ((2.0d0 + (y * (-2.0d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = -1.0 - ((y * -2.0) / x);
double tmp;
if (x <= -6.5e+147) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0 + ((x * -2.0) / y);
} else if (x <= -2.7e+85) {
tmp = t_0;
} else if (x <= 260000.0) {
tmp = (1.0 / (y - 2.0)) * (y - x);
} else {
tmp = -1.0 - ((2.0 + (y * -2.0)) / x);
}
return tmp;
}
def code(x, y): t_0 = -1.0 - ((y * -2.0) / x) tmp = 0 if x <= -6.5e+147: tmp = t_0 elif x <= -6e+129: tmp = 1.0 + ((x * -2.0) / y) elif x <= -2.7e+85: tmp = t_0 elif x <= 260000.0: tmp = (1.0 / (y - 2.0)) * (y - x) else: tmp = -1.0 - ((2.0 + (y * -2.0)) / x) return tmp
function code(x, y) t_0 = Float64(-1.0 - Float64(Float64(y * -2.0) / x)) tmp = 0.0 if (x <= -6.5e+147) tmp = t_0; elseif (x <= -6e+129) tmp = Float64(1.0 + Float64(Float64(x * -2.0) / y)); elseif (x <= -2.7e+85) tmp = t_0; elseif (x <= 260000.0) tmp = Float64(Float64(1.0 / Float64(y - 2.0)) * Float64(y - x)); else tmp = Float64(-1.0 - Float64(Float64(2.0 + Float64(y * -2.0)) / x)); end return tmp end
function tmp_2 = code(x, y) t_0 = -1.0 - ((y * -2.0) / x); tmp = 0.0; if (x <= -6.5e+147) tmp = t_0; elseif (x <= -6e+129) tmp = 1.0 + ((x * -2.0) / y); elseif (x <= -2.7e+85) tmp = t_0; elseif (x <= 260000.0) tmp = (1.0 / (y - 2.0)) * (y - x); else tmp = -1.0 - ((2.0 + (y * -2.0)) / x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(-1.0 - N[(N[(y * -2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+147], t$95$0, If[LessEqual[x, -6e+129], N[(1.0 + N[(N[(x * -2.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.7e+85], t$95$0, If[LessEqual[x, 260000.0], N[(N[(1.0 / N[(y - 2.0), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision], N[(-1.0 - N[(N[(2.0 + N[(y * -2.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - \frac{y \cdot -2}{x}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+147}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+129}:\\
\;\;\;\;1 + \frac{x \cdot -2}{y}\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{+85}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 260000:\\
\;\;\;\;\frac{1}{y - 2} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;-1 - \frac{2 + y \cdot -2}{x}\\
\end{array}
\end{array}
if x < -6.5e147 or -6.0000000000000006e129 < x < -2.69999999999999983e85Initial 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.0%
sub-neg86.0%
+-commutative86.0%
distribute-neg-in86.0%
metadata-eval86.0%
mul-1-neg86.0%
remove-double-neg86.0%
associate-+l+86.0%
remove-double-neg86.0%
mul-1-neg86.0%
neg-sub086.0%
associate--r-86.0%
associate-*r/86.0%
sub-neg86.0%
metadata-eval86.0%
+-commutative86.0%
distribute-lft-in86.0%
metadata-eval86.0%
div-sub86.0%
Simplified86.0%
Taylor expanded in y around inf 86.0%
associate-*r/86.0%
*-commutative86.0%
Simplified86.0%
if -6.5e147 < x < -6.0000000000000006e129Initial program 99.8%
remove-double-neg99.8%
+-commutative99.8%
distribute-neg-frac299.8%
distribute-frac-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 86.7%
associate--l+86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
associate-*r/86.7%
metadata-eval86.7%
div-sub86.7%
unsub-neg86.7%
mul-1-neg86.7%
div-sub86.7%
mul-1-neg86.7%
associate--l+86.7%
sub-neg86.7%
mul-1-neg86.7%
mul-1-neg86.7%
distribute-rgt-out86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in x around inf 86.7%
associate-*r/86.7%
*-commutative86.7%
Simplified86.7%
if -2.69999999999999983e85 < x < 2.6e5Initial 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.9%
associate-/r/99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 94.2%
if 2.6e5 < 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 x around inf 84.9%
sub-neg84.9%
+-commutative84.9%
distribute-neg-in84.9%
metadata-eval84.9%
mul-1-neg84.9%
remove-double-neg84.9%
associate-+l+84.9%
remove-double-neg84.9%
mul-1-neg84.9%
neg-sub084.9%
associate--r-84.9%
associate-*r/84.9%
sub-neg84.9%
metadata-eval84.9%
+-commutative84.9%
distribute-lft-in84.9%
metadata-eval84.9%
div-sub84.9%
Simplified84.9%
Final simplification90.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (- 2.0 x))))
(if (<= y -2.8e+71)
1.0
(if (<= y -3e-22)
t_0
(if (<= y -7e-104) (* y -0.5) (if (<= y 2.2e+15) t_0 1.0))))))
double code(double x, double y) {
double t_0 = x / (2.0 - x);
double tmp;
if (y <= -2.8e+71) {
tmp = 1.0;
} else if (y <= -3e-22) {
tmp = t_0;
} else if (y <= -7e-104) {
tmp = y * -0.5;
} else if (y <= 2.2e+15) {
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 <= (-2.8d+71)) then
tmp = 1.0d0
else if (y <= (-3d-22)) then
tmp = t_0
else if (y <= (-7d-104)) then
tmp = y * (-0.5d0)
else if (y <= 2.2d+15) 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 <= -2.8e+71) {
tmp = 1.0;
} else if (y <= -3e-22) {
tmp = t_0;
} else if (y <= -7e-104) {
tmp = y * -0.5;
} else if (y <= 2.2e+15) {
tmp = t_0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): t_0 = x / (2.0 - x) tmp = 0 if y <= -2.8e+71: tmp = 1.0 elif y <= -3e-22: tmp = t_0 elif y <= -7e-104: tmp = y * -0.5 elif y <= 2.2e+15: 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 <= -2.8e+71) tmp = 1.0; elseif (y <= -3e-22) tmp = t_0; elseif (y <= -7e-104) tmp = Float64(y * -0.5); elseif (y <= 2.2e+15) 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 <= -2.8e+71) tmp = 1.0; elseif (y <= -3e-22) tmp = t_0; elseif (y <= -7e-104) tmp = y * -0.5; elseif (y <= 2.2e+15) 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, -2.8e+71], 1.0, If[LessEqual[y, -3e-22], t$95$0, If[LessEqual[y, -7e-104], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 2.2e+15], t$95$0, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{2 - x}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+71}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-104}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.80000000000000002e71 or 2.2e15 < y 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 inf 75.5%
if -2.80000000000000002e71 < y < -2.9999999999999999e-22 or -7.00000000000000057e-104 < y < 2.2e15Initial 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 73.7%
mul-1-neg73.7%
distribute-neg-frac273.7%
neg-sub073.7%
associate-+l-73.7%
neg-sub073.7%
+-commutative73.7%
unsub-neg73.7%
Simplified73.7%
if -2.9999999999999999e-22 < y < -7.00000000000000057e-104Initial 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 70.5%
Taylor expanded in y around 0 70.5%
*-commutative70.5%
Simplified70.5%
Final simplification74.3%
(FPCore (x y)
:precision binary64
(if (<= x -6.5e+147)
-1.0
(if (<= x -5e+128)
1.0
(if (<= x -2.7e+85)
-1.0
(if (<= x 1.96e-63) (/ y (- y 2.0)) (/ x (- 2.0 x)))))))
double code(double x, double y) {
double tmp;
if (x <= -6.5e+147) {
tmp = -1.0;
} else if (x <= -5e+128) {
tmp = 1.0;
} else if (x <= -2.7e+85) {
tmp = -1.0;
} else if (x <= 1.96e-63) {
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.5d+147)) then
tmp = -1.0d0
else if (x <= (-5d+128)) then
tmp = 1.0d0
else if (x <= (-2.7d+85)) then
tmp = -1.0d0
else if (x <= 1.96d-63) 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.5e+147) {
tmp = -1.0;
} else if (x <= -5e+128) {
tmp = 1.0;
} else if (x <= -2.7e+85) {
tmp = -1.0;
} else if (x <= 1.96e-63) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.5e+147: tmp = -1.0 elif x <= -5e+128: tmp = 1.0 elif x <= -2.7e+85: tmp = -1.0 elif x <= 1.96e-63: tmp = y / (y - 2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) tmp = 0.0 if (x <= -6.5e+147) tmp = -1.0; elseif (x <= -5e+128) tmp = 1.0; elseif (x <= -2.7e+85) tmp = -1.0; elseif (x <= 1.96e-63) 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.5e+147) tmp = -1.0; elseif (x <= -5e+128) tmp = 1.0; elseif (x <= -2.7e+85) tmp = -1.0; elseif (x <= 1.96e-63) tmp = y / (y - 2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.5e+147], -1.0, If[LessEqual[x, -5e+128], 1.0, If[LessEqual[x, -2.7e+85], -1.0, If[LessEqual[x, 1.96e-63], 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.5 \cdot 10^{+147}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{+128}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{+85}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.96 \cdot 10^{-63}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -6.5e147 or -5e128 < x < -2.69999999999999983e85Initial 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.5%
if -6.5e147 < x < -5e128Initial program 99.8%
remove-double-neg99.8%
+-commutative99.8%
distribute-neg-frac299.8%
distribute-frac-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 80.1%
if -2.69999999999999983e85 < x < 1.9600000000000001e-63Initial 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 79.3%
if 1.9600000000000001e-63 < 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 82.6%
mul-1-neg82.6%
distribute-neg-frac282.6%
neg-sub082.6%
associate-+l-82.6%
neg-sub082.6%
+-commutative82.6%
unsub-neg82.6%
Simplified82.6%
Final simplification80.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (- y x) (/ 1.0 x))))
(if (<= x -6.5e+147)
t_0
(if (<= x -6e+129)
1.0
(if (<= x -9e+64)
t_0
(if (<= x 1.08e-63) (/ y (- y 2.0)) (/ x (- 2.0 x))))))))
double code(double x, double y) {
double t_0 = (y - x) * (1.0 / x);
double tmp;
if (x <= -6.5e+147) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0;
} else if (x <= -9e+64) {
tmp = t_0;
} else if (x <= 1.08e-63) {
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) :: t_0
real(8) :: tmp
t_0 = (y - x) * (1.0d0 / x)
if (x <= (-6.5d+147)) then
tmp = t_0
else if (x <= (-6d+129)) then
tmp = 1.0d0
else if (x <= (-9d+64)) then
tmp = t_0
else if (x <= 1.08d-63) 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 t_0 = (y - x) * (1.0 / x);
double tmp;
if (x <= -6.5e+147) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0;
} else if (x <= -9e+64) {
tmp = t_0;
} else if (x <= 1.08e-63) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): t_0 = (y - x) * (1.0 / x) tmp = 0 if x <= -6.5e+147: tmp = t_0 elif x <= -6e+129: tmp = 1.0 elif x <= -9e+64: tmp = t_0 elif x <= 1.08e-63: tmp = y / (y - 2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) t_0 = Float64(Float64(y - x) * Float64(1.0 / x)) tmp = 0.0 if (x <= -6.5e+147) tmp = t_0; elseif (x <= -6e+129) tmp = 1.0; elseif (x <= -9e+64) tmp = t_0; elseif (x <= 1.08e-63) 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) t_0 = (y - x) * (1.0 / x); tmp = 0.0; if (x <= -6.5e+147) tmp = t_0; elseif (x <= -6e+129) tmp = 1.0; elseif (x <= -9e+64) tmp = t_0; elseif (x <= 1.08e-63) tmp = y / (y - 2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+147], t$95$0, If[LessEqual[x, -6e+129], 1.0, If[LessEqual[x, -9e+64], t$95$0, If[LessEqual[x, 1.08e-63], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot \frac{1}{x}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+147}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+129}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+64}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{-63}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -6.5e147 or -6.0000000000000006e129 < x < -8.99999999999999946e64Initial 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.9%
associate-/r/99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 80.7%
if -6.5e147 < x < -6.0000000000000006e129Initial program 99.8%
remove-double-neg99.8%
+-commutative99.8%
distribute-neg-frac299.8%
distribute-frac-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 80.1%
if -8.99999999999999946e64 < x < 1.07999999999999994e-63Initial 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 80.4%
if 1.07999999999999994e-63 < 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 82.6%
mul-1-neg82.6%
distribute-neg-frac282.6%
neg-sub082.6%
associate-+l-82.6%
neg-sub082.6%
+-commutative82.6%
unsub-neg82.6%
Simplified82.6%
Final simplification81.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (- y x) (/ 1.0 x))))
(if (<= x -6.5e+147)
t_0
(if (<= x -6e+129)
(+ 1.0 (/ (* x -2.0) y))
(if (<= x -9e+64)
t_0
(if (<= x 1.9e-63) (/ y (- y 2.0)) (/ x (- 2.0 x))))))))
double code(double x, double y) {
double t_0 = (y - x) * (1.0 / x);
double tmp;
if (x <= -6.5e+147) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0 + ((x * -2.0) / y);
} else if (x <= -9e+64) {
tmp = t_0;
} else if (x <= 1.9e-63) {
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) :: t_0
real(8) :: tmp
t_0 = (y - x) * (1.0d0 / x)
if (x <= (-6.5d+147)) then
tmp = t_0
else if (x <= (-6d+129)) then
tmp = 1.0d0 + ((x * (-2.0d0)) / y)
else if (x <= (-9d+64)) then
tmp = t_0
else if (x <= 1.9d-63) 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 t_0 = (y - x) * (1.0 / x);
double tmp;
if (x <= -6.5e+147) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0 + ((x * -2.0) / y);
} else if (x <= -9e+64) {
tmp = t_0;
} else if (x <= 1.9e-63) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): t_0 = (y - x) * (1.0 / x) tmp = 0 if x <= -6.5e+147: tmp = t_0 elif x <= -6e+129: tmp = 1.0 + ((x * -2.0) / y) elif x <= -9e+64: tmp = t_0 elif x <= 1.9e-63: tmp = y / (y - 2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) t_0 = Float64(Float64(y - x) * Float64(1.0 / x)) tmp = 0.0 if (x <= -6.5e+147) tmp = t_0; elseif (x <= -6e+129) tmp = Float64(1.0 + Float64(Float64(x * -2.0) / y)); elseif (x <= -9e+64) tmp = t_0; elseif (x <= 1.9e-63) 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) t_0 = (y - x) * (1.0 / x); tmp = 0.0; if (x <= -6.5e+147) tmp = t_0; elseif (x <= -6e+129) tmp = 1.0 + ((x * -2.0) / y); elseif (x <= -9e+64) tmp = t_0; elseif (x <= 1.9e-63) tmp = y / (y - 2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+147], t$95$0, If[LessEqual[x, -6e+129], N[(1.0 + N[(N[(x * -2.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9e+64], t$95$0, If[LessEqual[x, 1.9e-63], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot \frac{1}{x}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+147}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+129}:\\
\;\;\;\;1 + \frac{x \cdot -2}{y}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+64}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-63}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -6.5e147 or -6.0000000000000006e129 < x < -8.99999999999999946e64Initial 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.9%
associate-/r/99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 80.7%
if -6.5e147 < x < -6.0000000000000006e129Initial program 99.8%
remove-double-neg99.8%
+-commutative99.8%
distribute-neg-frac299.8%
distribute-frac-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 86.7%
associate--l+86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
associate-*r/86.7%
metadata-eval86.7%
div-sub86.7%
unsub-neg86.7%
mul-1-neg86.7%
div-sub86.7%
mul-1-neg86.7%
associate--l+86.7%
sub-neg86.7%
mul-1-neg86.7%
mul-1-neg86.7%
distribute-rgt-out86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in x around inf 86.7%
associate-*r/86.7%
*-commutative86.7%
Simplified86.7%
if -8.99999999999999946e64 < x < 1.90000000000000009e-63Initial 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 80.4%
if 1.90000000000000009e-63 < 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 82.6%
mul-1-neg82.6%
distribute-neg-frac282.6%
neg-sub082.6%
associate-+l-82.6%
neg-sub082.6%
+-commutative82.6%
unsub-neg82.6%
Simplified82.6%
Final simplification81.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- -1.0 (/ (* y -2.0) x))))
(if (<= x -6.5e+147)
t_0
(if (<= x -6e+129)
(+ 1.0 (/ (* x -2.0) y))
(if (<= x -8.6e+64)
t_0
(if (<= x 1.96e-63) (/ y (- y 2.0)) (/ x (- 2.0 x))))))))
double code(double x, double y) {
double t_0 = -1.0 - ((y * -2.0) / x);
double tmp;
if (x <= -6.5e+147) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0 + ((x * -2.0) / y);
} else if (x <= -8.6e+64) {
tmp = t_0;
} else if (x <= 1.96e-63) {
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) :: t_0
real(8) :: tmp
t_0 = (-1.0d0) - ((y * (-2.0d0)) / x)
if (x <= (-6.5d+147)) then
tmp = t_0
else if (x <= (-6d+129)) then
tmp = 1.0d0 + ((x * (-2.0d0)) / y)
else if (x <= (-8.6d+64)) then
tmp = t_0
else if (x <= 1.96d-63) 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 t_0 = -1.0 - ((y * -2.0) / x);
double tmp;
if (x <= -6.5e+147) {
tmp = t_0;
} else if (x <= -6e+129) {
tmp = 1.0 + ((x * -2.0) / y);
} else if (x <= -8.6e+64) {
tmp = t_0;
} else if (x <= 1.96e-63) {
tmp = y / (y - 2.0);
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): t_0 = -1.0 - ((y * -2.0) / x) tmp = 0 if x <= -6.5e+147: tmp = t_0 elif x <= -6e+129: tmp = 1.0 + ((x * -2.0) / y) elif x <= -8.6e+64: tmp = t_0 elif x <= 1.96e-63: tmp = y / (y - 2.0) else: tmp = x / (2.0 - x) return tmp
function code(x, y) t_0 = Float64(-1.0 - Float64(Float64(y * -2.0) / x)) tmp = 0.0 if (x <= -6.5e+147) tmp = t_0; elseif (x <= -6e+129) tmp = Float64(1.0 + Float64(Float64(x * -2.0) / y)); elseif (x <= -8.6e+64) tmp = t_0; elseif (x <= 1.96e-63) 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) t_0 = -1.0 - ((y * -2.0) / x); tmp = 0.0; if (x <= -6.5e+147) tmp = t_0; elseif (x <= -6e+129) tmp = 1.0 + ((x * -2.0) / y); elseif (x <= -8.6e+64) tmp = t_0; elseif (x <= 1.96e-63) tmp = y / (y - 2.0); else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(-1.0 - N[(N[(y * -2.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+147], t$95$0, If[LessEqual[x, -6e+129], N[(1.0 + N[(N[(x * -2.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.6e+64], t$95$0, If[LessEqual[x, 1.96e-63], N[(y / N[(y - 2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - \frac{y \cdot -2}{x}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+147}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+129}:\\
\;\;\;\;1 + \frac{x \cdot -2}{y}\\
\mathbf{elif}\;x \leq -8.6 \cdot 10^{+64}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.96 \cdot 10^{-63}:\\
\;\;\;\;\frac{y}{y - 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if x < -6.5e147 or -6.0000000000000006e129 < x < -8.5999999999999995e64Initial 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 81.7%
sub-neg81.7%
+-commutative81.7%
distribute-neg-in81.7%
metadata-eval81.7%
mul-1-neg81.7%
remove-double-neg81.7%
associate-+l+81.7%
remove-double-neg81.7%
mul-1-neg81.7%
neg-sub081.7%
associate--r-81.7%
associate-*r/81.7%
sub-neg81.7%
metadata-eval81.7%
+-commutative81.7%
distribute-lft-in81.7%
metadata-eval81.7%
div-sub81.7%
Simplified81.7%
Taylor expanded in y around inf 81.7%
associate-*r/81.7%
*-commutative81.7%
Simplified81.7%
if -6.5e147 < x < -6.0000000000000006e129Initial program 99.8%
remove-double-neg99.8%
+-commutative99.8%
distribute-neg-frac299.8%
distribute-frac-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
neg-sub099.8%
associate--r-99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 86.7%
associate--l+86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
associate-*r/86.7%
metadata-eval86.7%
div-sub86.7%
unsub-neg86.7%
mul-1-neg86.7%
div-sub86.7%
mul-1-neg86.7%
associate--l+86.7%
sub-neg86.7%
mul-1-neg86.7%
mul-1-neg86.7%
distribute-rgt-out86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in x around inf 86.7%
associate-*r/86.7%
*-commutative86.7%
Simplified86.7%
if -8.5999999999999995e64 < x < 1.9600000000000001e-63Initial 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 80.4%
if 1.9600000000000001e-63 < 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 82.6%
mul-1-neg82.6%
distribute-neg-frac282.6%
neg-sub082.6%
associate-+l-82.6%
neg-sub082.6%
+-commutative82.6%
unsub-neg82.6%
Simplified82.6%
Final simplification81.4%
(FPCore (x y)
:precision binary64
(if (<= x -6.5e+147)
-1.0
(if (<= x -6e+129)
1.0
(if (<= x -2.7e+85) -1.0 (if (<= x 260000.0) 1.0 -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -6.5e+147) {
tmp = -1.0;
} else if (x <= -6e+129) {
tmp = 1.0;
} else if (x <= -2.7e+85) {
tmp = -1.0;
} else if (x <= 260000.0) {
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 <= (-6.5d+147)) then
tmp = -1.0d0
else if (x <= (-6d+129)) then
tmp = 1.0d0
else if (x <= (-2.7d+85)) then
tmp = -1.0d0
else if (x <= 260000.0d0) 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 <= -6.5e+147) {
tmp = -1.0;
} else if (x <= -6e+129) {
tmp = 1.0;
} else if (x <= -2.7e+85) {
tmp = -1.0;
} else if (x <= 260000.0) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.5e+147: tmp = -1.0 elif x <= -6e+129: tmp = 1.0 elif x <= -2.7e+85: tmp = -1.0 elif x <= 260000.0: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -6.5e+147) tmp = -1.0; elseif (x <= -6e+129) tmp = 1.0; elseif (x <= -2.7e+85) tmp = -1.0; elseif (x <= 260000.0) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.5e+147) tmp = -1.0; elseif (x <= -6e+129) tmp = 1.0; elseif (x <= -2.7e+85) tmp = -1.0; elseif (x <= 260000.0) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.5e+147], -1.0, If[LessEqual[x, -6e+129], 1.0, If[LessEqual[x, -2.7e+85], -1.0, If[LessEqual[x, 260000.0], 1.0, -1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+147}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+129}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{+85}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 260000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -6.5e147 or -6.0000000000000006e129 < x < -2.69999999999999983e85 or 2.6e5 < 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 x around inf 83.4%
if -6.5e147 < x < -6.0000000000000006e129 or -2.69999999999999983e85 < x < 2.6e5Initial 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 53.3%
Final simplification64.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 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 inf 34.4%
Final simplification34.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 2024071
(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))))