
(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 21 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 (+ y x)) (/ (/ x (+ y x)) (+ x (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0d0)))
end function
assert x < y;
public static double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)));
}
[x, y] = sort([x, y]) def code(x, y): return (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(x + Float64(y + 1.0)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{x + \left(y + 1\right)}
\end{array}
Initial program 61.8%
+-commutative61.8%
+-commutative61.8%
+-commutative61.8%
*-commutative61.8%
distribute-rgt1-in50.4%
fma-define61.8%
+-commutative61.8%
+-commutative61.8%
cube-unmult61.9%
+-commutative61.9%
Simplified61.9%
*-commutative61.9%
fma-define50.4%
cube-mult50.4%
distribute-rgt1-in61.8%
*-commutative61.8%
associate-*l*61.9%
times-frac90.3%
associate-+r+90.3%
Applied egg-rr90.3%
clear-num90.2%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times99.4%
metadata-eval99.4%
times-frac99.4%
*-un-lft-identity99.4%
*-un-lft-identity99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Applied egg-rr99.4%
*-un-lft-identity99.4%
times-frac99.7%
+-commutative99.7%
clear-num99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))) (t_1 (+ y (+ x 1.0))))
(if (<= y -4.6e+25)
(/ 1.0 (* (/ (+ y x) y) t_1))
(if (<= y 1e-19)
(* t_0 (/ x (* (+ y x) (+ x 1.0))))
(if (<= y 1.02e+160)
(/ x (* (+ y x) t_1))
(* t_0 (/ (/ x y) (+ x (+ y 1.0)))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (y + x);
double t_1 = y + (x + 1.0);
double tmp;
if (y <= -4.6e+25) {
tmp = 1.0 / (((y + x) / y) * t_1);
} else if (y <= 1e-19) {
tmp = t_0 * (x / ((y + x) * (x + 1.0)));
} else if (y <= 1.02e+160) {
tmp = x / ((y + x) * t_1);
} else {
tmp = t_0 * ((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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y / (y + x)
t_1 = y + (x + 1.0d0)
if (y <= (-4.6d+25)) then
tmp = 1.0d0 / (((y + x) / y) * t_1)
else if (y <= 1d-19) then
tmp = t_0 * (x / ((y + x) * (x + 1.0d0)))
else if (y <= 1.02d+160) then
tmp = x / ((y + x) * t_1)
else
tmp = t_0 * ((x / y) / (x + (y + 1.0d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (y + x);
double t_1 = y + (x + 1.0);
double tmp;
if (y <= -4.6e+25) {
tmp = 1.0 / (((y + x) / y) * t_1);
} else if (y <= 1e-19) {
tmp = t_0 * (x / ((y + x) * (x + 1.0)));
} else if (y <= 1.02e+160) {
tmp = x / ((y + x) * t_1);
} else {
tmp = t_0 * ((x / y) / (x + (y + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (y + x) t_1 = y + (x + 1.0) tmp = 0 if y <= -4.6e+25: tmp = 1.0 / (((y + x) / y) * t_1) elif y <= 1e-19: tmp = t_0 * (x / ((y + x) * (x + 1.0))) elif y <= 1.02e+160: tmp = x / ((y + x) * t_1) else: tmp = t_0 * ((x / y) / (x + (y + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(y + x)) t_1 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (y <= -4.6e+25) tmp = Float64(1.0 / Float64(Float64(Float64(y + x) / y) * t_1)); elseif (y <= 1e-19) tmp = Float64(t_0 * Float64(x / Float64(Float64(y + x) * Float64(x + 1.0)))); elseif (y <= 1.02e+160) tmp = Float64(x / Float64(Float64(y + x) * t_1)); else tmp = Float64(t_0 * Float64(Float64(x / y) / Float64(x + Float64(y + 1.0)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (y + x);
t_1 = y + (x + 1.0);
tmp = 0.0;
if (y <= -4.6e+25)
tmp = 1.0 / (((y + x) / y) * t_1);
elseif (y <= 1e-19)
tmp = t_0 * (x / ((y + x) * (x + 1.0)));
elseif (y <= 1.02e+160)
tmp = x / ((y + x) * t_1);
else
tmp = t_0 * ((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_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e+25], N[(1.0 / N[(N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-19], N[(t$95$0 * N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+160], N[(x / N[(N[(y + x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(x / y), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
t_1 := y + \left(x + 1\right)\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{1}{\frac{y + x}{y} \cdot t\_1}\\
\mathbf{elif}\;y \leq 10^{-19}:\\
\;\;\;\;t\_0 \cdot \frac{x}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+160}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{\frac{x}{y}}{x + \left(y + 1\right)}\\
\end{array}
\end{array}
if y < -4.5999999999999996e25Initial program 51.3%
+-commutative51.3%
+-commutative51.3%
+-commutative51.3%
*-commutative51.3%
distribute-rgt1-in21.1%
fma-define51.3%
+-commutative51.3%
+-commutative51.3%
cube-unmult51.3%
+-commutative51.3%
Simplified51.3%
*-commutative51.3%
fma-define21.1%
cube-mult21.1%
distribute-rgt1-in51.3%
*-commutative51.3%
associate-*l*51.3%
times-frac82.2%
associate-+r+82.2%
Applied egg-rr82.2%
clear-num82.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 x around inf 33.7%
if -4.5999999999999996e25 < y < 9.9999999999999998e-20Initial program 68.8%
Taylor expanded in x around inf 67.2%
*-commutative67.2%
associate-*l*67.2%
times-frac98.3%
+-commutative98.3%
+-commutative98.3%
Applied egg-rr98.3%
if 9.9999999999999998e-20 < y < 1.01999999999999993e160Initial program 78.7%
+-commutative78.7%
+-commutative78.7%
+-commutative78.7%
*-commutative78.7%
distribute-rgt1-in76.2%
fma-define78.8%
+-commutative78.8%
+-commutative78.8%
cube-unmult78.8%
+-commutative78.8%
Simplified78.8%
*-commutative78.8%
fma-define76.2%
cube-mult76.2%
distribute-rgt1-in78.7%
*-commutative78.7%
associate-*l*78.8%
times-frac95.2%
associate-+r+95.2%
Applied egg-rr95.2%
associate-*r/95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
associate-+l+95.2%
+-commutative95.2%
Applied egg-rr95.2%
Taylor expanded in y around inf 91.7%
if 1.01999999999999993e160 < y Initial program 38.3%
+-commutative38.3%
+-commutative38.3%
+-commutative38.3%
*-commutative38.3%
distribute-rgt1-in38.3%
fma-define38.3%
+-commutative38.3%
+-commutative38.3%
cube-unmult38.3%
+-commutative38.3%
Simplified38.3%
*-commutative38.3%
fma-define38.3%
cube-mult38.3%
distribute-rgt1-in38.3%
*-commutative38.3%
associate-*l*38.3%
times-frac67.5%
associate-+r+67.5%
Applied egg-rr67.5%
clear-num67.5%
associate-/r*99.7%
+-commutative99.7%
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%
*-un-lft-identity99.7%
times-frac99.7%
+-commutative99.7%
clear-num99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 88.8%
Final simplification81.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))) (t_1 (+ x (+ y 1.0))))
(if (<= y -1.5e-220)
(* t_0 (/ (- 1.0 (/ y x)) t_1))
(if (<= y 2.6e+159)
(* t_0 (/ x (* t_1 (+ y x))))
(/ (/ x y) (* (/ (+ y x) y) (+ y (+ x 1.0))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= -1.5e-220) {
tmp = t_0 * ((1.0 - (y / x)) / t_1);
} else if (y <= 2.6e+159) {
tmp = t_0 * (x / (t_1 * (y + x)));
} else {
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y / (y + x)
t_1 = x + (y + 1.0d0)
if (y <= (-1.5d-220)) then
tmp = t_0 * ((1.0d0 - (y / x)) / t_1)
else if (y <= 2.6d+159) then
tmp = t_0 * (x / (t_1 * (y + x)))
else
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= -1.5e-220) {
tmp = t_0 * ((1.0 - (y / x)) / t_1);
} else if (y <= 2.6e+159) {
tmp = t_0 * (x / (t_1 * (y + x)));
} else {
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (y + x) t_1 = x + (y + 1.0) tmp = 0 if y <= -1.5e-220: tmp = t_0 * ((1.0 - (y / x)) / t_1) elif y <= 2.6e+159: tmp = t_0 * (x / (t_1 * (y + x))) else: tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(y + x)) t_1 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= -1.5e-220) tmp = Float64(t_0 * Float64(Float64(1.0 - Float64(y / x)) / t_1)); elseif (y <= 2.6e+159) tmp = Float64(t_0 * Float64(x / Float64(t_1 * Float64(y + x)))); else tmp = Float64(Float64(x / y) / Float64(Float64(Float64(y + x) / y) * Float64(y + Float64(x + 1.0)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (y + x);
t_1 = x + (y + 1.0);
tmp = 0.0;
if (y <= -1.5e-220)
tmp = t_0 * ((1.0 - (y / x)) / t_1);
elseif (y <= 2.6e+159)
tmp = t_0 * (x / (t_1 * (y + x)));
else
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.5e-220], N[(t$95$0 * N[(N[(1.0 - N[(y / x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+159], N[(t$95$0 * N[(x / N[(t$95$1 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
t_1 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{-220}:\\
\;\;\;\;t\_0 \cdot \frac{1 - \frac{y}{x}}{t\_1}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+159}:\\
\;\;\;\;t\_0 \cdot \frac{x}{t\_1 \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if y < -1.50000000000000009e-220Initial program 59.2%
+-commutative59.2%
+-commutative59.2%
+-commutative59.2%
*-commutative59.2%
distribute-rgt1-in36.7%
fma-define59.2%
+-commutative59.2%
+-commutative59.2%
cube-unmult59.3%
+-commutative59.3%
Simplified59.3%
*-commutative59.3%
fma-define36.8%
cube-mult36.7%
distribute-rgt1-in59.2%
*-commutative59.2%
associate-*l*59.2%
times-frac89.7%
associate-+r+89.7%
Applied egg-rr89.7%
clear-num89.7%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times99.5%
metadata-eval99.5%
times-frac99.5%
*-un-lft-identity99.5%
*-un-lft-identity99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
*-un-lft-identity99.5%
times-frac99.7%
+-commutative99.7%
clear-num99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 45.9%
neg-mul-145.9%
unsub-neg45.9%
Simplified45.9%
if -1.50000000000000009e-220 < y < 2.6e159Initial program 71.8%
+-commutative71.8%
+-commutative71.8%
+-commutative71.8%
*-commutative71.8%
distribute-rgt1-in65.9%
fma-define71.9%
+-commutative71.9%
+-commutative71.9%
cube-unmult71.9%
+-commutative71.9%
Simplified71.9%
*-commutative71.9%
fma-define65.9%
cube-mult65.9%
distribute-rgt1-in71.8%
*-commutative71.8%
associate-*l*71.9%
times-frac98.3%
associate-+r+98.3%
Applied egg-rr98.3%
if 2.6e159 < y Initial program 38.3%
+-commutative38.3%
+-commutative38.3%
+-commutative38.3%
*-commutative38.3%
distribute-rgt1-in38.3%
fma-define38.3%
+-commutative38.3%
+-commutative38.3%
cube-unmult38.3%
+-commutative38.3%
Simplified38.3%
*-commutative38.3%
fma-define38.3%
cube-mult38.3%
distribute-rgt1-in38.3%
*-commutative38.3%
associate-*l*38.3%
times-frac67.5%
associate-+r+67.5%
Applied egg-rr67.5%
clear-num67.5%
associate-/r*99.7%
+-commutative99.7%
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 x around 0 93.4%
Final simplification77.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= y -6.8e+40)
(/ (/ x (+ y x)) (* (/ x y) t_0))
(if (<= y 2.6e+159)
(* (/ y (+ y x)) (/ x (* (+ x (+ y 1.0)) (+ y x))))
(/ (/ x y) (* (/ (+ y x) y) t_0))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (y <= -6.8e+40) {
tmp = (x / (y + x)) / ((x / y) * t_0);
} else if (y <= 2.6e+159) {
tmp = (y / (y + x)) * (x / ((x + (y + 1.0)) * (y + x)));
} 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 = y + (x + 1.0d0)
if (y <= (-6.8d+40)) then
tmp = (x / (y + x)) / ((x / y) * t_0)
else if (y <= 2.6d+159) then
tmp = (y / (y + x)) * (x / ((x + (y + 1.0d0)) * (y + x)))
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 = y + (x + 1.0);
double tmp;
if (y <= -6.8e+40) {
tmp = (x / (y + x)) / ((x / y) * t_0);
} else if (y <= 2.6e+159) {
tmp = (y / (y + x)) * (x / ((x + (y + 1.0)) * (y + x)));
} else {
tmp = (x / y) / (((y + x) / y) * t_0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if y <= -6.8e+40: tmp = (x / (y + x)) / ((x / y) * t_0) elif y <= 2.6e+159: tmp = (y / (y + x)) * (x / ((x + (y + 1.0)) * (y + x))) else: tmp = (x / y) / (((y + x) / y) * t_0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (y <= -6.8e+40) tmp = Float64(Float64(x / Float64(y + x)) / Float64(Float64(x / y) * t_0)); elseif (y <= 2.6e+159) tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(x + Float64(y + 1.0)) * Float64(y + x)))); else tmp = Float64(Float64(x / y) / Float64(Float64(Float64(y + x) / y) * t_0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y + (x + 1.0);
tmp = 0.0;
if (y <= -6.8e+40)
tmp = (x / (y + x)) / ((x / y) * t_0);
elseif (y <= 2.6e+159)
tmp = (y / (y + x)) * (x / ((x + (y + 1.0)) * (y + x)));
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[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.8e+40], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(x / y), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+159], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{\frac{x}{y} \cdot t\_0}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+159}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(x + \left(y + 1\right)\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y + x}{y} \cdot t\_0}\\
\end{array}
\end{array}
if y < -6.79999999999999977e40Initial program 49.5%
+-commutative49.5%
+-commutative49.5%
+-commutative49.5%
*-commutative49.5%
distribute-rgt1-in18.2%
fma-define49.5%
+-commutative49.5%
+-commutative49.5%
cube-unmult49.5%
+-commutative49.5%
Simplified49.5%
*-commutative49.5%
fma-define18.2%
cube-mult18.2%
distribute-rgt1-in49.5%
*-commutative49.5%
associate-*l*49.5%
times-frac81.6%
associate-+r+81.6%
Applied egg-rr81.6%
clear-num81.6%
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 y around 0 31.8%
if -6.79999999999999977e40 < y < 2.6e159Initial program 71.7%
+-commutative71.7%
+-commutative71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt1-in64.2%
fma-define71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.7%
+-commutative71.7%
Simplified71.7%
*-commutative71.7%
fma-define64.3%
cube-mult64.2%
distribute-rgt1-in71.7%
*-commutative71.7%
associate-*l*71.7%
times-frac98.7%
associate-+r+98.7%
Applied egg-rr98.7%
if 2.6e159 < y Initial program 38.3%
+-commutative38.3%
+-commutative38.3%
+-commutative38.3%
*-commutative38.3%
distribute-rgt1-in38.3%
fma-define38.3%
+-commutative38.3%
+-commutative38.3%
cube-unmult38.3%
+-commutative38.3%
Simplified38.3%
*-commutative38.3%
fma-define38.3%
cube-mult38.3%
distribute-rgt1-in38.3%
*-commutative38.3%
associate-*l*38.3%
times-frac67.5%
associate-+r+67.5%
Applied egg-rr67.5%
clear-num67.5%
associate-/r*99.7%
+-commutative99.7%
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 x around 0 93.4%
Final simplification83.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= y -2.1e+20)
(/ (/ x (+ y x)) (* (/ x y) t_0))
(if (<= y 1.8e-17)
(* (/ y (+ y x)) (/ x (* (+ y x) (+ x 1.0))))
(/ (/ x y) (* (/ (+ y x) y) t_0))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (y <= -2.1e+20) {
tmp = (x / (y + x)) / ((x / y) * t_0);
} else if (y <= 1.8e-17) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.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 = y + (x + 1.0d0)
if (y <= (-2.1d+20)) then
tmp = (x / (y + x)) / ((x / y) * t_0)
else if (y <= 1.8d-17) then
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0d0)))
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 = y + (x + 1.0);
double tmp;
if (y <= -2.1e+20) {
tmp = (x / (y + x)) / ((x / y) * t_0);
} else if (y <= 1.8e-17) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0)));
} else {
tmp = (x / y) / (((y + x) / y) * t_0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if y <= -2.1e+20: tmp = (x / (y + x)) / ((x / y) * t_0) elif y <= 1.8e-17: tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0))) else: tmp = (x / y) / (((y + x) / y) * t_0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (y <= -2.1e+20) tmp = Float64(Float64(x / Float64(y + x)) / Float64(Float64(x / y) * t_0)); elseif (y <= 1.8e-17) tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(y + x) * Float64(x + 1.0)))); else tmp = Float64(Float64(x / y) / Float64(Float64(Float64(y + x) / y) * t_0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y + (x + 1.0);
tmp = 0.0;
if (y <= -2.1e+20)
tmp = (x / (y + x)) / ((x / y) * t_0);
elseif (y <= 1.8e-17)
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.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[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+20], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(x / y), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-17], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+20}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{\frac{x}{y} \cdot t\_0}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y + x}{y} \cdot t\_0}\\
\end{array}
\end{array}
if y < -2.1e20Initial program 51.3%
+-commutative51.3%
+-commutative51.3%
+-commutative51.3%
*-commutative51.3%
distribute-rgt1-in21.1%
fma-define51.3%
+-commutative51.3%
+-commutative51.3%
cube-unmult51.3%
+-commutative51.3%
Simplified51.3%
*-commutative51.3%
fma-define21.1%
cube-mult21.1%
distribute-rgt1-in51.3%
*-commutative51.3%
associate-*l*51.3%
times-frac82.2%
associate-+r+82.2%
Applied egg-rr82.2%
clear-num82.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 32.5%
if -2.1e20 < y < 1.79999999999999997e-17Initial program 68.8%
Taylor expanded in x around inf 67.2%
*-commutative67.2%
associate-*l*67.2%
times-frac98.3%
+-commutative98.3%
+-commutative98.3%
Applied egg-rr98.3%
if 1.79999999999999997e-17 < y Initial program 59.0%
+-commutative59.0%
+-commutative59.0%
+-commutative59.0%
*-commutative59.0%
distribute-rgt1-in57.7%
fma-define59.0%
+-commutative59.0%
+-commutative59.0%
cube-unmult59.0%
+-commutative59.0%
Simplified59.0%
*-commutative59.0%
fma-define57.7%
cube-mult57.7%
distribute-rgt1-in59.0%
*-commutative59.0%
associate-*l*59.0%
times-frac81.7%
associate-+r+81.7%
Applied egg-rr81.7%
clear-num81.7%
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 92.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ (+ y x) y) (+ y (+ x 1.0)))))
(if (<= y -5.7e+35)
(/ 1.0 t_0)
(if (<= y 1.8e-17)
(* (/ y (+ y x)) (/ x (* (+ y x) (+ x 1.0))))
(/ (/ x y) t_0)))))assert(x < y);
double code(double x, double y) {
double t_0 = ((y + x) / y) * (y + (x + 1.0));
double tmp;
if (y <= -5.7e+35) {
tmp = 1.0 / t_0;
} else if (y <= 1.8e-17) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0)));
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = ((y + x) / y) * (y + (x + 1.0d0))
if (y <= (-5.7d+35)) then
tmp = 1.0d0 / t_0
else if (y <= 1.8d-17) then
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0d0)))
else
tmp = (x / y) / t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = ((y + x) / y) * (y + (x + 1.0));
double tmp;
if (y <= -5.7e+35) {
tmp = 1.0 / t_0;
} else if (y <= 1.8e-17) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0)));
} else {
tmp = (x / y) / t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = ((y + x) / y) * (y + (x + 1.0)) tmp = 0 if y <= -5.7e+35: tmp = 1.0 / t_0 elif y <= 1.8e-17: tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0))) else: tmp = (x / y) / t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(Float64(y + x) / y) * Float64(y + Float64(x + 1.0))) tmp = 0.0 if (y <= -5.7e+35) tmp = Float64(1.0 / t_0); elseif (y <= 1.8e-17) tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(y + x) * Float64(x + 1.0)))); else tmp = Float64(Float64(x / y) / t_0); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = ((y + x) / y) * (y + (x + 1.0));
tmp = 0.0;
if (y <= -5.7e+35)
tmp = 1.0 / t_0;
elseif (y <= 1.8e-17)
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0)));
else
tmp = (x / y) / t_0;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.7e+35], N[(1.0 / t$95$0), $MachinePrecision], If[LessEqual[y, 1.8e-17], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\\
\mathbf{if}\;y \leq -5.7 \cdot 10^{+35}:\\
\;\;\;\;\frac{1}{t\_0}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\end{array}
\end{array}
if y < -5.69999999999999993e35Initial program 50.4%
+-commutative50.4%
+-commutative50.4%
+-commutative50.4%
*-commutative50.4%
distribute-rgt1-in19.7%
fma-define50.4%
+-commutative50.4%
+-commutative50.4%
cube-unmult50.4%
+-commutative50.4%
Simplified50.4%
*-commutative50.4%
fma-define19.7%
cube-mult19.7%
distribute-rgt1-in50.4%
*-commutative50.4%
associate-*l*50.4%
times-frac81.9%
associate-+r+81.9%
Applied egg-rr81.9%
clear-num81.9%
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 inf 34.3%
if -5.69999999999999993e35 < y < 1.79999999999999997e-17Initial program 69.0%
Taylor expanded in x around inf 66.7%
*-commutative66.7%
associate-*l*66.7%
times-frac97.5%
+-commutative97.5%
+-commutative97.5%
Applied egg-rr97.5%
if 1.79999999999999997e-17 < y Initial program 59.0%
+-commutative59.0%
+-commutative59.0%
+-commutative59.0%
*-commutative59.0%
distribute-rgt1-in57.7%
fma-define59.0%
+-commutative59.0%
+-commutative59.0%
cube-unmult59.0%
+-commutative59.0%
Simplified59.0%
*-commutative59.0%
fma-define57.7%
cube-mult57.7%
distribute-rgt1-in59.0%
*-commutative59.0%
associate-*l*59.0%
times-frac81.7%
associate-+r+81.7%
Applied egg-rr81.7%
clear-num81.7%
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 92.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 3.4e-187)
(/ (/ y x) (+ x 1.0))
(if (<= y 2.95e+159)
(/ x (* (+ y x) (+ y (+ x 1.0))))
(* (/ y (+ y x)) (/ (/ x y) (+ x (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.4e-187) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 2.95e+159) {
tmp = x / ((y + x) * (y + (x + 1.0)));
} else {
tmp = (y / (y + x)) * ((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 (y <= 3.4d-187) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 2.95d+159) then
tmp = x / ((y + x) * (y + (x + 1.0d0)))
else
tmp = (y / (y + x)) * ((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 (y <= 3.4e-187) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 2.95e+159) {
tmp = x / ((y + x) * (y + (x + 1.0)));
} else {
tmp = (y / (y + x)) * ((x / y) / (x + (y + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.4e-187: tmp = (y / x) / (x + 1.0) elif y <= 2.95e+159: tmp = x / ((y + x) * (y + (x + 1.0))) else: tmp = (y / (y + x)) * ((x / y) / (x + (y + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.4e-187) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 2.95e+159) tmp = Float64(x / Float64(Float64(y + x) * Float64(y + Float64(x + 1.0)))); else tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / y) / Float64(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 (y <= 3.4e-187)
tmp = (y / x) / (x + 1.0);
elseif (y <= 2.95e+159)
tmp = x / ((y + x) * (y + (x + 1.0)));
else
tmp = (y / (y + x)) * ((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[y, 3.4e-187], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.95e+159], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / y), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{-187}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 2.95 \cdot 10^{+159}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{y}}{x + \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 3.4000000000000001e-187Initial program 56.1%
+-commutative56.1%
+-commutative56.1%
+-commutative56.1%
*-commutative56.1%
distribute-rgt1-in38.0%
fma-define56.1%
+-commutative56.1%
+-commutative56.1%
cube-unmult56.1%
+-commutative56.1%
Simplified56.1%
*-commutative56.1%
fma-define38.0%
cube-mult38.0%
distribute-rgt1-in56.1%
*-commutative56.1%
associate-*l*56.1%
times-frac92.4%
associate-+r+92.4%
Applied egg-rr92.4%
clear-num92.3%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.5%
metadata-eval99.5%
times-frac99.5%
*-un-lft-identity99.5%
*-un-lft-identity99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in y around 0 54.4%
associate-/r*56.6%
+-commutative56.6%
Simplified56.6%
if 3.4000000000000001e-187 < y < 2.94999999999999996e159Initial program 82.2%
+-commutative82.2%
+-commutative82.2%
+-commutative82.2%
*-commutative82.2%
distribute-rgt1-in76.2%
fma-define82.2%
+-commutative82.2%
+-commutative82.2%
cube-unmult82.2%
+-commutative82.2%
Simplified82.2%
*-commutative82.2%
fma-define76.2%
cube-mult76.2%
distribute-rgt1-in82.2%
*-commutative82.2%
associate-*l*82.2%
times-frac97.6%
associate-+r+97.6%
Applied egg-rr97.6%
associate-*r/97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
associate-+l+97.5%
+-commutative97.5%
Applied egg-rr97.5%
Taylor expanded in y around inf 80.6%
if 2.94999999999999996e159 < y Initial program 38.3%
+-commutative38.3%
+-commutative38.3%
+-commutative38.3%
*-commutative38.3%
distribute-rgt1-in38.3%
fma-define38.3%
+-commutative38.3%
+-commutative38.3%
cube-unmult38.3%
+-commutative38.3%
Simplified38.3%
*-commutative38.3%
fma-define38.3%
cube-mult38.3%
distribute-rgt1-in38.3%
*-commutative38.3%
associate-*l*38.3%
times-frac67.5%
associate-+r+67.5%
Applied egg-rr67.5%
clear-num67.5%
associate-/r*99.7%
+-commutative99.7%
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%
*-un-lft-identity99.7%
times-frac99.7%
+-commutative99.7%
clear-num99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 88.8%
Final simplification69.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -1e+24)
(/ x (* y (+ x 1.0)))
(if (<= y 3.8e-182)
(/ y (+ y x))
(if (<= y 3.15e+159) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1e+24) {
tmp = x / (y * (x + 1.0));
} else if (y <= 3.8e-182) {
tmp = y / (y + x);
} else if (y <= 3.15e+159) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1d+24)) then
tmp = x / (y * (x + 1.0d0))
else if (y <= 3.8d-182) then
tmp = y / (y + x)
else if (y <= 3.15d+159) then
tmp = x / (y * (y + 1.0d0))
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 <= -1e+24) {
tmp = x / (y * (x + 1.0));
} else if (y <= 3.8e-182) {
tmp = y / (y + x);
} else if (y <= 3.15e+159) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1e+24: tmp = x / (y * (x + 1.0)) elif y <= 3.8e-182: tmp = y / (y + x) elif y <= 3.15e+159: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1e+24) tmp = Float64(x / Float64(y * Float64(x + 1.0))); elseif (y <= 3.8e-182) tmp = Float64(y / Float64(y + x)); elseif (y <= 3.15e+159) tmp = Float64(x / Float64(y * Float64(y + 1.0))); 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 <= -1e+24)
tmp = x / (y * (x + 1.0));
elseif (y <= 3.8e-182)
tmp = y / (y + x);
elseif (y <= 3.15e+159)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -1e+24], N[(x / N[(y * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-182], N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.15e+159], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $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 \cdot 10^{+24}:\\
\;\;\;\;\frac{x}{y \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-182}:\\
\;\;\;\;\frac{y}{y + x}\\
\mathbf{elif}\;y \leq 3.15 \cdot 10^{+159}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < -9.9999999999999998e23Initial program 51.3%
Taylor expanded in x around inf 38.6%
Taylor expanded in y around inf 42.7%
if -9.9999999999999998e23 < y < 3.8000000000000003e-182Initial program 61.6%
+-commutative61.6%
+-commutative61.6%
+-commutative61.6%
*-commutative61.6%
distribute-rgt1-in51.7%
fma-define61.6%
+-commutative61.6%
+-commutative61.6%
cube-unmult61.6%
+-commutative61.6%
Simplified61.6%
*-commutative61.6%
fma-define51.8%
cube-mult51.7%
distribute-rgt1-in61.6%
*-commutative61.6%
associate-*l*61.6%
times-frac99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 76.6%
+-commutative76.6%
Simplified76.6%
associate-*l/76.6%
un-div-inv76.6%
Applied egg-rr76.6%
Taylor expanded in x around 0 53.0%
if 3.8000000000000003e-182 < y < 3.15000000000000003e159Initial program 81.3%
associate-/l*85.6%
associate-+l+85.6%
Simplified85.6%
Taylor expanded in x around 0 64.2%
if 3.15000000000000003e159 < y Initial program 38.3%
associate-/l*67.5%
associate-+l+67.5%
Simplified67.5%
Taylor expanded in x around 0 67.5%
associate-/r*88.1%
+-commutative88.1%
div-inv88.1%
Applied egg-rr88.1%
Taylor expanded in y around inf 88.1%
Final simplification59.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y (+ x 1.0)))))
(if (<= y -6.2e+19)
t_0
(if (<= y 3.8e-182) (/ y (+ y x)) (if (<= y 1.62) t_0 (/ (/ x y) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * (x + 1.0));
double tmp;
if (y <= -6.2e+19) {
tmp = t_0;
} else if (y <= 3.8e-182) {
tmp = y / (y + x);
} else if (y <= 1.62) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y * (x + 1.0d0))
if (y <= (-6.2d+19)) then
tmp = t_0
else if (y <= 3.8d-182) then
tmp = y / (y + x)
else if (y <= 1.62d0) then
tmp = t_0
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * (x + 1.0));
double tmp;
if (y <= -6.2e+19) {
tmp = t_0;
} else if (y <= 3.8e-182) {
tmp = y / (y + x);
} else if (y <= 1.62) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * (x + 1.0)) tmp = 0 if y <= -6.2e+19: tmp = t_0 elif y <= 3.8e-182: tmp = y / (y + x) elif y <= 1.62: tmp = t_0 else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * Float64(x + 1.0))) tmp = 0.0 if (y <= -6.2e+19) tmp = t_0; elseif (y <= 3.8e-182) tmp = Float64(y / Float64(y + x)); elseif (y <= 1.62) tmp = t_0; else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * (x + 1.0));
tmp = 0.0;
if (y <= -6.2e+19)
tmp = t_0;
elseif (y <= 3.8e-182)
tmp = y / (y + x);
elseif (y <= 1.62)
tmp = t_0;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+19], t$95$0, If[LessEqual[y, 3.8e-182], N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.62], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot \left(x + 1\right)}\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-182}:\\
\;\;\;\;\frac{y}{y + x}\\
\mathbf{elif}\;y \leq 1.62:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -6.2e19 or 3.8000000000000003e-182 < y < 1.6200000000000001Initial program 65.5%
Taylor expanded in x around inf 57.5%
Taylor expanded in y around inf 46.9%
if -6.2e19 < y < 3.8000000000000003e-182Initial program 61.6%
+-commutative61.6%
+-commutative61.6%
+-commutative61.6%
*-commutative61.6%
distribute-rgt1-in51.7%
fma-define61.6%
+-commutative61.6%
+-commutative61.6%
cube-unmult61.6%
+-commutative61.6%
Simplified61.6%
*-commutative61.6%
fma-define51.8%
cube-mult51.7%
distribute-rgt1-in61.6%
*-commutative61.6%
associate-*l*61.6%
times-frac99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 76.6%
+-commutative76.6%
Simplified76.6%
associate-*l/76.6%
un-div-inv76.6%
Applied egg-rr76.6%
Taylor expanded in x around 0 53.0%
if 1.6200000000000001 < y Initial program 57.4%
+-commutative57.4%
+-commutative57.4%
+-commutative57.4%
*-commutative57.4%
distribute-rgt1-in56.1%
fma-define57.5%
+-commutative57.5%
+-commutative57.5%
cube-unmult57.5%
+-commutative57.5%
Simplified57.5%
*-commutative57.5%
fma-define56.1%
cube-mult56.1%
distribute-rgt1-in57.4%
*-commutative57.4%
associate-*l*57.5%
times-frac81.0%
associate-+r+81.0%
Applied egg-rr81.0%
clear-num81.0%
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 y around inf 81.2%
Taylor expanded in x around 0 80.8%
Final simplification59.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 3.4e-187)
(/ (/ y x) (+ x 1.0))
(if (<= y 7e+159)
(/ x (* (+ y x) (+ y (+ x 1.0))))
(/ (/ x (+ y x)) (+ x (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.4e-187) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 7e+159) {
tmp = x / ((y + x) * (y + (x + 1.0)));
} else {
tmp = (x / (y + x)) / (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 (y <= 3.4d-187) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 7d+159) then
tmp = x / ((y + x) * (y + (x + 1.0d0)))
else
tmp = (x / (y + x)) / (x + (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-187) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 7e+159) {
tmp = x / ((y + x) * (y + (x + 1.0)));
} else {
tmp = (x / (y + x)) / (x + (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.4e-187: tmp = (y / x) / (x + 1.0) elif y <= 7e+159: tmp = x / ((y + x) * (y + (x + 1.0))) else: tmp = (x / (y + x)) / (x + (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.4e-187) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 7e+159) tmp = Float64(x / Float64(Float64(y + x) * Float64(y + Float64(x + 1.0)))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(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 (y <= 3.4e-187)
tmp = (y / x) / (x + 1.0);
elseif (y <= 7e+159)
tmp = x / ((y + x) * (y + (x + 1.0)));
else
tmp = (x / (y + x)) / (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[y, 3.4e-187], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+159], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{-187}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+159}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{x + \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 3.4000000000000001e-187Initial program 56.1%
+-commutative56.1%
+-commutative56.1%
+-commutative56.1%
*-commutative56.1%
distribute-rgt1-in38.0%
fma-define56.1%
+-commutative56.1%
+-commutative56.1%
cube-unmult56.1%
+-commutative56.1%
Simplified56.1%
*-commutative56.1%
fma-define38.0%
cube-mult38.0%
distribute-rgt1-in56.1%
*-commutative56.1%
associate-*l*56.1%
times-frac92.4%
associate-+r+92.4%
Applied egg-rr92.4%
clear-num92.3%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.5%
metadata-eval99.5%
times-frac99.5%
*-un-lft-identity99.5%
*-un-lft-identity99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in y around 0 54.4%
associate-/r*56.6%
+-commutative56.6%
Simplified56.6%
if 3.4000000000000001e-187 < y < 6.9999999999999999e159Initial program 82.2%
+-commutative82.2%
+-commutative82.2%
+-commutative82.2%
*-commutative82.2%
distribute-rgt1-in76.2%
fma-define82.2%
+-commutative82.2%
+-commutative82.2%
cube-unmult82.2%
+-commutative82.2%
Simplified82.2%
*-commutative82.2%
fma-define76.2%
cube-mult76.2%
distribute-rgt1-in82.2%
*-commutative82.2%
associate-*l*82.2%
times-frac97.6%
associate-+r+97.6%
Applied egg-rr97.6%
associate-*r/97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
associate-+l+97.5%
+-commutative97.5%
Applied egg-rr97.5%
Taylor expanded in y around inf 80.6%
if 6.9999999999999999e159 < y Initial program 38.3%
+-commutative38.3%
+-commutative38.3%
+-commutative38.3%
*-commutative38.3%
distribute-rgt1-in38.3%
fma-define38.3%
+-commutative38.3%
+-commutative38.3%
cube-unmult38.3%
+-commutative38.3%
Simplified38.3%
*-commutative38.3%
fma-define38.3%
cube-mult38.3%
distribute-rgt1-in38.3%
*-commutative38.3%
associate-*l*38.3%
times-frac67.5%
associate-+r+67.5%
Applied egg-rr67.5%
clear-num67.5%
associate-/r*99.7%
+-commutative99.7%
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%
*-un-lft-identity99.7%
times-frac99.7%
+-commutative99.7%
clear-num99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 88.8%
Final simplification69.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 3.4e-187)
(/ (/ y x) (+ x 1.0))
(if (<= y 2.65e+149)
(/ x (* (+ y x) (+ y (+ x 1.0))))
(* (/ x (+ y x)) (/ 1.0 y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.4e-187) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 2.65e+149) {
tmp = x / ((y + x) * (y + (x + 1.0)));
} else {
tmp = (x / (y + x)) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.4d-187) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 2.65d+149) then
tmp = x / ((y + x) * (y + (x + 1.0d0)))
else
tmp = (x / (y + x)) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.4e-187) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 2.65e+149) {
tmp = x / ((y + x) * (y + (x + 1.0)));
} else {
tmp = (x / (y + x)) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.4e-187: tmp = (y / x) / (x + 1.0) elif y <= 2.65e+149: tmp = x / ((y + x) * (y + (x + 1.0))) else: tmp = (x / (y + x)) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.4e-187) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 2.65e+149) tmp = Float64(x / Float64(Float64(y + x) * Float64(y + Float64(x + 1.0)))); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 3.4e-187)
tmp = (y / x) / (x + 1.0);
elseif (y <= 2.65e+149)
tmp = x / ((y + x) * (y + (x + 1.0)));
else
tmp = (x / (y + x)) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.4e-187], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.65e+149], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{-187}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{+149}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 3.4000000000000001e-187Initial program 56.1%
+-commutative56.1%
+-commutative56.1%
+-commutative56.1%
*-commutative56.1%
distribute-rgt1-in38.0%
fma-define56.1%
+-commutative56.1%
+-commutative56.1%
cube-unmult56.1%
+-commutative56.1%
Simplified56.1%
*-commutative56.1%
fma-define38.0%
cube-mult38.0%
distribute-rgt1-in56.1%
*-commutative56.1%
associate-*l*56.1%
times-frac92.4%
associate-+r+92.4%
Applied egg-rr92.4%
clear-num92.3%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.5%
metadata-eval99.5%
times-frac99.5%
*-un-lft-identity99.5%
*-un-lft-identity99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in y around 0 54.4%
associate-/r*56.6%
+-commutative56.6%
Simplified56.6%
if 3.4000000000000001e-187 < y < 2.65000000000000016e149Initial program 83.0%
+-commutative83.0%
+-commutative83.0%
+-commutative83.0%
*-commutative83.0%
distribute-rgt1-in76.8%
fma-define83.0%
+-commutative83.0%
+-commutative83.0%
cube-unmult83.0%
+-commutative83.0%
Simplified83.0%
*-commutative83.0%
fma-define76.8%
cube-mult76.8%
distribute-rgt1-in83.0%
*-commutative83.0%
associate-*l*83.0%
times-frac98.7%
associate-+r+98.7%
Applied egg-rr98.7%
associate-*r/98.6%
+-commutative98.6%
+-commutative98.6%
+-commutative98.6%
associate-+l+98.6%
+-commutative98.6%
Applied egg-rr98.6%
Taylor expanded in y around inf 81.3%
if 2.65000000000000016e149 < y Initial program 38.9%
+-commutative38.9%
+-commutative38.9%
+-commutative38.9%
*-commutative38.9%
distribute-rgt1-in38.8%
fma-define38.9%
+-commutative38.9%
+-commutative38.9%
cube-unmult38.9%
+-commutative38.9%
Simplified38.9%
*-commutative38.9%
fma-define38.8%
cube-mult38.8%
distribute-rgt1-in38.9%
*-commutative38.9%
associate-*l*38.9%
times-frac66.8%
associate-+r+66.8%
Applied egg-rr66.8%
clear-num66.8%
associate-/r*99.7%
+-commutative99.7%
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 inf 86.7%
div-inv86.7%
+-commutative86.7%
Applied egg-rr86.7%
Final simplification69.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -2.3e+18) (/ x (* y y)) (if (<= y 3.8e-182) (/ y (+ y x)) (if (<= y 1.0) (/ x y) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.3e+18) {
tmp = x / (y * y);
} else if (y <= 3.8e-182) {
tmp = y / (y + x);
} else 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 <= (-2.3d+18)) then
tmp = x / (y * y)
else if (y <= 3.8d-182) then
tmp = y / (y + x)
else 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 <= -2.3e+18) {
tmp = x / (y * y);
} else if (y <= 3.8e-182) {
tmp = y / (y + x);
} else 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 <= -2.3e+18: tmp = x / (y * y) elif y <= 3.8e-182: tmp = y / (y + x) elif 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 <= -2.3e+18) tmp = Float64(x / Float64(y * y)); elseif (y <= 3.8e-182) tmp = Float64(y / Float64(y + x)); elseif (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -2.3e+18)
tmp = x / (y * y);
elseif (y <= 3.8e-182)
tmp = y / (y + x);
elseif (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, -2.3e+18], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-182], N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+18}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-182}:\\
\;\;\;\;\frac{y}{y + x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -2.3e18Initial program 52.1%
associate-/l*70.6%
associate-+l+70.6%
Simplified70.6%
Taylor expanded in x around 0 69.3%
Taylor expanded in y around inf 69.3%
if -2.3e18 < y < 3.8000000000000003e-182Initial program 61.1%
+-commutative61.1%
+-commutative61.1%
+-commutative61.1%
*-commutative61.1%
distribute-rgt1-in51.1%
fma-define61.1%
+-commutative61.1%
+-commutative61.1%
cube-unmult61.2%
+-commutative61.2%
Simplified61.2%
*-commutative61.2%
fma-define51.2%
cube-mult51.1%
distribute-rgt1-in61.1%
*-commutative61.1%
associate-*l*61.2%
times-frac99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 77.5%
+-commutative77.5%
Simplified77.5%
associate-*l/77.5%
un-div-inv77.5%
Applied egg-rr77.5%
Taylor expanded in x around 0 53.6%
if 3.8000000000000003e-182 < y < 1Initial program 85.3%
associate-/l*91.0%
associate-+l+91.0%
Simplified91.0%
Taylor expanded in x around 0 54.0%
Taylor expanded in y around 0 52.5%
if 1 < y Initial program 57.4%
+-commutative57.4%
+-commutative57.4%
+-commutative57.4%
*-commutative57.4%
distribute-rgt1-in56.1%
fma-define57.5%
+-commutative57.5%
+-commutative57.5%
cube-unmult57.5%
+-commutative57.5%
Simplified57.5%
*-commutative57.5%
fma-define56.1%
cube-mult56.1%
distribute-rgt1-in57.4%
*-commutative57.4%
associate-*l*57.5%
times-frac81.0%
associate-+r+81.0%
Applied egg-rr81.0%
clear-num81.0%
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 y around inf 81.2%
Taylor expanded in x around 0 80.8%
Final simplification65.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 y))))
(if (<= y -2.3e+18)
t_0
(if (<= y 3.7e-182) (/ y (+ y x)) (if (<= y 1.0) (/ x y) t_0)))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -2.3e+18) {
tmp = t_0;
} else if (y <= 3.7e-182) {
tmp = y / (y + x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = 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 * y)
if (y <= (-2.3d+18)) then
tmp = t_0
else if (y <= 3.7d-182) then
tmp = y / (y + x)
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -2.3e+18) {
tmp = t_0;
} else if (y <= 3.7e-182) {
tmp = y / (y + x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * y) tmp = 0 if y <= -2.3e+18: tmp = t_0 elif y <= 3.7e-182: tmp = y / (y + x) elif y <= 1.0: tmp = x / y else: tmp = t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (y <= -2.3e+18) tmp = t_0; elseif (y <= 3.7e-182) tmp = Float64(y / Float64(y + x)); elseif (y <= 1.0) tmp = Float64(x / y); else tmp = t_0; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * y);
tmp = 0.0;
if (y <= -2.3e+18)
tmp = t_0;
elseif (y <= 3.7e-182)
tmp = y / (y + x);
elseif (y <= 1.0)
tmp = x / y;
else
tmp = 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 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e+18], t$95$0, If[LessEqual[y, 3.7e-182], N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-182}:\\
\;\;\;\;\frac{y}{y + x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.3e18 or 1 < y Initial program 55.1%
associate-/l*72.3%
associate-+l+72.3%
Simplified72.3%
Taylor expanded in x around 0 70.4%
Taylor expanded in y around inf 69.9%
if -2.3e18 < y < 3.69999999999999971e-182Initial program 61.1%
+-commutative61.1%
+-commutative61.1%
+-commutative61.1%
*-commutative61.1%
distribute-rgt1-in51.1%
fma-define61.1%
+-commutative61.1%
+-commutative61.1%
cube-unmult61.2%
+-commutative61.2%
Simplified61.2%
*-commutative61.2%
fma-define51.2%
cube-mult51.1%
distribute-rgt1-in61.1%
*-commutative61.1%
associate-*l*61.2%
times-frac99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 77.5%
+-commutative77.5%
Simplified77.5%
associate-*l/77.5%
un-div-inv77.5%
Applied egg-rr77.5%
Taylor expanded in x around 0 53.6%
if 3.69999999999999971e-182 < y < 1Initial program 85.3%
associate-/l*91.0%
associate-+l+91.0%
Simplified91.0%
Taylor expanded in x around 0 54.0%
Taylor expanded in y around 0 52.5%
Final simplification62.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 8.2e-158) (/ y (* x (+ x 1.0))) (if (<= y 1.9e+160) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 8.2e-158) {
tmp = y / (x * (x + 1.0));
} else if (y <= 1.9e+160) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 8.2d-158) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 1.9d+160) then
tmp = x / (y * (y + 1.0d0))
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 <= 8.2e-158) {
tmp = y / (x * (x + 1.0));
} else if (y <= 1.9e+160) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 8.2e-158: tmp = y / (x * (x + 1.0)) elif y <= 1.9e+160: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 8.2e-158) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 1.9e+160) tmp = Float64(x / Float64(y * Float64(y + 1.0))); 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 <= 8.2e-158)
tmp = y / (x * (x + 1.0));
elseif (y <= 1.9e+160)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 8.2e-158], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+160], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $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 8.2 \cdot 10^{-158}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+160}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 8.20000000000000008e-158Initial program 57.4%
associate-/l*71.9%
associate-+l+71.9%
Simplified71.9%
Taylor expanded in y around 0 55.9%
+-commutative55.9%
Simplified55.9%
if 8.20000000000000008e-158 < y < 1.90000000000000006e160Initial program 82.8%
associate-/l*87.3%
associate-+l+87.3%
Simplified87.3%
Taylor expanded in x around 0 65.8%
if 1.90000000000000006e160 < y Initial program 38.3%
associate-/l*67.5%
associate-+l+67.5%
Simplified67.5%
Taylor expanded in x around 0 67.5%
associate-/r*88.1%
+-commutative88.1%
div-inv88.1%
Applied egg-rr88.1%
Taylor expanded in y around inf 88.1%
Final simplification63.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (or (<= y -1.7e-61) (not (<= y 1.0))) (/ x (* y y)) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if ((y <= -1.7e-61) || !(y <= 1.0)) {
tmp = x / (y * y);
} 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 ((y <= (-1.7d-61)) .or. (.not. (y <= 1.0d0))) then
tmp = x / (y * y)
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if ((y <= -1.7e-61) || !(y <= 1.0)) {
tmp = x / (y * y);
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if (y <= -1.7e-61) or not (y <= 1.0): tmp = x / (y * y) else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if ((y <= -1.7e-61) || !(y <= 1.0)) tmp = Float64(x / Float64(y * y)); 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 ((y <= -1.7e-61) || ~((y <= 1.0)))
tmp = x / (y * y);
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[Or[LessEqual[y, -1.7e-61], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-61} \lor \neg \left(y \leq 1\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < -1.6999999999999999e-61 or 1 < y Initial program 57.9%
associate-/l*73.5%
associate-+l+73.5%
Simplified73.5%
Taylor expanded in x around 0 65.8%
Taylor expanded in y around inf 64.3%
if -1.6999999999999999e-61 < y < 1Initial program 67.2%
associate-/l*78.6%
associate-+l+78.6%
Simplified78.6%
Taylor expanded in x around 0 35.9%
Taylor expanded in y around 0 35.3%
Final simplification52.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.35e-166) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y x)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.35e-166) {
tmp = (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 (y <= 2.35d-166) then
tmp = (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 (y <= 2.35e-166) {
tmp = (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 y <= 2.35e-166: tmp = (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 (y <= 2.35e-166) tmp = Float64(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 (y <= 2.35e-166)
tmp = (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[y, 2.35e-166], N[(N[(y / x), $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}\;y \leq 2.35 \cdot 10^{-166}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if y < 2.35000000000000007e-166Initial program 57.8%
+-commutative57.8%
+-commutative57.8%
+-commutative57.8%
*-commutative57.8%
distribute-rgt1-in39.3%
fma-define57.8%
+-commutative57.8%
+-commutative57.8%
cube-unmult57.9%
+-commutative57.9%
Simplified57.9%
*-commutative57.9%
fma-define39.4%
cube-mult39.3%
distribute-rgt1-in57.8%
*-commutative57.8%
associate-*l*57.9%
times-frac92.8%
associate-+r+92.8%
Applied egg-rr92.8%
clear-num92.7%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.6%
metadata-eval99.6%
times-frac99.6%
*-un-lft-identity99.6%
*-un-lft-identity99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 56.3%
associate-/r*58.4%
+-commutative58.4%
Simplified58.4%
if 2.35000000000000007e-166 < y Initial program 66.8%
+-commutative66.8%
+-commutative66.8%
+-commutative66.8%
*-commutative66.8%
distribute-rgt1-in64.2%
fma-define66.8%
+-commutative66.8%
+-commutative66.8%
cube-unmult66.8%
+-commutative66.8%
Simplified66.8%
*-commutative66.8%
fma-define64.2%
cube-mult64.2%
distribute-rgt1-in66.8%
*-commutative66.8%
associate-*l*66.8%
times-frac87.1%
associate-+r+87.1%
Applied egg-rr87.1%
clear-num87.1%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times99.2%
metadata-eval99.2%
times-frac99.2%
*-un-lft-identity99.2%
*-un-lft-identity99.2%
+-commutative99.2%
+-commutative99.2%
+-commutative99.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 74.1%
+-commutative74.1%
Simplified74.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.7e-151) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.7e-151) {
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 <= 1.7d-151) 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 <= 1.7e-151) {
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 <= 1.7e-151: 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 <= 1.7e-151) 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 <= 1.7e-151)
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, 1.7e-151], 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 1.7 \cdot 10^{-151}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 1.7000000000000001e-151Initial program 57.4%
+-commutative57.4%
+-commutative57.4%
+-commutative57.4%
*-commutative57.4%
distribute-rgt1-in39.1%
fma-define57.4%
+-commutative57.4%
+-commutative57.4%
cube-unmult57.5%
+-commutative57.5%
Simplified57.5%
*-commutative57.5%
fma-define39.1%
cube-mult39.1%
distribute-rgt1-in57.4%
*-commutative57.4%
associate-*l*57.4%
times-frac92.8%
associate-+r+92.8%
Applied egg-rr92.8%
clear-num92.8%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.6%
metadata-eval99.6%
times-frac99.6%
*-un-lft-identity99.6%
*-un-lft-identity99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 55.9%
associate-/r*58.0%
+-commutative58.0%
Simplified58.0%
if 1.7000000000000001e-151 < y Initial program 67.4%
associate-/l*80.5%
associate-+l+80.5%
Simplified80.5%
Taylor expanded in x around 0 66.4%
associate-/r*73.5%
+-commutative73.5%
Simplified73.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.7e-151) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.7e-151) {
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 <= 1.7d-151) 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 <= 1.7e-151) {
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 <= 1.7e-151: 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 <= 1.7e-151) 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 (y <= 1.7e-151)
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, 1.7e-151], 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}\;y \leq 1.7 \cdot 10^{-151}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 1.7000000000000001e-151Initial program 57.4%
associate-/l*71.9%
associate-+l+71.9%
Simplified71.9%
Taylor expanded in y around 0 55.9%
+-commutative55.9%
Simplified55.9%
if 1.7000000000000001e-151 < y Initial program 67.4%
associate-/l*80.5%
associate-+l+80.5%
Simplified80.5%
Taylor expanded in x around 0 66.4%
associate-/r*73.5%
+-commutative73.5%
Simplified73.5%
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 61.8%
associate-/l*75.7%
associate-+l+75.7%
Simplified75.7%
Taylor expanded in x around 0 53.2%
Taylor expanded in y around 0 29.7%
clear-num29.7%
inv-pow29.7%
Applied egg-rr29.7%
unpow-129.7%
Simplified29.7%
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 61.8%
associate-/l*75.7%
associate-+l+75.7%
Simplified75.7%
Taylor expanded in x around 0 53.2%
Taylor expanded in y around 0 29.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 y))
assert(x < y);
double code(double x, double y) {
return 1.0 / 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 = 1.0d0 / y
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / y;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / y
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{y}
\end{array}
Initial program 61.8%
+-commutative61.8%
+-commutative61.8%
+-commutative61.8%
*-commutative61.8%
distribute-rgt1-in50.4%
fma-define61.8%
+-commutative61.8%
+-commutative61.8%
cube-unmult61.9%
+-commutative61.9%
Simplified61.9%
*-commutative61.9%
fma-define50.4%
cube-mult50.4%
distribute-rgt1-in61.8%
*-commutative61.8%
associate-*l*61.9%
times-frac90.3%
associate-+r+90.3%
Applied egg-rr90.3%
clear-num90.2%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times99.4%
metadata-eval99.4%
times-frac99.4%
*-un-lft-identity99.4%
*-un-lft-identity99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 42.4%
Taylor expanded in x 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 2024141
(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))))