
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (* y (* (/ 1.0 (+ x y)) (/ x (+ x y)))) (- y (- -1.0 x))))
assert(x < y);
double code(double x, double y) {
return (y * ((1.0 / (x + y)) * (x / (x + y)))) / (y - (-1.0 - x));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y * ((1.0d0 / (x + y)) * (x / (x + y)))) / (y - ((-1.0d0) - x))
end function
assert x < y;
public static double code(double x, double y) {
return (y * ((1.0 / (x + y)) * (x / (x + y)))) / (y - (-1.0 - x));
}
[x, y] = sort([x, y]) def code(x, y): return (y * ((1.0 / (x + y)) * (x / (x + y)))) / (y - (-1.0 - x))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y * Float64(Float64(1.0 / Float64(x + y)) * Float64(x / Float64(x + y)))) / Float64(y - Float64(-1.0 - x))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y * ((1.0 / (x + y)) * (x / (x + y)))) / (y - (-1.0 - x));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(y * N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y \cdot \left(\frac{1}{x + y} \cdot \frac{x}{x + y}\right)}{y - \left(-1 - x\right)}
\end{array}
Initial program 67.3%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
associate-*r/67.3%
associate-+r+67.3%
times-frac86.7%
associate-*r/86.7%
pow286.7%
+-commutative86.7%
associate-+r+86.7%
+-commutative86.7%
associate-+l+86.7%
Applied egg-rr86.7%
*-un-lft-identity86.7%
unpow286.7%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ x y))))
(if (<= x -7e+17)
(/ t_0 (+ x y))
(if (<= x -5.2e-6)
(/ (/ x (+ x y)) y)
(if (<= x -2.6e-46)
(/ y (* x (+ x 1.0)))
(if (<= x -5.1e-101)
(/ 1.0 (/ (* y (+ y 1.0)) x))
(if (<= x -2.6e-109)
(* t_0 (/ -1.0 (- -1.0 x)))
(/ (/ x y) (- y (- -1.0 x))))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x + y);
double tmp;
if (x <= -7e+17) {
tmp = t_0 / (x + y);
} else if (x <= -5.2e-6) {
tmp = (x / (x + y)) / y;
} else if (x <= -2.6e-46) {
tmp = y / (x * (x + 1.0));
} else if (x <= -5.1e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = t_0 * (-1.0 / (-1.0 - x));
} else {
tmp = (x / y) / (y - (-1.0 - x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 + y)
if (x <= (-7d+17)) then
tmp = t_0 / (x + y)
else if (x <= (-5.2d-6)) then
tmp = (x / (x + y)) / y
else if (x <= (-2.6d-46)) then
tmp = y / (x * (x + 1.0d0))
else if (x <= (-5.1d-101)) then
tmp = 1.0d0 / ((y * (y + 1.0d0)) / x)
else if (x <= (-2.6d-109)) then
tmp = t_0 * ((-1.0d0) / ((-1.0d0) - x))
else
tmp = (x / y) / (y - ((-1.0d0) - x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x + y);
double tmp;
if (x <= -7e+17) {
tmp = t_0 / (x + y);
} else if (x <= -5.2e-6) {
tmp = (x / (x + y)) / y;
} else if (x <= -2.6e-46) {
tmp = y / (x * (x + 1.0));
} else if (x <= -5.1e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = t_0 * (-1.0 / (-1.0 - x));
} else {
tmp = (x / y) / (y - (-1.0 - x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x + y) tmp = 0 if x <= -7e+17: tmp = t_0 / (x + y) elif x <= -5.2e-6: tmp = (x / (x + y)) / y elif x <= -2.6e-46: tmp = y / (x * (x + 1.0)) elif x <= -5.1e-101: tmp = 1.0 / ((y * (y + 1.0)) / x) elif x <= -2.6e-109: tmp = t_0 * (-1.0 / (-1.0 - x)) else: tmp = (x / y) / (y - (-1.0 - x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x + y)) tmp = 0.0 if (x <= -7e+17) tmp = Float64(t_0 / Float64(x + y)); elseif (x <= -5.2e-6) tmp = Float64(Float64(x / Float64(x + y)) / y); elseif (x <= -2.6e-46) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (x <= -5.1e-101) tmp = Float64(1.0 / Float64(Float64(y * Float64(y + 1.0)) / x)); elseif (x <= -2.6e-109) tmp = Float64(t_0 * Float64(-1.0 / Float64(-1.0 - x))); else tmp = Float64(Float64(x / y) / Float64(y - Float64(-1.0 - x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x + y);
tmp = 0.0;
if (x <= -7e+17)
tmp = t_0 / (x + y);
elseif (x <= -5.2e-6)
tmp = (x / (x + y)) / y;
elseif (x <= -2.6e-46)
tmp = y / (x * (x + 1.0));
elseif (x <= -5.1e-101)
tmp = 1.0 / ((y * (y + 1.0)) / x);
elseif (x <= -2.6e-109)
tmp = t_0 * (-1.0 / (-1.0 - x));
else
tmp = (x / y) / (y - (-1.0 - x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7e+17], N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.2e-6], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, -2.6e-46], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.1e-101], N[(1.0 / N[(N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6e-109], N[(t$95$0 * N[(-1.0 / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x + y}\\
\mathbf{if}\;x \leq -7 \cdot 10^{+17}:\\
\;\;\;\;\frac{t\_0}{x + y}\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-46}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq -5.1 \cdot 10^{-101}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-109}:\\
\;\;\;\;t\_0 \cdot \frac{-1}{-1 - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y - \left(-1 - x\right)}\\
\end{array}
\end{array}
if x < -7e17Initial program 55.7%
Taylor expanded in x around inf 55.7%
*-commutative55.7%
associate-*l*55.7%
+-commutative55.7%
times-frac77.7%
+-commutative77.7%
Applied egg-rr77.7%
associate-*l/77.7%
frac-2neg77.7%
*-commutative77.7%
Applied egg-rr77.7%
associate-/r*88.6%
*-inverses88.6%
associate-*r/88.6%
*-rgt-identity88.6%
distribute-neg-in88.6%
unsub-neg88.6%
Simplified88.6%
if -7e17 < x < -5.20000000000000019e-6Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
times-frac99.4%
+-commutative99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+l+99.4%
Applied egg-rr99.4%
clear-num99.4%
associate-/r*98.8%
frac-times99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in y around inf 60.7%
if -5.20000000000000019e-6 < x < -2.6000000000000002e-46Initial program 99.8%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 86.0%
if -2.6000000000000002e-46 < x < -5.1000000000000002e-101Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
*-un-lft-identity92.6%
times-frac91.7%
Applied egg-rr91.7%
frac-times92.6%
*-un-lft-identity92.6%
clear-num92.6%
+-commutative92.6%
Applied egg-rr92.6%
if -5.1000000000000002e-101 < x < -2.5999999999999998e-109Initial program 99.2%
*-commutative99.2%
associate-*l*99.2%
times-frac99.2%
+-commutative99.2%
+-commutative99.2%
associate-+r+99.2%
+-commutative99.2%
associate-+l+99.2%
Applied egg-rr99.2%
Taylor expanded in y around 0 37.2%
+-commutative37.2%
Simplified37.2%
if -2.5999999999999998e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
associate-*r/67.8%
associate-+r+67.8%
times-frac87.7%
associate-*r/87.8%
pow287.8%
+-commutative87.8%
associate-+r+87.8%
+-commutative87.8%
associate-+l+87.8%
Applied egg-rr87.8%
*-un-lft-identity87.8%
unpow287.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 66.2%
Final simplification72.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ x y))) (t_1 (- y (- -1.0 x))))
(if (<= x -1.85e+16)
(/ t_0 (+ x y))
(if (<= x -1.75e-9)
(/ (/ -1.0 (- -1.0 y)) (/ (+ x y) x))
(if (<= x -1.9e-46)
(/ (* y (/ 1.0 x)) t_1)
(if (<= x -5.6e-101)
(/ 1.0 (/ (* y (+ y 1.0)) x))
(if (<= x -1.06e-109)
(* t_0 (/ -1.0 (- -1.0 x)))
(/ (/ x y) t_1))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x + y);
double t_1 = y - (-1.0 - x);
double tmp;
if (x <= -1.85e+16) {
tmp = t_0 / (x + y);
} else if (x <= -1.75e-9) {
tmp = (-1.0 / (-1.0 - y)) / ((x + y) / x);
} else if (x <= -1.9e-46) {
tmp = (y * (1.0 / x)) / t_1;
} else if (x <= -5.6e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -1.06e-109) {
tmp = t_0 * (-1.0 / (-1.0 - x));
} else {
tmp = (x / y) / t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y / (x + y)
t_1 = y - ((-1.0d0) - x)
if (x <= (-1.85d+16)) then
tmp = t_0 / (x + y)
else if (x <= (-1.75d-9)) then
tmp = ((-1.0d0) / ((-1.0d0) - y)) / ((x + y) / x)
else if (x <= (-1.9d-46)) then
tmp = (y * (1.0d0 / x)) / t_1
else if (x <= (-5.6d-101)) then
tmp = 1.0d0 / ((y * (y + 1.0d0)) / x)
else if (x <= (-1.06d-109)) then
tmp = t_0 * ((-1.0d0) / ((-1.0d0) - x))
else
tmp = (x / y) / t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x + y);
double t_1 = y - (-1.0 - x);
double tmp;
if (x <= -1.85e+16) {
tmp = t_0 / (x + y);
} else if (x <= -1.75e-9) {
tmp = (-1.0 / (-1.0 - y)) / ((x + y) / x);
} else if (x <= -1.9e-46) {
tmp = (y * (1.0 / x)) / t_1;
} else if (x <= -5.6e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -1.06e-109) {
tmp = t_0 * (-1.0 / (-1.0 - x));
} else {
tmp = (x / y) / t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x + y) t_1 = y - (-1.0 - x) tmp = 0 if x <= -1.85e+16: tmp = t_0 / (x + y) elif x <= -1.75e-9: tmp = (-1.0 / (-1.0 - y)) / ((x + y) / x) elif x <= -1.9e-46: tmp = (y * (1.0 / x)) / t_1 elif x <= -5.6e-101: tmp = 1.0 / ((y * (y + 1.0)) / x) elif x <= -1.06e-109: tmp = t_0 * (-1.0 / (-1.0 - x)) else: tmp = (x / y) / t_1 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x + y)) t_1 = Float64(y - Float64(-1.0 - x)) tmp = 0.0 if (x <= -1.85e+16) tmp = Float64(t_0 / Float64(x + y)); elseif (x <= -1.75e-9) tmp = Float64(Float64(-1.0 / Float64(-1.0 - y)) / Float64(Float64(x + y) / x)); elseif (x <= -1.9e-46) tmp = Float64(Float64(y * Float64(1.0 / x)) / t_1); elseif (x <= -5.6e-101) tmp = Float64(1.0 / Float64(Float64(y * Float64(y + 1.0)) / x)); elseif (x <= -1.06e-109) tmp = Float64(t_0 * Float64(-1.0 / Float64(-1.0 - x))); else tmp = Float64(Float64(x / y) / t_1); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x + y);
t_1 = y - (-1.0 - x);
tmp = 0.0;
if (x <= -1.85e+16)
tmp = t_0 / (x + y);
elseif (x <= -1.75e-9)
tmp = (-1.0 / (-1.0 - y)) / ((x + y) / x);
elseif (x <= -1.9e-46)
tmp = (y * (1.0 / x)) / t_1;
elseif (x <= -5.6e-101)
tmp = 1.0 / ((y * (y + 1.0)) / x);
elseif (x <= -1.06e-109)
tmp = t_0 * (-1.0 / (-1.0 - x));
else
tmp = (x / y) / t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.85e+16], N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.75e-9], N[(N[(-1.0 / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e-46], N[(N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x, -5.6e-101], N[(1.0 / N[(N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.06e-109], N[(t$95$0 * N[(-1.0 / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x + y}\\
t_1 := y - \left(-1 - x\right)\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{+16}:\\
\;\;\;\;\frac{t\_0}{x + y}\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{-1}{-1 - y}}{\frac{x + y}{x}}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-46}:\\
\;\;\;\;\frac{y \cdot \frac{1}{x}}{t\_1}\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-101}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-109}:\\
\;\;\;\;t\_0 \cdot \frac{-1}{-1 - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_1}\\
\end{array}
\end{array}
if x < -1.85e16Initial program 55.7%
Taylor expanded in x around inf 55.7%
*-commutative55.7%
associate-*l*55.7%
+-commutative55.7%
times-frac77.7%
+-commutative77.7%
Applied egg-rr77.7%
associate-*l/77.7%
frac-2neg77.7%
*-commutative77.7%
Applied egg-rr77.7%
associate-/r*88.6%
*-inverses88.6%
associate-*r/88.6%
*-rgt-identity88.6%
distribute-neg-in88.6%
unsub-neg88.6%
Simplified88.6%
if -1.85e16 < x < -1.75e-9Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
times-frac99.4%
+-commutative99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+l+99.4%
Applied egg-rr99.4%
frac-times99.7%
*-commutative99.7%
frac-times99.1%
*-commutative99.1%
clear-num99.4%
un-div-inv99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in x around 0 60.6%
+-commutative60.6%
Simplified60.6%
if -1.75e-9 < x < -1.8999999999999998e-46Initial program 99.8%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
associate-*r/99.8%
associate-+r+99.8%
times-frac99.6%
associate-*r/99.6%
pow299.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+l+99.6%
Applied egg-rr99.6%
*-un-lft-identity99.6%
unpow299.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 85.9%
if -1.8999999999999998e-46 < x < -5.59999999999999978e-101Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
*-un-lft-identity92.6%
times-frac91.7%
Applied egg-rr91.7%
frac-times92.6%
*-un-lft-identity92.6%
clear-num92.6%
+-commutative92.6%
Applied egg-rr92.6%
if -5.59999999999999978e-101 < x < -1.06e-109Initial program 99.2%
*-commutative99.2%
associate-*l*99.2%
times-frac99.2%
+-commutative99.2%
+-commutative99.2%
associate-+r+99.2%
+-commutative99.2%
associate-+l+99.2%
Applied egg-rr99.2%
Taylor expanded in y around 0 37.2%
+-commutative37.2%
Simplified37.2%
if -1.06e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
associate-*r/67.8%
associate-+r+67.8%
times-frac87.7%
associate-*r/87.8%
pow287.8%
+-commutative87.8%
associate-+r+87.8%
+-commutative87.8%
associate-+l+87.8%
Applied egg-rr87.8%
*-un-lft-identity87.8%
unpow287.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 66.2%
Final simplification72.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= x -1.8e+18)
(/ (/ 1.0 x) (/ (+ x y) y))
(if (<= x -1.25e-10)
(/ (/ x (+ x y)) y)
(if (<= x -2.25e-46)
t_0
(if (<= x -5.2e-101)
(/ 1.0 (/ (* y (+ y 1.0)) x))
(if (<= x -2.6e-109) t_0 (/ (/ x y) (- y (- -1.0 x))))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -1.8e+18) {
tmp = (1.0 / x) / ((x + y) / y);
} else if (x <= -1.25e-10) {
tmp = (x / (x + y)) / y;
} else if (x <= -2.25e-46) {
tmp = t_0;
} else if (x <= -5.2e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = t_0;
} else {
tmp = (x / y) / (y - (-1.0 - x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 * (x + 1.0d0))
if (x <= (-1.8d+18)) then
tmp = (1.0d0 / x) / ((x + y) / y)
else if (x <= (-1.25d-10)) then
tmp = (x / (x + y)) / y
else if (x <= (-2.25d-46)) then
tmp = t_0
else if (x <= (-5.2d-101)) then
tmp = 1.0d0 / ((y * (y + 1.0d0)) / x)
else if (x <= (-2.6d-109)) then
tmp = t_0
else
tmp = (x / y) / (y - ((-1.0d0) - x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -1.8e+18) {
tmp = (1.0 / x) / ((x + y) / y);
} else if (x <= -1.25e-10) {
tmp = (x / (x + y)) / y;
} else if (x <= -2.25e-46) {
tmp = t_0;
} else if (x <= -5.2e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = t_0;
} else {
tmp = (x / y) / (y - (-1.0 - x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if x <= -1.8e+18: tmp = (1.0 / x) / ((x + y) / y) elif x <= -1.25e-10: tmp = (x / (x + y)) / y elif x <= -2.25e-46: tmp = t_0 elif x <= -5.2e-101: tmp = 1.0 / ((y * (y + 1.0)) / x) elif x <= -2.6e-109: tmp = t_0 else: tmp = (x / y) / (y - (-1.0 - x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (x <= -1.8e+18) tmp = Float64(Float64(1.0 / x) / Float64(Float64(x + y) / y)); elseif (x <= -1.25e-10) tmp = Float64(Float64(x / Float64(x + y)) / y); elseif (x <= -2.25e-46) tmp = t_0; elseif (x <= -5.2e-101) tmp = Float64(1.0 / Float64(Float64(y * Float64(y + 1.0)) / x)); elseif (x <= -2.6e-109) tmp = t_0; else tmp = Float64(Float64(x / y) / Float64(y - Float64(-1.0 - x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * (x + 1.0));
tmp = 0.0;
if (x <= -1.8e+18)
tmp = (1.0 / x) / ((x + y) / y);
elseif (x <= -1.25e-10)
tmp = (x / (x + y)) / y;
elseif (x <= -2.25e-46)
tmp = t_0;
elseif (x <= -5.2e-101)
tmp = 1.0 / ((y * (y + 1.0)) / x);
elseif (x <= -2.6e-109)
tmp = t_0;
else
tmp = (x / y) / (y - (-1.0 - x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.8e+18], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.25e-10], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, -2.25e-46], t$95$0, If[LessEqual[x, -5.2e-101], N[(1.0 / N[(N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6e-109], t$95$0, N[(N[(x / y), $MachinePrecision] / N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{x + y}{y}}\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\
\mathbf{elif}\;x \leq -2.25 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-101}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y - \left(-1 - x\right)}\\
\end{array}
\end{array}
if x < -1.8e18Initial program 55.7%
*-commutative55.7%
associate-*l*55.7%
times-frac79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
+-commutative79.2%
associate-+l+79.2%
Applied egg-rr79.2%
Taylor expanded in x around inf 88.1%
*-commutative88.1%
+-commutative88.1%
clear-num88.1%
un-div-inv88.2%
Applied egg-rr88.2%
if -1.8e18 < x < -1.25000000000000008e-10Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
times-frac99.4%
+-commutative99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+l+99.4%
Applied egg-rr99.4%
clear-num99.4%
associate-/r*98.8%
frac-times99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in y around inf 60.7%
if -1.25000000000000008e-10 < x < -2.25e-46 or -5.2000000000000002e-101 < x < -2.5999999999999998e-109Initial program 99.7%
associate-/l*99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 74.8%
if -2.25e-46 < x < -5.2000000000000002e-101Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
*-un-lft-identity92.6%
times-frac91.7%
Applied egg-rr91.7%
frac-times92.6%
*-un-lft-identity92.6%
clear-num92.6%
+-commutative92.6%
Applied egg-rr92.6%
if -2.5999999999999998e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
associate-*r/67.8%
associate-+r+67.8%
times-frac87.7%
associate-*r/87.8%
pow287.8%
+-commutative87.8%
associate-+r+87.8%
+-commutative87.8%
associate-+l+87.8%
Applied egg-rr87.8%
*-un-lft-identity87.8%
unpow287.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 66.2%
Final simplification72.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= x -9.5e+129)
(* (/ 1.0 x) (/ y x))
(if (<= x -5.3e+14)
(/ y (* x (+ x y)))
(if (<= x -1.36e-46)
t_0
(if (<= x -5.1e-101)
(/ x (* y (+ y 1.0)))
(if (<= x -1.06e-109) t_0 (/ (/ x (+ y 1.0)) y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -9.5e+129) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -5.3e+14) {
tmp = y / (x * (x + y));
} else if (x <= -1.36e-46) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = x / (y * (y + 1.0));
} else if (x <= -1.06e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 * (x + 1.0d0))
if (x <= (-9.5d+129)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-5.3d+14)) then
tmp = y / (x * (x + y))
else if (x <= (-1.36d-46)) then
tmp = t_0
else if (x <= (-5.1d-101)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-1.06d-109)) then
tmp = t_0
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -9.5e+129) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -5.3e+14) {
tmp = y / (x * (x + y));
} else if (x <= -1.36e-46) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = x / (y * (y + 1.0));
} else if (x <= -1.06e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if x <= -9.5e+129: tmp = (1.0 / x) * (y / x) elif x <= -5.3e+14: tmp = y / (x * (x + y)) elif x <= -1.36e-46: tmp = t_0 elif x <= -5.1e-101: tmp = x / (y * (y + 1.0)) elif x <= -1.06e-109: tmp = t_0 else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (x <= -9.5e+129) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -5.3e+14) tmp = Float64(y / Float64(x * Float64(x + y))); elseif (x <= -1.36e-46) tmp = t_0; elseif (x <= -5.1e-101) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -1.06e-109) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * (x + 1.0));
tmp = 0.0;
if (x <= -9.5e+129)
tmp = (1.0 / x) * (y / x);
elseif (x <= -5.3e+14)
tmp = y / (x * (x + y));
elseif (x <= -1.36e-46)
tmp = t_0;
elseif (x <= -5.1e-101)
tmp = x / (y * (y + 1.0));
elseif (x <= -1.06e-109)
tmp = t_0;
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e+129], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.3e+14], N[(y / N[(x * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.36e-46], t$95$0, If[LessEqual[x, -5.1e-101], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.06e-109], t$95$0, N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+129}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -5.3 \cdot 10^{+14}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + y\right)}\\
\mathbf{elif}\;x \leq -1.36 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.1 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -9.5000000000000004e129Initial program 50.0%
*-commutative50.0%
associate-*l*50.0%
times-frac73.7%
+-commutative73.7%
+-commutative73.7%
associate-+r+73.7%
+-commutative73.7%
associate-+l+73.7%
Applied egg-rr73.7%
Taylor expanded in x around inf 93.1%
Taylor expanded in y around 0 93.0%
if -9.5000000000000004e129 < x < -5.3e14Initial program 78.3%
*-commutative78.3%
associate-*l*78.3%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+l+99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 65.2%
frac-times85.9%
*-rgt-identity85.9%
+-commutative85.9%
Applied egg-rr85.9%
if -5.3e14 < x < -1.3600000000000001e-46 or -5.1000000000000002e-101 < x < -1.06e-109Initial program 99.6%
associate-/l*99.3%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in y around 0 67.6%
if -1.3600000000000001e-46 < x < -5.1000000000000002e-101Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
if -1.06e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in x around 0 64.7%
+-commutative64.7%
Simplified64.7%
*-un-lft-identity64.7%
times-frac66.0%
Applied egg-rr66.0%
associate-*l/66.0%
*-un-lft-identity66.0%
+-commutative66.0%
Applied egg-rr66.0%
Final simplification73.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= x -1.8e+18)
(/ (/ y x) (+ x y))
(if (<= x -0.000106)
(/ (/ x (+ x y)) y)
(if (<= x -2.6e-46)
t_0
(if (<= x -5.1e-101)
(/ x (* y (+ y 1.0)))
(if (<= x -1.06e-109) t_0 (/ (/ x (+ y 1.0)) y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -1.8e+18) {
tmp = (y / x) / (x + y);
} else if (x <= -0.000106) {
tmp = (x / (x + y)) / y;
} else if (x <= -2.6e-46) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = x / (y * (y + 1.0));
} else if (x <= -1.06e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 * (x + 1.0d0))
if (x <= (-1.8d+18)) then
tmp = (y / x) / (x + y)
else if (x <= (-0.000106d0)) then
tmp = (x / (x + y)) / y
else if (x <= (-2.6d-46)) then
tmp = t_0
else if (x <= (-5.1d-101)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-1.06d-109)) then
tmp = t_0
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -1.8e+18) {
tmp = (y / x) / (x + y);
} else if (x <= -0.000106) {
tmp = (x / (x + y)) / y;
} else if (x <= -2.6e-46) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = x / (y * (y + 1.0));
} else if (x <= -1.06e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if x <= -1.8e+18: tmp = (y / x) / (x + y) elif x <= -0.000106: tmp = (x / (x + y)) / y elif x <= -2.6e-46: tmp = t_0 elif x <= -5.1e-101: tmp = x / (y * (y + 1.0)) elif x <= -1.06e-109: tmp = t_0 else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (x <= -1.8e+18) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -0.000106) tmp = Float64(Float64(x / Float64(x + y)) / y); elseif (x <= -2.6e-46) tmp = t_0; elseif (x <= -5.1e-101) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -1.06e-109) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * (x + 1.0));
tmp = 0.0;
if (x <= -1.8e+18)
tmp = (y / x) / (x + y);
elseif (x <= -0.000106)
tmp = (x / (x + y)) / y;
elseif (x <= -2.6e-46)
tmp = t_0;
elseif (x <= -5.1e-101)
tmp = x / (y * (y + 1.0));
elseif (x <= -1.06e-109)
tmp = t_0;
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.8e+18], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -0.000106], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, -2.6e-46], t$95$0, If[LessEqual[x, -5.1e-101], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.06e-109], t$95$0, N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -0.000106:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.1 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -1.8e18Initial program 55.7%
*-commutative55.7%
associate-*l*55.7%
times-frac79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
+-commutative79.2%
associate-+l+79.2%
Applied egg-rr79.2%
Taylor expanded in x around inf 88.1%
frac-times77.7%
*-rgt-identity77.7%
+-commutative77.7%
Applied egg-rr77.7%
associate-/l/88.1%
Simplified88.1%
if -1.8e18 < x < -1.06e-4Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
times-frac99.4%
+-commutative99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+l+99.4%
Applied egg-rr99.4%
clear-num99.4%
associate-/r*98.8%
frac-times99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in y around inf 60.7%
if -1.06e-4 < x < -2.6000000000000002e-46 or -5.1000000000000002e-101 < x < -1.06e-109Initial program 99.7%
associate-/l*99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 74.8%
if -2.6000000000000002e-46 < x < -5.1000000000000002e-101Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
if -1.06e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in x around 0 64.7%
+-commutative64.7%
Simplified64.7%
*-un-lft-identity64.7%
times-frac66.0%
Applied egg-rr66.0%
associate-*l/66.0%
*-un-lft-identity66.0%
+-commutative66.0%
Applied egg-rr66.0%
Final simplification72.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= x -1.25e+18)
(* (/ y (+ x y)) (/ 1.0 x))
(if (<= x -3e-10)
(/ (/ x (+ x y)) y)
(if (<= x -6.8e-47)
t_0
(if (<= x -5.1e-101)
(/ x (* y (+ y 1.0)))
(if (<= x -1.06e-109) t_0 (/ (/ x (+ y 1.0)) y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -1.25e+18) {
tmp = (y / (x + y)) * (1.0 / x);
} else if (x <= -3e-10) {
tmp = (x / (x + y)) / y;
} else if (x <= -6.8e-47) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = x / (y * (y + 1.0));
} else if (x <= -1.06e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 * (x + 1.0d0))
if (x <= (-1.25d+18)) then
tmp = (y / (x + y)) * (1.0d0 / x)
else if (x <= (-3d-10)) then
tmp = (x / (x + y)) / y
else if (x <= (-6.8d-47)) then
tmp = t_0
else if (x <= (-5.1d-101)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-1.06d-109)) then
tmp = t_0
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -1.25e+18) {
tmp = (y / (x + y)) * (1.0 / x);
} else if (x <= -3e-10) {
tmp = (x / (x + y)) / y;
} else if (x <= -6.8e-47) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = x / (y * (y + 1.0));
} else if (x <= -1.06e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if x <= -1.25e+18: tmp = (y / (x + y)) * (1.0 / x) elif x <= -3e-10: tmp = (x / (x + y)) / y elif x <= -6.8e-47: tmp = t_0 elif x <= -5.1e-101: tmp = x / (y * (y + 1.0)) elif x <= -1.06e-109: tmp = t_0 else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (x <= -1.25e+18) tmp = Float64(Float64(y / Float64(x + y)) * Float64(1.0 / x)); elseif (x <= -3e-10) tmp = Float64(Float64(x / Float64(x + y)) / y); elseif (x <= -6.8e-47) tmp = t_0; elseif (x <= -5.1e-101) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -1.06e-109) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * (x + 1.0));
tmp = 0.0;
if (x <= -1.25e+18)
tmp = (y / (x + y)) * (1.0 / x);
elseif (x <= -3e-10)
tmp = (x / (x + y)) / y;
elseif (x <= -6.8e-47)
tmp = t_0;
elseif (x <= -5.1e-101)
tmp = x / (y * (y + 1.0));
elseif (x <= -1.06e-109)
tmp = t_0;
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+18], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3e-10], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, -6.8e-47], t$95$0, If[LessEqual[x, -5.1e-101], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.06e-109], t$95$0, N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+18}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.1 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -1.25e18Initial program 55.7%
*-commutative55.7%
associate-*l*55.7%
times-frac79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
+-commutative79.2%
associate-+l+79.2%
Applied egg-rr79.2%
Taylor expanded in x around inf 88.1%
if -1.25e18 < x < -3e-10Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
times-frac99.4%
+-commutative99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+l+99.4%
Applied egg-rr99.4%
clear-num99.4%
associate-/r*98.8%
frac-times99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in y around inf 60.7%
if -3e-10 < x < -6.8000000000000003e-47 or -5.1000000000000002e-101 < x < -1.06e-109Initial program 99.7%
associate-/l*99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 74.8%
if -6.8000000000000003e-47 < x < -5.1000000000000002e-101Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
if -1.06e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in x around 0 64.7%
+-commutative64.7%
Simplified64.7%
*-un-lft-identity64.7%
times-frac66.0%
Applied egg-rr66.0%
associate-*l/66.0%
*-un-lft-identity66.0%
+-commutative66.0%
Applied egg-rr66.0%
Final simplification72.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= x -9.2e+17)
(* (/ y (+ x y)) (/ 1.0 x))
(if (<= x -1.7e-6)
(/ (/ x (+ x y)) y)
(if (<= x -1.9e-46)
t_0
(if (<= x -5.1e-101)
(/ 1.0 (/ (* y (+ y 1.0)) x))
(if (<= x -2.6e-109) t_0 (/ (/ x (+ y 1.0)) y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -9.2e+17) {
tmp = (y / (x + y)) * (1.0 / x);
} else if (x <= -1.7e-6) {
tmp = (x / (x + y)) / y;
} else if (x <= -1.9e-46) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 * (x + 1.0d0))
if (x <= (-9.2d+17)) then
tmp = (y / (x + y)) * (1.0d0 / x)
else if (x <= (-1.7d-6)) then
tmp = (x / (x + y)) / y
else if (x <= (-1.9d-46)) then
tmp = t_0
else if (x <= (-5.1d-101)) then
tmp = 1.0d0 / ((y * (y + 1.0d0)) / x)
else if (x <= (-2.6d-109)) then
tmp = t_0
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -9.2e+17) {
tmp = (y / (x + y)) * (1.0 / x);
} else if (x <= -1.7e-6) {
tmp = (x / (x + y)) / y;
} else if (x <= -1.9e-46) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if x <= -9.2e+17: tmp = (y / (x + y)) * (1.0 / x) elif x <= -1.7e-6: tmp = (x / (x + y)) / y elif x <= -1.9e-46: tmp = t_0 elif x <= -5.1e-101: tmp = 1.0 / ((y * (y + 1.0)) / x) elif x <= -2.6e-109: tmp = t_0 else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (x <= -9.2e+17) tmp = Float64(Float64(y / Float64(x + y)) * Float64(1.0 / x)); elseif (x <= -1.7e-6) tmp = Float64(Float64(x / Float64(x + y)) / y); elseif (x <= -1.9e-46) tmp = t_0; elseif (x <= -5.1e-101) tmp = Float64(1.0 / Float64(Float64(y * Float64(y + 1.0)) / x)); elseif (x <= -2.6e-109) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * (x + 1.0));
tmp = 0.0;
if (x <= -9.2e+17)
tmp = (y / (x + y)) * (1.0 / x);
elseif (x <= -1.7e-6)
tmp = (x / (x + y)) / y;
elseif (x <= -1.9e-46)
tmp = t_0;
elseif (x <= -5.1e-101)
tmp = 1.0 / ((y * (y + 1.0)) / x);
elseif (x <= -2.6e-109)
tmp = t_0;
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.2e+17], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-6], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, -1.9e-46], t$95$0, If[LessEqual[x, -5.1e-101], N[(1.0 / N[(N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6e-109], t$95$0, N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;x \leq -9.2 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.1 \cdot 10^{-101}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -9.2e17Initial program 55.7%
*-commutative55.7%
associate-*l*55.7%
times-frac79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
+-commutative79.2%
associate-+l+79.2%
Applied egg-rr79.2%
Taylor expanded in x around inf 88.1%
if -9.2e17 < x < -1.70000000000000003e-6Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
times-frac99.4%
+-commutative99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+l+99.4%
Applied egg-rr99.4%
clear-num99.4%
associate-/r*98.8%
frac-times99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in y around inf 60.7%
if -1.70000000000000003e-6 < x < -1.8999999999999998e-46 or -5.1000000000000002e-101 < x < -2.5999999999999998e-109Initial program 99.7%
associate-/l*99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 74.8%
if -1.8999999999999998e-46 < x < -5.1000000000000002e-101Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
*-un-lft-identity92.6%
times-frac91.7%
Applied egg-rr91.7%
frac-times92.6%
*-un-lft-identity92.6%
clear-num92.6%
+-commutative92.6%
Applied egg-rr92.6%
if -2.5999999999999998e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in x around 0 64.7%
+-commutative64.7%
Simplified64.7%
*-un-lft-identity64.7%
times-frac66.0%
Applied egg-rr66.0%
associate-*l/66.0%
*-un-lft-identity66.0%
+-commutative66.0%
Applied egg-rr66.0%
Final simplification72.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= x -2.8e+17)
(/ (/ 1.0 x) (/ (+ x y) y))
(if (<= x -1.85e-10)
(/ (/ x (+ x y)) y)
(if (<= x -2.5e-46)
t_0
(if (<= x -3.8e-100)
(/ 1.0 (/ (* y (+ y 1.0)) x))
(if (<= x -2.6e-109) t_0 (/ (/ x (+ y 1.0)) y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -2.8e+17) {
tmp = (1.0 / x) / ((x + y) / y);
} else if (x <= -1.85e-10) {
tmp = (x / (x + y)) / y;
} else if (x <= -2.5e-46) {
tmp = t_0;
} else if (x <= -3.8e-100) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 * (x + 1.0d0))
if (x <= (-2.8d+17)) then
tmp = (1.0d0 / x) / ((x + y) / y)
else if (x <= (-1.85d-10)) then
tmp = (x / (x + y)) / y
else if (x <= (-2.5d-46)) then
tmp = t_0
else if (x <= (-3.8d-100)) then
tmp = 1.0d0 / ((y * (y + 1.0d0)) / x)
else if (x <= (-2.6d-109)) then
tmp = t_0
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (x <= -2.8e+17) {
tmp = (1.0 / x) / ((x + y) / y);
} else if (x <= -1.85e-10) {
tmp = (x / (x + y)) / y;
} else if (x <= -2.5e-46) {
tmp = t_0;
} else if (x <= -3.8e-100) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if x <= -2.8e+17: tmp = (1.0 / x) / ((x + y) / y) elif x <= -1.85e-10: tmp = (x / (x + y)) / y elif x <= -2.5e-46: tmp = t_0 elif x <= -3.8e-100: tmp = 1.0 / ((y * (y + 1.0)) / x) elif x <= -2.6e-109: tmp = t_0 else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (x <= -2.8e+17) tmp = Float64(Float64(1.0 / x) / Float64(Float64(x + y) / y)); elseif (x <= -1.85e-10) tmp = Float64(Float64(x / Float64(x + y)) / y); elseif (x <= -2.5e-46) tmp = t_0; elseif (x <= -3.8e-100) tmp = Float64(1.0 / Float64(Float64(y * Float64(y + 1.0)) / x)); elseif (x <= -2.6e-109) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * (x + 1.0));
tmp = 0.0;
if (x <= -2.8e+17)
tmp = (1.0 / x) / ((x + y) / y);
elseif (x <= -1.85e-10)
tmp = (x / (x + y)) / y;
elseif (x <= -2.5e-46)
tmp = t_0;
elseif (x <= -3.8e-100)
tmp = 1.0 / ((y * (y + 1.0)) / x);
elseif (x <= -2.6e-109)
tmp = t_0;
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8e+17], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.85e-10], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, -2.5e-46], t$95$0, If[LessEqual[x, -3.8e-100], N[(1.0 / N[(N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6e-109], t$95$0, N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{x + y}{y}}\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-100}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -2.8e17Initial program 55.7%
*-commutative55.7%
associate-*l*55.7%
times-frac79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
+-commutative79.2%
associate-+l+79.2%
Applied egg-rr79.2%
Taylor expanded in x around inf 88.1%
*-commutative88.1%
+-commutative88.1%
clear-num88.1%
un-div-inv88.2%
Applied egg-rr88.2%
if -2.8e17 < x < -1.85000000000000007e-10Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
times-frac99.4%
+-commutative99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+l+99.4%
Applied egg-rr99.4%
clear-num99.4%
associate-/r*98.8%
frac-times99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in y around inf 60.7%
if -1.85000000000000007e-10 < x < -2.49999999999999996e-46 or -3.79999999999999997e-100 < x < -2.5999999999999998e-109Initial program 99.7%
associate-/l*99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 74.8%
if -2.49999999999999996e-46 < x < -3.79999999999999997e-100Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
*-un-lft-identity92.6%
times-frac91.7%
Applied egg-rr91.7%
frac-times92.6%
*-un-lft-identity92.6%
clear-num92.6%
+-commutative92.6%
Applied egg-rr92.6%
if -2.5999999999999998e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in x around 0 64.7%
+-commutative64.7%
Simplified64.7%
*-un-lft-identity64.7%
times-frac66.0%
Applied egg-rr66.0%
associate-*l/66.0%
*-un-lft-identity66.0%
+-commutative66.0%
Applied egg-rr66.0%
Final simplification72.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -5e+129)
(* (/ 1.0 x) (/ y x))
(if (or (<= x -2.6e-46) (and (not (<= x -1.4e-100)) (<= x -2.6e-109)))
(/ y (* x (+ x 1.0)))
(/ x (* y (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -5e+129) {
tmp = (1.0 / x) * (y / x);
} else if ((x <= -2.6e-46) || (!(x <= -1.4e-100) && (x <= -2.6e-109))) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5d+129)) then
tmp = (1.0d0 / x) * (y / x)
else if ((x <= (-2.6d-46)) .or. (.not. (x <= (-1.4d-100))) .and. (x <= (-2.6d-109))) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -5e+129) {
tmp = (1.0 / x) * (y / x);
} else if ((x <= -2.6e-46) || (!(x <= -1.4e-100) && (x <= -2.6e-109))) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -5e+129: tmp = (1.0 / x) * (y / x) elif (x <= -2.6e-46) or (not (x <= -1.4e-100) and (x <= -2.6e-109)): tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -5e+129) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif ((x <= -2.6e-46) || (!(x <= -1.4e-100) && (x <= -2.6e-109))) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -5e+129)
tmp = (1.0 / x) * (y / x);
elseif ((x <= -2.6e-46) || (~((x <= -1.4e-100)) && (x <= -2.6e-109)))
tmp = y / (x * (x + 1.0));
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -5e+129], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -2.6e-46], And[N[Not[LessEqual[x, -1.4e-100]], $MachinePrecision], LessEqual[x, -2.6e-109]]], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+129}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-46} \lor \neg \left(x \leq -1.4 \cdot 10^{-100}\right) \land x \leq -2.6 \cdot 10^{-109}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -5.0000000000000003e129Initial program 50.0%
*-commutative50.0%
associate-*l*50.0%
times-frac73.7%
+-commutative73.7%
+-commutative73.7%
associate-+r+73.7%
+-commutative73.7%
associate-+l+73.7%
Applied egg-rr73.7%
Taylor expanded in x around inf 93.1%
Taylor expanded in y around 0 93.0%
if -5.0000000000000003e129 < x < -2.6000000000000002e-46 or -1.39999999999999998e-100 < x < -2.5999999999999998e-109Initial program 88.6%
associate-/l*95.0%
associate-+l+95.0%
Simplified95.0%
Taylor expanded in y around 0 66.1%
if -2.6000000000000002e-46 < x < -1.39999999999999998e-100 or -2.5999999999999998e-109 < x Initial program 68.7%
associate-/l*80.9%
associate-+l+80.9%
Simplified80.9%
Taylor expanded in x around 0 66.0%
+-commutative66.0%
Simplified66.0%
Final simplification71.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -3.4e+103)
(/ (/ 1.0 (+ x y)) (/ (+ x y) y))
(if (<= x -2.3e-177)
(* x (/ y (* (* (+ x y) (+ x y)) (+ x (+ y 1.0)))))
(/ (/ x (+ x y)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4e+103) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (x <= -2.3e-177) {
tmp = x * (y / (((x + y) * (x + y)) * (x + (y + 1.0))));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.4d+103)) then
tmp = (1.0d0 / (x + y)) / ((x + y) / y)
else if (x <= (-2.3d-177)) then
tmp = x * (y / (((x + y) * (x + y)) * (x + (y + 1.0d0))))
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.4e+103) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (x <= -2.3e-177) {
tmp = x * (y / (((x + y) * (x + y)) * (x + (y + 1.0))));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4e+103: tmp = (1.0 / (x + y)) / ((x + y) / y) elif x <= -2.3e-177: tmp = x * (y / (((x + y) * (x + y)) * (x + (y + 1.0)))) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4e+103) tmp = Float64(Float64(1.0 / Float64(x + y)) / Float64(Float64(x + y) / y)); elseif (x <= -2.3e-177) tmp = Float64(x * Float64(y / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(x + Float64(y + 1.0))))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.4e+103)
tmp = (1.0 / (x + y)) / ((x + y) / y);
elseif (x <= -2.3e-177)
tmp = x * (y / (((x + y) * (x + y)) * (x + (y + 1.0))));
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.4e+103], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.3e-177], N[(x * N[(y / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+103}:\\
\;\;\;\;\frac{\frac{1}{x + y}}{\frac{x + y}{y}}\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-177}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -3.3999999999999998e103Initial program 50.0%
Taylor expanded in x around inf 50.0%
*-commutative50.0%
associate-*l*50.0%
+-commutative50.0%
times-frac73.7%
+-commutative73.7%
Applied egg-rr73.7%
clear-num73.7%
associate-/r*93.2%
frac-times88.1%
*-un-lft-identity88.1%
Applied egg-rr88.1%
div-inv88.1%
*-commutative88.1%
times-frac93.2%
Applied egg-rr93.2%
*-inverses93.2%
associate-*r/93.2%
Simplified93.2%
if -3.3999999999999998e103 < x < -2.30000000000000022e-177Initial program 90.5%
associate-/l*94.5%
associate-+l+94.5%
Simplified94.5%
if -2.30000000000000022e-177 < x Initial program 66.3%
*-commutative66.3%
associate-*l*66.3%
times-frac96.0%
+-commutative96.0%
+-commutative96.0%
associate-+r+96.0%
+-commutative96.0%
associate-+l+96.0%
Applied egg-rr96.0%
clear-num96.0%
associate-/r*99.8%
frac-times99.3%
*-un-lft-identity99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 65.3%
+-commutative65.3%
Simplified65.3%
Final simplification75.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ y (+ x y)) (/ -1.0 (- -1.0 x)))))
(if (<= x -1.65e-46)
t_0
(if (<= x -5.1e-101)
(/ 1.0 (/ (* y (+ y 1.0)) x))
(if (<= x -2.3e-109) t_0 (/ (/ x y) (- y (- -1.0 x))))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / (x + y)) * (-1.0 / (-1.0 - x));
double tmp;
if (x <= -1.65e-46) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.3e-109) {
tmp = t_0;
} else {
tmp = (x / y) / (y - (-1.0 - x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 + y)) * ((-1.0d0) / ((-1.0d0) - x))
if (x <= (-1.65d-46)) then
tmp = t_0
else if (x <= (-5.1d-101)) then
tmp = 1.0d0 / ((y * (y + 1.0d0)) / x)
else if (x <= (-2.3d-109)) then
tmp = t_0
else
tmp = (x / y) / (y - ((-1.0d0) - x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / (x + y)) * (-1.0 / (-1.0 - x));
double tmp;
if (x <= -1.65e-46) {
tmp = t_0;
} else if (x <= -5.1e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.3e-109) {
tmp = t_0;
} else {
tmp = (x / y) / (y - (-1.0 - x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / (x + y)) * (-1.0 / (-1.0 - x)) tmp = 0 if x <= -1.65e-46: tmp = t_0 elif x <= -5.1e-101: tmp = 1.0 / ((y * (y + 1.0)) / x) elif x <= -2.3e-109: tmp = t_0 else: tmp = (x / y) / (y - (-1.0 - x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / Float64(x + y)) * Float64(-1.0 / Float64(-1.0 - x))) tmp = 0.0 if (x <= -1.65e-46) tmp = t_0; elseif (x <= -5.1e-101) tmp = Float64(1.0 / Float64(Float64(y * Float64(y + 1.0)) / x)); elseif (x <= -2.3e-109) tmp = t_0; else tmp = Float64(Float64(x / y) / Float64(y - Float64(-1.0 - x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / (x + y)) * (-1.0 / (-1.0 - x));
tmp = 0.0;
if (x <= -1.65e-46)
tmp = t_0;
elseif (x <= -5.1e-101)
tmp = 1.0 / ((y * (y + 1.0)) / x);
elseif (x <= -2.3e-109)
tmp = t_0;
else
tmp = (x / y) / (y - (-1.0 - x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e-46], t$95$0, If[LessEqual[x, -5.1e-101], N[(1.0 / N[(N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.3e-109], t$95$0, N[(N[(x / y), $MachinePrecision] / N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x + y} \cdot \frac{-1}{-1 - x}\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.1 \cdot 10^{-101}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y - \left(-1 - x\right)}\\
\end{array}
\end{array}
if x < -1.65000000000000007e-46 or -5.1000000000000002e-101 < x < -2.3000000000000001e-109Initial program 63.9%
*-commutative63.9%
associate-*l*63.9%
times-frac83.0%
+-commutative83.0%
+-commutative83.0%
associate-+r+83.0%
+-commutative83.0%
associate-+l+83.0%
Applied egg-rr83.0%
Taylor expanded in y around 0 83.6%
+-commutative83.6%
Simplified83.6%
if -1.65000000000000007e-46 < x < -5.1000000000000002e-101Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
*-un-lft-identity92.6%
times-frac91.7%
Applied egg-rr91.7%
frac-times92.6%
*-un-lft-identity92.6%
clear-num92.6%
+-commutative92.6%
Applied egg-rr92.6%
if -2.3000000000000001e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
associate-*r/67.8%
associate-+r+67.8%
times-frac87.7%
associate-*r/87.8%
pow287.8%
+-commutative87.8%
associate-+r+87.8%
+-commutative87.8%
associate-+l+87.8%
Applied egg-rr87.8%
*-un-lft-identity87.8%
unpow287.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 66.2%
Final simplification72.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (- y (- -1.0 x))))
(if (<= x -2.6e-46)
(/ (* y (/ 1.0 x)) t_0)
(if (<= x -5.1e-101)
(/ 1.0 (/ (* y (+ y 1.0)) x))
(if (<= x -2.6e-109)
(* (/ y (+ x y)) (/ -1.0 (- -1.0 x)))
(/ (/ x y) t_0))))))assert(x < y);
double code(double x, double y) {
double t_0 = y - (-1.0 - x);
double tmp;
if (x <= -2.6e-46) {
tmp = (y * (1.0 / x)) / t_0;
} else if (x <= -5.1e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = (y / (x + y)) * (-1.0 / (-1.0 - x));
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 - ((-1.0d0) - x)
if (x <= (-2.6d-46)) then
tmp = (y * (1.0d0 / x)) / t_0
else if (x <= (-5.1d-101)) then
tmp = 1.0d0 / ((y * (y + 1.0d0)) / x)
else if (x <= (-2.6d-109)) then
tmp = (y / (x + y)) * ((-1.0d0) / ((-1.0d0) - x))
else
tmp = (x / y) / t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y - (-1.0 - x);
double tmp;
if (x <= -2.6e-46) {
tmp = (y * (1.0 / x)) / t_0;
} else if (x <= -5.1e-101) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -2.6e-109) {
tmp = (y / (x + y)) * (-1.0 / (-1.0 - x));
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y - (-1.0 - x) tmp = 0 if x <= -2.6e-46: tmp = (y * (1.0 / x)) / t_0 elif x <= -5.1e-101: tmp = 1.0 / ((y * (y + 1.0)) / x) elif x <= -2.6e-109: tmp = (y / (x + y)) * (-1.0 / (-1.0 - x)) else: tmp = (x / y) / t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y - Float64(-1.0 - x)) tmp = 0.0 if (x <= -2.6e-46) tmp = Float64(Float64(y * Float64(1.0 / x)) / t_0); elseif (x <= -5.1e-101) tmp = Float64(1.0 / Float64(Float64(y * Float64(y + 1.0)) / x)); elseif (x <= -2.6e-109) tmp = Float64(Float64(y / Float64(x + y)) * Float64(-1.0 / Float64(-1.0 - x))); else tmp = Float64(Float64(x / y) / t_0); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y - (-1.0 - x);
tmp = 0.0;
if (x <= -2.6e-46)
tmp = (y * (1.0 / x)) / t_0;
elseif (x <= -5.1e-101)
tmp = 1.0 / ((y * (y + 1.0)) / x);
elseif (x <= -2.6e-109)
tmp = (y / (x + y)) * (-1.0 / (-1.0 - x));
else
tmp = (x / y) / t_0;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e-46], N[(N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, -5.1e-101], N[(1.0 / N[(N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6e-109], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y - \left(-1 - x\right)\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{-46}:\\
\;\;\;\;\frac{y \cdot \frac{1}{x}}{t\_0}\\
\mathbf{elif}\;x \leq -5.1 \cdot 10^{-101}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-109}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{-1}{-1 - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\end{array}
\end{array}
if x < -2.6000000000000002e-46Initial program 62.9%
associate-/l*75.8%
associate-+l+75.8%
Simplified75.8%
associate-*r/62.9%
associate-+r+62.9%
times-frac82.5%
associate-*r/82.5%
pow282.5%
+-commutative82.5%
associate-+r+82.5%
+-commutative82.5%
associate-+l+82.5%
Applied egg-rr82.5%
*-un-lft-identity82.5%
unpow282.5%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 84.8%
if -2.6000000000000002e-46 < x < -5.1000000000000002e-101Initial program 87.6%
associate-/l*88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around 0 92.6%
+-commutative92.6%
Simplified92.6%
*-un-lft-identity92.6%
times-frac91.7%
Applied egg-rr91.7%
frac-times92.6%
*-un-lft-identity92.6%
clear-num92.6%
+-commutative92.6%
Applied egg-rr92.6%
if -5.1000000000000002e-101 < x < -2.5999999999999998e-109Initial program 99.2%
*-commutative99.2%
associate-*l*99.2%
times-frac99.2%
+-commutative99.2%
+-commutative99.2%
associate-+r+99.2%
+-commutative99.2%
associate-+l+99.2%
Applied egg-rr99.2%
Taylor expanded in y around 0 37.2%
+-commutative37.2%
Simplified37.2%
if -2.5999999999999998e-109 < x Initial program 67.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
associate-*r/67.8%
associate-+r+67.8%
times-frac87.7%
associate-*r/87.8%
pow287.8%
+-commutative87.8%
associate-+r+87.8%
+-commutative87.8%
associate-+l+87.8%
Applied egg-rr87.8%
*-un-lft-identity87.8%
unpow287.8%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 66.2%
Final simplification72.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.02e+93)
(/ (/ 1.0 (+ x y)) (/ (+ x y) y))
(if (<= x -2.7e-120)
(/ (* x y) (* (+ x 1.0) (* (+ x y) (+ x y))))
(/ (/ x (+ x y)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.02e+93) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (x <= -2.7e-120) {
tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.02d+93)) then
tmp = (1.0d0 / (x + y)) / ((x + y) / y)
else if (x <= (-2.7d-120)) then
tmp = (x * y) / ((x + 1.0d0) * ((x + y) * (x + y)))
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.02e+93) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (x <= -2.7e-120) {
tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.02e+93: tmp = (1.0 / (x + y)) / ((x + y) / y) elif x <= -2.7e-120: tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y))) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.02e+93) tmp = Float64(Float64(1.0 / Float64(x + y)) / Float64(Float64(x + y) / y)); elseif (x <= -2.7e-120) tmp = Float64(Float64(x * y) / Float64(Float64(x + 1.0) * Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.02e+93)
tmp = (1.0 / (x + y)) / ((x + y) / y);
elseif (x <= -2.7e-120)
tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y)));
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.02e+93], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.7e-120], N[(N[(x * y), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+93}:\\
\;\;\;\;\frac{\frac{1}{x + y}}{\frac{x + y}{y}}\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-120}:\\
\;\;\;\;\frac{x \cdot y}{\left(x + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.0200000000000001e93Initial program 51.8%
Taylor expanded in x around inf 51.8%
*-commutative51.8%
associate-*l*51.8%
+-commutative51.8%
times-frac76.6%
+-commutative76.6%
Applied egg-rr76.6%
clear-num76.6%
associate-/r*90.5%
frac-times85.9%
*-un-lft-identity85.9%
Applied egg-rr85.9%
div-inv86.0%
*-commutative86.0%
times-frac90.5%
Applied egg-rr90.5%
*-inverses90.5%
associate-*r/90.5%
Simplified90.5%
if -1.0200000000000001e93 < x < -2.6999999999999999e-120Initial program 93.5%
Taylor expanded in y around 0 76.4%
+-commutative76.4%
Simplified76.4%
if -2.6999999999999999e-120 < x Initial program 67.3%
*-commutative67.3%
associate-*l*67.3%
times-frac96.1%
+-commutative96.1%
+-commutative96.1%
associate-+r+96.1%
+-commutative96.1%
associate-+l+96.1%
Applied egg-rr96.1%
clear-num96.2%
associate-/r*99.8%
frac-times99.3%
*-un-lft-identity99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 66.3%
+-commutative66.3%
Simplified66.3%
Final simplification72.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -60000000.0)
(/ (* y (/ 1.0 x)) (- y (- -1.0 x)))
(if (<= x -5e-159)
(/ (* x y) (* (* (+ x y) (+ x y)) (+ y 1.0)))
(/ (/ x (+ x y)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -60000000.0) {
tmp = (y * (1.0 / x)) / (y - (-1.0 - x));
} else if (x <= -5e-159) {
tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-60000000.0d0)) then
tmp = (y * (1.0d0 / x)) / (y - ((-1.0d0) - x))
else if (x <= (-5d-159)) then
tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0d0))
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -60000000.0) {
tmp = (y * (1.0 / x)) / (y - (-1.0 - x));
} else if (x <= -5e-159) {
tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -60000000.0: tmp = (y * (1.0 / x)) / (y - (-1.0 - x)) elif x <= -5e-159: tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0)) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -60000000.0) tmp = Float64(Float64(y * Float64(1.0 / x)) / Float64(y - Float64(-1.0 - x))); elseif (x <= -5e-159) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(y + 1.0))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -60000000.0)
tmp = (y * (1.0 / x)) / (y - (-1.0 - x));
elseif (x <= -5e-159)
tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0));
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -60000000.0], N[(N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-159], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -60000000:\\
\;\;\;\;\frac{y \cdot \frac{1}{x}}{y - \left(-1 - x\right)}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-159}:\\
\;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -6e7Initial program 57.7%
associate-/l*72.4%
associate-+l+72.4%
Simplified72.4%
associate-*r/57.7%
associate-+r+57.7%
times-frac80.1%
associate-*r/80.2%
pow280.2%
+-commutative80.2%
associate-+r+80.2%
+-commutative80.2%
associate-+l+80.2%
Applied egg-rr80.2%
*-un-lft-identity80.2%
unpow280.2%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 87.2%
if -6e7 < x < -5.00000000000000032e-159Initial program 96.0%
Taylor expanded in x around 0 95.4%
+-commutative95.4%
Simplified95.4%
if -5.00000000000000032e-159 < x Initial program 66.5%
*-commutative66.5%
associate-*l*66.5%
times-frac96.0%
+-commutative96.0%
+-commutative96.0%
associate-+r+96.0%
+-commutative96.0%
associate-+l+96.0%
Applied egg-rr96.0%
clear-num96.1%
associate-/r*99.8%
frac-times99.3%
*-un-lft-identity99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 65.5%
+-commutative65.5%
Simplified65.5%
Final simplification73.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4.3e+156) (/ (/ 1.0 (+ x y)) (/ (+ x y) y)) (* (/ x (+ x y)) (/ y (* (+ x y) (- y (- -1.0 x)))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.3e+156) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else {
tmp = (x / (x + y)) * (y / ((x + y) * (y - (-1.0 - x))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.3d+156)) then
tmp = (1.0d0 / (x + y)) / ((x + y) / y)
else
tmp = (x / (x + y)) * (y / ((x + y) * (y - ((-1.0d0) - x))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.3e+156) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else {
tmp = (x / (x + y)) * (y / ((x + y) * (y - (-1.0 - x))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.3e+156: tmp = (1.0 / (x + y)) / ((x + y) / y) else: tmp = (x / (x + y)) * (y / ((x + y) * (y - (-1.0 - x)))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.3e+156) tmp = Float64(Float64(1.0 / Float64(x + y)) / Float64(Float64(x + y) / y)); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(y / Float64(Float64(x + y) * Float64(y - Float64(-1.0 - x))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.3e+156)
tmp = (1.0 / (x + y)) / ((x + y) / y);
else
tmp = (x / (x + y)) * (y / ((x + y) * (y - (-1.0 - x))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.3e+156], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(x + y), $MachinePrecision] * N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{+156}:\\
\;\;\;\;\frac{\frac{1}{x + y}}{\frac{x + y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{y}{\left(x + y\right) \cdot \left(y - \left(-1 - x\right)\right)}\\
\end{array}
\end{array}
if x < -4.29999999999999985e156Initial program 49.4%
Taylor expanded in x around inf 49.4%
*-commutative49.4%
associate-*l*49.4%
+-commutative49.4%
times-frac68.6%
+-commutative68.6%
Applied egg-rr68.6%
clear-num68.6%
associate-/r*91.8%
frac-times85.8%
*-un-lft-identity85.8%
Applied egg-rr85.8%
div-inv85.8%
*-commutative85.8%
times-frac91.9%
Applied egg-rr91.9%
*-inverses91.9%
associate-*r/91.9%
Simplified91.9%
if -4.29999999999999985e156 < x Initial program 70.6%
associate-*l*70.6%
times-frac96.8%
+-commutative96.8%
+-commutative96.8%
associate-+r+96.8%
+-commutative96.8%
associate-+l+96.8%
Applied egg-rr96.8%
Final simplification96.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.65e+155) (/ (/ 1.0 (+ x y)) (/ (+ x y) y)) (* (/ y (+ x y)) (/ x (* (+ x y) (- y (- -1.0 x)))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.65e+155) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else {
tmp = (y / (x + y)) * (x / ((x + y) * (y - (-1.0 - x))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.65d+155)) then
tmp = (1.0d0 / (x + y)) / ((x + y) / y)
else
tmp = (y / (x + y)) * (x / ((x + y) * (y - ((-1.0d0) - x))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.65e+155) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else {
tmp = (y / (x + y)) * (x / ((x + y) * (y - (-1.0 - x))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.65e+155: tmp = (1.0 / (x + y)) / ((x + y) / y) else: tmp = (y / (x + y)) * (x / ((x + y) * (y - (-1.0 - x)))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.65e+155) tmp = Float64(Float64(1.0 / Float64(x + y)) / Float64(Float64(x + y) / y)); else tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x + y) * Float64(y - Float64(-1.0 - x))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.65e+155)
tmp = (1.0 / (x + y)) / ((x + y) / y);
else
tmp = (y / (x + y)) * (x / ((x + y) * (y - (-1.0 - x))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.65e+155], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.65 \cdot 10^{+155}:\\
\;\;\;\;\frac{\frac{1}{x + y}}{\frac{x + y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(y - \left(-1 - x\right)\right)}\\
\end{array}
\end{array}
if x < -2.64999999999999982e155Initial program 49.4%
Taylor expanded in x around inf 49.4%
*-commutative49.4%
associate-*l*49.4%
+-commutative49.4%
times-frac68.6%
+-commutative68.6%
Applied egg-rr68.6%
clear-num68.6%
associate-/r*91.8%
frac-times85.8%
*-un-lft-identity85.8%
Applied egg-rr85.8%
div-inv85.8%
*-commutative85.8%
times-frac91.9%
Applied egg-rr91.9%
*-inverses91.9%
associate-*r/91.9%
Simplified91.9%
if -2.64999999999999982e155 < x Initial program 70.6%
*-commutative70.6%
associate-*l*70.6%
times-frac96.9%
+-commutative96.9%
+-commutative96.9%
associate-+r+96.9%
+-commutative96.9%
associate-+l+96.9%
Applied egg-rr96.9%
Final simplification96.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (/ x (+ x y)) (* (- y (- -1.0 x)) (+ (/ x y) 1.0))))
assert(x < y);
double code(double x, double y) {
return (x / (x + y)) / ((y - (-1.0 - x)) * ((x / y) + 1.0));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (x + y)) / ((y - ((-1.0d0) - x)) * ((x / y) + 1.0d0))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (x + y)) / ((y - (-1.0 - x)) * ((x / y) + 1.0));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (x + y)) / ((y - (-1.0 - x)) * ((x / y) + 1.0))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(x + y)) / Float64(Float64(y - Float64(-1.0 - x)) * Float64(Float64(x / y) + 1.0))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (x + y)) / ((y - (-1.0 - x)) * ((x / y) + 1.0));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{x + y}}{\left(y - \left(-1 - x\right)\right) \cdot \left(\frac{x}{y} + 1\right)}
\end{array}
Initial program 67.3%
*-commutative67.3%
associate-*l*67.3%
times-frac92.5%
+-commutative92.5%
+-commutative92.5%
associate-+r+92.5%
+-commutative92.5%
associate-+l+92.5%
Applied egg-rr92.5%
clear-num92.5%
associate-/r*99.8%
frac-times98.3%
*-un-lft-identity98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Applied egg-rr98.3%
Taylor expanded in x around 0 98.4%
Final simplification98.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (/ y (+ x y)) (* (- y (- -1.0 x)) (/ (+ x y) x))))
assert(x < y);
double code(double x, double y) {
return (y / (x + y)) / ((y - (-1.0 - x)) * ((x + y) / x));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (x + y)) / ((y - ((-1.0d0) - x)) * ((x + y) / x))
end function
assert x < y;
public static double code(double x, double y) {
return (y / (x + y)) / ((y - (-1.0 - x)) * ((x + y) / x));
}
[x, y] = sort([x, y]) def code(x, y): return (y / (x + y)) / ((y - (-1.0 - x)) * ((x + y) / x))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y / Float64(x + y)) / Float64(Float64(y - Float64(-1.0 - x)) * Float64(Float64(x + y) / x))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y / (x + y)) / ((y - (-1.0 - x)) * ((x + y) / x));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{x + y}}{\left(y - \left(-1 - x\right)\right) \cdot \frac{x + y}{x}}
\end{array}
Initial program 67.3%
*-commutative67.3%
associate-*l*67.3%
times-frac92.5%
+-commutative92.5%
+-commutative92.5%
associate-+r+92.5%
+-commutative92.5%
associate-+l+92.5%
Applied egg-rr92.5%
frac-times67.3%
*-commutative67.3%
frac-times92.4%
clear-num92.4%
associate-/r*99.7%
frac-times99.6%
*-un-lft-identity99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Final simplification99.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (let* ((t_0 (- y (- -1.0 x)))) (if (<= y 1.7e-149) (/ (* y (/ 1.0 x)) t_0) (/ x (* (+ x y) t_0)))))
assert(x < y);
double code(double x, double y) {
double t_0 = y - (-1.0 - x);
double tmp;
if (y <= 1.7e-149) {
tmp = (y * (1.0 / x)) / t_0;
} else {
tmp = x / ((x + y) * t_0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 - ((-1.0d0) - x)
if (y <= 1.7d-149) then
tmp = (y * (1.0d0 / x)) / t_0
else
tmp = x / ((x + y) * t_0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y - (-1.0 - x);
double tmp;
if (y <= 1.7e-149) {
tmp = (y * (1.0 / x)) / t_0;
} else {
tmp = x / ((x + y) * t_0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y - (-1.0 - x) tmp = 0 if y <= 1.7e-149: tmp = (y * (1.0 / x)) / t_0 else: tmp = x / ((x + y) * t_0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y - Float64(-1.0 - x)) tmp = 0.0 if (y <= 1.7e-149) tmp = Float64(Float64(y * Float64(1.0 / x)) / t_0); else tmp = Float64(x / Float64(Float64(x + y) * t_0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y - (-1.0 - x);
tmp = 0.0;
if (y <= 1.7e-149)
tmp = (y * (1.0 / x)) / t_0;
else
tmp = x / ((x + y) * t_0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.7e-149], N[(N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(x / N[(N[(x + y), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y - \left(-1 - x\right)\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{-149}:\\
\;\;\;\;\frac{y \cdot \frac{1}{x}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot t\_0}\\
\end{array}
\end{array}
if y < 1.6999999999999999e-149Initial program 63.2%
associate-/l*75.7%
associate-+l+75.7%
Simplified75.7%
associate-*r/63.2%
associate-+r+63.2%
times-frac82.6%
associate-*r/82.6%
pow282.6%
+-commutative82.6%
associate-+r+82.6%
+-commutative82.6%
associate-+l+82.6%
Applied egg-rr82.6%
*-un-lft-identity82.6%
unpow282.6%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 56.2%
if 1.6999999999999999e-149 < y Initial program 73.8%
*-commutative73.8%
associate-*l*73.9%
times-frac93.4%
+-commutative93.4%
+-commutative93.4%
associate-+r+93.4%
+-commutative93.4%
associate-+l+93.4%
Applied egg-rr93.4%
Taylor expanded in y around inf 79.4%
Final simplification65.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -60000000.0) (* (/ 1.0 x) (/ y x)) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -60000000.0) {
tmp = (1.0 / x) * (y / x);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-60000000.0d0)) then
tmp = (1.0d0 / x) * (y / x)
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -60000000.0) {
tmp = (1.0 / x) * (y / x);
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -60000000.0: tmp = (1.0 / x) * (y / x) else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -60000000.0) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -60000000.0)
tmp = (1.0 / x) * (y / x);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -60000000.0], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -60000000:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -6e7Initial program 57.7%
*-commutative57.7%
associate-*l*57.7%
times-frac80.2%
+-commutative80.2%
+-commutative80.2%
associate-+r+80.2%
+-commutative80.2%
associate-+l+80.2%
Applied egg-rr80.2%
Taylor expanded in x around inf 86.5%
Taylor expanded in y around 0 86.3%
if -6e7 < x Initial program 70.5%
associate-/l*82.0%
associate-+l+82.0%
Simplified82.0%
Taylor expanded in x around 0 64.4%
+-commutative64.4%
Simplified64.4%
Taylor expanded in y around 0 42.4%
Final simplification53.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.9e+17) (* (/ 1.0 x) (/ y x)) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.9e+17) {
tmp = (1.0 / x) * (y / x);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.9d+17)) then
tmp = (1.0d0 / x) * (y / x)
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.9e+17) {
tmp = (1.0 / x) * (y / x);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.9e+17: tmp = (1.0 / x) * (y / x) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.9e+17) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.9e+17)
tmp = (1.0 / x) * (y / x);
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.9e+17], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+17}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -2.9e17Initial program 55.7%
*-commutative55.7%
associate-*l*55.7%
times-frac79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
+-commutative79.2%
associate-+l+79.2%
Applied egg-rr79.2%
Taylor expanded in x around inf 88.1%
Taylor expanded in y around 0 88.0%
if -2.9e17 < x Initial program 70.9%
associate-/l*82.2%
associate-+l+82.2%
Simplified82.2%
Taylor expanded in x around 0 64.0%
+-commutative64.0%
Simplified64.0%
Final simplification69.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.85e+18) (/ 1.0 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.85e+18) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.85d+18)) then
tmp = 1.0d0 / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.85e+18) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.85e+18: tmp = 1.0 / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.85e+18) tmp = Float64(1.0 / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.85e+18)
tmp = 1.0 / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.85e+18], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.85 \cdot 10^{+18}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -2.85e18Initial program 55.7%
*-commutative55.7%
associate-*l*55.7%
times-frac79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
+-commutative79.2%
associate-+l+79.2%
Applied egg-rr79.2%
Taylor expanded in x around inf 88.1%
Taylor expanded in y around inf 6.2%
if -2.85e18 < x Initial program 70.9%
associate-/l*82.2%
associate-+l+82.2%
Simplified82.2%
Taylor expanded in x around 0 64.0%
+-commutative64.0%
Simplified64.0%
Taylor expanded in y around 0 41.8%
Final simplification33.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 x))
assert(x < y);
double code(double x, double y) {
return 1.0 / x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / x
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{x}
\end{array}
Initial program 67.3%
*-commutative67.3%
associate-*l*67.3%
times-frac92.5%
+-commutative92.5%
+-commutative92.5%
associate-+r+92.5%
+-commutative92.5%
associate-+l+92.5%
Applied egg-rr92.5%
Taylor expanded in x around inf 38.6%
Taylor expanded in y around inf 4.3%
Final simplification4.3%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2024078
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))