
(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 (* (/ x (+ y (+ x 1.0))) (/ (/ 1.0 (+ x y)) (/ (+ x y) y))))
assert(x < y);
double code(double x, double y) {
return (x / (y + (x + 1.0))) * ((1.0 / (x + y)) / ((x + y) / y));
}
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 + 1.0d0))) * ((1.0d0 / (x + y)) / ((x + y) / y))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (y + (x + 1.0))) * ((1.0 / (x + y)) / ((x + y) / y));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (y + (x + 1.0))) * ((1.0 / (x + y)) / ((x + y) / y))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(y + Float64(x + 1.0))) * Float64(Float64(1.0 / Float64(x + y)) / Float64(Float64(x + y) / y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (y + (x + 1.0))) * ((1.0 / (x + y)) / ((x + y) / y));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y + \left(x + 1\right)} \cdot \frac{\frac{1}{x + y}}{\frac{x + y}{y}}
\end{array}
Initial program 68.2%
+-commutative68.2%
+-commutative68.2%
+-commutative68.2%
*-commutative68.2%
distribute-rgt1-in52.9%
fma-define68.2%
+-commutative68.2%
+-commutative68.2%
cube-unmult68.2%
+-commutative68.2%
Simplified68.2%
*-commutative68.2%
fma-define52.9%
cube-mult52.9%
distribute-rgt1-in68.2%
*-commutative68.2%
associate-*l*68.1%
times-frac92.3%
associate-+r+92.3%
Applied egg-rr92.3%
clear-num92.2%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
div-inv99.7%
*-commutative99.7%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -1.1)
(/ (/ 1.0 (+ x y)) (/ (+ x y) y))
(if (<= y 8e+19)
(* (/ y (+ x y)) (/ x (* (+ x 1.0) (+ x y))))
(if (<= y 1e+146)
(/ x (* (+ x y) (+ x (+ y 1.0))))
(/ (/ x (+ x y)) (* (+ y (+ x 1.0)) (/ y y)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1.1) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (y <= 8e+19) {
tmp = (y / (x + y)) * (x / ((x + 1.0) * (x + y)));
} else if (y <= 1e+146) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) / ((y + (x + 1.0)) * (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.1d0)) then
tmp = (1.0d0 / (x + y)) / ((x + y) / y)
else if (y <= 8d+19) then
tmp = (y / (x + y)) * (x / ((x + 1.0d0) * (x + y)))
else if (y <= 1d+146) then
tmp = x / ((x + y) * (x + (y + 1.0d0)))
else
tmp = (x / (x + y)) / ((y + (x + 1.0d0)) * (y / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -1.1) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (y <= 8e+19) {
tmp = (y / (x + y)) * (x / ((x + 1.0) * (x + y)));
} else if (y <= 1e+146) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) / ((y + (x + 1.0)) * (y / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1.1: tmp = (1.0 / (x + y)) / ((x + y) / y) elif y <= 8e+19: tmp = (y / (x + y)) * (x / ((x + 1.0) * (x + y))) elif y <= 1e+146: tmp = x / ((x + y) * (x + (y + 1.0))) else: tmp = (x / (x + y)) / ((y + (x + 1.0)) * (y / y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1.1) tmp = Float64(Float64(1.0 / Float64(x + y)) / Float64(Float64(x + y) / y)); elseif (y <= 8e+19) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x + 1.0) * Float64(x + y)))); elseif (y <= 1e+146) tmp = Float64(x / Float64(Float64(x + y) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(Float64(y + Float64(x + 1.0)) * 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.1)
tmp = (1.0 / (x + y)) / ((x + y) / y);
elseif (y <= 8e+19)
tmp = (y / (x + y)) * (x / ((x + 1.0) * (x + y)));
elseif (y <= 1e+146)
tmp = x / ((x + y) * (x + (y + 1.0)));
else
tmp = (x / (x + y)) / ((y + (x + 1.0)) * (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.1], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+19], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + 1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+146], N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(y / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1:\\
\;\;\;\;\frac{\frac{1}{x + y}}{\frac{x + y}{y}}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+19}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + 1\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;y \leq 10^{+146}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y}{y}}\\
\end{array}
\end{array}
if y < -1.1000000000000001Initial program 59.1%
+-commutative59.1%
+-commutative59.1%
+-commutative59.1%
*-commutative59.1%
distribute-rgt1-in25.0%
fma-define59.1%
+-commutative59.1%
+-commutative59.1%
cube-unmult59.1%
+-commutative59.1%
Simplified59.1%
*-commutative59.1%
fma-define25.1%
cube-mult25.0%
distribute-rgt1-in59.1%
*-commutative59.1%
associate-*l*59.1%
times-frac82.3%
associate-+r+82.3%
Applied egg-rr82.3%
clear-num82.3%
associate-/r*99.6%
+-commutative99.6%
associate-+l+99.6%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
div-inv99.7%
*-commutative99.7%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 35.8%
if -1.1000000000000001 < y < 8e19Initial program 78.6%
Taylor expanded in x around inf 77.5%
*-commutative77.5%
associate-*l*77.4%
times-frac98.8%
+-commutative98.8%
+-commutative98.8%
Applied egg-rr98.8%
if 8e19 < y < 9.99999999999999934e145Initial program 69.0%
+-commutative69.0%
+-commutative69.0%
+-commutative69.0%
*-commutative69.0%
distribute-rgt1-in60.2%
fma-define69.0%
+-commutative69.0%
+-commutative69.0%
cube-unmult69.0%
+-commutative69.0%
Simplified69.0%
*-commutative69.0%
fma-define60.2%
cube-mult60.2%
distribute-rgt1-in69.0%
*-commutative69.0%
associate-*l*69.0%
times-frac94.3%
associate-+r+94.3%
Applied egg-rr94.3%
Taylor expanded in y around inf 82.9%
if 9.99999999999999934e145 < y Initial program 44.7%
+-commutative44.7%
+-commutative44.7%
+-commutative44.7%
*-commutative44.7%
distribute-rgt1-in44.7%
fma-define44.7%
+-commutative44.7%
+-commutative44.7%
cube-unmult44.7%
+-commutative44.7%
Simplified44.7%
*-commutative44.7%
fma-define44.7%
cube-mult44.7%
distribute-rgt1-in44.7%
*-commutative44.7%
associate-*l*44.7%
times-frac78.9%
associate-+r+78.9%
Applied egg-rr78.9%
clear-num78.9%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 92.3%
Final simplification81.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= y -520000.0)
(/ (/ 1.0 (+ x y)) (/ (+ x y) y))
(if (<= y 1.05e+134)
(* t_0 (/ y (* (+ x y) (+ x (+ y 1.0)))))
(/ t_0 (* (+ y (+ x 1.0)) (/ y y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= -520000.0) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (y <= 1.05e+134) {
tmp = t_0 * (y / ((x + y) * (x + (y + 1.0))));
} else {
tmp = t_0 / ((y + (x + 1.0)) * (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 = x / (x + y)
if (y <= (-520000.0d0)) then
tmp = (1.0d0 / (x + y)) / ((x + y) / y)
else if (y <= 1.05d+134) then
tmp = t_0 * (y / ((x + y) * (x + (y + 1.0d0))))
else
tmp = t_0 / ((y + (x + 1.0d0)) * (y / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= -520000.0) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (y <= 1.05e+134) {
tmp = t_0 * (y / ((x + y) * (x + (y + 1.0))));
} else {
tmp = t_0 / ((y + (x + 1.0)) * (y / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if y <= -520000.0: tmp = (1.0 / (x + y)) / ((x + y) / y) elif y <= 1.05e+134: tmp = t_0 * (y / ((x + y) * (x + (y + 1.0)))) else: tmp = t_0 / ((y + (x + 1.0)) * (y / y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= -520000.0) tmp = Float64(Float64(1.0 / Float64(x + y)) / Float64(Float64(x + y) / y)); elseif (y <= 1.05e+134) tmp = Float64(t_0 * Float64(y / Float64(Float64(x + y) * Float64(x + Float64(y + 1.0))))); else tmp = Float64(t_0 / Float64(Float64(y + Float64(x + 1.0)) * Float64(y / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (y <= -520000.0)
tmp = (1.0 / (x + y)) / ((x + y) / y);
elseif (y <= 1.05e+134)
tmp = t_0 * (y / ((x + y) * (x + (y + 1.0))));
else
tmp = t_0 / ((y + (x + 1.0)) * (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[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -520000.0], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+134], N[(t$95$0 * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(y / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;y \leq -520000:\\
\;\;\;\;\frac{\frac{1}{x + y}}{\frac{x + y}{y}}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+134}:\\
\;\;\;\;t\_0 \cdot \frac{y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\left(y + \left(x + 1\right)\right) \cdot \frac{y}{y}}\\
\end{array}
\end{array}
if y < -5.2e5Initial program 58.4%
+-commutative58.4%
+-commutative58.4%
+-commutative58.4%
*-commutative58.4%
distribute-rgt1-in23.7%
fma-define58.3%
+-commutative58.3%
+-commutative58.3%
cube-unmult58.4%
+-commutative58.4%
Simplified58.4%
*-commutative58.4%
fma-define23.7%
cube-mult23.7%
distribute-rgt1-in58.4%
*-commutative58.4%
associate-*l*58.4%
times-frac82.0%
associate-+r+82.0%
Applied egg-rr82.0%
clear-num82.0%
associate-/r*99.6%
+-commutative99.6%
associate-+l+99.6%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
div-inv99.7%
*-commutative99.7%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 34.6%
if -5.2e5 < y < 1.05e134Initial program 77.9%
+-commutative77.9%
+-commutative77.9%
+-commutative77.9%
*-commutative77.9%
distribute-rgt1-in65.4%
fma-define77.9%
+-commutative77.9%
+-commutative77.9%
cube-unmult77.9%
+-commutative77.9%
Simplified77.9%
fma-define65.4%
cube-mult65.4%
distribute-rgt1-in77.9%
*-commutative77.9%
associate-*l*77.9%
times-frac98.7%
associate-+r+98.7%
Applied egg-rr98.7%
if 1.05e134 < y Initial program 43.3%
+-commutative43.3%
+-commutative43.3%
+-commutative43.3%
*-commutative43.3%
distribute-rgt1-in43.3%
fma-define43.3%
+-commutative43.3%
+-commutative43.3%
cube-unmult43.3%
+-commutative43.3%
Simplified43.3%
*-commutative43.3%
fma-define43.3%
cube-mult43.3%
distribute-rgt1-in43.3%
*-commutative43.3%
associate-*l*43.3%
times-frac80.9%
associate-+r+80.9%
Applied egg-rr80.9%
clear-num80.9%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 93.1%
Final simplification84.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= y 6.8e-23)
(/ t_0 (* (+ x 1.0) (/ (+ x y) y)))
(if (<= y 8.8e+77)
(* x (/ y (* (+ x (+ y 1.0)) (* (+ x y) (+ x y)))))
(/ t_0 (* (+ y (+ x 1.0)) (/ y y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= 6.8e-23) {
tmp = t_0 / ((x + 1.0) * ((x + y) / y));
} else if (y <= 8.8e+77) {
tmp = x * (y / ((x + (y + 1.0)) * ((x + y) * (x + y))));
} else {
tmp = t_0 / ((y + (x + 1.0)) * (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 = x / (x + y)
if (y <= 6.8d-23) then
tmp = t_0 / ((x + 1.0d0) * ((x + y) / y))
else if (y <= 8.8d+77) then
tmp = x * (y / ((x + (y + 1.0d0)) * ((x + y) * (x + y))))
else
tmp = t_0 / ((y + (x + 1.0d0)) * (y / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= 6.8e-23) {
tmp = t_0 / ((x + 1.0) * ((x + y) / y));
} else if (y <= 8.8e+77) {
tmp = x * (y / ((x + (y + 1.0)) * ((x + y) * (x + y))));
} else {
tmp = t_0 / ((y + (x + 1.0)) * (y / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if y <= 6.8e-23: tmp = t_0 / ((x + 1.0) * ((x + y) / y)) elif y <= 8.8e+77: tmp = x * (y / ((x + (y + 1.0)) * ((x + y) * (x + y)))) else: tmp = t_0 / ((y + (x + 1.0)) * (y / y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= 6.8e-23) tmp = Float64(t_0 / Float64(Float64(x + 1.0) * Float64(Float64(x + y) / y))); elseif (y <= 8.8e+77) tmp = Float64(x * Float64(y / Float64(Float64(x + Float64(y + 1.0)) * Float64(Float64(x + y) * Float64(x + y))))); else tmp = Float64(t_0 / Float64(Float64(y + Float64(x + 1.0)) * Float64(y / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (y <= 6.8e-23)
tmp = t_0 / ((x + 1.0) * ((x + y) / y));
elseif (y <= 8.8e+77)
tmp = x * (y / ((x + (y + 1.0)) * ((x + y) * (x + y))));
else
tmp = t_0 / ((y + (x + 1.0)) * (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[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.8e-23], N[(t$95$0 / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.8e+77], N[(x * N[(y / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(y / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;y \leq 6.8 \cdot 10^{-23}:\\
\;\;\;\;\frac{t\_0}{\left(x + 1\right) \cdot \frac{x + y}{y}}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+77}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + \left(y + 1\right)\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\left(y + \left(x + 1\right)\right) \cdot \frac{y}{y}}\\
\end{array}
\end{array}
if y < 6.8000000000000001e-23Initial program 71.5%
+-commutative71.5%
+-commutative71.5%
+-commutative71.5%
*-commutative71.5%
distribute-rgt1-in51.1%
fma-define71.5%
+-commutative71.5%
+-commutative71.5%
cube-unmult71.5%
+-commutative71.5%
Simplified71.5%
*-commutative71.5%
fma-define51.1%
cube-mult51.1%
distribute-rgt1-in71.5%
*-commutative71.5%
associate-*l*71.5%
times-frac94.3%
associate-+r+94.3%
Applied egg-rr94.3%
clear-num94.3%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 84.8%
+-commutative84.8%
Simplified84.8%
if 6.8000000000000001e-23 < y < 8.8000000000000002e77Initial program 88.3%
associate-/l*92.2%
associate-+l+92.2%
Simplified92.2%
if 8.8000000000000002e77 < y Initial program 47.1%
+-commutative47.1%
+-commutative47.1%
+-commutative47.1%
*-commutative47.1%
distribute-rgt1-in47.1%
fma-define47.1%
+-commutative47.1%
+-commutative47.1%
cube-unmult47.1%
+-commutative47.1%
Simplified47.1%
*-commutative47.1%
fma-define47.1%
cube-mult47.1%
distribute-rgt1-in47.1%
*-commutative47.1%
associate-*l*47.1%
times-frac83.5%
associate-+r+83.5%
Applied egg-rr83.5%
clear-num83.5%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 91.2%
Final simplification86.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -2100.0)
(/ (/ 1.0 (+ x y)) (/ (+ x y) y))
(if (<= y 8.2e+19)
(* (/ y (+ x y)) (/ x (* (+ x 1.0) (+ x y))))
(if (<= y 3.4e+149)
(/ x (* (+ x y) (+ x (+ y 1.0))))
(/ (/ x (+ x y)) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2100.0) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (y <= 8.2e+19) {
tmp = (y / (x + y)) * (x / ((x + 1.0) * (x + y)));
} else if (y <= 3.4e+149) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2100.0d0)) then
tmp = (1.0d0 / (x + y)) / ((x + y) / y)
else if (y <= 8.2d+19) then
tmp = (y / (x + y)) * (x / ((x + 1.0d0) * (x + y)))
else if (y <= 3.4d+149) then
tmp = x / ((x + y) * (x + (y + 1.0d0)))
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -2100.0) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (y <= 8.2e+19) {
tmp = (y / (x + y)) * (x / ((x + 1.0) * (x + y)));
} else if (y <= 3.4e+149) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -2100.0: tmp = (1.0 / (x + y)) / ((x + y) / y) elif y <= 8.2e+19: tmp = (y / (x + y)) * (x / ((x + 1.0) * (x + y))) elif y <= 3.4e+149: tmp = x / ((x + y) * (x + (y + 1.0))) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2100.0) tmp = Float64(Float64(1.0 / Float64(x + y)) / Float64(Float64(x + y) / y)); elseif (y <= 8.2e+19) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x + 1.0) * Float64(x + y)))); elseif (y <= 3.4e+149) tmp = Float64(x / Float64(Float64(x + y) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -2100.0)
tmp = (1.0 / (x + y)) / ((x + y) / y);
elseif (y <= 8.2e+19)
tmp = (y / (x + y)) * (x / ((x + 1.0) * (x + y)));
elseif (y <= 3.4e+149)
tmp = x / ((x + y) * (x + (y + 1.0)));
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -2100.0], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+19], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + 1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+149], N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2100:\\
\;\;\;\;\frac{\frac{1}{x + y}}{\frac{x + y}{y}}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+19}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + 1\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+149}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if y < -2100Initial program 58.4%
+-commutative58.4%
+-commutative58.4%
+-commutative58.4%
*-commutative58.4%
distribute-rgt1-in23.7%
fma-define58.3%
+-commutative58.3%
+-commutative58.3%
cube-unmult58.4%
+-commutative58.4%
Simplified58.4%
*-commutative58.4%
fma-define23.7%
cube-mult23.7%
distribute-rgt1-in58.4%
*-commutative58.4%
associate-*l*58.4%
times-frac82.0%
associate-+r+82.0%
Applied egg-rr82.0%
clear-num82.0%
associate-/r*99.6%
+-commutative99.6%
associate-+l+99.6%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
div-inv99.7%
*-commutative99.7%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 34.6%
if -2100 < y < 8.2e19Initial program 78.8%
Taylor expanded in x around inf 77.6%
*-commutative77.6%
associate-*l*77.6%
times-frac98.8%
+-commutative98.8%
+-commutative98.8%
Applied egg-rr98.8%
if 8.2e19 < y < 3.3999999999999998e149Initial program 69.0%
+-commutative69.0%
+-commutative69.0%
+-commutative69.0%
*-commutative69.0%
distribute-rgt1-in60.2%
fma-define69.0%
+-commutative69.0%
+-commutative69.0%
cube-unmult69.0%
+-commutative69.0%
Simplified69.0%
*-commutative69.0%
fma-define60.2%
cube-mult60.2%
distribute-rgt1-in69.0%
*-commutative69.0%
associate-*l*69.0%
times-frac94.3%
associate-+r+94.3%
Applied egg-rr94.3%
Taylor expanded in y around inf 82.9%
if 3.3999999999999998e149 < y Initial program 44.7%
+-commutative44.7%
+-commutative44.7%
+-commutative44.7%
*-commutative44.7%
distribute-rgt1-in44.7%
fma-define44.7%
+-commutative44.7%
+-commutative44.7%
cube-unmult44.7%
+-commutative44.7%
Simplified44.7%
*-commutative44.7%
fma-define44.7%
cube-mult44.7%
distribute-rgt1-in44.7%
*-commutative44.7%
associate-*l*44.7%
times-frac78.9%
associate-+r+78.9%
Applied egg-rr78.9%
clear-num78.9%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
Simplified92.1%
Final simplification81.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= y -41.0)
(/ (/ 1.0 (+ x y)) (/ (+ x y) y))
(if (<= y 8e+19)
(* t_0 (/ y (* (+ x 1.0) (+ x y))))
(if (<= y 6e+148)
(/ x (* (+ x y) (+ x (+ y 1.0))))
(/ t_0 (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= -41.0) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (y <= 8e+19) {
tmp = t_0 * (y / ((x + 1.0) * (x + y)));
} else if (y <= 6e+148) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = t_0 / (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) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (y <= (-41.0d0)) then
tmp = (1.0d0 / (x + y)) / ((x + y) / y)
else if (y <= 8d+19) then
tmp = t_0 * (y / ((x + 1.0d0) * (x + y)))
else if (y <= 6d+148) then
tmp = x / ((x + y) * (x + (y + 1.0d0)))
else
tmp = t_0 / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= -41.0) {
tmp = (1.0 / (x + y)) / ((x + y) / y);
} else if (y <= 8e+19) {
tmp = t_0 * (y / ((x + 1.0) * (x + y)));
} else if (y <= 6e+148) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = t_0 / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if y <= -41.0: tmp = (1.0 / (x + y)) / ((x + y) / y) elif y <= 8e+19: tmp = t_0 * (y / ((x + 1.0) * (x + y))) elif y <= 6e+148: tmp = x / ((x + y) * (x + (y + 1.0))) else: tmp = t_0 / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= -41.0) tmp = Float64(Float64(1.0 / Float64(x + y)) / Float64(Float64(x + y) / y)); elseif (y <= 8e+19) tmp = Float64(t_0 * Float64(y / Float64(Float64(x + 1.0) * Float64(x + y)))); elseif (y <= 6e+148) tmp = Float64(x / Float64(Float64(x + y) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(t_0 / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (y <= -41.0)
tmp = (1.0 / (x + y)) / ((x + y) / y);
elseif (y <= 8e+19)
tmp = t_0 * (y / ((x + 1.0) * (x + y)));
elseif (y <= 6e+148)
tmp = x / ((x + y) * (x + (y + 1.0)));
else
tmp = t_0 / (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_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -41.0], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+19], N[(t$95$0 * N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+148], N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;y \leq -41:\\
\;\;\;\;\frac{\frac{1}{x + y}}{\frac{x + y}{y}}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+19}:\\
\;\;\;\;t\_0 \cdot \frac{y}{\left(x + 1\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+148}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{y + 1}\\
\end{array}
\end{array}
if y < -41Initial program 58.4%
+-commutative58.4%
+-commutative58.4%
+-commutative58.4%
*-commutative58.4%
distribute-rgt1-in23.7%
fma-define58.3%
+-commutative58.3%
+-commutative58.3%
cube-unmult58.4%
+-commutative58.4%
Simplified58.4%
*-commutative58.4%
fma-define23.7%
cube-mult23.7%
distribute-rgt1-in58.4%
*-commutative58.4%
associate-*l*58.4%
times-frac82.0%
associate-+r+82.0%
Applied egg-rr82.0%
clear-num82.0%
associate-/r*99.6%
+-commutative99.6%
associate-+l+99.6%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
div-inv99.7%
*-commutative99.7%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 34.6%
if -41 < y < 8e19Initial program 78.8%
Taylor expanded in x around inf 77.6%
associate-*l*77.6%
times-frac98.8%
+-commutative98.8%
+-commutative98.8%
Applied egg-rr98.8%
if 8e19 < y < 6.00000000000000029e148Initial program 69.0%
+-commutative69.0%
+-commutative69.0%
+-commutative69.0%
*-commutative69.0%
distribute-rgt1-in60.2%
fma-define69.0%
+-commutative69.0%
+-commutative69.0%
cube-unmult69.0%
+-commutative69.0%
Simplified69.0%
*-commutative69.0%
fma-define60.2%
cube-mult60.2%
distribute-rgt1-in69.0%
*-commutative69.0%
associate-*l*69.0%
times-frac94.3%
associate-+r+94.3%
Applied egg-rr94.3%
Taylor expanded in y around inf 82.9%
if 6.00000000000000029e148 < y Initial program 44.7%
+-commutative44.7%
+-commutative44.7%
+-commutative44.7%
*-commutative44.7%
distribute-rgt1-in44.7%
fma-define44.7%
+-commutative44.7%
+-commutative44.7%
cube-unmult44.7%
+-commutative44.7%
Simplified44.7%
*-commutative44.7%
fma-define44.7%
cube-mult44.7%
distribute-rgt1-in44.7%
*-commutative44.7%
associate-*l*44.7%
times-frac78.9%
associate-+r+78.9%
Applied egg-rr78.9%
clear-num78.9%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
Simplified92.1%
Final simplification81.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 4e-148)
(/ (/ y x) (+ x 1.0))
(if (<= y 8.5e+19)
(* x (/ y (* (+ x 1.0) (* (+ x y) (+ x y)))))
(if (<= y 4.2e+149)
(/ x (* (+ x y) (+ x (+ y 1.0))))
(/ (/ x (+ x y)) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 4e-148) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 8.5e+19) {
tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y))));
} else if (y <= 4.2e+149) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4d-148) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 8.5d+19) then
tmp = x * (y / ((x + 1.0d0) * ((x + y) * (x + y))))
else if (y <= 4.2d+149) then
tmp = x / ((x + y) * (x + (y + 1.0d0)))
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 4e-148) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 8.5e+19) {
tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y))));
} else if (y <= 4.2e+149) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 4e-148: tmp = (y / x) / (x + 1.0) elif y <= 8.5e+19: tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y)))) elif y <= 4.2e+149: tmp = x / ((x + y) * (x + (y + 1.0))) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 4e-148) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 8.5e+19) tmp = Float64(x * Float64(y / Float64(Float64(x + 1.0) * Float64(Float64(x + y) * Float64(x + y))))); elseif (y <= 4.2e+149) tmp = Float64(x / Float64(Float64(x + y) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 4e-148)
tmp = (y / x) / (x + 1.0);
elseif (y <= 8.5e+19)
tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y))));
elseif (y <= 4.2e+149)
tmp = x / ((x + y) * (x + (y + 1.0)));
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 4e-148], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+19], N[(x * N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+149], N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{-148}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+149}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if y < 3.99999999999999974e-148Initial program 67.1%
+-commutative67.1%
+-commutative67.1%
+-commutative67.1%
*-commutative67.1%
distribute-rgt1-in45.1%
fma-define67.1%
+-commutative67.1%
+-commutative67.1%
cube-unmult67.1%
+-commutative67.1%
Simplified67.1%
*-commutative67.1%
fma-define45.1%
cube-mult45.1%
distribute-rgt1-in67.1%
*-commutative67.1%
associate-*l*67.1%
times-frac92.9%
associate-+r+92.9%
Applied egg-rr92.9%
clear-num92.8%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 59.2%
associate-/r*61.9%
+-commutative61.9%
Simplified61.9%
if 3.99999999999999974e-148 < y < 8.5e19Initial program 90.6%
associate-/l*93.0%
associate-+l+93.0%
Simplified93.0%
Taylor expanded in y around 0 89.7%
+-commutative89.7%
Simplified89.7%
if 8.5e19 < y < 4.2000000000000003e149Initial program 69.0%
+-commutative69.0%
+-commutative69.0%
+-commutative69.0%
*-commutative69.0%
distribute-rgt1-in60.2%
fma-define69.0%
+-commutative69.0%
+-commutative69.0%
cube-unmult69.0%
+-commutative69.0%
Simplified69.0%
*-commutative69.0%
fma-define60.2%
cube-mult60.2%
distribute-rgt1-in69.0%
*-commutative69.0%
associate-*l*69.0%
times-frac94.3%
associate-+r+94.3%
Applied egg-rr94.3%
Taylor expanded in y around inf 82.9%
if 4.2000000000000003e149 < y Initial program 44.7%
+-commutative44.7%
+-commutative44.7%
+-commutative44.7%
*-commutative44.7%
distribute-rgt1-in44.7%
fma-define44.7%
+-commutative44.7%
+-commutative44.7%
cube-unmult44.7%
+-commutative44.7%
Simplified44.7%
*-commutative44.7%
fma-define44.7%
cube-mult44.7%
distribute-rgt1-in44.7%
*-commutative44.7%
associate-*l*44.7%
times-frac78.9%
associate-+r+78.9%
Applied egg-rr78.9%
clear-num78.9%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
Simplified92.1%
Final simplification73.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= y 8e+20)
(/ t_0 (* (+ x 1.0) (/ (+ x y) y)))
(if (<= y 4.2e+149)
(/ x (* (+ x y) (+ x (+ y 1.0))))
(/ t_0 (* (+ y (+ x 1.0)) (/ y y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= 8e+20) {
tmp = t_0 / ((x + 1.0) * ((x + y) / y));
} else if (y <= 4.2e+149) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = t_0 / ((y + (x + 1.0)) * (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 = x / (x + y)
if (y <= 8d+20) then
tmp = t_0 / ((x + 1.0d0) * ((x + y) / y))
else if (y <= 4.2d+149) then
tmp = x / ((x + y) * (x + (y + 1.0d0)))
else
tmp = t_0 / ((y + (x + 1.0d0)) * (y / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= 8e+20) {
tmp = t_0 / ((x + 1.0) * ((x + y) / y));
} else if (y <= 4.2e+149) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = t_0 / ((y + (x + 1.0)) * (y / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if y <= 8e+20: tmp = t_0 / ((x + 1.0) * ((x + y) / y)) elif y <= 4.2e+149: tmp = x / ((x + y) * (x + (y + 1.0))) else: tmp = t_0 / ((y + (x + 1.0)) * (y / y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= 8e+20) tmp = Float64(t_0 / Float64(Float64(x + 1.0) * Float64(Float64(x + y) / y))); elseif (y <= 4.2e+149) tmp = Float64(x / Float64(Float64(x + y) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(t_0 / Float64(Float64(y + Float64(x + 1.0)) * Float64(y / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (y <= 8e+20)
tmp = t_0 / ((x + 1.0) * ((x + y) / y));
elseif (y <= 4.2e+149)
tmp = x / ((x + y) * (x + (y + 1.0)));
else
tmp = t_0 / ((y + (x + 1.0)) * (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[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 8e+20], N[(t$95$0 / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+149], N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(y / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;y \leq 8 \cdot 10^{+20}:\\
\;\;\;\;\frac{t\_0}{\left(x + 1\right) \cdot \frac{x + y}{y}}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+149}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\left(y + \left(x + 1\right)\right) \cdot \frac{y}{y}}\\
\end{array}
\end{array}
if y < 8e20Initial program 72.7%
+-commutative72.7%
+-commutative72.7%
+-commutative72.7%
*-commutative72.7%
distribute-rgt1-in53.2%
fma-define72.7%
+-commutative72.7%
+-commutative72.7%
cube-unmult72.7%
+-commutative72.7%
Simplified72.7%
*-commutative72.7%
fma-define53.2%
cube-mult53.2%
distribute-rgt1-in72.7%
*-commutative72.7%
associate-*l*72.7%
times-frac94.6%
associate-+r+94.6%
Applied egg-rr94.6%
clear-num94.5%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.7%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 84.7%
+-commutative84.7%
Simplified84.7%
if 8e20 < y < 4.2000000000000003e149Initial program 69.0%
+-commutative69.0%
+-commutative69.0%
+-commutative69.0%
*-commutative69.0%
distribute-rgt1-in60.2%
fma-define69.0%
+-commutative69.0%
+-commutative69.0%
cube-unmult69.0%
+-commutative69.0%
Simplified69.0%
*-commutative69.0%
fma-define60.2%
cube-mult60.2%
distribute-rgt1-in69.0%
*-commutative69.0%
associate-*l*69.0%
times-frac94.3%
associate-+r+94.3%
Applied egg-rr94.3%
Taylor expanded in y around inf 82.9%
if 4.2000000000000003e149 < y Initial program 44.7%
+-commutative44.7%
+-commutative44.7%
+-commutative44.7%
*-commutative44.7%
distribute-rgt1-in44.7%
fma-define44.7%
+-commutative44.7%
+-commutative44.7%
cube-unmult44.7%
+-commutative44.7%
Simplified44.7%
*-commutative44.7%
fma-define44.7%
cube-mult44.7%
distribute-rgt1-in44.7%
*-commutative44.7%
associate-*l*44.7%
times-frac78.9%
associate-+r+78.9%
Applied egg-rr78.9%
clear-num78.9%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 92.3%
Final simplification85.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -8e+169)
(* (/ y x) (/ 1.0 x))
(if (<= x -26000000000.0)
(/ y (* x (+ x y)))
(if (<= x -2.5e-54) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -8e+169) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -26000000000.0) {
tmp = y / (x * (x + y));
} else if (x <= -2.5e-54) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-8d+169)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-26000000000.0d0)) then
tmp = y / (x * (x + y))
else if (x <= (-2.5d-54)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -8e+169) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -26000000000.0) {
tmp = y / (x * (x + y));
} else if (x <= -2.5e-54) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -8e+169: tmp = (y / x) * (1.0 / x) elif x <= -26000000000.0: tmp = y / (x * (x + y)) elif x <= -2.5e-54: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -8e+169) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -26000000000.0) tmp = Float64(y / Float64(x * Float64(x + y))); elseif (x <= -2.5e-54) tmp = Float64(y / Float64(x * Float64(x + 1.0))); 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 <= -8e+169)
tmp = (y / x) * (1.0 / x);
elseif (x <= -26000000000.0)
tmp = y / (x * (x + y));
elseif (x <= -2.5e-54)
tmp = y / (x * (x + 1.0));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -8e+169], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -26000000000.0], N[(y / N[(x * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.5e-54], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $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 -8 \cdot 10^{+169}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -26000000000:\\
\;\;\;\;\frac{y}{x \cdot \left(x + y\right)}\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -7.99999999999999947e169Initial program 50.2%
+-commutative50.2%
+-commutative50.2%
+-commutative50.2%
*-commutative50.2%
distribute-rgt1-in0.0%
fma-define50.2%
+-commutative50.2%
+-commutative50.2%
cube-unmult50.2%
+-commutative50.2%
Simplified50.2%
*-commutative50.2%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in50.2%
*-commutative50.2%
associate-*l*50.2%
times-frac79.1%
associate-+r+79.1%
Applied egg-rr79.1%
Taylor expanded in x around inf 81.7%
Taylor expanded in y around 0 81.4%
if -7.99999999999999947e169 < x < -2.6e10Initial program 68.0%
+-commutative68.0%
+-commutative68.0%
+-commutative68.0%
*-commutative68.0%
distribute-rgt1-in51.9%
fma-define68.0%
+-commutative68.0%
+-commutative68.0%
cube-unmult68.0%
+-commutative68.0%
Simplified68.0%
*-commutative68.0%
fma-define51.9%
cube-mult51.9%
distribute-rgt1-in68.0%
*-commutative68.0%
associate-*l*68.0%
times-frac91.1%
associate-+r+91.1%
Applied egg-rr91.1%
Taylor expanded in x around inf 57.8%
frac-times73.3%
*-rgt-identity73.3%
Applied egg-rr73.3%
if -2.6e10 < x < -2.50000000000000008e-54Initial program 99.4%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 39.3%
+-commutative39.3%
Simplified39.3%
if -2.50000000000000008e-54 < x Initial program 68.4%
associate-/l*80.0%
associate-+l+80.0%
Simplified80.0%
Taylor expanded in x around 0 53.2%
associate-/r*55.5%
+-commutative55.5%
Simplified55.5%
Final simplification59.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.75e+171)
(* (/ y x) (/ 1.0 x))
(if (<= x -26000000000.0)
(/ y (* x (+ x y)))
(if (<= x -8.2e-55) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.75e+171) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -26000000000.0) {
tmp = y / (x * (x + y));
} else if (x <= -8.2e-55) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.75d+171)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-26000000000.0d0)) then
tmp = y / (x * (x + y))
else if (x <= (-8.2d-55)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.75e+171) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -26000000000.0) {
tmp = y / (x * (x + y));
} else if (x <= -8.2e-55) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.75e+171: tmp = (y / x) * (1.0 / x) elif x <= -26000000000.0: tmp = y / (x * (x + y)) elif x <= -8.2e-55: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.75e+171) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -26000000000.0) tmp = Float64(y / Float64(x * Float64(x + y))); elseif (x <= -8.2e-55) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.75e+171)
tmp = (y / x) * (1.0 / x);
elseif (x <= -26000000000.0)
tmp = y / (x * (x + y));
elseif (x <= -8.2e-55)
tmp = y / (x * (x + 1.0));
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.75e+171], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -26000000000.0], N[(y / N[(x * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.2e-55], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+171}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -26000000000:\\
\;\;\;\;\frac{y}{x \cdot \left(x + y\right)}\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{-55}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1.75e171Initial program 50.2%
+-commutative50.2%
+-commutative50.2%
+-commutative50.2%
*-commutative50.2%
distribute-rgt1-in0.0%
fma-define50.2%
+-commutative50.2%
+-commutative50.2%
cube-unmult50.2%
+-commutative50.2%
Simplified50.2%
*-commutative50.2%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in50.2%
*-commutative50.2%
associate-*l*50.2%
times-frac79.1%
associate-+r+79.1%
Applied egg-rr79.1%
Taylor expanded in x around inf 81.7%
Taylor expanded in y around 0 81.4%
if -1.75e171 < x < -2.6e10Initial program 68.0%
+-commutative68.0%
+-commutative68.0%
+-commutative68.0%
*-commutative68.0%
distribute-rgt1-in51.9%
fma-define68.0%
+-commutative68.0%
+-commutative68.0%
cube-unmult68.0%
+-commutative68.0%
Simplified68.0%
*-commutative68.0%
fma-define51.9%
cube-mult51.9%
distribute-rgt1-in68.0%
*-commutative68.0%
associate-*l*68.0%
times-frac91.1%
associate-+r+91.1%
Applied egg-rr91.1%
Taylor expanded in x around inf 57.8%
frac-times73.3%
*-rgt-identity73.3%
Applied egg-rr73.3%
if -2.6e10 < x < -8.1999999999999996e-55Initial program 99.4%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 39.3%
+-commutative39.3%
Simplified39.3%
if -8.1999999999999996e-55 < x Initial program 68.4%
associate-/l*80.0%
associate-+l+80.0%
Simplified80.0%
Taylor expanded in x around 0 53.2%
Final simplification58.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))) (t_1 (/ (+ x y) y)))
(if (<= y 0.215)
(/ t_0 (* (+ x 1.0) t_1))
(* t_0 (/ (/ 1.0 (+ x y)) t_1)))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double t_1 = (x + y) / y;
double tmp;
if (y <= 0.215) {
tmp = t_0 / ((x + 1.0) * t_1);
} else {
tmp = t_0 * ((1.0 / (x + y)) / t_1);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / (x + y)
t_1 = (x + y) / y
if (y <= 0.215d0) then
tmp = t_0 / ((x + 1.0d0) * t_1)
else
tmp = t_0 * ((1.0d0 / (x + y)) / t_1)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double t_1 = (x + y) / y;
double tmp;
if (y <= 0.215) {
tmp = t_0 / ((x + 1.0) * t_1);
} else {
tmp = t_0 * ((1.0 / (x + y)) / t_1);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) t_1 = (x + y) / y tmp = 0 if y <= 0.215: tmp = t_0 / ((x + 1.0) * t_1) else: tmp = t_0 * ((1.0 / (x + y)) / t_1) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) t_1 = Float64(Float64(x + y) / y) tmp = 0.0 if (y <= 0.215) tmp = Float64(t_0 / Float64(Float64(x + 1.0) * t_1)); else tmp = Float64(t_0 * Float64(Float64(1.0 / Float64(x + y)) / t_1)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
t_1 = (x + y) / y;
tmp = 0.0;
if (y <= 0.215)
tmp = t_0 / ((x + 1.0) * t_1);
else
tmp = t_0 * ((1.0 / (x + y)) / t_1);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, 0.215], N[(t$95$0 / N[(N[(x + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
t_1 := \frac{x + y}{y}\\
\mathbf{if}\;y \leq 0.215:\\
\;\;\;\;\frac{t\_0}{\left(x + 1\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{\frac{1}{x + y}}{t\_1}\\
\end{array}
\end{array}
if y < 0.214999999999999997Initial program 72.4%
+-commutative72.4%
+-commutative72.4%
+-commutative72.4%
*-commutative72.4%
distribute-rgt1-in52.7%
fma-define72.4%
+-commutative72.4%
+-commutative72.4%
cube-unmult72.4%
+-commutative72.4%
Simplified72.4%
*-commutative72.4%
fma-define52.7%
cube-mult52.7%
distribute-rgt1-in72.4%
*-commutative72.4%
associate-*l*72.4%
times-frac94.5%
associate-+r+94.5%
Applied egg-rr94.5%
clear-num94.4%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.7%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 85.0%
+-commutative85.0%
Simplified85.0%
if 0.214999999999999997 < y Initial program 57.5%
+-commutative57.5%
+-commutative57.5%
+-commutative57.5%
*-commutative57.5%
distribute-rgt1-in53.4%
fma-define57.5%
+-commutative57.5%
+-commutative57.5%
cube-unmult57.5%
+-commutative57.5%
Simplified57.5%
*-commutative57.5%
fma-define53.4%
cube-mult53.4%
distribute-rgt1-in57.5%
*-commutative57.5%
associate-*l*57.5%
times-frac86.6%
associate-+r+86.6%
Applied egg-rr86.6%
clear-num86.6%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.8%
*-commutative99.8%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 98.9%
Final simplification89.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 3.4e-117)
(/ (/ y x) (+ x 1.0))
(if (<= y 4.2e+149)
(/ x (* (+ x y) (+ x (+ y 1.0))))
(/ (/ x (+ x y)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.4e-117) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 4.2e+149) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.4d-117) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 4.2d+149) then
tmp = x / ((x + y) * (x + (y + 1.0d0)))
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.4e-117) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 4.2e+149) {
tmp = x / ((x + y) * (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.4e-117: tmp = (y / x) / (x + 1.0) elif y <= 4.2e+149: tmp = x / ((x + y) * (x + (y + 1.0))) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.4e-117) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 4.2e+149) tmp = Float64(x / Float64(Float64(x + y) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 3.4e-117)
tmp = (y / x) / (x + 1.0);
elseif (y <= 4.2e+149)
tmp = x / ((x + y) * (x + (y + 1.0)));
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.4e-117], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+149], N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{-117}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+149}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if y < 3.40000000000000035e-117Initial program 67.8%
+-commutative67.8%
+-commutative67.8%
+-commutative67.8%
*-commutative67.8%
distribute-rgt1-in46.4%
fma-define67.8%
+-commutative67.8%
+-commutative67.8%
cube-unmult67.8%
+-commutative67.8%
Simplified67.8%
*-commutative67.8%
fma-define46.4%
cube-mult46.4%
distribute-rgt1-in67.8%
*-commutative67.8%
associate-*l*67.8%
times-frac93.3%
associate-+r+93.3%
Applied egg-rr93.3%
clear-num93.3%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 59.8%
associate-/r*62.3%
+-commutative62.3%
Simplified62.3%
if 3.40000000000000035e-117 < y < 4.2000000000000003e149Initial program 81.5%
+-commutative81.5%
+-commutative81.5%
+-commutative81.5%
*-commutative81.5%
distribute-rgt1-in71.4%
fma-define81.6%
+-commutative81.6%
+-commutative81.6%
cube-unmult81.6%
+-commutative81.6%
Simplified81.6%
*-commutative81.6%
fma-define71.4%
cube-mult71.4%
distribute-rgt1-in81.5%
*-commutative81.5%
associate-*l*81.5%
times-frac97.1%
associate-+r+97.1%
Applied egg-rr97.1%
Taylor expanded in y around inf 72.9%
if 4.2000000000000003e149 < y Initial program 44.7%
+-commutative44.7%
+-commutative44.7%
+-commutative44.7%
*-commutative44.7%
distribute-rgt1-in44.7%
fma-define44.7%
+-commutative44.7%
+-commutative44.7%
cube-unmult44.7%
+-commutative44.7%
Simplified44.7%
*-commutative44.7%
fma-define44.7%
cube-mult44.7%
distribute-rgt1-in44.7%
*-commutative44.7%
associate-*l*44.7%
times-frac78.9%
associate-+r+78.9%
Applied egg-rr78.9%
clear-num78.9%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
Simplified92.1%
Final simplification69.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1250000000.0)
(* (/ y x) (/ 1.0 x))
(if (or (<= x -7.4e-163) (not (<= x 9e-169)))
(/ x (* y y))
(/ 1.0 (/ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1250000000.0) {
tmp = (y / x) * (1.0 / x);
} else if ((x <= -7.4e-163) || !(x <= 9e-169)) {
tmp = x / (y * y);
} else {
tmp = 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 (x <= (-1250000000.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if ((x <= (-7.4d-163)) .or. (.not. (x <= 9d-169))) then
tmp = x / (y * y)
else
tmp = 1.0d0 / (y / x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1250000000.0) {
tmp = (y / x) * (1.0 / x);
} else if ((x <= -7.4e-163) || !(x <= 9e-169)) {
tmp = x / (y * y);
} else {
tmp = 1.0 / (y / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1250000000.0: tmp = (y / x) * (1.0 / x) elif (x <= -7.4e-163) or not (x <= 9e-169): tmp = x / (y * y) else: tmp = 1.0 / (y / x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1250000000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif ((x <= -7.4e-163) || !(x <= 9e-169)) tmp = Float64(x / Float64(y * y)); else tmp = Float64(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 (x <= -1250000000.0)
tmp = (y / x) * (1.0 / x);
elseif ((x <= -7.4e-163) || ~((x <= 9e-169)))
tmp = x / (y * y);
else
tmp = 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[x, -1250000000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -7.4e-163], N[Not[LessEqual[x, 9e-169]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1250000000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -7.4 \cdot 10^{-163} \lor \neg \left(x \leq 9 \cdot 10^{-169}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\end{array}
\end{array}
if x < -1.25e9Initial program 60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
*-commutative60.2%
distribute-rgt1-in27.8%
fma-define60.2%
+-commutative60.2%
+-commutative60.2%
cube-unmult60.2%
+-commutative60.2%
Simplified60.2%
*-commutative60.2%
fma-define27.8%
cube-mult27.8%
distribute-rgt1-in60.2%
*-commutative60.2%
associate-*l*60.2%
times-frac85.4%
associate-+r+85.4%
Applied egg-rr85.4%
Taylor expanded in x around inf 69.8%
Taylor expanded in y around 0 69.4%
if -1.25e9 < x < -7.3999999999999998e-163 or 8.9999999999999997e-169 < x Initial program 75.1%
associate-/l*84.9%
associate-+l+84.9%
Simplified84.9%
Taylor expanded in x around 0 41.7%
Taylor expanded in y around inf 39.2%
if -7.3999999999999998e-163 < x < 8.9999999999999997e-169Initial program 58.5%
associate-/l*72.0%
associate-+l+72.0%
Simplified72.0%
Taylor expanded in x around 0 88.5%
Taylor expanded in y around 0 79.4%
clear-num79.1%
inv-pow79.1%
Applied egg-rr79.1%
unpow-179.1%
Simplified79.1%
Final simplification54.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.7e+170)
(/ (/ y x) (+ x y))
(if (<= x -7.2e-54)
(/ y (* (+ x 1.0) (+ x y)))
(/ (/ x (+ x y)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.7e+170) {
tmp = (y / x) / (x + y);
} else if (x <= -7.2e-54) {
tmp = y / ((x + 1.0) * (x + y));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.7d+170)) then
tmp = (y / x) / (x + y)
else if (x <= (-7.2d-54)) then
tmp = y / ((x + 1.0d0) * (x + y))
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.7e+170) {
tmp = (y / x) / (x + y);
} else if (x <= -7.2e-54) {
tmp = y / ((x + 1.0) * (x + y));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.7e+170: tmp = (y / x) / (x + y) elif x <= -7.2e-54: tmp = y / ((x + 1.0) * (x + y)) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.7e+170) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -7.2e-54) tmp = Float64(y / Float64(Float64(x + 1.0) * Float64(x + y))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.7e+170)
tmp = (y / x) / (x + y);
elseif (x <= -7.2e-54)
tmp = y / ((x + 1.0) * (x + y));
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.7e+170], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.2e-54], N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+170}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-54}:\\
\;\;\;\;\frac{y}{\left(x + 1\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.7000000000000001e170Initial program 50.2%
+-commutative50.2%
+-commutative50.2%
+-commutative50.2%
*-commutative50.2%
distribute-rgt1-in0.0%
fma-define50.2%
+-commutative50.2%
+-commutative50.2%
cube-unmult50.2%
+-commutative50.2%
Simplified50.2%
*-commutative50.2%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in50.2%
*-commutative50.2%
associate-*l*50.2%
times-frac79.1%
associate-+r+79.1%
Applied egg-rr79.1%
Taylor expanded in x around inf 81.7%
frac-times79.1%
*-rgt-identity79.1%
Applied egg-rr79.1%
associate-/l/81.8%
Simplified81.8%
if -1.7000000000000001e170 < x < -7.19999999999999953e-54Initial program 79.1%
Taylor expanded in x around inf 67.0%
*-commutative67.0%
associate-*l*67.0%
times-frac64.0%
+-commutative64.0%
+-commutative64.0%
Applied egg-rr64.0%
Taylor expanded in y around 0 51.5%
+-commutative51.5%
Simplified51.5%
+-commutative51.5%
clear-num51.5%
frac-times61.5%
*-rgt-identity61.5%
/-rgt-identity61.5%
+-commutative61.5%
Applied egg-rr61.5%
if -7.19999999999999953e-54 < x Initial program 68.4%
+-commutative68.4%
+-commutative68.4%
+-commutative68.4%
*-commutative68.4%
distribute-rgt1-in60.5%
fma-define68.4%
+-commutative68.4%
+-commutative68.4%
cube-unmult68.4%
+-commutative68.4%
Simplified68.4%
*-commutative68.4%
fma-define60.5%
cube-mult60.5%
distribute-rgt1-in68.4%
*-commutative68.4%
associate-*l*68.4%
times-frac94.1%
associate-+r+94.1%
Applied egg-rr94.1%
clear-num94.1%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 56.0%
+-commutative56.0%
Simplified56.0%
Final simplification60.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.45e+170) (/ (/ y x) (+ x y)) (if (<= x -3.3e-55) (/ y (* (+ x 1.0) (+ x y))) (/ (/ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.45e+170) {
tmp = (y / x) / (x + y);
} else if (x <= -3.3e-55) {
tmp = y / ((x + 1.0) * (x + y));
} 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 <= (-1.45d+170)) then
tmp = (y / x) / (x + y)
else if (x <= (-3.3d-55)) then
tmp = y / ((x + 1.0d0) * (x + y))
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 <= -1.45e+170) {
tmp = (y / x) / (x + y);
} else if (x <= -3.3e-55) {
tmp = y / ((x + 1.0) * (x + y));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.45e+170: tmp = (y / x) / (x + y) elif x <= -3.3e-55: tmp = y / ((x + 1.0) * (x + y)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.45e+170) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -3.3e-55) tmp = Float64(y / Float64(Float64(x + 1.0) * Float64(x + y))); 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 <= -1.45e+170)
tmp = (y / x) / (x + y);
elseif (x <= -3.3e-55)
tmp = y / ((x + 1.0) * (x + y));
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, -1.45e+170], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.3e-55], N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $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 -1.45 \cdot 10^{+170}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-55}:\\
\;\;\;\;\frac{y}{\left(x + 1\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.45e170Initial program 50.2%
+-commutative50.2%
+-commutative50.2%
+-commutative50.2%
*-commutative50.2%
distribute-rgt1-in0.0%
fma-define50.2%
+-commutative50.2%
+-commutative50.2%
cube-unmult50.2%
+-commutative50.2%
Simplified50.2%
*-commutative50.2%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in50.2%
*-commutative50.2%
associate-*l*50.2%
times-frac79.1%
associate-+r+79.1%
Applied egg-rr79.1%
Taylor expanded in x around inf 81.7%
frac-times79.1%
*-rgt-identity79.1%
Applied egg-rr79.1%
associate-/l/81.8%
Simplified81.8%
if -1.45e170 < x < -3.2999999999999999e-55Initial program 79.1%
Taylor expanded in x around inf 67.0%
*-commutative67.0%
associate-*l*67.0%
times-frac64.0%
+-commutative64.0%
+-commutative64.0%
Applied egg-rr64.0%
Taylor expanded in y around 0 51.5%
+-commutative51.5%
Simplified51.5%
+-commutative51.5%
clear-num51.5%
frac-times61.5%
*-rgt-identity61.5%
/-rgt-identity61.5%
+-commutative61.5%
Applied egg-rr61.5%
if -3.2999999999999999e-55 < x Initial program 68.4%
associate-/l*80.0%
associate-+l+80.0%
Simplified80.0%
Taylor expanded in x around 0 53.2%
associate-/r*55.5%
+-commutative55.5%
Simplified55.5%
Final simplification59.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.7e+170) (* (/ y x) (/ 1.0 x)) (if (<= x -7.2e-54) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.7e+170) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -7.2e-54) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.7d+170)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-7.2d-54)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.7e+170) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -7.2e-54) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.7e+170: tmp = (y / x) * (1.0 / x) elif x <= -7.2e-54: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.7e+170) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -7.2e-54) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.7e+170)
tmp = (y / x) * (1.0 / x);
elseif (x <= -7.2e-54)
tmp = y / (x * (x + 1.0));
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.7e+170], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.2e-54], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+170}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-54}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1.7000000000000001e170Initial program 50.2%
+-commutative50.2%
+-commutative50.2%
+-commutative50.2%
*-commutative50.2%
distribute-rgt1-in0.0%
fma-define50.2%
+-commutative50.2%
+-commutative50.2%
cube-unmult50.2%
+-commutative50.2%
Simplified50.2%
*-commutative50.2%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in50.2%
*-commutative50.2%
associate-*l*50.2%
times-frac79.1%
associate-+r+79.1%
Applied egg-rr79.1%
Taylor expanded in x around inf 81.7%
Taylor expanded in y around 0 81.4%
if -1.7000000000000001e170 < x < -7.19999999999999953e-54Initial program 79.1%
associate-/l*89.6%
associate-+l+89.6%
Simplified89.6%
Taylor expanded in y around 0 52.8%
+-commutative52.8%
Simplified52.8%
if -7.19999999999999953e-54 < x Initial program 68.4%
associate-/l*80.0%
associate-+l+80.0%
Simplified80.0%
Taylor expanded in x around 0 53.2%
Final simplification56.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (/ x (+ x y)) (* (/ (+ x y) y) (+ 1.0 (+ x y)))))
assert(x < y);
double code(double x, double y) {
return (x / (x + y)) / (((x + y) / y) * (1.0 + (x + y)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (x + y)) / (((x + y) / y) * (1.0d0 + (x + y)))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (x + y)) / (((x + y) / y) * (1.0 + (x + y)));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (x + y)) / (((x + y) / y) * (1.0 + (x + y)))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(x + y)) / Float64(Float64(Float64(x + y) / y) * Float64(1.0 + Float64(x + y)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (x + y)) / (((x + y) / y) * (1.0 + (x + y)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision] * N[(1.0 + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{x + y}}{\frac{x + y}{y} \cdot \left(1 + \left(x + y\right)\right)}
\end{array}
Initial program 68.2%
+-commutative68.2%
+-commutative68.2%
+-commutative68.2%
*-commutative68.2%
distribute-rgt1-in52.9%
fma-define68.2%
+-commutative68.2%
+-commutative68.2%
cube-unmult68.2%
+-commutative68.2%
Simplified68.2%
*-commutative68.2%
fma-define52.9%
cube-mult52.9%
distribute-rgt1-in68.2%
*-commutative68.2%
associate-*l*68.1%
times-frac92.3%
associate-+r+92.3%
Applied egg-rr92.3%
clear-num92.2%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 99.7%
Final simplification99.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.3e-117) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.3e-117) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.3d-117) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.3e-117) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.3e-117: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.3e-117) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); 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 (y <= 3.3e-117)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.3e-117], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $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}\;y \leq 3.3 \cdot 10^{-117}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 3.30000000000000015e-117Initial program 67.8%
+-commutative67.8%
+-commutative67.8%
+-commutative67.8%
*-commutative67.8%
distribute-rgt1-in46.4%
fma-define67.8%
+-commutative67.8%
+-commutative67.8%
cube-unmult67.8%
+-commutative67.8%
Simplified67.8%
*-commutative67.8%
fma-define46.4%
cube-mult46.4%
distribute-rgt1-in67.8%
*-commutative67.8%
associate-*l*67.8%
times-frac93.3%
associate-+r+93.3%
Applied egg-rr93.3%
clear-num93.3%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 59.8%
associate-/r*62.3%
+-commutative62.3%
Simplified62.3%
if 3.30000000000000015e-117 < y Initial program 68.7%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 60.8%
associate-/r*65.5%
+-commutative65.5%
Simplified65.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -250000000.0) (* (/ y x) (/ 1.0 x)) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -250000000.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 <= (-250000000.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 <= -250000000.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 <= -250000000.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 <= -250000000.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 <= -250000000.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, -250000000.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 -250000000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -2.5e8Initial program 60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
*-commutative60.2%
distribute-rgt1-in27.8%
fma-define60.2%
+-commutative60.2%
+-commutative60.2%
cube-unmult60.2%
+-commutative60.2%
Simplified60.2%
*-commutative60.2%
fma-define27.8%
cube-mult27.8%
distribute-rgt1-in60.2%
*-commutative60.2%
associate-*l*60.2%
times-frac85.4%
associate-+r+85.4%
Applied egg-rr85.4%
Taylor expanded in x around inf 69.8%
Taylor expanded in y around 0 69.4%
if -2.5e8 < x Initial program 70.9%
associate-/l*81.6%
associate-+l+81.6%
Simplified81.6%
Taylor expanded in x around 0 53.8%
Final simplification57.7%
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 72.5%
associate-/l*83.5%
associate-+l+83.5%
Simplified83.5%
Taylor expanded in x around 0 36.7%
Taylor expanded in y around 0 23.3%
if 1 < y Initial program 56.9%
associate-/l*77.2%
associate-+l+77.2%
Simplified77.2%
Taylor expanded in x around 0 74.1%
Taylor expanded in y around inf 73.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 (/ y x)))
assert(x < y);
double code(double x, double y) {
return 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 = 1.0d0 / (y / x)
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / (y / x);
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / (y / x)
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / Float64(y / x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / (y / x);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{\frac{y}{x}}
\end{array}
Initial program 68.2%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 47.2%
Taylor expanded in y around 0 20.5%
clear-num20.8%
inv-pow20.8%
Applied egg-rr20.8%
unpow-120.8%
Simplified20.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ x y))
assert(x < y);
double code(double x, double y) {
return x / y;
}
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
end function
assert x < y;
public static double code(double x, double y) {
return x / y;
}
[x, y] = sort([x, y]) def code(x, y): return x / y
x, y = sort([x, y]) function code(x, y) return Float64(x / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = x / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y}
\end{array}
Initial program 68.2%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 47.2%
Taylor expanded in y around 0 20.5%
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.2%
+-commutative68.2%
+-commutative68.2%
+-commutative68.2%
*-commutative68.2%
distribute-rgt1-in52.9%
fma-define68.2%
+-commutative68.2%
+-commutative68.2%
cube-unmult68.2%
+-commutative68.2%
Simplified68.2%
*-commutative68.2%
fma-define52.9%
cube-mult52.9%
distribute-rgt1-in68.2%
*-commutative68.2%
associate-*l*68.1%
times-frac92.3%
associate-+r+92.3%
Applied egg-rr92.3%
Taylor expanded in x around inf 41.2%
Taylor expanded in y around inf 4.4%
(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 2024180
(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))))