
(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 20 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 (+ x (+ y 1.0))) (+ y x)) (/ x (+ y x))))
assert(x < y);
double code(double x, double y) {
return ((y / (x + (y + 1.0))) / (y + 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 + 1.0d0))) / (y + x)) * (x / (y + x))
end function
assert x < y;
public static double code(double x, double y) {
return ((y / (x + (y + 1.0))) / (y + x)) * (x / (y + x));
}
[x, y] = sort([x, y]) def code(x, y): return ((y / (x + (y + 1.0))) / (y + x)) * (x / (y + x))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(y / Float64(x + Float64(y + 1.0))) / Float64(y + x)) * Float64(x / Float64(y + x))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((y / (x + (y + 1.0))) / (y + x)) * (x / (y + x));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{x + \left(y + 1\right)}}{y + x} \cdot \frac{x}{y + x}
\end{array}
Initial program 68.6%
times-frac85.6%
associate-+r+85.6%
associate-*l/80.6%
times-frac99.8%
*-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= x -5.2e+172)
(* t_0 (/ (/ y x) (+ y x)))
(if (<= x -8.5e-21)
(* (/ y (+ x (+ y 1.0))) (/ x (* (+ y x) (+ y x))))
(* t_0 (/ (/ y (+ y 1.0)) (+ y x)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -5.2e+172) {
tmp = t_0 * ((y / x) / (y + x));
} else if (x <= -8.5e-21) {
tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
} else {
tmp = t_0 * ((y / (y + 1.0)) / (y + 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 = x / (y + x)
if (x <= (-5.2d+172)) then
tmp = t_0 * ((y / x) / (y + x))
else if (x <= (-8.5d-21)) then
tmp = (y / (x + (y + 1.0d0))) * (x / ((y + x) * (y + x)))
else
tmp = t_0 * ((y / (y + 1.0d0)) / (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -5.2e+172) {
tmp = t_0 * ((y / x) / (y + x));
} else if (x <= -8.5e-21) {
tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
} else {
tmp = t_0 * ((y / (y + 1.0)) / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + x) tmp = 0 if x <= -5.2e+172: tmp = t_0 * ((y / x) / (y + x)) elif x <= -8.5e-21: tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x))) else: tmp = t_0 * ((y / (y + 1.0)) / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (x <= -5.2e+172) tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(y + x))); elseif (x <= -8.5e-21) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(t_0 * Float64(Float64(y / Float64(y + 1.0)) / Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + x);
tmp = 0.0;
if (x <= -5.2e+172)
tmp = t_0 * ((y / x) / (y + x));
elseif (x <= -8.5e-21)
tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
else
tmp = t_0 * ((y / (y + 1.0)) / (y + 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[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e+172], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-21], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+172}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-21}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -5.2e172Initial program 62.5%
times-frac80.0%
associate-+r+80.0%
associate-*l/80.0%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 99.7%
if -5.2e172 < x < -8.4999999999999993e-21Initial program 67.4%
times-frac90.1%
/-rgt-identity90.1%
/-rgt-identity90.1%
associate-+l+90.1%
Simplified90.1%
if -8.4999999999999993e-21 < x Initial program 69.7%
times-frac85.5%
associate-+r+85.5%
associate-*l/78.8%
times-frac99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 84.7%
+-commutative77.2%
Simplified84.7%
Final simplification87.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= x -2.2e+14)
(* t_0 (/ (/ y x) (+ y x)))
(if (<= x -8.5e-166)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ y 1.0)))
(/ t_0 (+ y (+ x 1.0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -2.2e+14) {
tmp = t_0 * ((y / x) / (y + x));
} else if (x <= -8.5e-166) {
tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0));
} else {
tmp = t_0 / (y + (x + 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) :: t_0
real(8) :: tmp
t_0 = x / (y + x)
if (x <= (-2.2d+14)) then
tmp = t_0 * ((y / x) / (y + x))
else if (x <= (-8.5d-166)) then
tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0d0))
else
tmp = t_0 / (y + (x + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -2.2e+14) {
tmp = t_0 * ((y / x) / (y + x));
} else if (x <= -8.5e-166) {
tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0));
} else {
tmp = t_0 / (y + (x + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + x) tmp = 0 if x <= -2.2e+14: tmp = t_0 * ((y / x) / (y + x)) elif x <= -8.5e-166: tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0)) else: tmp = t_0 / (y + (x + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (x <= -2.2e+14) tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(y + x))); elseif (x <= -8.5e-166) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(y + 1.0))); else tmp = Float64(t_0 / Float64(y + Float64(x + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + x);
tmp = 0.0;
if (x <= -2.2e+14)
tmp = t_0 * ((y / x) / (y + x));
elseif (x <= -8.5e-166)
tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0));
else
tmp = t_0 / (y + (x + 1.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[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.2e+14], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-166], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{+14}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-166}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y + \left(x + 1\right)}\\
\end{array}
\end{array}
if x < -2.2e14Initial program 63.5%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.2%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 85.5%
if -2.2e14 < x < -8.5e-166Initial program 82.6%
times-frac97.5%
/-rgt-identity97.5%
/-rgt-identity97.5%
associate-+l+97.5%
Simplified97.5%
Taylor expanded in x around 0 96.1%
+-commutative96.1%
Simplified96.1%
if -8.5e-166 < x Initial program 66.2%
times-frac83.0%
+-commutative83.0%
associate-*r/83.0%
*-commutative83.0%
+-commutative83.0%
+-commutative83.0%
associate-*r/70.8%
associate-/r*73.1%
*-commutative73.1%
+-commutative73.1%
+-commutative73.1%
associate-+l+73.1%
Simplified73.1%
Taylor expanded in x around 0 59.3%
Final simplification71.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 1.0))) (t_1 (/ (/ y x) t_0)))
(if (<= x -8.8e+15)
t_1
(if (<= x -5.2e-25)
(/ x (* (+ y 1.0) (+ y x)))
(if (<= x -1e-134) t_1 (/ (/ x (+ y x)) t_0))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = (y / x) / t_0;
double tmp;
if (x <= -8.8e+15) {
tmp = t_1;
} else if (x <= -5.2e-25) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = t_1;
} else {
tmp = (x / (y + x)) / 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) :: t_1
real(8) :: tmp
t_0 = y + (x + 1.0d0)
t_1 = (y / x) / t_0
if (x <= (-8.8d+15)) then
tmp = t_1
else if (x <= (-5.2d-25)) then
tmp = x / ((y + 1.0d0) * (y + x))
else if (x <= (-1d-134)) then
tmp = t_1
else
tmp = (x / (y + x)) / t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = (y / x) / t_0;
double tmp;
if (x <= -8.8e+15) {
tmp = t_1;
} else if (x <= -5.2e-25) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = t_1;
} else {
tmp = (x / (y + x)) / t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) t_1 = (y / x) / t_0 tmp = 0 if x <= -8.8e+15: tmp = t_1 elif x <= -5.2e-25: tmp = x / ((y + 1.0) * (y + x)) elif x <= -1e-134: tmp = t_1 else: tmp = (x / (y + x)) / t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) t_1 = Float64(Float64(y / x) / t_0) tmp = 0.0 if (x <= -8.8e+15) tmp = t_1; elseif (x <= -5.2e-25) tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x))); elseif (x <= -1e-134) tmp = t_1; else tmp = Float64(Float64(x / Float64(y + x)) / t_0); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y + (x + 1.0);
t_1 = (y / x) / t_0;
tmp = 0.0;
if (x <= -8.8e+15)
tmp = t_1;
elseif (x <= -5.2e-25)
tmp = x / ((y + 1.0) * (y + x));
elseif (x <= -1e-134)
tmp = t_1;
else
tmp = (x / (y + x)) / 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[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x, -8.8e+15], t$95$1, If[LessEqual[x, -5.2e-25], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], t$95$1, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
t_1 := \frac{\frac{y}{x}}{t_0}\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t_0}\\
\end{array}
\end{array}
if x < -8.8e15 or -5.2e-25 < x < -1.00000000000000004e-134Initial program 71.7%
times-frac89.1%
+-commutative89.1%
associate-*r/89.1%
*-commutative89.1%
+-commutative89.1%
+-commutative89.1%
associate-*r/76.1%
associate-/r*80.6%
*-commutative80.6%
+-commutative80.6%
+-commutative80.6%
associate-+l+80.6%
Simplified80.6%
associate-/l*99.8%
div-inv99.7%
clear-num99.8%
remove-double-div99.9%
Applied egg-rr99.9%
associate-*r/80.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 70.6%
if -8.8e15 < x < -5.2e-25Initial program 74.5%
times-frac99.7%
associate-+r+99.7%
associate-*l/99.7%
times-frac99.7%
*-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.7%
un-div-inv99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-/r/99.9%
*-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-/l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 91.0%
+-commutative91.0%
Simplified91.0%
if -1.00000000000000004e-134 < x Initial program 66.6%
times-frac82.9%
+-commutative82.9%
associate-*r/82.9%
*-commutative82.9%
+-commutative82.9%
+-commutative82.9%
associate-*r/71.1%
associate-/r*73.3%
*-commutative73.3%
+-commutative73.3%
+-commutative73.3%
associate-+l+73.3%
Simplified73.3%
Taylor expanded in x around 0 60.0%
Final simplification64.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))) (t_1 (/ (/ y (+ y x)) t_0)))
(if (<= x -1.25e+14)
t_1
(if (<= x -1.15e-26)
(/ x (* (+ y 1.0) (+ y x)))
(if (<= x -1e-134) t_1 (/ (/ x (+ y x)) t_0))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = (y / (y + x)) / t_0;
double tmp;
if (x <= -1.25e+14) {
tmp = t_1;
} else if (x <= -1.15e-26) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = t_1;
} else {
tmp = (x / (y + x)) / 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) :: t_1
real(8) :: tmp
t_0 = y + (x + 1.0d0)
t_1 = (y / (y + x)) / t_0
if (x <= (-1.25d+14)) then
tmp = t_1
else if (x <= (-1.15d-26)) then
tmp = x / ((y + 1.0d0) * (y + x))
else if (x <= (-1d-134)) then
tmp = t_1
else
tmp = (x / (y + x)) / t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = (y / (y + x)) / t_0;
double tmp;
if (x <= -1.25e+14) {
tmp = t_1;
} else if (x <= -1.15e-26) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = t_1;
} else {
tmp = (x / (y + x)) / t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) t_1 = (y / (y + x)) / t_0 tmp = 0 if x <= -1.25e+14: tmp = t_1 elif x <= -1.15e-26: tmp = x / ((y + 1.0) * (y + x)) elif x <= -1e-134: tmp = t_1 else: tmp = (x / (y + x)) / t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) t_1 = Float64(Float64(y / Float64(y + x)) / t_0) tmp = 0.0 if (x <= -1.25e+14) tmp = t_1; elseif (x <= -1.15e-26) tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x))); elseif (x <= -1e-134) tmp = t_1; else tmp = Float64(Float64(x / Float64(y + x)) / t_0); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y + (x + 1.0);
t_1 = (y / (y + x)) / t_0;
tmp = 0.0;
if (x <= -1.25e+14)
tmp = t_1;
elseif (x <= -1.15e-26)
tmp = x / ((y + 1.0) * (y + x));
elseif (x <= -1e-134)
tmp = t_1;
else
tmp = (x / (y + x)) / 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[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x, -1.25e+14], t$95$1, If[LessEqual[x, -1.15e-26], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], t$95$1, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
t_1 := \frac{\frac{y}{y + x}}{t_0}\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-26}:\\
\;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t_0}\\
\end{array}
\end{array}
if x < -1.25e14 or -1.15000000000000004e-26 < x < -1.00000000000000004e-134Initial program 71.7%
times-frac89.1%
+-commutative89.1%
associate-*r/89.1%
*-commutative89.1%
+-commutative89.1%
+-commutative89.1%
associate-*r/76.1%
associate-/r*80.6%
*-commutative80.6%
+-commutative80.6%
+-commutative80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in x around inf 71.3%
if -1.25e14 < x < -1.15000000000000004e-26Initial program 74.5%
times-frac99.7%
associate-+r+99.7%
associate-*l/99.7%
times-frac99.7%
*-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.7%
un-div-inv99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-/r/99.9%
*-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-/l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 91.0%
+-commutative91.0%
Simplified91.0%
if -1.00000000000000004e-134 < x Initial program 66.6%
times-frac82.9%
+-commutative82.9%
associate-*r/82.9%
*-commutative82.9%
+-commutative82.9%
+-commutative82.9%
associate-*r/71.1%
associate-/r*73.3%
*-commutative73.3%
+-commutative73.3%
+-commutative73.3%
associate-+l+73.3%
Simplified73.3%
Taylor expanded in x around 0 60.0%
Final simplification65.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))) (t_1 (+ y (+ x 1.0))))
(if (<= x -1.6e+14)
(* t_0 (/ (/ y x) (+ y x)))
(if (<= x -1.7e-24)
(/ x (* (+ y 1.0) (+ y x)))
(if (<= x -1e-134) (/ (/ y (+ y x)) t_1) (/ t_0 t_1))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = y + (x + 1.0);
double tmp;
if (x <= -1.6e+14) {
tmp = t_0 * ((y / x) / (y + x));
} else if (x <= -1.7e-24) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = (y / (y + x)) / t_1;
} else {
tmp = t_0 / 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 = x / (y + x)
t_1 = y + (x + 1.0d0)
if (x <= (-1.6d+14)) then
tmp = t_0 * ((y / x) / (y + x))
else if (x <= (-1.7d-24)) then
tmp = x / ((y + 1.0d0) * (y + x))
else if (x <= (-1d-134)) then
tmp = (y / (y + x)) / t_1
else
tmp = t_0 / t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = y + (x + 1.0);
double tmp;
if (x <= -1.6e+14) {
tmp = t_0 * ((y / x) / (y + x));
} else if (x <= -1.7e-24) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = (y / (y + x)) / t_1;
} else {
tmp = t_0 / t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + x) t_1 = y + (x + 1.0) tmp = 0 if x <= -1.6e+14: tmp = t_0 * ((y / x) / (y + x)) elif x <= -1.7e-24: tmp = x / ((y + 1.0) * (y + x)) elif x <= -1e-134: tmp = (y / (y + x)) / t_1 else: tmp = t_0 / t_1 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + x)) t_1 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (x <= -1.6e+14) tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(y + x))); elseif (x <= -1.7e-24) tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x))); elseif (x <= -1e-134) tmp = Float64(Float64(y / Float64(y + x)) / t_1); else tmp = Float64(t_0 / t_1); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + x);
t_1 = y + (x + 1.0);
tmp = 0.0;
if (x <= -1.6e+14)
tmp = t_0 * ((y / x) / (y + x));
elseif (x <= -1.7e-24)
tmp = x / ((y + 1.0) * (y + x));
elseif (x <= -1e-134)
tmp = (y / (y + x)) / t_1;
else
tmp = t_0 / 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[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+14], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-24], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(t$95$0 / t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
t_1 := y + \left(x + 1\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+14}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{t_1}\\
\end{array}
\end{array}
if x < -1.6e14Initial program 63.5%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.2%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 85.5%
if -1.6e14 < x < -1.69999999999999996e-24Initial program 74.5%
times-frac99.7%
associate-+r+99.7%
associate-*l/99.7%
times-frac99.7%
*-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.7%
un-div-inv99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-/r/99.9%
*-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-/l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 91.0%
+-commutative91.0%
Simplified91.0%
if -1.69999999999999996e-24 < x < -1.00000000000000004e-134Initial program 86.1%
times-frac99.5%
+-commutative99.5%
associate-*r/99.5%
*-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-*r/89.0%
associate-/r*89.2%
*-commutative89.2%
+-commutative89.2%
+-commutative89.2%
associate-+l+89.2%
Simplified89.2%
Taylor expanded in x around inf 46.1%
if -1.00000000000000004e-134 < x Initial program 66.6%
times-frac82.9%
+-commutative82.9%
associate-*r/82.9%
*-commutative82.9%
+-commutative82.9%
+-commutative82.9%
associate-*r/71.1%
associate-/r*73.3%
*-commutative73.3%
+-commutative73.3%
+-commutative73.3%
associate-+l+73.3%
Simplified73.3%
Taylor expanded in x around 0 60.0%
Final simplification65.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 2.2e-183)
(/ (/ y (+ x 1.0)) (+ y x))
(if (<= y 1.85e+165)
(/ x (* (+ y x) (+ 1.0 (+ y (* x 2.0)))))
(* (/ x (+ y x)) (/ 1.0 y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.2e-183) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 1.85e+165) {
tmp = x / ((y + x) * (1.0 + (y + (x * 2.0))));
} else {
tmp = (x / (y + x)) * (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) :: tmp
if (y <= 2.2d-183) then
tmp = (y / (x + 1.0d0)) / (y + x)
else if (y <= 1.85d+165) then
tmp = x / ((y + x) * (1.0d0 + (y + (x * 2.0d0))))
else
tmp = (x / (y + x)) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.2e-183) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 1.85e+165) {
tmp = x / ((y + x) * (1.0 + (y + (x * 2.0))));
} else {
tmp = (x / (y + x)) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.2e-183: tmp = (y / (x + 1.0)) / (y + x) elif y <= 1.85e+165: tmp = x / ((y + x) * (1.0 + (y + (x * 2.0)))) else: tmp = (x / (y + x)) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.2e-183) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); elseif (y <= 1.85e+165) tmp = Float64(x / Float64(Float64(y + x) * Float64(1.0 + Float64(y + Float64(x * 2.0))))); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.2e-183)
tmp = (y / (x + 1.0)) / (y + x);
elseif (y <= 1.85e+165)
tmp = x / ((y + x) * (1.0 + (y + (x * 2.0))));
else
tmp = (x / (y + x)) * (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_] := If[LessEqual[y, 2.2e-183], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e+165], N[(x / N[(N[(y + x), $MachinePrecision] * N[(1.0 + N[(y + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+165}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(1 + \left(y + x \cdot 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 2.2e-183Initial program 65.7%
times-frac83.0%
associate-+r+83.0%
associate-*l/75.4%
times-frac99.8%
*-commutative99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.1%
un-div-inv99.2%
+-commutative99.2%
associate-+r+99.2%
+-commutative99.2%
associate-+r+99.2%
associate-/r/99.2%
*-commutative99.2%
+-commutative99.2%
Applied egg-rr99.2%
associate-/l/94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in y around 0 55.0%
*-lft-identity55.0%
+-commutative55.0%
associate-/r*56.3%
associate-/r/57.0%
*-commutative57.0%
associate-/r*58.8%
*-inverses58.8%
div-inv58.8%
+-commutative58.8%
Applied egg-rr58.8%
*-lft-identity58.8%
+-commutative58.8%
+-commutative58.8%
Simplified58.8%
if 2.2e-183 < y < 1.85000000000000003e165Initial program 80.3%
times-frac92.9%
associate-+r+92.9%
associate-*l/90.6%
times-frac99.7%
*-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num98.9%
un-div-inv98.9%
+-commutative98.9%
associate-+r+98.9%
+-commutative98.9%
associate-+r+98.9%
associate-/r/98.9%
*-commutative98.9%
+-commutative98.9%
Applied egg-rr98.9%
associate-/l/90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y around inf 74.6%
*-commutative74.6%
Simplified74.6%
if 1.85000000000000003e165 < y Initial program 53.1%
times-frac80.1%
associate-+r+80.1%
associate-*l/80.1%
times-frac99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 88.2%
Final simplification67.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= x -2.55e+16)
(* t_0 (/ (/ y x) (+ y x)))
(* t_0 (/ (/ y (+ y 1.0)) (+ y x))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -2.55e+16) {
tmp = t_0 * ((y / x) / (y + x));
} else {
tmp = t_0 * ((y / (y + 1.0)) / (y + 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 = x / (y + x)
if (x <= (-2.55d+16)) then
tmp = t_0 * ((y / x) / (y + x))
else
tmp = t_0 * ((y / (y + 1.0d0)) / (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -2.55e+16) {
tmp = t_0 * ((y / x) / (y + x));
} else {
tmp = t_0 * ((y / (y + 1.0)) / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + x) tmp = 0 if x <= -2.55e+16: tmp = t_0 * ((y / x) / (y + x)) else: tmp = t_0 * ((y / (y + 1.0)) / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (x <= -2.55e+16) tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(y + x))); else tmp = Float64(t_0 * Float64(Float64(y / Float64(y + 1.0)) / Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + x);
tmp = 0.0;
if (x <= -2.55e+16)
tmp = t_0 * ((y / x) / (y + x));
else
tmp = t_0 * ((y / (y + 1.0)) / (y + 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[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.55e+16], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;x \leq -2.55 \cdot 10^{+16}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -2.55e16Initial program 63.5%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.2%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 85.5%
if -2.55e16 < x Initial program 69.9%
times-frac86.3%
associate-+r+86.3%
associate-*l/79.9%
times-frac99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 85.2%
+-commutative78.1%
Simplified85.2%
Final simplification85.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -90000000000000.0)
(/ (/ y x) x)
(if (<= x -5.2e-26)
(/ x (* (+ y 1.0) (+ y x)))
(if (<= x -1e-134) (/ y x) (/ (/ x y) (+ y (+ x 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -90000000000000.0) {
tmp = (y / x) / x;
} else if (x <= -5.2e-26) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = y / x;
} else {
tmp = (x / y) / (y + (x + 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 <= (-90000000000000.0d0)) then
tmp = (y / x) / x
else if (x <= (-5.2d-26)) then
tmp = x / ((y + 1.0d0) * (y + x))
else if (x <= (-1d-134)) then
tmp = y / x
else
tmp = (x / y) / (y + (x + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -90000000000000.0) {
tmp = (y / x) / x;
} else if (x <= -5.2e-26) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = y / x;
} else {
tmp = (x / y) / (y + (x + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -90000000000000.0: tmp = (y / x) / x elif x <= -5.2e-26: tmp = x / ((y + 1.0) * (y + x)) elif x <= -1e-134: tmp = y / x else: tmp = (x / y) / (y + (x + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -90000000000000.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -5.2e-26) tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x))); elseif (x <= -1e-134) tmp = Float64(y / x); else tmp = Float64(Float64(x / y) / Float64(y + Float64(x + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -90000000000000.0)
tmp = (y / x) / x;
elseif (x <= -5.2e-26)
tmp = x / ((y + 1.0) * (y + x));
elseif (x <= -1e-134)
tmp = y / x;
else
tmp = (x / y) / (y + (x + 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, -90000000000000.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -5.2e-26], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -90000000000000:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-26}:\\
\;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + \left(x + 1\right)}\\
\end{array}
\end{array}
if x < -9e13Initial program 63.5%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.2%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 75.2%
unpow275.2%
associate-/r*84.7%
Simplified84.7%
if -9e13 < x < -5.2000000000000002e-26Initial program 74.5%
times-frac99.7%
associate-+r+99.7%
associate-*l/99.7%
times-frac99.7%
*-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.7%
un-div-inv99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-/r/99.9%
*-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-/l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 91.0%
+-commutative91.0%
Simplified91.0%
if -5.2000000000000002e-26 < x < -1.00000000000000004e-134Initial program 86.1%
times-frac99.5%
/-rgt-identity99.5%
/-rgt-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 45.1%
Taylor expanded in x around 0 45.1%
if -1.00000000000000004e-134 < x Initial program 66.6%
times-frac82.9%
+-commutative82.9%
associate-*r/82.9%
*-commutative82.9%
+-commutative82.9%
+-commutative82.9%
associate-*r/71.1%
associate-/r*73.3%
*-commutative73.3%
+-commutative73.3%
+-commutative73.3%
associate-+l+73.3%
Simplified73.3%
Taylor expanded in x around 0 59.3%
Final simplification64.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 1.0))) (t_1 (/ (/ y x) t_0)))
(if (<= x -6.8e+14)
t_1
(if (<= x -2e-24)
(/ x (* (+ y 1.0) (+ y x)))
(if (<= x -1e-134) t_1 (/ (/ x y) t_0))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = (y / x) / t_0;
double tmp;
if (x <= -6.8e+14) {
tmp = t_1;
} else if (x <= -2e-24) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = y + (x + 1.0d0)
t_1 = (y / x) / t_0
if (x <= (-6.8d+14)) then
tmp = t_1
else if (x <= (-2d-24)) then
tmp = x / ((y + 1.0d0) * (y + x))
else if (x <= (-1d-134)) then
tmp = t_1
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 + (x + 1.0);
double t_1 = (y / x) / t_0;
double tmp;
if (x <= -6.8e+14) {
tmp = t_1;
} else if (x <= -2e-24) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = t_1;
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) t_1 = (y / x) / t_0 tmp = 0 if x <= -6.8e+14: tmp = t_1 elif x <= -2e-24: tmp = x / ((y + 1.0) * (y + x)) elif x <= -1e-134: tmp = t_1 else: tmp = (x / y) / t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) t_1 = Float64(Float64(y / x) / t_0) tmp = 0.0 if (x <= -6.8e+14) tmp = t_1; elseif (x <= -2e-24) tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x))); elseif (x <= -1e-134) tmp = t_1; 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 + (x + 1.0);
t_1 = (y / x) / t_0;
tmp = 0.0;
if (x <= -6.8e+14)
tmp = t_1;
elseif (x <= -2e-24)
tmp = x / ((y + 1.0) * (y + x));
elseif (x <= -1e-134)
tmp = t_1;
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[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x, -6.8e+14], t$95$1, If[LessEqual[x, -2e-24], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], t$95$1, 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(x + 1\right)\\
t_1 := \frac{\frac{y}{x}}{t_0}\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t_0}\\
\end{array}
\end{array}
if x < -6.8e14 or -1.99999999999999985e-24 < x < -1.00000000000000004e-134Initial program 71.7%
times-frac89.1%
+-commutative89.1%
associate-*r/89.1%
*-commutative89.1%
+-commutative89.1%
+-commutative89.1%
associate-*r/76.1%
associate-/r*80.6%
*-commutative80.6%
+-commutative80.6%
+-commutative80.6%
associate-+l+80.6%
Simplified80.6%
associate-/l*99.8%
div-inv99.7%
clear-num99.8%
remove-double-div99.9%
Applied egg-rr99.9%
associate-*r/80.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 70.6%
if -6.8e14 < x < -1.99999999999999985e-24Initial program 74.5%
times-frac99.7%
associate-+r+99.7%
associate-*l/99.7%
times-frac99.7%
*-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.7%
un-div-inv99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-/r/99.9%
*-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-/l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 91.0%
+-commutative91.0%
Simplified91.0%
if -1.00000000000000004e-134 < x Initial program 66.6%
times-frac82.9%
+-commutative82.9%
associate-*r/82.9%
*-commutative82.9%
+-commutative82.9%
+-commutative82.9%
associate-*r/71.1%
associate-/r*73.3%
*-commutative73.3%
+-commutative73.3%
+-commutative73.3%
associate-+l+73.3%
Simplified73.3%
Taylor expanded in x around 0 59.3%
Final simplification64.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -9.6e+14)
(/ (/ y x) x)
(if (or (<= x -1.15e-26) (not (<= x -1e-134)))
(/ x (* y (+ y 1.0)))
(/ y x))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -9.6e+14) {
tmp = (y / x) / x;
} else if ((x <= -1.15e-26) || !(x <= -1e-134)) {
tmp = x / (y * (y + 1.0));
} else {
tmp = y / 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 <= (-9.6d+14)) then
tmp = (y / x) / x
else if ((x <= (-1.15d-26)) .or. (.not. (x <= (-1d-134)))) then
tmp = x / (y * (y + 1.0d0))
else
tmp = y / x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -9.6e+14) {
tmp = (y / x) / x;
} else if ((x <= -1.15e-26) || !(x <= -1e-134)) {
tmp = x / (y * (y + 1.0));
} else {
tmp = y / x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -9.6e+14: tmp = (y / x) / x elif (x <= -1.15e-26) or not (x <= -1e-134): tmp = x / (y * (y + 1.0)) else: tmp = y / x return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -9.6e+14) tmp = Float64(Float64(y / x) / x); elseif ((x <= -1.15e-26) || !(x <= -1e-134)) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(y / x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -9.6e+14)
tmp = (y / x) / x;
elseif ((x <= -1.15e-26) || ~((x <= -1e-134)))
tmp = x / (y * (y + 1.0));
else
tmp = y / 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, -9.6e+14], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[Or[LessEqual[x, -1.15e-26], N[Not[LessEqual[x, -1e-134]], $MachinePrecision]], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-26} \lor \neg \left(x \leq -1 \cdot 10^{-134}\right):\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x}\\
\end{array}
\end{array}
if x < -9.6e14Initial program 63.5%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.2%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 75.2%
unpow275.2%
associate-/r*84.7%
Simplified84.7%
if -9.6e14 < x < -1.15000000000000004e-26 or -1.00000000000000004e-134 < x Initial program 67.1%
times-frac84.0%
/-rgt-identity84.0%
/-rgt-identity84.0%
associate-+l+84.0%
Simplified84.0%
Taylor expanded in x around 0 60.7%
if -1.15000000000000004e-26 < x < -1.00000000000000004e-134Initial program 86.1%
times-frac99.5%
/-rgt-identity99.5%
/-rgt-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 45.1%
Taylor expanded in x around 0 45.1%
Final simplification63.9%
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)))
(if (<= y -6.8e-77)
t_0
(if (<= y 8.8e-146) (/ y x) (if (<= y 6.7) t_0 (* (/ 1.0 y) (/ x y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / x) / x;
double tmp;
if (y <= -6.8e-77) {
tmp = t_0;
} else if (y <= 8.8e-146) {
tmp = y / x;
} else if (y <= 6.7) {
tmp = t_0;
} else {
tmp = (1.0 / y) * (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) :: t_0
real(8) :: tmp
t_0 = (y / x) / x
if (y <= (-6.8d-77)) then
tmp = t_0
else if (y <= 8.8d-146) then
tmp = y / x
else if (y <= 6.7d0) then
tmp = t_0
else
tmp = (1.0d0 / y) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / x) / x;
double tmp;
if (y <= -6.8e-77) {
tmp = t_0;
} else if (y <= 8.8e-146) {
tmp = y / x;
} else if (y <= 6.7) {
tmp = t_0;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / x) / x tmp = 0 if y <= -6.8e-77: tmp = t_0 elif y <= 8.8e-146: tmp = y / x elif y <= 6.7: tmp = t_0 else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / x) / x) tmp = 0.0 if (y <= -6.8e-77) tmp = t_0; elseif (y <= 8.8e-146) tmp = Float64(y / x); elseif (y <= 6.7) tmp = t_0; else tmp = Float64(Float64(1.0 / y) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / x) / x;
tmp = 0.0;
if (y <= -6.8e-77)
tmp = t_0;
elseif (y <= 8.8e-146)
tmp = y / x;
elseif (y <= 6.7)
tmp = t_0;
else
tmp = (1.0 / y) * (x / 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[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[y, -6.8e-77], t$95$0, If[LessEqual[y, 8.8e-146], N[(y / x), $MachinePrecision], If[LessEqual[y, 6.7], t$95$0, N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x}}{x}\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{-77}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{-146}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 6.7:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -6.79999999999999966e-77 or 8.8e-146 < y < 6.70000000000000018Initial program 79.3%
times-frac94.5%
associate-+r+94.5%
associate-*l/93.0%
times-frac99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 38.5%
unpow238.5%
associate-/r*41.0%
Simplified41.0%
if -6.79999999999999966e-77 < y < 8.8e-146Initial program 59.2%
times-frac74.0%
/-rgt-identity74.0%
/-rgt-identity74.0%
associate-+l+74.0%
Simplified74.0%
Taylor expanded in y around 0 80.8%
Taylor expanded in x around 0 68.8%
if 6.70000000000000018 < y Initial program 63.5%
times-frac86.0%
+-commutative86.0%
associate-*r/85.9%
*-commutative85.9%
+-commutative85.9%
+-commutative85.9%
associate-*r/70.2%
associate-/r*75.5%
*-commutative75.5%
+-commutative75.5%
+-commutative75.5%
associate-+l+75.5%
Simplified75.5%
Taylor expanded in x around 0 80.6%
clear-num79.7%
inv-pow79.7%
metadata-eval79.7%
sqr-pow67.4%
div-inv67.4%
clear-num67.4%
+-commutative67.4%
metadata-eval67.4%
metadata-eval67.4%
div-inv67.4%
clear-num67.4%
+-commutative67.4%
metadata-eval67.4%
metadata-eval67.4%
Applied egg-rr67.4%
pow-sqr79.7%
metadata-eval79.7%
unpow-179.7%
Simplified79.7%
Taylor expanded in y around inf 75.6%
unpow275.6%
Simplified75.6%
associate-/l*76.3%
associate-/r/77.2%
*-commutative77.2%
Applied egg-rr77.2%
Final simplification59.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2.45e+14)
(/ (/ y x) x)
(if (<= x -3.3e-24)
(/ x (* y (+ y 1.0)))
(if (<= x -8.8e-135) (/ y x) (/ (/ x y) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.45e+14) {
tmp = (y / x) / x;
} else if (x <= -3.3e-24) {
tmp = x / (y * (y + 1.0));
} else if (x <= -8.8e-135) {
tmp = 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.45d+14)) then
tmp = (y / x) / x
else if (x <= (-3.3d-24)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-8.8d-135)) then
tmp = 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.45e+14) {
tmp = (y / x) / x;
} else if (x <= -3.3e-24) {
tmp = x / (y * (y + 1.0));
} else if (x <= -8.8e-135) {
tmp = 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.45e+14: tmp = (y / x) / x elif x <= -3.3e-24: tmp = x / (y * (y + 1.0)) elif x <= -8.8e-135: tmp = 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.45e+14) tmp = Float64(Float64(y / x) / x); elseif (x <= -3.3e-24) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -8.8e-135) tmp = Float64(y / x); else tmp = Float64(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 <= -2.45e+14)
tmp = (y / x) / x;
elseif (x <= -3.3e-24)
tmp = x / (y * (y + 1.0));
elseif (x <= -8.8e-135)
tmp = 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.45e+14], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -3.3e-24], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.8e-135], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -8.8 \cdot 10^{-135}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.45e14Initial program 63.5%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.2%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 75.2%
unpow275.2%
associate-/r*84.7%
Simplified84.7%
if -2.45e14 < x < -3.29999999999999984e-24Initial program 74.5%
times-frac99.7%
/-rgt-identity99.7%
/-rgt-identity99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 90.8%
if -3.29999999999999984e-24 < x < -8.7999999999999999e-135Initial program 86.1%
times-frac99.5%
/-rgt-identity99.5%
/-rgt-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 45.1%
Taylor expanded in x around 0 45.1%
if -8.7999999999999999e-135 < x Initial program 66.6%
times-frac82.9%
/-rgt-identity82.9%
/-rgt-identity82.9%
associate-+l+82.9%
Simplified82.9%
Taylor expanded in x around 0 58.7%
associate-/r*59.1%
+-commutative59.1%
Simplified59.1%
Final simplification64.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -4.7e+14)
(/ (/ y x) x)
(if (<= x -2.1e-23)
(/ 1.0 (/ (* y (+ y 1.0)) x))
(if (<= x -1e-134) (/ y x) (/ (/ x y) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.7e+14) {
tmp = (y / x) / x;
} else if (x <= -2.1e-23) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -1e-134) {
tmp = 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 <= (-4.7d+14)) then
tmp = (y / x) / x
else if (x <= (-2.1d-23)) then
tmp = 1.0d0 / ((y * (y + 1.0d0)) / x)
else if (x <= (-1d-134)) then
tmp = 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 <= -4.7e+14) {
tmp = (y / x) / x;
} else if (x <= -2.1e-23) {
tmp = 1.0 / ((y * (y + 1.0)) / x);
} else if (x <= -1e-134) {
tmp = y / x;
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.7e+14: tmp = (y / x) / x elif x <= -2.1e-23: tmp = 1.0 / ((y * (y + 1.0)) / x) elif x <= -1e-134: tmp = 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 <= -4.7e+14) tmp = Float64(Float64(y / x) / x); elseif (x <= -2.1e-23) tmp = Float64(1.0 / Float64(Float64(y * Float64(y + 1.0)) / x)); elseif (x <= -1e-134) tmp = Float64(y / x); else tmp = Float64(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 <= -4.7e+14)
tmp = (y / x) / x;
elseif (x <= -2.1e-23)
tmp = 1.0 / ((y * (y + 1.0)) / x);
elseif (x <= -1e-134)
tmp = 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, -4.7e+14], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.1e-23], N[(1.0 / N[(N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-23}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -4.7e14Initial program 63.5%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.2%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 75.2%
unpow275.2%
associate-/r*84.7%
Simplified84.7%
if -4.7e14 < x < -2.1000000000000001e-23Initial program 74.5%
times-frac99.7%
/-rgt-identity99.7%
/-rgt-identity99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 90.8%
associate-/r*91.0%
+-commutative91.0%
Simplified91.0%
clear-num90.8%
inv-pow90.8%
metadata-eval90.8%
sqr-pow45.7%
associate-/r/45.7%
*-commutative45.7%
metadata-eval45.7%
metadata-eval45.7%
associate-/r/45.7%
*-commutative45.7%
metadata-eval45.7%
metadata-eval45.7%
Applied egg-rr45.7%
pow-sqr91.0%
metadata-eval91.0%
unpow-191.0%
+-commutative91.0%
associate-*r/90.8%
+-commutative90.8%
Simplified90.8%
if -2.1000000000000001e-23 < x < -1.00000000000000004e-134Initial program 86.1%
times-frac99.5%
/-rgt-identity99.5%
/-rgt-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 45.1%
Taylor expanded in x around 0 45.1%
if -1.00000000000000004e-134 < x Initial program 66.6%
times-frac82.9%
/-rgt-identity82.9%
/-rgt-identity82.9%
associate-+l+82.9%
Simplified82.9%
Taylor expanded in x around 0 58.7%
associate-/r*59.1%
+-commutative59.1%
Simplified59.1%
Final simplification64.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -3.6e+14)
(/ (/ y x) x)
(if (<= x -1.4e-26)
(/ x (* (+ y 1.0) (+ y x)))
(if (<= x -1e-134) (/ y x) (/ (/ x y) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.6e+14) {
tmp = (y / x) / x;
} else if (x <= -1.4e-26) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = 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 <= (-3.6d+14)) then
tmp = (y / x) / x
else if (x <= (-1.4d-26)) then
tmp = x / ((y + 1.0d0) * (y + x))
else if (x <= (-1d-134)) then
tmp = 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 <= -3.6e+14) {
tmp = (y / x) / x;
} else if (x <= -1.4e-26) {
tmp = x / ((y + 1.0) * (y + x));
} else if (x <= -1e-134) {
tmp = y / x;
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.6e+14: tmp = (y / x) / x elif x <= -1.4e-26: tmp = x / ((y + 1.0) * (y + x)) elif x <= -1e-134: tmp = 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 <= -3.6e+14) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.4e-26) tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x))); elseif (x <= -1e-134) tmp = Float64(y / x); else tmp = Float64(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.6e+14)
tmp = (y / x) / x;
elseif (x <= -1.4e-26)
tmp = x / ((y + 1.0) * (y + x));
elseif (x <= -1e-134)
tmp = 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, -3.6e+14], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.4e-26], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-26}:\\
\;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -3.6e14Initial program 63.5%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.2%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 75.2%
unpow275.2%
associate-/r*84.7%
Simplified84.7%
if -3.6e14 < x < -1.4000000000000001e-26Initial program 74.5%
times-frac99.7%
associate-+r+99.7%
associate-*l/99.7%
times-frac99.7%
*-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.7%
un-div-inv99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-/r/99.9%
*-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-/l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 91.0%
+-commutative91.0%
Simplified91.0%
if -1.4000000000000001e-26 < x < -1.00000000000000004e-134Initial program 86.1%
times-frac99.5%
/-rgt-identity99.5%
/-rgt-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 45.1%
Taylor expanded in x around 0 45.1%
if -1.00000000000000004e-134 < x Initial program 66.6%
times-frac82.9%
/-rgt-identity82.9%
/-rgt-identity82.9%
associate-+l+82.9%
Simplified82.9%
Taylor expanded in x around 0 58.7%
associate-/r*59.1%
+-commutative59.1%
Simplified59.1%
Final simplification64.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.05e+16) (/ (/ y x) x) (if (or (<= x -3.2e-23) (not (<= x -5.5e-137))) (/ x (* y y)) (/ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.05e+16) {
tmp = (y / x) / x;
} else if ((x <= -3.2e-23) || !(x <= -5.5e-137)) {
tmp = x / (y * y);
} else {
tmp = y / 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 <= (-1.05d+16)) then
tmp = (y / x) / x
else if ((x <= (-3.2d-23)) .or. (.not. (x <= (-5.5d-137)))) then
tmp = x / (y * y)
else
tmp = y / x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.05e+16) {
tmp = (y / x) / x;
} else if ((x <= -3.2e-23) || !(x <= -5.5e-137)) {
tmp = x / (y * y);
} else {
tmp = y / x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.05e+16: tmp = (y / x) / x elif (x <= -3.2e-23) or not (x <= -5.5e-137): tmp = x / (y * y) else: tmp = y / x return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.05e+16) tmp = Float64(Float64(y / x) / x); elseif ((x <= -3.2e-23) || !(x <= -5.5e-137)) tmp = Float64(x / Float64(y * y)); else tmp = Float64(y / x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.05e+16)
tmp = (y / x) / x;
elseif ((x <= -3.2e-23) || ~((x <= -5.5e-137)))
tmp = x / (y * y);
else
tmp = y / 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, -1.05e+16], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[Or[LessEqual[x, -3.2e-23], N[Not[LessEqual[x, -5.5e-137]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(y / x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-23} \lor \neg \left(x \leq -5.5 \cdot 10^{-137}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x}\\
\end{array}
\end{array}
if x < -1.05e16Initial program 63.5%
times-frac83.2%
associate-+r+83.2%
associate-*l/83.2%
times-frac99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 75.2%
unpow275.2%
associate-/r*84.7%
Simplified84.7%
if -1.05e16 < x < -3.19999999999999976e-23 or -5.5000000000000003e-137 < x Initial program 67.1%
times-frac84.0%
associate-+r+84.0%
associate-*l/78.3%
times-frac99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 46.1%
unpow246.1%
Simplified46.1%
if -3.19999999999999976e-23 < x < -5.5000000000000003e-137Initial program 86.1%
times-frac99.5%
/-rgt-identity99.5%
/-rgt-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 45.1%
Taylor expanded in x around 0 45.1%
Final simplification54.0%
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))))
(if (<= y -6.8e-77)
t_0
(if (<= y 1.65e-146) (/ y x) (if (<= y 6.7) t_0 (/ x (* y y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -6.8e-77) {
tmp = t_0;
} else if (y <= 1.65e-146) {
tmp = y / x;
} else if (y <= 6.7) {
tmp = t_0;
} else {
tmp = x / (y * 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)
if (y <= (-6.8d-77)) then
tmp = t_0
else if (y <= 1.65d-146) then
tmp = y / x
else if (y <= 6.7d0) then
tmp = t_0
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -6.8e-77) {
tmp = t_0;
} else if (y <= 1.65e-146) {
tmp = y / x;
} else if (y <= 6.7) {
tmp = t_0;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -6.8e-77: tmp = t_0 elif y <= 1.65e-146: tmp = y / x elif y <= 6.7: tmp = t_0 else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -6.8e-77) tmp = t_0; elseif (y <= 1.65e-146) tmp = Float64(y / x); elseif (y <= 6.7) tmp = t_0; else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * x);
tmp = 0.0;
if (y <= -6.8e-77)
tmp = t_0;
elseif (y <= 1.65e-146)
tmp = y / x;
elseif (y <= 6.7)
tmp = t_0;
else
tmp = x / (y * 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 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.8e-77], t$95$0, If[LessEqual[y, 1.65e-146], N[(y / x), $MachinePrecision], If[LessEqual[y, 6.7], t$95$0, N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{-77}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-146}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 6.7:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -6.79999999999999966e-77 or 1.65e-146 < y < 6.70000000000000018Initial program 79.3%
times-frac94.5%
/-rgt-identity94.5%
/-rgt-identity94.5%
associate-+l+94.5%
Simplified94.5%
Taylor expanded in x around inf 38.5%
unpow238.5%
Simplified38.5%
if -6.79999999999999966e-77 < y < 1.65e-146Initial program 59.2%
times-frac74.0%
/-rgt-identity74.0%
/-rgt-identity74.0%
associate-+l+74.0%
Simplified74.0%
Taylor expanded in y around 0 80.8%
Taylor expanded in x around 0 68.8%
if 6.70000000000000018 < y Initial program 63.5%
times-frac86.0%
associate-+r+86.0%
associate-*l/85.9%
times-frac99.6%
*-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 75.6%
unpow275.6%
Simplified75.6%
Final simplification58.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 4.7e-76) (/ y x) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 4.7e-76) {
tmp = y / x;
} else {
tmp = x / (y * 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 (y <= 4.7d-76) then
tmp = y / x
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 4.7e-76) {
tmp = y / x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 4.7e-76: tmp = y / x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 4.7e-76) tmp = Float64(y / x); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 4.7e-76)
tmp = y / x;
else
tmp = x / (y * 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[y, 4.7e-76], N[(y / x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.7 \cdot 10^{-76}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 4.7000000000000002e-76Initial program 67.6%
times-frac83.8%
/-rgt-identity83.8%
/-rgt-identity83.8%
associate-+l+83.8%
Simplified83.8%
Taylor expanded in y around 0 58.8%
Taylor expanded in x around 0 38.4%
if 4.7000000000000002e-76 < y Initial program 70.6%
times-frac89.0%
associate-+r+89.0%
associate-*l/89.0%
times-frac99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 59.6%
unpow259.6%
Simplified59.6%
Final simplification45.8%
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 68.6%
times-frac85.6%
+-commutative85.6%
associate-*r/85.6%
*-commutative85.6%
+-commutative85.6%
+-commutative85.6%
associate-*r/73.9%
associate-/r*76.8%
*-commutative76.8%
+-commutative76.8%
+-commutative76.8%
associate-+l+76.8%
Simplified76.8%
Taylor expanded in x around 0 52.6%
Taylor expanded in x around inf 3.9%
Final simplification3.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ y x))
assert(x < y);
double code(double x, double y) {
return 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
end function
assert x < y;
public static double code(double x, double y) {
return y / x;
}
[x, y] = sort([x, y]) def code(x, y): return y / x
x, y = sort([x, y]) function code(x, y) return Float64(y / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = y / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(y / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{x}
\end{array}
Initial program 68.6%
times-frac85.6%
/-rgt-identity85.6%
/-rgt-identity85.6%
associate-+l+85.6%
Simplified85.6%
Taylor expanded in y around 0 46.7%
Taylor expanded in x around 0 26.3%
Final simplification26.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 2023297
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))