
(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 23 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 x)) (+ x (+ y 1.0)))) (+ y x)))
assert(x < y);
double code(double x, double y) {
return (y * ((x / (y + x)) / (x + (y + 1.0)))) / (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 + x)) / (x + (y + 1.0d0)))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
return (y * ((x / (y + x)) / (x + (y + 1.0)))) / (y + x);
}
[x, y] = sort([x, y]) def code(x, y): return (y * ((x / (y + x)) / (x + (y + 1.0)))) / (y + x)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y * Float64(Float64(x / Float64(y + x)) / Float64(x + Float64(y + 1.0)))) / Float64(y + x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y * ((x / (y + x)) / (x + (y + 1.0)))) / (y + x);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(y * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y \cdot \frac{\frac{x}{y + x}}{x + \left(y + 1\right)}}{y + x}
\end{array}
Initial program 69.1%
+-commutative69.1%
+-commutative69.1%
+-commutative69.1%
*-commutative69.1%
distribute-rgt1-in52.7%
fma-define69.1%
+-commutative69.1%
+-commutative69.1%
cube-unmult69.2%
+-commutative69.2%
Simplified69.2%
*-commutative69.2%
fma-define52.8%
cube-mult52.7%
distribute-rgt1-in69.1%
*-commutative69.1%
associate-*l*69.1%
times-frac94.0%
associate-+r+94.0%
Applied egg-rr94.0%
associate-*l/94.0%
frac-2neg94.0%
+-commutative94.0%
+-commutative94.0%
Applied egg-rr94.0%
distribute-rgt-neg-in94.0%
associate-/r*99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 4.3e-274)
(* (/ y (+ y x)) (/ (- 1.0 (/ y x)) (+ x 1.0)))
(if (<= y 580.0)
(* x (/ y (* (+ x 1.0) (* (+ y x) (+ y x)))))
(if (<= y 1.66e+152)
(/ x (* (+ y x) (+ x (+ y 1.0))))
(/ (/ x (+ y 1.0)) (+ y x))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 4.3e-274) {
tmp = (y / (y + x)) * ((1.0 - (y / x)) / (x + 1.0));
} else if (y <= 580.0) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else if (y <= 1.66e+152) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (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) :: tmp
if (y <= 4.3d-274) then
tmp = (y / (y + x)) * ((1.0d0 - (y / x)) / (x + 1.0d0))
else if (y <= 580.0d0) then
tmp = x * (y / ((x + 1.0d0) * ((y + x) * (y + x))))
else if (y <= 1.66d+152) then
tmp = x / ((y + x) * (x + (y + 1.0d0)))
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 4.3e-274) {
tmp = (y / (y + x)) * ((1.0 - (y / x)) / (x + 1.0));
} else if (y <= 580.0) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else if (y <= 1.66e+152) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 4.3e-274: tmp = (y / (y + x)) * ((1.0 - (y / x)) / (x + 1.0)) elif y <= 580.0: tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x)))) elif y <= 1.66e+152: tmp = x / ((y + x) * (x + (y + 1.0))) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 4.3e-274) tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(1.0 - Float64(y / x)) / Float64(x + 1.0))); elseif (y <= 580.0) tmp = Float64(x * Float64(y / Float64(Float64(x + 1.0) * Float64(Float64(y + x) * Float64(y + x))))); elseif (y <= 1.66e+152) tmp = Float64(x / Float64(Float64(y + x) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 4.3e-274)
tmp = (y / (y + x)) * ((1.0 - (y / x)) / (x + 1.0));
elseif (y <= 580.0)
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
elseif (y <= 1.66e+152)
tmp = x / ((y + x) * (x + (y + 1.0)));
else
tmp = (x / (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_] := If[LessEqual[y, 4.3e-274], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 580.0], N[(x * N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.66e+152], N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{-274}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1 - \frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 580:\\
\;\;\;\;x \cdot \frac{y}{\left(x + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{+152}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 4.29999999999999989e-274Initial program 69.5%
Taylor expanded in x around inf 60.2%
*-commutative60.2%
associate-*l*60.2%
times-frac73.6%
+-commutative73.6%
+-commutative73.6%
Applied egg-rr73.6%
associate-/r*71.7%
Simplified71.7%
Taylor expanded in x around inf 50.3%
mul-1-neg50.3%
unsub-neg50.3%
Simplified50.3%
if 4.29999999999999989e-274 < y < 580Initial program 76.9%
associate-/l*90.2%
associate-+l+90.2%
Simplified90.2%
Taylor expanded in y around 0 89.9%
+-commutative89.9%
Simplified89.9%
if 580 < y < 1.65999999999999998e152Initial program 69.3%
+-commutative69.3%
+-commutative69.3%
+-commutative69.3%
*-commutative69.3%
distribute-rgt1-in63.6%
fma-define69.3%
+-commutative69.3%
+-commutative69.3%
cube-unmult69.4%
+-commutative69.4%
Simplified69.4%
*-commutative69.4%
fma-define63.7%
cube-mult63.6%
distribute-rgt1-in69.3%
*-commutative69.3%
associate-*l*69.3%
times-frac97.0%
associate-+r+97.0%
Applied egg-rr97.0%
Taylor expanded in y around inf 82.7%
if 1.65999999999999998e152 < y Initial program 54.0%
+-commutative54.0%
+-commutative54.0%
+-commutative54.0%
*-commutative54.0%
distribute-rgt1-in54.0%
fma-define54.0%
+-commutative54.0%
+-commutative54.0%
cube-unmult54.0%
+-commutative54.0%
Simplified54.0%
*-commutative54.0%
fma-define54.0%
cube-mult54.0%
distribute-rgt1-in54.0%
*-commutative54.0%
associate-*l*54.0%
times-frac73.1%
associate-+r+73.1%
Applied egg-rr73.1%
associate-*l/73.1%
frac-2neg73.1%
+-commutative73.1%
+-commutative73.1%
Applied egg-rr73.1%
distribute-rgt-neg-in73.1%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 83.7%
associate-*r/83.7%
neg-mul-183.7%
+-commutative83.7%
distribute-neg-frac83.7%
distribute-neg-frac283.7%
neg-mul-183.7%
+-commutative83.7%
distribute-lft-in83.7%
metadata-eval83.7%
neg-mul-183.7%
unsub-neg83.7%
Simplified83.7%
Final simplification66.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 1.9e-167)
(/ (* (/ x (+ y x)) (/ y x)) (+ x 1.0))
(if (<= y 570.0)
(* x (/ y (* (+ x 1.0) (* (+ y x) (+ y x)))))
(if (<= y 1.66e+152)
(/ x (* (+ y x) (+ x (+ y 1.0))))
(/ (/ x (+ y 1.0)) (+ y x))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.9e-167) {
tmp = ((x / (y + x)) * (y / x)) / (x + 1.0);
} else if (y <= 570.0) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else if (y <= 1.66e+152) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (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) :: tmp
if (y <= 1.9d-167) then
tmp = ((x / (y + x)) * (y / x)) / (x + 1.0d0)
else if (y <= 570.0d0) then
tmp = x * (y / ((x + 1.0d0) * ((y + x) * (y + x))))
else if (y <= 1.66d+152) then
tmp = x / ((y + x) * (x + (y + 1.0d0)))
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.9e-167) {
tmp = ((x / (y + x)) * (y / x)) / (x + 1.0);
} else if (y <= 570.0) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else if (y <= 1.66e+152) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.9e-167: tmp = ((x / (y + x)) * (y / x)) / (x + 1.0) elif y <= 570.0: tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x)))) elif y <= 1.66e+152: tmp = x / ((y + x) * (x + (y + 1.0))) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.9e-167) tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / x)) / Float64(x + 1.0)); elseif (y <= 570.0) tmp = Float64(x * Float64(y / Float64(Float64(x + 1.0) * Float64(Float64(y + x) * Float64(y + x))))); elseif (y <= 1.66e+152) tmp = Float64(x / Float64(Float64(y + x) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.9e-167)
tmp = ((x / (y + x)) * (y / x)) / (x + 1.0);
elseif (y <= 570.0)
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
elseif (y <= 1.66e+152)
tmp = x / ((y + x) * (x + (y + 1.0)));
else
tmp = (x / (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_] := If[LessEqual[y, 1.9e-167], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 570.0], N[(x * N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.66e+152], N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{-167}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 570:\\
\;\;\;\;x \cdot \frac{y}{\left(x + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{+152}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 1.89999999999999984e-167Initial program 68.2%
Taylor expanded in x around inf 59.9%
Taylor expanded in x around inf 37.3%
*-un-lft-identity37.3%
*-commutative37.3%
times-frac40.9%
times-frac53.1%
+-commutative53.1%
Applied egg-rr53.1%
associate-*l/53.2%
*-lft-identity53.2%
*-commutative53.2%
Simplified53.2%
if 1.89999999999999984e-167 < y < 570Initial program 86.0%
associate-/l*97.0%
associate-+l+97.0%
Simplified97.0%
Taylor expanded in y around 0 96.5%
+-commutative96.5%
Simplified96.5%
if 570 < y < 1.65999999999999998e152Initial program 69.3%
+-commutative69.3%
+-commutative69.3%
+-commutative69.3%
*-commutative69.3%
distribute-rgt1-in63.6%
fma-define69.3%
+-commutative69.3%
+-commutative69.3%
cube-unmult69.4%
+-commutative69.4%
Simplified69.4%
*-commutative69.4%
fma-define63.7%
cube-mult63.6%
distribute-rgt1-in69.3%
*-commutative69.3%
associate-*l*69.3%
times-frac97.0%
associate-+r+97.0%
Applied egg-rr97.0%
Taylor expanded in y around inf 82.7%
if 1.65999999999999998e152 < y Initial program 54.0%
+-commutative54.0%
+-commutative54.0%
+-commutative54.0%
*-commutative54.0%
distribute-rgt1-in54.0%
fma-define54.0%
+-commutative54.0%
+-commutative54.0%
cube-unmult54.0%
+-commutative54.0%
Simplified54.0%
*-commutative54.0%
fma-define54.0%
cube-mult54.0%
distribute-rgt1-in54.0%
*-commutative54.0%
associate-*l*54.0%
times-frac73.1%
associate-+r+73.1%
Applied egg-rr73.1%
associate-*l/73.1%
frac-2neg73.1%
+-commutative73.1%
+-commutative73.1%
Applied egg-rr73.1%
distribute-rgt-neg-in73.1%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 83.7%
associate-*r/83.7%
neg-mul-183.7%
+-commutative83.7%
distribute-neg-frac83.7%
distribute-neg-frac283.7%
neg-mul-183.7%
+-commutative83.7%
distribute-lft-in83.7%
metadata-eval83.7%
neg-mul-183.7%
unsub-neg83.7%
Simplified83.7%
Final simplification66.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y 720.0)
(* (/ y (+ y x)) (/ (/ x (+ y x)) (+ x 1.0)))
(if (<= y 6.8e+151)
(/ x (* (+ y x) t_0))
(* (/ (/ x y) (+ y x)) (/ y t_0))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 720.0) {
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0));
} else if (y <= 6.8e+151) {
tmp = x / ((y + x) * t_0);
} else {
tmp = ((x / y) / (y + 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 = x + (y + 1.0d0)
if (y <= 720.0d0) then
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0d0))
else if (y <= 6.8d+151) then
tmp = x / ((y + x) * t_0)
else
tmp = ((x / y) / (y + x)) * (y / t_0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 720.0) {
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0));
} else if (y <= 6.8e+151) {
tmp = x / ((y + x) * t_0);
} else {
tmp = ((x / y) / (y + x)) * (y / t_0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 720.0: tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0)) elif y <= 6.8e+151: tmp = x / ((y + x) * t_0) else: tmp = ((x / y) / (y + x)) * (y / t_0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 720.0) tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(x + 1.0))); elseif (y <= 6.8e+151) tmp = Float64(x / Float64(Float64(y + x) * t_0)); else tmp = Float64(Float64(Float64(x / y) / Float64(y + x)) * Float64(y / t_0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= 720.0)
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0));
elseif (y <= 6.8e+151)
tmp = x / ((y + x) * t_0);
else
tmp = ((x / y) / (y + 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[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 720.0], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+151], N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 720:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{x + 1}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+151}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x} \cdot \frac{y}{t\_0}\\
\end{array}
\end{array}
if y < 720Initial program 71.5%
Taylor expanded in x around inf 64.6%
*-commutative64.6%
associate-*l*64.6%
times-frac80.5%
+-commutative80.5%
+-commutative80.5%
Applied egg-rr80.5%
associate-/r*79.1%
Simplified79.1%
if 720 < y < 6.7999999999999999e151Initial program 69.3%
+-commutative69.3%
+-commutative69.3%
+-commutative69.3%
*-commutative69.3%
distribute-rgt1-in63.6%
fma-define69.3%
+-commutative69.3%
+-commutative69.3%
cube-unmult69.4%
+-commutative69.4%
Simplified69.4%
*-commutative69.4%
fma-define63.7%
cube-mult63.6%
distribute-rgt1-in69.3%
*-commutative69.3%
associate-*l*69.3%
times-frac97.0%
associate-+r+97.0%
Applied egg-rr97.0%
Taylor expanded in y around inf 82.7%
if 6.7999999999999999e151 < y Initial program 54.0%
Taylor expanded in x around 0 54.0%
times-frac73.1%
associate-+r+73.1%
*-commutative73.1%
+-commutative73.1%
Applied egg-rr73.1%
associate-/r*84.3%
Simplified84.3%
Final simplification80.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -920000000.0)
(* (/ y x) (/ 1.0 x))
(if (<= x -2.384e-50)
(/ x (* y y))
(if (<= x 6e-127) (/ x y) (* (/ x y) (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -920000000.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.384e-50) {
tmp = x / (y * y);
} else if (x <= 6e-127) {
tmp = x / y;
} 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) :: tmp
if (x <= (-920000000.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-2.384d-50)) then
tmp = x / (y * y)
else if (x <= 6d-127) then
tmp = x / y
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 tmp;
if (x <= -920000000.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.384e-50) {
tmp = x / (y * y);
} else if (x <= 6e-127) {
tmp = x / y;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -920000000.0: tmp = (y / x) * (1.0 / x) elif x <= -2.384e-50: tmp = x / (y * y) elif x <= 6e-127: tmp = x / y else: tmp = (x / y) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -920000000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -2.384e-50) tmp = Float64(x / Float64(y * y)); elseif (x <= 6e-127) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -920000000.0)
tmp = (y / x) * (1.0 / x);
elseif (x <= -2.384e-50)
tmp = x / (y * y);
elseif (x <= 6e-127)
tmp = x / y;
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_] := If[LessEqual[x, -920000000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.384e-50], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e-127], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -920000000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2.384 \cdot 10^{-50}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-127}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -9.2e8Initial program 57.8%
+-commutative57.8%
+-commutative57.8%
+-commutative57.8%
*-commutative57.8%
distribute-rgt1-in34.0%
fma-define57.8%
+-commutative57.8%
+-commutative57.8%
cube-unmult57.9%
+-commutative57.9%
Simplified57.9%
*-commutative57.9%
fma-define34.1%
cube-mult34.0%
distribute-rgt1-in57.8%
*-commutative57.8%
associate-*l*57.8%
times-frac85.2%
associate-+r+85.2%
Applied egg-rr85.2%
Taylor expanded in x around inf 73.4%
Taylor expanded in y around 0 73.0%
if -9.2e8 < x < -2.38400000000000016e-50Initial program 78.5%
associate-/l*78.3%
associate-+l+78.3%
Simplified78.3%
Taylor expanded in x around 0 91.0%
Taylor expanded in y around inf 90.9%
if -2.38400000000000016e-50 < x < 6.00000000000000017e-127Initial program 73.4%
associate-/l*87.5%
associate-+l+87.5%
Simplified87.5%
Taylor expanded in x around 0 81.8%
Taylor expanded in y around 0 65.3%
if 6.00000000000000017e-127 < x Initial program 71.8%
associate-/l*85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in x around 0 45.7%
*-un-lft-identity45.7%
+-commutative45.7%
times-frac45.4%
Applied egg-rr45.4%
Taylor expanded in y around inf 42.1%
Final simplification59.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 1.0))))
(if (<= y 2.1e+140)
(* (/ y (+ y x)) (/ x (* (+ y x) t_0)))
(/ (/ x y) (* t_0 (/ (+ y x) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2.1e+140) {
tmp = (y / (y + x)) * (x / ((y + x) * t_0));
} else {
tmp = (x / y) / (t_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 = x + (y + 1.0d0)
if (y <= 2.1d+140) then
tmp = (y / (y + x)) * (x / ((y + x) * t_0))
else
tmp = (x / y) / (t_0 * ((y + x) / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2.1e+140) {
tmp = (y / (y + x)) * (x / ((y + x) * t_0));
} else {
tmp = (x / y) / (t_0 * ((y + x) / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 2.1e+140: tmp = (y / (y + x)) * (x / ((y + x) * t_0)) else: tmp = (x / y) / (t_0 * ((y + x) / y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 2.1e+140) tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(y + x) * t_0))); else tmp = Float64(Float64(x / y) / Float64(t_0 * Float64(Float64(y + x) / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= 2.1e+140)
tmp = (y / (y + x)) * (x / ((y + x) * t_0));
else
tmp = (x / y) / (t_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[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.1e+140], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(t$95$0 * N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 2.1 \cdot 10^{+140}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0 \cdot \frac{y + x}{y}}\\
\end{array}
\end{array}
if y < 2.1000000000000002e140Initial program 71.3%
+-commutative71.3%
+-commutative71.3%
+-commutative71.3%
*-commutative71.3%
distribute-rgt1-in52.6%
fma-define71.3%
+-commutative71.3%
+-commutative71.3%
cube-unmult71.4%
+-commutative71.4%
Simplified71.4%
*-commutative71.4%
fma-define52.6%
cube-mult52.6%
distribute-rgt1-in71.3%
*-commutative71.3%
associate-*l*71.3%
times-frac96.8%
associate-+r+96.8%
Applied egg-rr96.8%
if 2.1000000000000002e140 < y Initial program 53.8%
+-commutative53.8%
+-commutative53.8%
+-commutative53.8%
*-commutative53.8%
distribute-rgt1-in53.8%
fma-define53.8%
+-commutative53.8%
+-commutative53.8%
cube-unmult53.8%
+-commutative53.8%
Simplified53.8%
*-commutative53.8%
fma-define53.8%
cube-mult53.8%
distribute-rgt1-in53.8%
*-commutative53.8%
associate-*l*53.8%
times-frac74.7%
associate-+r+74.7%
Applied egg-rr74.7%
clear-num74.7%
associate-+r+74.7%
associate-/r*99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 90.6%
Final simplification96.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 1.0))))
(if (<= y 2e+141)
(* (/ x (+ y x)) (/ y (* (+ y x) t_0)))
(/ (/ x y) (* t_0 (/ (+ y x) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2e+141) {
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
} else {
tmp = (x / y) / (t_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 = x + (y + 1.0d0)
if (y <= 2d+141) then
tmp = (x / (y + x)) * (y / ((y + x) * t_0))
else
tmp = (x / y) / (t_0 * ((y + x) / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2e+141) {
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
} else {
tmp = (x / y) / (t_0 * ((y + x) / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 2e+141: tmp = (x / (y + x)) * (y / ((y + x) * t_0)) else: tmp = (x / y) / (t_0 * ((y + x) / y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 2e+141) tmp = Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + x) * t_0))); else tmp = Float64(Float64(x / y) / Float64(t_0 * Float64(Float64(y + x) / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= 2e+141)
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
else
tmp = (x / y) / (t_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[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2e+141], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(t$95$0 * N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 2 \cdot 10^{+141}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0 \cdot \frac{y + x}{y}}\\
\end{array}
\end{array}
if y < 2.00000000000000003e141Initial program 71.3%
+-commutative71.3%
+-commutative71.3%
+-commutative71.3%
*-commutative71.3%
distribute-rgt1-in52.6%
fma-define71.3%
+-commutative71.3%
+-commutative71.3%
cube-unmult71.4%
+-commutative71.4%
Simplified71.4%
fma-define52.6%
cube-mult52.6%
distribute-rgt1-in71.3%
*-commutative71.3%
associate-*l*71.3%
times-frac96.7%
associate-+r+96.7%
Applied egg-rr96.7%
if 2.00000000000000003e141 < y Initial program 53.8%
+-commutative53.8%
+-commutative53.8%
+-commutative53.8%
*-commutative53.8%
distribute-rgt1-in53.8%
fma-define53.8%
+-commutative53.8%
+-commutative53.8%
cube-unmult53.8%
+-commutative53.8%
Simplified53.8%
*-commutative53.8%
fma-define53.8%
cube-mult53.8%
distribute-rgt1-in53.8%
*-commutative53.8%
associate-*l*53.8%
times-frac74.7%
associate-+r+74.7%
Applied egg-rr74.7%
clear-num74.7%
associate-+r+74.7%
associate-/r*99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 90.6%
Final simplification96.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 600.0)
(* (/ y (+ y x)) (/ (/ x (+ y x)) (+ x 1.0)))
(if (<= y 1.66e+152)
(/ x (* (+ y x) (+ x (+ y 1.0))))
(/ (/ x (+ y 1.0)) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 600.0) {
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0));
} else if (y <= 1.66e+152) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (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) :: tmp
if (y <= 600.0d0) then
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0d0))
else if (y <= 1.66d+152) then
tmp = x / ((y + x) * (x + (y + 1.0d0)))
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 600.0) {
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0));
} else if (y <= 1.66e+152) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 600.0: tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0)) elif y <= 1.66e+152: tmp = x / ((y + x) * (x + (y + 1.0))) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 600.0) tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(x + 1.0))); elseif (y <= 1.66e+152) tmp = Float64(x / Float64(Float64(y + x) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 600.0)
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0));
elseif (y <= 1.66e+152)
tmp = x / ((y + x) * (x + (y + 1.0)));
else
tmp = (x / (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_] := If[LessEqual[y, 600.0], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.66e+152], N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 600:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{x + 1}\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{+152}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 600Initial program 71.5%
Taylor expanded in x around inf 64.6%
*-commutative64.6%
associate-*l*64.6%
times-frac80.5%
+-commutative80.5%
+-commutative80.5%
Applied egg-rr80.5%
associate-/r*79.1%
Simplified79.1%
if 600 < y < 1.65999999999999998e152Initial program 69.3%
+-commutative69.3%
+-commutative69.3%
+-commutative69.3%
*-commutative69.3%
distribute-rgt1-in63.6%
fma-define69.3%
+-commutative69.3%
+-commutative69.3%
cube-unmult69.4%
+-commutative69.4%
Simplified69.4%
*-commutative69.4%
fma-define63.7%
cube-mult63.6%
distribute-rgt1-in69.3%
*-commutative69.3%
associate-*l*69.3%
times-frac97.0%
associate-+r+97.0%
Applied egg-rr97.0%
Taylor expanded in y around inf 82.7%
if 1.65999999999999998e152 < y Initial program 54.0%
+-commutative54.0%
+-commutative54.0%
+-commutative54.0%
*-commutative54.0%
distribute-rgt1-in54.0%
fma-define54.0%
+-commutative54.0%
+-commutative54.0%
cube-unmult54.0%
+-commutative54.0%
Simplified54.0%
*-commutative54.0%
fma-define54.0%
cube-mult54.0%
distribute-rgt1-in54.0%
*-commutative54.0%
associate-*l*54.0%
times-frac73.1%
associate-+r+73.1%
Applied egg-rr73.1%
associate-*l/73.1%
frac-2neg73.1%
+-commutative73.1%
+-commutative73.1%
Applied egg-rr73.1%
distribute-rgt-neg-in73.1%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 83.7%
associate-*r/83.7%
neg-mul-183.7%
+-commutative83.7%
distribute-neg-frac83.7%
distribute-neg-frac283.7%
neg-mul-183.7%
+-commutative83.7%
distribute-lft-in83.7%
metadata-eval83.7%
neg-mul-183.7%
unsub-neg83.7%
Simplified83.7%
Final simplification80.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 4.4e-178)
(/ (* (/ x (+ y x)) (/ y x)) (+ x 1.0))
(if (<= y 6.8e+151)
(/ x (* (+ y x) (+ x (+ y 1.0))))
(/ (/ x (+ y 1.0)) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 4.4e-178) {
tmp = ((x / (y + x)) * (y / x)) / (x + 1.0);
} else if (y <= 6.8e+151) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (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) :: tmp
if (y <= 4.4d-178) then
tmp = ((x / (y + x)) * (y / x)) / (x + 1.0d0)
else if (y <= 6.8d+151) then
tmp = x / ((y + x) * (x + (y + 1.0d0)))
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 4.4e-178) {
tmp = ((x / (y + x)) * (y / x)) / (x + 1.0);
} else if (y <= 6.8e+151) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 4.4e-178: tmp = ((x / (y + x)) * (y / x)) / (x + 1.0) elif y <= 6.8e+151: tmp = x / ((y + x) * (x + (y + 1.0))) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 4.4e-178) tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / x)) / Float64(x + 1.0)); elseif (y <= 6.8e+151) tmp = Float64(x / Float64(Float64(y + x) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 4.4e-178)
tmp = ((x / (y + x)) * (y / x)) / (x + 1.0);
elseif (y <= 6.8e+151)
tmp = x / ((y + x) * (x + (y + 1.0)));
else
tmp = (x / (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_] := If[LessEqual[y, 4.4e-178], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+151], N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.4 \cdot 10^{-178}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+151}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 4.4000000000000002e-178Initial program 69.1%
Taylor expanded in x around inf 60.6%
Taylor expanded in x around inf 37.8%
*-un-lft-identity37.8%
*-commutative37.8%
times-frac41.4%
times-frac53.8%
+-commutative53.8%
Applied egg-rr53.8%
associate-*l/53.8%
*-lft-identity53.8%
*-commutative53.8%
Simplified53.8%
if 4.4000000000000002e-178 < y < 6.7999999999999999e151Initial program 75.5%
+-commutative75.5%
+-commutative75.5%
+-commutative75.5%
*-commutative75.5%
distribute-rgt1-in71.3%
fma-define75.5%
+-commutative75.5%
+-commutative75.5%
cube-unmult75.5%
+-commutative75.5%
Simplified75.5%
*-commutative75.5%
fma-define71.4%
cube-mult71.3%
distribute-rgt1-in75.5%
*-commutative75.5%
associate-*l*75.5%
times-frac98.4%
associate-+r+98.4%
Applied egg-rr98.4%
Taylor expanded in y around inf 69.9%
if 6.7999999999999999e151 < y Initial program 54.0%
+-commutative54.0%
+-commutative54.0%
+-commutative54.0%
*-commutative54.0%
distribute-rgt1-in54.0%
fma-define54.0%
+-commutative54.0%
+-commutative54.0%
cube-unmult54.0%
+-commutative54.0%
Simplified54.0%
*-commutative54.0%
fma-define54.0%
cube-mult54.0%
distribute-rgt1-in54.0%
*-commutative54.0%
associate-*l*54.0%
times-frac73.1%
associate-+r+73.1%
Applied egg-rr73.1%
associate-*l/73.1%
frac-2neg73.1%
+-commutative73.1%
+-commutative73.1%
Applied egg-rr73.1%
distribute-rgt-neg-in73.1%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 83.7%
associate-*r/83.7%
neg-mul-183.7%
+-commutative83.7%
distribute-neg-frac83.7%
distribute-neg-frac283.7%
neg-mul-183.7%
+-commutative83.7%
distribute-lft-in83.7%
metadata-eval83.7%
neg-mul-183.7%
unsub-neg83.7%
Simplified83.7%
Final simplification61.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 4.4e-178)
(/ (/ y (+ y x)) (+ x 1.0))
(if (<= y 1.66e+152)
(/ x (* (+ y x) (+ x (+ y 1.0))))
(/ (/ x (+ y 1.0)) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 4.4e-178) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 1.66e+152) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (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) :: tmp
if (y <= 4.4d-178) then
tmp = (y / (y + x)) / (x + 1.0d0)
else if (y <= 1.66d+152) then
tmp = x / ((y + x) * (x + (y + 1.0d0)))
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 4.4e-178) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 1.66e+152) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 4.4e-178: tmp = (y / (y + x)) / (x + 1.0) elif y <= 1.66e+152: tmp = x / ((y + x) * (x + (y + 1.0))) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 4.4e-178) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); elseif (y <= 1.66e+152) tmp = Float64(x / Float64(Float64(y + x) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 4.4e-178)
tmp = (y / (y + x)) / (x + 1.0);
elseif (y <= 1.66e+152)
tmp = x / ((y + x) * (x + (y + 1.0)));
else
tmp = (x / (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_] := If[LessEqual[y, 4.4e-178], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.66e+152], N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.4 \cdot 10^{-178}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{+152}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 4.4000000000000002e-178Initial program 69.1%
Taylor expanded in x around inf 60.6%
Taylor expanded in x around inf 37.8%
associate-/l*50.3%
*-commutative50.3%
+-commutative50.3%
Applied egg-rr50.3%
associate-*r/37.8%
*-commutative37.8%
associate-*r/51.4%
associate-/r*55.0%
associate-/r*55.5%
*-inverses55.5%
Simplified55.5%
associate-*r/54.1%
+-commutative54.1%
div-inv54.2%
Applied egg-rr54.2%
if 4.4000000000000002e-178 < y < 1.65999999999999998e152Initial program 75.5%
+-commutative75.5%
+-commutative75.5%
+-commutative75.5%
*-commutative75.5%
distribute-rgt1-in71.3%
fma-define75.5%
+-commutative75.5%
+-commutative75.5%
cube-unmult75.5%
+-commutative75.5%
Simplified75.5%
*-commutative75.5%
fma-define71.4%
cube-mult71.3%
distribute-rgt1-in75.5%
*-commutative75.5%
associate-*l*75.5%
times-frac98.4%
associate-+r+98.4%
Applied egg-rr98.4%
Taylor expanded in y around inf 69.9%
if 1.65999999999999998e152 < y Initial program 54.0%
+-commutative54.0%
+-commutative54.0%
+-commutative54.0%
*-commutative54.0%
distribute-rgt1-in54.0%
fma-define54.0%
+-commutative54.0%
+-commutative54.0%
cube-unmult54.0%
+-commutative54.0%
Simplified54.0%
*-commutative54.0%
fma-define54.0%
cube-mult54.0%
distribute-rgt1-in54.0%
*-commutative54.0%
associate-*l*54.0%
times-frac73.1%
associate-+r+73.1%
Applied egg-rr73.1%
associate-*l/73.1%
frac-2neg73.1%
+-commutative73.1%
+-commutative73.1%
Applied egg-rr73.1%
distribute-rgt-neg-in73.1%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 83.7%
associate-*r/83.7%
neg-mul-183.7%
+-commutative83.7%
distribute-neg-frac83.7%
distribute-neg-frac283.7%
neg-mul-183.7%
+-commutative83.7%
distribute-lft-in83.7%
metadata-eval83.7%
neg-mul-183.7%
unsub-neg83.7%
Simplified83.7%
Final simplification62.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2e+183)
(/ 1.0 (* x (/ (+ y x) y)))
(if (<= x -1950000000.0)
(* y (/ (/ 1.0 (+ y x)) (+ x 1.0)))
(/ (/ x (+ y x)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2e+183) {
tmp = 1.0 / (x * ((y + x) / y));
} else if (x <= -1950000000.0) {
tmp = y * ((1.0 / (y + x)) / (x + 1.0));
} else {
tmp = (x / (y + x)) / (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 <= (-2d+183)) then
tmp = 1.0d0 / (x * ((y + x) / y))
else if (x <= (-1950000000.0d0)) then
tmp = y * ((1.0d0 / (y + x)) / (x + 1.0d0))
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2e+183) {
tmp = 1.0 / (x * ((y + x) / y));
} else if (x <= -1950000000.0) {
tmp = y * ((1.0 / (y + x)) / (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2e+183: tmp = 1.0 / (x * ((y + x) / y)) elif x <= -1950000000.0: tmp = y * ((1.0 / (y + x)) / (x + 1.0)) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2e+183) tmp = Float64(1.0 / Float64(x * Float64(Float64(y + x) / y))); elseif (x <= -1950000000.0) tmp = Float64(y * Float64(Float64(1.0 / Float64(y + x)) / Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + x)) / 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 <= -2e+183)
tmp = 1.0 / (x * ((y + x) / y));
elseif (x <= -1950000000.0)
tmp = y * ((1.0 / (y + x)) / (x + 1.0));
else
tmp = (x / (y + x)) / (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, -2e+183], N[(1.0 / N[(x * N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1950000000.0], N[(y * N[(N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+183}:\\
\;\;\;\;\frac{1}{x \cdot \frac{y + x}{y}}\\
\mathbf{elif}\;x \leq -1950000000:\\
\;\;\;\;y \cdot \frac{\frac{1}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -1.99999999999999989e183Initial program 44.0%
+-commutative44.0%
+-commutative44.0%
+-commutative44.0%
*-commutative44.0%
distribute-rgt1-in0.0%
fma-define44.0%
+-commutative44.0%
+-commutative44.0%
cube-unmult44.0%
+-commutative44.0%
Simplified44.0%
*-commutative44.0%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in44.0%
*-commutative44.0%
associate-*l*44.0%
times-frac70.5%
associate-+r+70.5%
Applied egg-rr70.5%
Taylor expanded in x around inf 83.1%
+-commutative83.1%
clear-num83.1%
clear-num83.0%
frac-times83.2%
metadata-eval83.2%
/-rgt-identity83.2%
+-commutative83.2%
Applied egg-rr83.2%
if -1.99999999999999989e183 < x < -1.95e9Initial program 66.9%
Taylor expanded in x around inf 62.1%
Taylor expanded in x around inf 56.9%
associate-/l*60.5%
*-commutative60.5%
+-commutative60.5%
Applied egg-rr60.5%
associate-*r/56.9%
*-commutative56.9%
associate-*r/65.0%
associate-/r*75.1%
associate-/r*75.1%
*-inverses75.1%
Simplified75.1%
if -1.95e9 < x Initial program 72.9%
+-commutative72.9%
+-commutative72.9%
+-commutative72.9%
*-commutative72.9%
distribute-rgt1-in58.8%
fma-define72.8%
+-commutative72.8%
+-commutative72.8%
cube-unmult72.9%
+-commutative72.9%
Simplified72.9%
*-commutative72.9%
fma-define58.9%
cube-mult58.8%
distribute-rgt1-in72.9%
*-commutative72.9%
associate-*l*72.8%
times-frac96.9%
associate-+r+96.9%
Applied egg-rr96.9%
clear-num96.8%
associate-+r+96.8%
associate-/r*99.8%
frac-times99.3%
metadata-eval99.3%
times-frac99.3%
*-un-lft-identity99.3%
*-un-lft-identity99.3%
+-commutative99.3%
+-commutative99.3%
associate-+r+99.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 63.3%
+-commutative63.3%
Simplified63.3%
Final simplification67.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 580.0) (* (/ y (+ y x)) (/ (/ x (+ y x)) (+ x 1.0))) (/ (/ x y) (* (+ x (+ y 1.0)) (/ (+ y x) y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 580.0) {
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0));
} else {
tmp = (x / y) / ((x + (y + 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) :: tmp
if (y <= 580.0d0) then
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0d0))
else
tmp = (x / y) / ((x + (y + 1.0d0)) * ((y + x) / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 580.0) {
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0));
} else {
tmp = (x / y) / ((x + (y + 1.0)) * ((y + x) / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 580.0: tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0)) else: tmp = (x / y) / ((x + (y + 1.0)) * ((y + x) / y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 580.0) tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(Float64(x + Float64(y + 1.0)) * Float64(Float64(y + x) / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 580.0)
tmp = (y / (y + x)) * ((x / (y + x)) / (x + 1.0));
else
tmp = (x / y) / ((x + (y + 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_] := If[LessEqual[y, 580.0], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 580:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\left(x + \left(y + 1\right)\right) \cdot \frac{y + x}{y}}\\
\end{array}
\end{array}
if y < 580Initial program 71.5%
Taylor expanded in x around inf 64.6%
*-commutative64.6%
associate-*l*64.6%
times-frac80.5%
+-commutative80.5%
+-commutative80.5%
Applied egg-rr80.5%
associate-/r*79.1%
Simplified79.1%
if 580 < y Initial program 62.3%
+-commutative62.3%
+-commutative62.3%
+-commutative62.3%
*-commutative62.3%
distribute-rgt1-in59.2%
fma-define62.3%
+-commutative62.3%
+-commutative62.3%
cube-unmult62.3%
+-commutative62.3%
Simplified62.3%
*-commutative62.3%
fma-define59.2%
cube-mult59.2%
distribute-rgt1-in62.3%
*-commutative62.3%
associate-*l*62.3%
times-frac86.0%
associate-+r+86.0%
Applied egg-rr86.0%
clear-num86.0%
associate-+r+86.0%
associate-/r*99.7%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 86.0%
Final simplification80.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (* (/ x (+ y x)) (/ y (+ y x))) (+ (+ y x) 1.0)))
assert(x < y);
double code(double x, double y) {
return ((x / (y + x)) * (y / (y + x))) / ((y + x) + 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 / (y + x)) * (y / (y + x))) / ((y + x) + 1.0d0)
end function
assert x < y;
public static double code(double x, double y) {
return ((x / (y + x)) * (y / (y + x))) / ((y + x) + 1.0);
}
[x, y] = sort([x, y]) def code(x, y): return ((x / (y + x)) * (y / (y + x))) / ((y + x) + 1.0)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(y + x))) / Float64(Float64(y + x) + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((x / (y + x)) * (y / (y + x))) / ((y + x) + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{y + x} \cdot \frac{y}{y + x}}{\left(y + x\right) + 1}
\end{array}
Initial program 69.1%
+-commutative69.1%
+-commutative69.1%
+-commutative69.1%
*-commutative69.1%
distribute-rgt1-in52.7%
fma-define69.1%
+-commutative69.1%
+-commutative69.1%
cube-unmult69.2%
+-commutative69.2%
Simplified69.2%
*-commutative69.2%
fma-define52.8%
cube-mult52.7%
distribute-rgt1-in69.1%
*-commutative69.1%
associate-*l*69.1%
times-frac94.0%
associate-+r+94.0%
Applied egg-rr94.0%
clear-num94.0%
associate-+r+94.0%
associate-/r*99.8%
frac-times99.4%
metadata-eval99.4%
times-frac99.4%
*-un-lft-identity99.4%
*-un-lft-identity99.4%
+-commutative99.4%
+-commutative99.4%
associate-+r+99.4%
Applied egg-rr99.4%
add-exp-log73.5%
associate-/r*73.5%
log-div35.0%
div-inv35.0%
+-commutative35.0%
+-commutative35.0%
clear-num35.0%
+-commutative35.0%
+-commutative35.0%
associate-+l+35.0%
log1p-undefine35.0%
+-commutative35.0%
Applied egg-rr35.0%
exp-diff35.1%
rem-exp-log56.7%
*-commutative56.7%
log1p-undefine56.7%
rem-exp-log99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -122000000.0) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x (+ y x)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -122000000.0) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (y + x)) / (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 <= (-122000000.0d0)) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -122000000.0) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -122000000.0: tmp = (y / (y + x)) / (x + 1.0) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -122000000.0) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + x)) / 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 <= -122000000.0)
tmp = (y / (y + x)) / (x + 1.0);
else
tmp = (x / (y + x)) / (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, -122000000.0], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -122000000:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -1.22e8Initial program 58.5%
Taylor expanded in x around inf 54.2%
Taylor expanded in x around inf 51.1%
associate-/l*63.6%
*-commutative63.6%
+-commutative63.6%
Applied egg-rr63.6%
associate-*r/51.1%
*-commutative51.1%
associate-*r/66.2%
associate-/r*72.2%
associate-/r*72.2%
*-inverses72.2%
Simplified72.2%
associate-*r/72.6%
+-commutative72.6%
div-inv72.6%
Applied egg-rr72.6%
if -1.22e8 < x Initial program 72.7%
+-commutative72.7%
+-commutative72.7%
+-commutative72.7%
*-commutative72.7%
distribute-rgt1-in58.6%
fma-define72.7%
+-commutative72.7%
+-commutative72.7%
cube-unmult72.7%
+-commutative72.7%
Simplified72.7%
*-commutative72.7%
fma-define58.7%
cube-mult58.6%
distribute-rgt1-in72.7%
*-commutative72.7%
associate-*l*72.7%
times-frac96.9%
associate-+r+96.9%
Applied egg-rr96.9%
clear-num96.8%
associate-+r+96.8%
associate-/r*99.8%
frac-times99.2%
metadata-eval99.2%
times-frac99.2%
*-un-lft-identity99.2%
*-un-lft-identity99.2%
+-commutative99.2%
+-commutative99.2%
associate-+r+99.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 63.1%
+-commutative63.1%
Simplified63.1%
Final simplification65.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3500000000.0) (/ (/ y (+ y x)) x) (/ (/ x (+ y x)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3500000000.0) {
tmp = (y / (y + x)) / x;
} else {
tmp = (x / (y + x)) / (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 <= (-3500000000.0d0)) then
tmp = (y / (y + x)) / x
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3500000000.0) {
tmp = (y / (y + x)) / x;
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3500000000.0: tmp = (y / (y + x)) / x else: tmp = (x / (y + x)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3500000000.0) tmp = Float64(Float64(y / Float64(y + x)) / x); else tmp = Float64(Float64(x / Float64(y + x)) / 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 <= -3500000000.0)
tmp = (y / (y + x)) / x;
else
tmp = (x / (y + x)) / (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, -3500000000.0], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3500000000:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -3.5e9Initial program 57.8%
+-commutative57.8%
+-commutative57.8%
+-commutative57.8%
*-commutative57.8%
distribute-rgt1-in34.0%
fma-define57.8%
+-commutative57.8%
+-commutative57.8%
cube-unmult57.9%
+-commutative57.9%
Simplified57.9%
*-commutative57.9%
fma-define34.1%
cube-mult34.0%
distribute-rgt1-in57.8%
*-commutative57.8%
associate-*l*57.8%
times-frac85.2%
associate-+r+85.2%
Applied egg-rr85.2%
Taylor expanded in x around inf 73.4%
un-div-inv73.5%
Applied egg-rr73.5%
if -3.5e9 < x Initial program 72.9%
+-commutative72.9%
+-commutative72.9%
+-commutative72.9%
*-commutative72.9%
distribute-rgt1-in58.8%
fma-define72.8%
+-commutative72.8%
+-commutative72.8%
cube-unmult72.9%
+-commutative72.9%
Simplified72.9%
*-commutative72.9%
fma-define58.9%
cube-mult58.8%
distribute-rgt1-in72.9%
*-commutative72.9%
associate-*l*72.8%
times-frac96.9%
associate-+r+96.9%
Applied egg-rr96.9%
clear-num96.8%
associate-+r+96.8%
associate-/r*99.8%
frac-times99.3%
metadata-eval99.3%
times-frac99.3%
*-un-lft-identity99.3%
*-un-lft-identity99.3%
+-commutative99.3%
+-commutative99.3%
associate-+r+99.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 63.3%
+-commutative63.3%
Simplified63.3%
Final simplification65.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -720000000.0) (/ (/ y (+ y x)) x) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -720000000.0) {
tmp = (y / (y + x)) / 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 <= (-720000000.0d0)) then
tmp = (y / (y + x)) / 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 <= -720000000.0) {
tmp = (y / (y + x)) / x;
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -720000000.0: tmp = (y / (y + x)) / x else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -720000000.0) tmp = Float64(Float64(y / Float64(y + x)) / 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 <= -720000000.0)
tmp = (y / (y + x)) / 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, -720000000.0], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / 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 -720000000:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -7.2e8Initial program 57.8%
+-commutative57.8%
+-commutative57.8%
+-commutative57.8%
*-commutative57.8%
distribute-rgt1-in34.0%
fma-define57.8%
+-commutative57.8%
+-commutative57.8%
cube-unmult57.9%
+-commutative57.9%
Simplified57.9%
*-commutative57.9%
fma-define34.1%
cube-mult34.0%
distribute-rgt1-in57.8%
*-commutative57.8%
associate-*l*57.8%
times-frac85.2%
associate-+r+85.2%
Applied egg-rr85.2%
Taylor expanded in x around inf 73.4%
un-div-inv73.5%
Applied egg-rr73.5%
if -7.2e8 < x Initial program 72.9%
associate-/l*85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in x around 0 63.2%
associate-/r*63.0%
+-commutative63.0%
Simplified63.0%
Final simplification65.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3100000000.0) (* (/ y x) (/ 1.0 x)) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3100000000.0) {
tmp = (y / x) * (1.0 / 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 <= (-3100000000.0d0)) then
tmp = (y / x) * (1.0d0 / 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 <= -3100000000.0) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3100000000.0: tmp = (y / x) * (1.0 / x) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3100000000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / 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 <= -3100000000.0)
tmp = (y / x) * (1.0 / 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, -3100000000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $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 -3100000000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -3.1e9Initial program 57.8%
+-commutative57.8%
+-commutative57.8%
+-commutative57.8%
*-commutative57.8%
distribute-rgt1-in34.0%
fma-define57.8%
+-commutative57.8%
+-commutative57.8%
cube-unmult57.9%
+-commutative57.9%
Simplified57.9%
*-commutative57.9%
fma-define34.1%
cube-mult34.0%
distribute-rgt1-in57.8%
*-commutative57.8%
associate-*l*57.8%
times-frac85.2%
associate-+r+85.2%
Applied egg-rr85.2%
Taylor expanded in x around inf 73.4%
Taylor expanded in y around 0 73.0%
if -3.1e9 < x Initial program 72.9%
associate-/l*85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in x around 0 63.2%
associate-/r*63.0%
+-commutative63.0%
Simplified63.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -17000000.0) (* (/ y x) (/ 1.0 x)) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -17000000.0) {
tmp = (y / x) * (1.0 / 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 <= (-17000000.0d0)) then
tmp = (y / x) * (1.0d0 / 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 <= -17000000.0) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -17000000.0: tmp = (y / x) * (1.0 / x) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -17000000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / 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 <= -17000000.0)
tmp = (y / x) * (1.0 / 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, -17000000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / 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 -17000000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1.7e7Initial program 58.5%
+-commutative58.5%
+-commutative58.5%
+-commutative58.5%
*-commutative58.5%
distribute-rgt1-in35.0%
fma-define58.5%
+-commutative58.5%
+-commutative58.5%
cube-unmult58.5%
+-commutative58.5%
Simplified58.5%
*-commutative58.5%
fma-define35.1%
cube-mult35.0%
distribute-rgt1-in58.5%
*-commutative58.5%
associate-*l*58.5%
times-frac85.4%
associate-+r+85.4%
Applied egg-rr85.4%
Taylor expanded in x around inf 72.3%
Taylor expanded in y around 0 72.0%
if -1.7e7 < x Initial program 72.7%
associate-/l*85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in x around 0 63.0%
Final simplification65.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (* (/ x y) (/ 1.0 y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} 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) :: tmp
if (y <= 1.0d0) then
tmp = x / y
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 tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.0: tmp = x / y else: tmp = (x / y) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) * 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 <= 1.0)
tmp = x / y;
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_] := If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 1Initial program 71.5%
associate-/l*84.1%
associate-+l+84.1%
Simplified84.1%
Taylor expanded in x around 0 47.0%
Taylor expanded in y around 0 26.5%
if 1 < y Initial program 62.3%
associate-/l*75.8%
associate-+l+75.8%
Simplified75.8%
Taylor expanded in x around 0 70.5%
*-un-lft-identity70.5%
+-commutative70.5%
times-frac75.2%
Applied egg-rr75.2%
Taylor expanded in y around inf 73.4%
Final simplification38.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} 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 <= 1.0d0) then
tmp = x / y
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 <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.0) tmp = Float64(x / y); 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 <= 1.0)
tmp = x / y;
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, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1Initial program 71.5%
associate-/l*84.1%
associate-+l+84.1%
Simplified84.1%
Taylor expanded in x around 0 47.0%
Taylor expanded in y around 0 26.5%
if 1 < y Initial program 62.3%
associate-/l*75.8%
associate-+l+75.8%
Simplified75.8%
Taylor expanded in x around 0 70.5%
Taylor expanded in y around inf 68.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -215000.0) (/ 1.0 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -215000.0) {
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 <= (-215000.0d0)) 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 <= -215000.0) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -215000.0: tmp = 1.0 / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -215000.0) 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 <= -215000.0)
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, -215000.0], 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 -215000:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -215000Initial program 58.5%
+-commutative58.5%
+-commutative58.5%
+-commutative58.5%
*-commutative58.5%
distribute-rgt1-in35.0%
fma-define58.5%
+-commutative58.5%
+-commutative58.5%
cube-unmult58.5%
+-commutative58.5%
Simplified58.5%
*-commutative58.5%
fma-define35.1%
cube-mult35.0%
distribute-rgt1-in58.5%
*-commutative58.5%
associate-*l*58.5%
times-frac85.4%
associate-+r+85.4%
Applied egg-rr85.4%
Taylor expanded in x around inf 72.3%
Taylor expanded in y around inf 5.7%
if -215000 < x Initial program 72.7%
associate-/l*85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in x around 0 63.0%
Taylor expanded in y around 0 32.6%
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 69.1%
+-commutative69.1%
+-commutative69.1%
+-commutative69.1%
*-commutative69.1%
distribute-rgt1-in52.7%
fma-define69.1%
+-commutative69.1%
+-commutative69.1%
cube-unmult69.2%
+-commutative69.2%
Simplified69.2%
*-commutative69.2%
fma-define52.8%
cube-mult52.7%
distribute-rgt1-in69.1%
*-commutative69.1%
associate-*l*69.1%
times-frac94.0%
associate-+r+94.0%
Applied egg-rr94.0%
Taylor expanded in x around inf 37.4%
Taylor expanded in y around inf 4.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 1.0)
assert(x < y);
double code(double x, double y) {
return 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 = 1.0d0
end function
assert x < y;
public static double code(double x, double y) {
return 1.0;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0
x, y = sort([x, y]) function code(x, y) return 1.0 end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := 1.0
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
1
\end{array}
Initial program 69.1%
Taylor expanded in x around inf 57.4%
Taylor expanded in x around inf 32.7%
Taylor expanded in x around 0 3.6%
(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 2024186
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))