
(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 (/ (/ x (+ x y)) (* (/ (+ x (+ y 1.0)) y) (+ x y))))
assert(x < y);
double code(double x, double y) {
return (x / (x + y)) / (((x + (y + 1.0)) / y) * (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 + 1.0d0)) / y) * (x + y))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (x + y)) / (((x + (y + 1.0)) / y) * (x + y));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (x + y)) / (((x + (y + 1.0)) / y) * (x + y))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(x + y)) / Float64(Float64(Float64(x + Float64(y + 1.0)) / y) * Float64(x + y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (x + y)) / (((x + (y + 1.0)) / y) * (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 + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{x + y}}{\frac{x + \left(y + 1\right)}{y} \cdot \left(x + y\right)}
\end{array}
Initial program 66.6%
associate-*l*66.6%
times-frac91.9%
associate-+r+91.9%
Applied egg-rr91.9%
clear-num91.1%
un-div-inv91.1%
+-commutative91.1%
*-un-lft-identity91.1%
times-frac99.0%
/-rgt-identity99.0%
+-commutative99.0%
Applied egg-rr99.0%
Final simplification99.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= x -1.32e+154)
(/ (/ y (+ x y)) t_0)
(if (<= x -2.8e-15)
(/ y (* t_0 (+ x y)))
(/ (/ x (+ x y)) (* (+ x y) (/ (+ y 1.0) y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.32e+154) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -2.8e-15) {
tmp = y / (t_0 * (x + y));
} else {
tmp = (x / (x + y)) / ((x + y) * ((y + 1.0) / y));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (x <= (-1.32d+154)) then
tmp = (y / (x + y)) / t_0
else if (x <= (-2.8d-15)) then
tmp = y / (t_0 * (x + y))
else
tmp = (x / (x + y)) / ((x + y) * ((y + 1.0d0) / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.32e+154) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -2.8e-15) {
tmp = y / (t_0 * (x + y));
} else {
tmp = (x / (x + y)) / ((x + y) * ((y + 1.0) / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if x <= -1.32e+154: tmp = (y / (x + y)) / t_0 elif x <= -2.8e-15: tmp = y / (t_0 * (x + y)) else: tmp = (x / (x + y)) / ((x + y) * ((y + 1.0) / y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -1.32e+154) tmp = Float64(Float64(y / Float64(x + y)) / t_0); elseif (x <= -2.8e-15) tmp = Float64(y / Float64(t_0 * Float64(x + y))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(Float64(x + y) * Float64(Float64(y + 1.0) / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (x <= -1.32e+154)
tmp = (y / (x + y)) / t_0;
elseif (x <= -2.8e-15)
tmp = y / (t_0 * (x + y));
else
tmp = (x / (x + y)) / ((x + y) * ((y + 1.0) / y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.32e+154], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, -2.8e-15], N[(y / N[(t$95$0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{t\_0}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{t\_0 \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{\left(x + y\right) \cdot \frac{y + 1}{y}}\\
\end{array}
\end{array}
if x < -1.31999999999999998e154Initial program 67.3%
associate-*l*67.3%
times-frac84.8%
associate-+r+84.8%
Applied egg-rr84.8%
clear-num84.8%
associate-/r*100.0%
frac-times99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 93.7%
if -1.31999999999999998e154 < x < -2.80000000000000014e-15Initial program 75.1%
associate-*l*75.1%
times-frac91.9%
associate-+r+91.9%
Applied egg-rr91.9%
Taylor expanded in x around inf 80.4%
if -2.80000000000000014e-15 < x Initial program 64.7%
associate-*l*64.7%
times-frac93.3%
associate-+r+93.3%
Applied egg-rr93.3%
clear-num92.4%
un-div-inv92.4%
+-commutative92.4%
*-un-lft-identity92.4%
times-frac98.9%
/-rgt-identity98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in x around 0 82.9%
+-commutative82.9%
Simplified82.9%
Final simplification84.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 0.065)
(* (/ y (+ x y)) (/ x (* (+ x y) (+ x 1.0))))
(if (<= y 1.65e+60)
(/ (* x y) (* (+ y 1.0) (* (+ x y) (+ x y))))
(* (/ 1.0 (+ x y)) (/ x y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 0.065) {
tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0)));
} else if (y <= 1.65e+60) {
tmp = (x * y) / ((y + 1.0) * ((x + y) * (x + y)));
} else {
tmp = (1.0 / (x + y)) * (x / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 0.065d0) then
tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0d0)))
else if (y <= 1.65d+60) then
tmp = (x * y) / ((y + 1.0d0) * ((x + y) * (x + y)))
else
tmp = (1.0d0 / (x + y)) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 0.065) {
tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0)));
} else if (y <= 1.65e+60) {
tmp = (x * y) / ((y + 1.0) * ((x + y) * (x + y)));
} else {
tmp = (1.0 / (x + y)) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 0.065: tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0))) elif y <= 1.65e+60: tmp = (x * y) / ((y + 1.0) * ((x + y) * (x + y))) else: tmp = (1.0 / (x + y)) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 0.065) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x + y) * Float64(x + 1.0)))); elseif (y <= 1.65e+60) tmp = Float64(Float64(x * y) / Float64(Float64(y + 1.0) * Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(1.0 / Float64(x + y)) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 0.065)
tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0)));
elseif (y <= 1.65e+60)
tmp = (x * y) / ((y + 1.0) * ((x + y) * (x + y)));
else
tmp = (1.0 / (x + y)) * (x / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 0.065], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+60], N[(N[(x * y), $MachinePrecision] / N[(N[(y + 1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.065:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+60}:\\
\;\;\;\;\frac{x \cdot y}{\left(y + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x + y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < 0.065000000000000002Initial program 66.8%
Taylor expanded in x around inf 58.6%
*-commutative58.6%
associate-*l*58.6%
times-frac81.9%
+-commutative81.9%
+-commutative81.9%
Applied egg-rr81.9%
if 0.065000000000000002 < y < 1.6499999999999999e60Initial program 71.7%
Taylor expanded in x around 0 71.5%
if 1.6499999999999999e60 < y Initial program 63.8%
associate-*l*63.8%
times-frac80.9%
associate-+r+80.9%
Applied egg-rr80.9%
Taylor expanded in y around inf 79.1%
clear-num79.0%
+-commutative79.0%
frac-times78.7%
metadata-eval78.7%
+-commutative78.7%
Applied egg-rr78.7%
associate-/r/78.7%
associate-/r/79.1%
Simplified79.1%
Final simplification80.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -6.2e+232)
(/ x (* y (+ x 1.0)))
(if (<= x -4.2e+29)
(/ (/ x y) y)
(if (<= x 5.6e-59) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -6.2e+232) {
tmp = x / (y * (x + 1.0));
} else if (x <= -4.2e+29) {
tmp = (x / y) / y;
} else if (x <= 5.6e-59) {
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 (x <= (-6.2d+232)) then
tmp = x / (y * (x + 1.0d0))
else if (x <= (-4.2d+29)) then
tmp = (x / y) / y
else if (x <= 5.6d-59) 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 (x <= -6.2e+232) {
tmp = x / (y * (x + 1.0));
} else if (x <= -4.2e+29) {
tmp = (x / y) / y;
} else if (x <= 5.6e-59) {
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 x <= -6.2e+232: tmp = x / (y * (x + 1.0)) elif x <= -4.2e+29: tmp = (x / y) / y elif x <= 5.6e-59: 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 (x <= -6.2e+232) tmp = Float64(x / Float64(y * Float64(x + 1.0))); elseif (x <= -4.2e+29) tmp = Float64(Float64(x / y) / y); elseif (x <= 5.6e-59) 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 (x <= -6.2e+232)
tmp = x / (y * (x + 1.0));
elseif (x <= -4.2e+29)
tmp = (x / y) / y;
elseif (x <= 5.6e-59)
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[x, -6.2e+232], N[(x / N[(y * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.2e+29], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 5.6e-59], 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}\;x \leq -6.2 \cdot 10^{+232}:\\
\;\;\;\;\frac{x}{y \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -6.19999999999999966e232Initial program 61.9%
Taylor expanded in x around inf 61.9%
Taylor expanded in y around inf 31.0%
+-commutative31.0%
Simplified31.0%
if -6.19999999999999966e232 < x < -4.2000000000000003e29Initial program 73.2%
associate-*l*73.2%
times-frac83.8%
associate-+r+83.8%
Applied egg-rr83.8%
clear-num82.6%
un-div-inv82.7%
+-commutative82.7%
*-un-lft-identity82.7%
times-frac98.6%
/-rgt-identity98.6%
+-commutative98.6%
Applied egg-rr98.6%
Taylor expanded in y around inf 20.5%
Taylor expanded in x around 0 19.7%
if -4.2000000000000003e29 < x < 5.59999999999999961e-59Initial program 72.4%
associate-/l*88.4%
associate-+l+88.4%
Simplified88.4%
Taylor expanded in x around 0 76.1%
+-commutative76.1%
Simplified76.1%
if 5.59999999999999961e-59 < x Initial program 53.6%
associate-*l*53.6%
times-frac82.6%
associate-+r+82.6%
Applied egg-rr82.6%
Taylor expanded in y around inf 34.3%
Taylor expanded in x around 0 33.6%
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 1.02e+142)
(* t_0 (/ y (* (+ x (+ y 1.0)) (+ x y))))
(/ t_0 (* (+ x y) (/ (+ y 1.0) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= 1.02e+142) {
tmp = t_0 * (y / ((x + (y + 1.0)) * (x + y)));
} else {
tmp = t_0 / ((x + y) * ((y + 1.0) / y));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (y <= 1.02d+142) then
tmp = t_0 * (y / ((x + (y + 1.0d0)) * (x + y)))
else
tmp = t_0 / ((x + y) * ((y + 1.0d0) / 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 <= 1.02e+142) {
tmp = t_0 * (y / ((x + (y + 1.0)) * (x + y)));
} else {
tmp = t_0 / ((x + y) * ((y + 1.0) / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if y <= 1.02e+142: tmp = t_0 * (y / ((x + (y + 1.0)) * (x + y))) else: tmp = t_0 / ((x + y) * ((y + 1.0) / y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= 1.02e+142) tmp = Float64(t_0 * Float64(y / Float64(Float64(x + Float64(y + 1.0)) * Float64(x + y)))); else tmp = Float64(t_0 / Float64(Float64(x + y) * Float64(Float64(y + 1.0) / 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 <= 1.02e+142)
tmp = t_0 * (y / ((x + (y + 1.0)) * (x + y)));
else
tmp = t_0 / ((x + y) * ((y + 1.0) / y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.02e+142], N[(t$95$0 * N[(y / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(x + y), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / 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 1.02 \cdot 10^{+142}:\\
\;\;\;\;t\_0 \cdot \frac{y}{\left(x + \left(y + 1\right)\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\left(x + y\right) \cdot \frac{y + 1}{y}}\\
\end{array}
\end{array}
if y < 1.0199999999999999e142Initial program 66.3%
associate-*l*66.3%
times-frac93.6%
associate-+r+93.6%
Applied egg-rr93.6%
if 1.0199999999999999e142 < y Initial program 68.4%
associate-*l*68.4%
times-frac81.1%
associate-+r+81.1%
Applied egg-rr81.1%
clear-num81.1%
un-div-inv81.1%
+-commutative81.1%
*-un-lft-identity81.1%
times-frac99.8%
/-rgt-identity99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 89.9%
+-commutative89.9%
Simplified89.9%
Final simplification93.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 6.2e+29)
(* (/ y (+ x y)) (/ x (* (+ x y) (+ x 1.0))))
(if (<= y 1.02e+142)
(* x (* (/ 1.0 (+ x y)) (/ 1.0 y)))
(* (/ x (+ x y)) (/ 1.0 (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 6.2e+29) {
tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0)));
} else if (y <= 1.02e+142) {
tmp = x * ((1.0 / (x + y)) * (1.0 / y));
} else {
tmp = (x / (x + y)) * (1.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) :: tmp
if (y <= 6.2d+29) then
tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0d0)))
else if (y <= 1.02d+142) then
tmp = x * ((1.0d0 / (x + y)) * (1.0d0 / y))
else
tmp = (x / (x + y)) * (1.0d0 / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 6.2e+29) {
tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0)));
} else if (y <= 1.02e+142) {
tmp = x * ((1.0 / (x + y)) * (1.0 / y));
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 6.2e+29: tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0))) elif y <= 1.02e+142: tmp = x * ((1.0 / (x + y)) * (1.0 / y)) else: tmp = (x / (x + y)) * (1.0 / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 6.2e+29) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x + y) * Float64(x + 1.0)))); elseif (y <= 1.02e+142) tmp = Float64(x * Float64(Float64(1.0 / Float64(x + y)) * Float64(1.0 / y))); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(1.0 / 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 <= 6.2e+29)
tmp = (y / (x + y)) * (x / ((x + y) * (x + 1.0)));
elseif (y <= 1.02e+142)
tmp = x * ((1.0 / (x + y)) * (1.0 / y));
else
tmp = (x / (x + y)) * (1.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_] := If[LessEqual[y, 6.2e+29], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+142], N[(x * N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+29}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\frac{1}{x + y} \cdot \frac{1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y + 1}\\
\end{array}
\end{array}
if y < 6.1999999999999998e29Initial program 67.5%
Taylor expanded in x around inf 58.3%
*-commutative58.3%
associate-*l*58.3%
times-frac81.2%
+-commutative81.2%
+-commutative81.2%
Applied egg-rr81.2%
if 6.1999999999999998e29 < y < 1.0199999999999999e142Initial program 56.1%
associate-/l*77.0%
associate-+l+77.0%
Simplified77.0%
*-un-lft-identity77.0%
associate-+r+77.0%
associate-*l*77.0%
times-frac80.6%
associate-+r+80.6%
Applied egg-rr80.6%
Taylor expanded in y around inf 72.2%
if 1.0199999999999999e142 < y Initial program 68.4%
associate-*l*68.4%
times-frac81.1%
associate-+r+81.1%
Applied egg-rr81.1%
Taylor expanded in x around 0 89.7%
+-commutative89.7%
Simplified89.7%
Final simplification81.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 1.0))))
(if (<= x -1.04e+157)
(/ (/ y (+ x y)) t_0)
(if (<= x -5e-152) (/ y (* t_0 (+ x y))) (/ (/ x (+ x y)) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.04e+157) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -5e-152) {
tmp = y / (t_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) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (x <= (-1.04d+157)) then
tmp = (y / (x + y)) / t_0
else if (x <= (-5d-152)) then
tmp = y / (t_0 * (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 t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.04e+157) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -5e-152) {
tmp = y / (t_0 * (x + y));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if x <= -1.04e+157: tmp = (y / (x + y)) / t_0 elif x <= -5e-152: tmp = y / (t_0 * (x + y)) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -1.04e+157) tmp = Float64(Float64(y / Float64(x + y)) / t_0); elseif (x <= -5e-152) tmp = Float64(y / Float64(t_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)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (x <= -1.04e+157)
tmp = (y / (x + y)) / t_0;
elseif (x <= -5e-152)
tmp = y / (t_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_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.04e+157], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, -5e-152], N[(y / N[(t$95$0 * 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}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -1.04 \cdot 10^{+157}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{t\_0}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-152}:\\
\;\;\;\;\frac{y}{t\_0 \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.04000000000000007e157Initial program 67.3%
associate-*l*67.3%
times-frac84.8%
associate-+r+84.8%
Applied egg-rr84.8%
clear-num84.8%
associate-/r*100.0%
frac-times99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 93.7%
if -1.04000000000000007e157 < x < -4.9999999999999997e-152Initial program 76.2%
associate-*l*76.2%
times-frac95.4%
associate-+r+95.4%
Applied egg-rr95.4%
Taylor expanded in x around inf 73.9%
if -4.9999999999999997e-152 < x Initial program 62.2%
associate-*l*62.2%
times-frac92.1%
associate-+r+92.1%
Applied egg-rr92.1%
clear-num91.0%
un-div-inv91.0%
+-commutative91.0%
*-un-lft-identity91.0%
times-frac98.8%
/-rgt-identity98.8%
+-commutative98.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 61.6%
+-commutative61.6%
Simplified61.6%
Final simplification69.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2.8e+154)
(/ (/ y (+ x y)) x)
(if (<= x -1.9e-151)
(/ y (* (+ x (+ y 1.0)) (+ x y)))
(/ (/ x (+ x y)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.8e+154) {
tmp = (y / (x + y)) / x;
} else if (x <= -1.9e-151) {
tmp = y / ((x + (y + 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 <= (-2.8d+154)) then
tmp = (y / (x + y)) / x
else if (x <= (-1.9d-151)) then
tmp = y / ((x + (y + 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 <= -2.8e+154) {
tmp = (y / (x + y)) / x;
} else if (x <= -1.9e-151) {
tmp = y / ((x + (y + 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 <= -2.8e+154: tmp = (y / (x + y)) / x elif x <= -1.9e-151: tmp = y / ((x + (y + 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 <= -2.8e+154) tmp = Float64(Float64(y / Float64(x + y)) / x); elseif (x <= -1.9e-151) tmp = Float64(y / Float64(Float64(x + Float64(y + 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 <= -2.8e+154)
tmp = (y / (x + y)) / x;
elseif (x <= -1.9e-151)
tmp = y / ((x + (y + 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, -2.8e+154], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.9e-151], N[(y / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $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 -2.8 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-151}:\\
\;\;\;\;\frac{y}{\left(x + \left(y + 1\right)\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.7999999999999999e154Initial program 67.3%
associate-*l*67.3%
times-frac84.8%
associate-+r+84.8%
Applied egg-rr84.8%
clear-num84.8%
associate-/r*100.0%
frac-times99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 93.7%
if -2.7999999999999999e154 < x < -1.89999999999999985e-151Initial program 76.2%
associate-*l*76.2%
times-frac95.4%
associate-+r+95.4%
Applied egg-rr95.4%
Taylor expanded in x around inf 73.9%
if -1.89999999999999985e-151 < x Initial program 62.2%
associate-*l*62.2%
times-frac92.1%
associate-+r+92.1%
Applied egg-rr92.1%
clear-num91.0%
un-div-inv91.0%
+-commutative91.0%
*-un-lft-identity91.0%
times-frac98.8%
/-rgt-identity98.8%
+-commutative98.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 61.6%
+-commutative61.6%
Simplified61.6%
Final simplification69.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -7e-28) (/ (/ y x) (* (+ x (+ y 1.0)) (+ 1.0 (/ y x)))) (/ (/ x (+ x y)) (* (+ x y) (/ (+ y 1.0) y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -7e-28) {
tmp = (y / x) / ((x + (y + 1.0)) * (1.0 + (y / x)));
} else {
tmp = (x / (x + y)) / ((x + y) * ((y + 1.0) / y));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-7d-28)) then
tmp = (y / x) / ((x + (y + 1.0d0)) * (1.0d0 + (y / x)))
else
tmp = (x / (x + y)) / ((x + y) * ((y + 1.0d0) / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -7e-28) {
tmp = (y / x) / ((x + (y + 1.0)) * (1.0 + (y / x)));
} else {
tmp = (x / (x + y)) / ((x + y) * ((y + 1.0) / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -7e-28: tmp = (y / x) / ((x + (y + 1.0)) * (1.0 + (y / x))) else: tmp = (x / (x + y)) / ((x + y) * ((y + 1.0) / y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -7e-28) tmp = Float64(Float64(y / x) / Float64(Float64(x + Float64(y + 1.0)) * Float64(1.0 + Float64(y / x)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(Float64(x + y) * Float64(Float64(y + 1.0) / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -7e-28)
tmp = (y / x) / ((x + (y + 1.0)) * (1.0 + (y / x)));
else
tmp = (x / (x + y)) / ((x + y) * ((y + 1.0) / y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -7e-28], N[(N[(y / x), $MachinePrecision] / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-28}:\\
\;\;\;\;\frac{\frac{y}{x}}{\left(x + \left(y + 1\right)\right) \cdot \left(1 + \frac{y}{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{\left(x + y\right) \cdot \frac{y + 1}{y}}\\
\end{array}
\end{array}
if x < -6.9999999999999999e-28Initial program 72.7%
associate-*l*72.7%
times-frac89.0%
associate-+r+89.0%
Applied egg-rr89.0%
clear-num89.0%
associate-/r*99.8%
frac-times99.6%
*-un-lft-identity99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 99.6%
Taylor expanded in y around 0 87.5%
if -6.9999999999999999e-28 < x Initial program 63.9%
associate-*l*63.9%
times-frac93.1%
associate-+r+93.1%
Applied egg-rr93.1%
clear-num92.2%
un-div-inv92.2%
+-commutative92.2%
*-un-lft-identity92.2%
times-frac98.9%
/-rgt-identity98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in x around 0 82.5%
+-commutative82.5%
Simplified82.5%
Final simplification84.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -9e-141) (/ (/ y x) (+ x 1.0)) (if (<= x 5.6e-59) (/ x (* y (+ y 1.0))) (* (/ 1.0 (+ x y)) (/ x y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -9e-141) {
tmp = (y / x) / (x + 1.0);
} else if (x <= 5.6e-59) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / (x + y)) * (x / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-9d-141)) then
tmp = (y / x) / (x + 1.0d0)
else if (x <= 5.6d-59) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (1.0d0 / (x + y)) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -9e-141) {
tmp = (y / x) / (x + 1.0);
} else if (x <= 5.6e-59) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / (x + y)) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -9e-141: tmp = (y / x) / (x + 1.0) elif x <= 5.6e-59: tmp = x / (y * (y + 1.0)) else: tmp = (1.0 / (x + y)) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -9e-141) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (x <= 5.6e-59) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(1.0 / Float64(x + y)) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -9e-141)
tmp = (y / x) / (x + 1.0);
elseif (x <= 5.6e-59)
tmp = x / (y * (y + 1.0));
else
tmp = (1.0 / (x + y)) * (x / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -9e-141], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.6e-59], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{-141}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x + y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -9.0000000000000001e-141Initial program 73.5%
associate-/l*82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in y around 0 65.3%
associate-/r*68.4%
+-commutative68.4%
Simplified68.4%
if -9.0000000000000001e-141 < x < 5.59999999999999961e-59Initial program 69.0%
associate-/l*86.6%
associate-+l+86.6%
Simplified86.6%
Taylor expanded in x around 0 83.5%
+-commutative83.5%
Simplified83.5%
if 5.59999999999999961e-59 < x Initial program 53.6%
associate-*l*53.6%
times-frac82.6%
associate-+r+82.6%
Applied egg-rr82.6%
Taylor expanded in y around inf 34.3%
clear-num34.2%
+-commutative34.2%
frac-times34.1%
metadata-eval34.1%
+-commutative34.1%
Applied egg-rr34.1%
associate-/r/34.0%
associate-/r/34.2%
Simplified34.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -9e-141) (/ (/ y x) (+ x 1.0)) (if (<= x 5.6e-59) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -9e-141) {
tmp = (y / x) / (x + 1.0);
} else if (x <= 5.6e-59) {
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 (x <= (-9d-141)) then
tmp = (y / x) / (x + 1.0d0)
else if (x <= 5.6d-59) 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 (x <= -9e-141) {
tmp = (y / x) / (x + 1.0);
} else if (x <= 5.6e-59) {
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 x <= -9e-141: tmp = (y / x) / (x + 1.0) elif x <= 5.6e-59: 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 (x <= -9e-141) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (x <= 5.6e-59) 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 (x <= -9e-141)
tmp = (y / x) / (x + 1.0);
elseif (x <= 5.6e-59)
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[x, -9e-141], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.6e-59], 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}\;x \leq -9 \cdot 10^{-141}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -9.0000000000000001e-141Initial program 73.5%
associate-/l*82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in y around 0 65.3%
associate-/r*68.4%
+-commutative68.4%
Simplified68.4%
if -9.0000000000000001e-141 < x < 5.59999999999999961e-59Initial program 69.0%
associate-/l*86.6%
associate-+l+86.6%
Simplified86.6%
Taylor expanded in x around 0 83.5%
+-commutative83.5%
Simplified83.5%
if 5.59999999999999961e-59 < x Initial program 53.6%
associate-*l*53.6%
times-frac82.6%
associate-+r+82.6%
Applied egg-rr82.6%
Taylor expanded in y around inf 34.3%
Taylor expanded in x around 0 33.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -8.8e-141) (/ y (* x (+ x 1.0))) (if (<= x 5.6e-59) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -8.8e-141) {
tmp = y / (x * (x + 1.0));
} else if (x <= 5.6e-59) {
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 (x <= (-8.8d-141)) then
tmp = y / (x * (x + 1.0d0))
else if (x <= 5.6d-59) 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 (x <= -8.8e-141) {
tmp = y / (x * (x + 1.0));
} else if (x <= 5.6e-59) {
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 x <= -8.8e-141: tmp = y / (x * (x + 1.0)) elif x <= 5.6e-59: 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 (x <= -8.8e-141) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (x <= 5.6e-59) 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 (x <= -8.8e-141)
tmp = y / (x * (x + 1.0));
elseif (x <= 5.6e-59)
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[x, -8.8e-141], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.6e-59], 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}\;x \leq -8.8 \cdot 10^{-141}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -8.80000000000000037e-141Initial program 73.5%
associate-/l*82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in y around 0 65.3%
if -8.80000000000000037e-141 < x < 5.59999999999999961e-59Initial program 69.0%
associate-/l*86.6%
associate-+l+86.6%
Simplified86.6%
Taylor expanded in x around 0 83.5%
+-commutative83.5%
Simplified83.5%
if 5.59999999999999961e-59 < x Initial program 53.6%
associate-*l*53.6%
times-frac82.6%
associate-+r+82.6%
Applied egg-rr82.6%
Taylor expanded in y around inf 34.3%
Taylor expanded in x around 0 33.6%
Final simplification62.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -9.5e-150) (/ (/ 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 <= -9.5e-150) {
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 <= (-9.5d-150)) 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 <= -9.5e-150) {
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 <= -9.5e-150: 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 <= -9.5e-150) tmp = Float64(Float64(y / 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 <= -9.5e-150)
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, -9.5e-150], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $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 -9.5 \cdot 10^{-150}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -9.50000000000000013e-150Initial program 73.1%
Taylor expanded in x around inf 63.3%
Taylor expanded in x around inf 51.3%
associate-*l*51.3%
+-commutative51.3%
times-frac65.1%
+-commutative65.1%
Applied egg-rr65.1%
associate-*l/65.1%
associate-/l*54.5%
times-frac68.4%
*-inverses68.4%
Simplified68.4%
if -9.50000000000000013e-150 < x Initial program 62.2%
associate-*l*62.2%
times-frac92.1%
associate-+r+92.1%
Applied egg-rr92.1%
clear-num91.0%
un-div-inv91.0%
+-commutative91.0%
*-un-lft-identity91.0%
times-frac98.8%
/-rgt-identity98.8%
+-commutative98.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 61.6%
+-commutative61.6%
Simplified61.6%
Final simplification64.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -9.5e-150) (/ (/ y (+ x y)) (+ x 1.0)) (/ (/ x (+ x y)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -9.5e-150) {
tmp = (y / (x + y)) / (x + 1.0);
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-9.5d-150)) then
tmp = (y / (x + y)) / (x + 1.0d0)
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -9.5e-150) {
tmp = (y / (x + y)) / (x + 1.0);
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -9.5e-150: tmp = (y / (x + y)) / (x + 1.0) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -9.5e-150) tmp = Float64(Float64(y / Float64(x + y)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -9.5e-150)
tmp = (y / (x + y)) / (x + 1.0);
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -9.5e-150], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $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 -9.5 \cdot 10^{-150}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -9.50000000000000013e-150Initial program 73.1%
associate-*l*73.1%
times-frac91.6%
associate-+r+91.6%
Applied egg-rr91.6%
clear-num91.6%
associate-/r*99.8%
frac-times99.6%
*-un-lft-identity99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 68.4%
+-commutative68.4%
Simplified68.4%
if -9.50000000000000013e-150 < x Initial program 62.2%
associate-*l*62.2%
times-frac92.1%
associate-+r+92.1%
Applied egg-rr92.1%
clear-num91.0%
un-div-inv91.0%
+-commutative91.0%
*-un-lft-identity91.0%
times-frac98.8%
/-rgt-identity98.8%
+-commutative98.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 61.6%
+-commutative61.6%
Simplified61.6%
Final simplification64.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -9e-141) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ x y)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -9e-141) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-9d-141)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -9e-141) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -9e-141: tmp = (y / x) / (x + 1.0) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -9e-141) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -9e-141)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -9e-141], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $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 -9 \cdot 10^{-141}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -9.0000000000000001e-141Initial program 73.5%
associate-/l*82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in y around 0 65.3%
associate-/r*68.4%
+-commutative68.4%
Simplified68.4%
if -9.0000000000000001e-141 < x Initial program 62.1%
associate-*l*62.1%
times-frac92.2%
associate-+r+92.2%
Applied egg-rr92.2%
clear-num91.1%
un-div-inv91.1%
+-commutative91.1%
*-un-lft-identity91.1%
times-frac98.8%
/-rgt-identity98.8%
+-commutative98.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 61.5%
+-commutative61.5%
Simplified61.5%
Final simplification64.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 6.0) (/ x (* y (+ x 1.0))) (/ (/ x y) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 6.0) {
tmp = x / (y * (x + 1.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) :: tmp
if (y <= 6.0d0) then
tmp = x / (y * (x + 1.0d0))
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 <= 6.0) {
tmp = x / (y * (x + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 6.0: tmp = x / (y * (x + 1.0)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 6.0) tmp = Float64(x / Float64(y * Float64(x + 1.0))); 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 <= 6.0)
tmp = x / (y * (x + 1.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_] := If[LessEqual[y, 6.0], N[(x / N[(y * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6:\\
\;\;\;\;\frac{x}{y \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 6Initial program 66.8%
Taylor expanded in x around inf 58.6%
Taylor expanded in y around inf 32.4%
+-commutative32.4%
Simplified32.4%
if 6 < y Initial program 65.8%
associate-*l*65.8%
times-frac84.4%
associate-+r+84.4%
Applied egg-rr84.4%
clear-num84.4%
un-div-inv84.4%
+-commutative84.4%
*-un-lft-identity84.4%
times-frac99.8%
/-rgt-identity99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 70.3%
Taylor expanded in x around 0 69.9%
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(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 <= 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[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 1Initial program 66.8%
associate-/l*81.9%
associate-+l+81.9%
Simplified81.9%
Taylor expanded in x around 0 41.4%
+-commutative41.4%
Simplified41.4%
Taylor expanded in y around 0 24.7%
if 1 < y Initial program 65.8%
associate-*l*65.8%
times-frac84.4%
associate-+r+84.4%
Applied egg-rr84.4%
clear-num84.4%
un-div-inv84.4%
+-commutative84.4%
*-un-lft-identity84.4%
times-frac99.8%
/-rgt-identity99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 70.3%
Taylor expanded in x around 0 69.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -170000.0) (/ 1.0 (+ x 1.0)) (/ 1.0 (/ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -170000.0) {
tmp = 1.0 / (x + 1.0);
} 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 <= (-170000.0d0)) then
tmp = 1.0d0 / (x + 1.0d0)
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 <= -170000.0) {
tmp = 1.0 / (x + 1.0);
} else {
tmp = 1.0 / (y / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -170000.0: tmp = 1.0 / (x + 1.0) else: tmp = 1.0 / (y / x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -170000.0) tmp = Float64(1.0 / Float64(x + 1.0)); 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 <= -170000.0)
tmp = 1.0 / (x + 1.0);
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, -170000.0], N[(1.0 / N[(x + 1.0), $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 -170000:\\
\;\;\;\;\frac{1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\end{array}
\end{array}
if x < -1.7e5Initial program 70.1%
Taylor expanded in x around inf 66.6%
Taylor expanded in x around inf 63.8%
Taylor expanded in y around inf 6.4%
+-commutative6.4%
Simplified6.4%
if -1.7e5 < x Initial program 65.3%
associate-/l*82.1%
associate-+l+82.1%
Simplified82.1%
Taylor expanded in x around 0 60.7%
+-commutative60.7%
Simplified60.7%
Taylor expanded in y around 0 35.4%
clear-num35.3%
inv-pow35.3%
Applied egg-rr35.3%
unpow-135.3%
Simplified35.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -500000.0) (/ 1.0 (+ x 1.0)) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -500000.0) {
tmp = 1.0 / (x + 1.0);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-500000.0d0)) then
tmp = 1.0d0 / (x + 1.0d0)
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -500000.0) {
tmp = 1.0 / (x + 1.0);
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -500000.0: tmp = 1.0 / (x + 1.0) else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -500000.0) tmp = Float64(1.0 / Float64(x + 1.0)); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -500000.0)
tmp = 1.0 / (x + 1.0);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -500000.0], N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -500000:\\
\;\;\;\;\frac{1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -5e5Initial program 70.1%
Taylor expanded in x around inf 66.6%
Taylor expanded in x around inf 63.8%
Taylor expanded in y around inf 6.4%
+-commutative6.4%
Simplified6.4%
if -5e5 < x Initial program 65.3%
associate-/l*82.1%
associate-+l+82.1%
Simplified82.1%
Taylor expanded in x around 0 60.7%
+-commutative60.7%
Simplified60.7%
Taylor expanded in y around 0 35.4%
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 66.6%
associate-/l*81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around 0 47.9%
+-commutative47.9%
Simplified47.9%
Taylor expanded in y around 0 26.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 66.6%
associate-*l*66.6%
times-frac91.9%
associate-+r+91.9%
Applied egg-rr91.9%
Taylor expanded in y around inf 39.1%
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 2024137
(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))))