
(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 26 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)) (+ (+ y (+ x (+ x 1.0))) (* (/ x y) (+ x 1.0)))))
assert(x < y);
double code(double x, double y) {
return (x / (x + y)) / ((y + (x + (x + 1.0))) + ((x / y) * (x + 1.0)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (x + y)) / ((y + (x + (x + 1.0d0))) + ((x / y) * (x + 1.0d0)))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (x + y)) / ((y + (x + (x + 1.0))) + ((x / y) * (x + 1.0)));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (x + y)) / ((y + (x + (x + 1.0))) + ((x / y) * (x + 1.0)))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(x + y)) / Float64(Float64(y + Float64(x + Float64(x + 1.0))) + Float64(Float64(x / y) * Float64(x + 1.0)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (x + y)) / ((y + (x + (x + 1.0))) + ((x / y) * (x + 1.0)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + N[(x + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{x + y}}{\left(y + \left(x + \left(x + 1\right)\right)\right) + \frac{x}{y} \cdot \left(x + 1\right)}
\end{array}
Initial program 72.1%
associate-*l*72.1%
+-commutative72.1%
+-commutative72.1%
+-commutative72.1%
associate-*l*72.1%
*-commutative72.1%
associate-*r/81.4%
*-commutative81.4%
distribute-rgt1-in62.4%
fma-def81.4%
+-commutative81.4%
+-commutative81.4%
cube-unmult81.4%
+-commutative81.4%
Simplified81.4%
associate-*r/72.2%
*-commutative72.2%
fma-udef55.3%
cube-mult55.3%
distribute-rgt1-in72.1%
*-commutative72.1%
+-commutative72.1%
associate-+r+72.1%
frac-times88.2%
*-commutative88.2%
clear-num88.2%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in y around -inf 95.1%
associate-+r+95.1%
mul-1-neg95.1%
unsub-neg95.1%
neg-mul-195.1%
distribute-lft-in95.1%
metadata-eval95.1%
neg-mul-195.1%
+-commutative95.1%
+-commutative95.1%
unsub-neg95.1%
+-commutative95.1%
unsub-neg95.1%
+-commutative95.1%
*-commutative95.1%
associate-*r/99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= x -1.9e+146)
(/ 1.0 (* x (/ t_0 y)))
(if (<= x -4.5e-17)
(* (/ x (* (+ x y) (+ x y))) (/ y t_0))
(/ (/ y (+ x y)) (* (+ x y) (/ (+ y 1.0) x)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (x <= -1.9e+146) {
tmp = 1.0 / (x * (t_0 / y));
} else if (x <= -4.5e-17) {
tmp = (x / ((x + y) * (x + y))) * (y / t_0);
} else {
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y + (x + 1.0d0)
if (x <= (-1.9d+146)) then
tmp = 1.0d0 / (x * (t_0 / y))
else if (x <= (-4.5d-17)) then
tmp = (x / ((x + y) * (x + y))) * (y / t_0)
else
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0d0) / x))
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 (x <= -1.9e+146) {
tmp = 1.0 / (x * (t_0 / y));
} else if (x <= -4.5e-17) {
tmp = (x / ((x + y) * (x + y))) * (y / t_0);
} else {
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if x <= -1.9e+146: tmp = 1.0 / (x * (t_0 / y)) elif x <= -4.5e-17: tmp = (x / ((x + y) * (x + y))) * (y / t_0) else: tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (x <= -1.9e+146) tmp = Float64(1.0 / Float64(x * Float64(t_0 / y))); elseif (x <= -4.5e-17) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / t_0)); else tmp = Float64(Float64(y / Float64(x + y)) / Float64(Float64(x + y) * Float64(Float64(y + 1.0) / x))); 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 (x <= -1.9e+146)
tmp = 1.0 / (x * (t_0 / y));
elseif (x <= -4.5e-17)
tmp = (x / ((x + y) * (x + y))) * (y / t_0);
else
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.9e+146], N[(1.0 / N[(x * N[(t$95$0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e-17], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+146}:\\
\;\;\;\;\frac{1}{x \cdot \frac{t_0}{y}}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{\left(x + y\right) \cdot \frac{y + 1}{x}}\\
\end{array}
\end{array}
if x < -1.8999999999999999e146Initial program 59.8%
times-frac79.9%
+-commutative79.9%
associate-+l+79.9%
Simplified79.9%
Taylor expanded in x around inf 91.3%
*-commutative91.3%
clear-num91.3%
associate-+r+91.3%
+-commutative91.3%
associate-+r+91.3%
frac-times91.3%
metadata-eval91.3%
associate-+r+91.3%
+-commutative91.3%
associate-+r+91.3%
Applied egg-rr91.3%
if -1.8999999999999999e146 < x < -4.49999999999999978e-17Initial program 68.2%
times-frac93.5%
+-commutative93.5%
associate-+l+93.5%
Simplified93.5%
if -4.49999999999999978e-17 < x Initial program 74.8%
associate-*l*74.8%
+-commutative74.8%
+-commutative74.8%
+-commutative74.8%
*-commutative74.8%
associate-*l*74.8%
times-frac88.8%
+-commutative88.8%
+-commutative88.8%
associate-+l+88.8%
Simplified88.8%
Taylor expanded in x around 0 83.3%
+-commutative83.3%
Simplified83.3%
*-commutative83.3%
clear-num83.2%
associate-/r*91.4%
frac-times85.8%
*-un-lft-identity85.8%
+-commutative85.8%
+-commutative85.8%
Applied egg-rr85.8%
Final simplification87.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= x -8.8e+146)
(/ 1.0 (* x (/ t_0 y)))
(if (<= x -3.4e-17)
(* (/ x t_0) (/ y (* (+ x y) (+ x y))))
(/ (/ y (+ x y)) (* (+ x y) (/ (+ y 1.0) x)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (x <= -8.8e+146) {
tmp = 1.0 / (x * (t_0 / y));
} else if (x <= -3.4e-17) {
tmp = (x / t_0) * (y / ((x + y) * (x + y)));
} else {
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y + (x + 1.0d0)
if (x <= (-8.8d+146)) then
tmp = 1.0d0 / (x * (t_0 / y))
else if (x <= (-3.4d-17)) then
tmp = (x / t_0) * (y / ((x + y) * (x + y)))
else
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0d0) / x))
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 (x <= -8.8e+146) {
tmp = 1.0 / (x * (t_0 / y));
} else if (x <= -3.4e-17) {
tmp = (x / t_0) * (y / ((x + y) * (x + y)));
} else {
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if x <= -8.8e+146: tmp = 1.0 / (x * (t_0 / y)) elif x <= -3.4e-17: tmp = (x / t_0) * (y / ((x + y) * (x + y))) else: tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (x <= -8.8e+146) tmp = Float64(1.0 / Float64(x * Float64(t_0 / y))); elseif (x <= -3.4e-17) tmp = Float64(Float64(x / t_0) * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(y / Float64(x + y)) / Float64(Float64(x + y) * Float64(Float64(y + 1.0) / x))); 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 (x <= -8.8e+146)
tmp = 1.0 / (x * (t_0 / y));
elseif (x <= -3.4e-17)
tmp = (x / t_0) * (y / ((x + y) * (x + y)));
else
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.8e+146], N[(1.0 / N[(x * N[(t$95$0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.4e-17], N[(N[(x / t$95$0), $MachinePrecision] * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{+146}:\\
\;\;\;\;\frac{1}{x \cdot \frac{t_0}{y}}\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{t_0} \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{\left(x + y\right) \cdot \frac{y + 1}{x}}\\
\end{array}
\end{array}
if x < -8.7999999999999992e146Initial program 59.8%
times-frac79.9%
+-commutative79.9%
associate-+l+79.9%
Simplified79.9%
Taylor expanded in x around inf 91.3%
*-commutative91.3%
clear-num91.3%
associate-+r+91.3%
+-commutative91.3%
associate-+r+91.3%
frac-times91.3%
metadata-eval91.3%
associate-+r+91.3%
+-commutative91.3%
associate-+r+91.3%
Applied egg-rr91.3%
if -8.7999999999999992e146 < x < -3.3999999999999998e-17Initial program 68.2%
associate-*l*68.2%
+-commutative68.2%
+-commutative68.2%
+-commutative68.2%
*-commutative68.2%
associate-*l*68.2%
times-frac93.5%
+-commutative93.5%
+-commutative93.5%
associate-+l+93.5%
Simplified93.5%
if -3.3999999999999998e-17 < x Initial program 74.8%
associate-*l*74.8%
+-commutative74.8%
+-commutative74.8%
+-commutative74.8%
*-commutative74.8%
associate-*l*74.8%
times-frac88.8%
+-commutative88.8%
+-commutative88.8%
associate-+l+88.8%
Simplified88.8%
Taylor expanded in x around 0 83.3%
+-commutative83.3%
Simplified83.3%
*-commutative83.3%
clear-num83.2%
associate-/r*91.4%
frac-times85.8%
*-un-lft-identity85.8%
+-commutative85.8%
+-commutative85.8%
Applied egg-rr85.8%
Final simplification87.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (* (/ y (+ x y)) (/ 1.0 (+ x y))) (/ x (+ y (+ x 1.0)))))
assert(x < y);
double code(double x, double y) {
return ((y / (x + y)) * (1.0 / (x + y))) * (x / (y + (x + 1.0)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (x + y)) * (1.0d0 / (x + y))) * (x / (y + (x + 1.0d0)))
end function
assert x < y;
public static double code(double x, double y) {
return ((y / (x + y)) * (1.0 / (x + y))) * (x / (y + (x + 1.0)));
}
[x, y] = sort([x, y]) def code(x, y): return ((y / (x + y)) * (1.0 / (x + y))) * (x / (y + (x + 1.0)))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(y / Float64(x + y)) * Float64(1.0 / Float64(x + y))) * Float64(x / Float64(y + Float64(x + 1.0)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((y / (x + y)) * (1.0 / (x + y))) * (x / (y + (x + 1.0)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\left(\frac{y}{x + y} \cdot \frac{1}{x + y}\right) \cdot \frac{x}{y + \left(x + 1\right)}
\end{array}
Initial program 72.1%
associate-*l*72.1%
+-commutative72.1%
+-commutative72.1%
+-commutative72.1%
*-commutative72.1%
associate-*l*72.1%
times-frac88.3%
+-commutative88.3%
+-commutative88.3%
associate-+l+88.3%
Simplified88.3%
associate-/r*64.5%
div-inv64.5%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 1.0 (+ x y))))
(if (<= y -2.1e-293)
(/ 1.0 (* (/ x y) (+ x 1.0)))
(if (<= y 5.2e-15) (* x (* (/ y (+ x y)) t_0)) (/ (* x t_0) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double t_0 = 1.0 / (x + y);
double tmp;
if (y <= -2.1e-293) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else if (y <= 5.2e-15) {
tmp = x * ((y / (x + y)) * t_0);
} else {
tmp = (x * t_0) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (x + y)
if (y <= (-2.1d-293)) then
tmp = 1.0d0 / ((x / y) * (x + 1.0d0))
else if (y <= 5.2d-15) then
tmp = x * ((y / (x + y)) * t_0)
else
tmp = (x * t_0) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = 1.0 / (x + y);
double tmp;
if (y <= -2.1e-293) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else if (y <= 5.2e-15) {
tmp = x * ((y / (x + y)) * t_0);
} else {
tmp = (x * t_0) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = 1.0 / (x + y) tmp = 0 if y <= -2.1e-293: tmp = 1.0 / ((x / y) * (x + 1.0)) elif y <= 5.2e-15: tmp = x * ((y / (x + y)) * t_0) else: tmp = (x * t_0) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(1.0 / Float64(x + y)) tmp = 0.0 if (y <= -2.1e-293) tmp = Float64(1.0 / Float64(Float64(x / y) * Float64(x + 1.0))); elseif (y <= 5.2e-15) tmp = Float64(x * Float64(Float64(y / Float64(x + y)) * t_0)); else tmp = Float64(Float64(x * t_0) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = 1.0 / (x + y);
tmp = 0.0;
if (y <= -2.1e-293)
tmp = 1.0 / ((x / y) * (x + 1.0));
elseif (y <= 5.2e-15)
tmp = x * ((y / (x + y)) * t_0);
else
tmp = (x * t_0) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e-293], N[(1.0 / N[(N[(x / y), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-15], N[(x * N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$0), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{1}{x + y}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-293}:\\
\;\;\;\;\frac{1}{\frac{x}{y} \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left(\frac{y}{x + y} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot t_0}{y + 1}\\
\end{array}
\end{array}
if y < -2.10000000000000005e-293Initial program 70.6%
times-frac88.1%
+-commutative88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 43.8%
associate-/r*49.3%
+-commutative49.3%
Simplified49.3%
clear-num49.3%
inv-pow49.3%
div-inv49.3%
clear-num49.3%
Applied egg-rr49.3%
unpow-149.3%
*-commutative49.3%
Simplified49.3%
if -2.10000000000000005e-293 < y < 5.20000000000000009e-15Initial program 73.4%
associate-*l*73.4%
+-commutative73.4%
+-commutative73.4%
+-commutative73.4%
*-commutative73.4%
associate-*l*73.4%
times-frac81.8%
+-commutative81.8%
+-commutative81.8%
associate-+l+81.8%
Simplified81.8%
Taylor expanded in x around 0 65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in y around 0 65.2%
associate-/r*83.2%
div-inv83.2%
Applied egg-rr83.2%
if 5.20000000000000009e-15 < y Initial program 73.7%
associate-*l*73.6%
+-commutative73.6%
+-commutative73.6%
+-commutative73.6%
associate-*l*73.7%
*-commutative73.7%
associate-*r/82.3%
*-commutative82.3%
distribute-rgt1-in79.6%
fma-def82.3%
+-commutative82.3%
+-commutative82.3%
cube-unmult82.4%
+-commutative82.4%
Simplified82.4%
associate-*r/73.7%
*-commutative73.7%
fma-udef73.6%
cube-mult73.6%
distribute-rgt1-in73.7%
*-commutative73.7%
+-commutative73.7%
associate-+r+73.7%
frac-times93.6%
*-commutative93.6%
clear-num93.6%
associate-/r*99.8%
frac-times99.8%
*-un-lft-identity99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
Simplified78.9%
div-inv78.9%
Applied egg-rr78.9%
Final simplification65.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -1e-294)
(/ 1.0 (* (/ x y) (+ x 1.0)))
(if (<= y 2.8e-13)
(* x (* (/ y (+ x y)) (/ 1.0 (+ x y))))
(/ (/ x (+ x y)) (+ y (+ x (+ x 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1e-294) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else if (y <= 2.8e-13) {
tmp = x * ((y / (x + y)) * (1.0 / (x + y)));
} else {
tmp = (x / (x + y)) / (y + (x + (x + 1.0)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1d-294)) then
tmp = 1.0d0 / ((x / y) * (x + 1.0d0))
else if (y <= 2.8d-13) then
tmp = x * ((y / (x + y)) * (1.0d0 / (x + y)))
else
tmp = (x / (x + y)) / (y + (x + (x + 1.0d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -1e-294) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else if (y <= 2.8e-13) {
tmp = x * ((y / (x + y)) * (1.0 / (x + y)));
} else {
tmp = (x / (x + y)) / (y + (x + (x + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1e-294: tmp = 1.0 / ((x / y) * (x + 1.0)) elif y <= 2.8e-13: tmp = x * ((y / (x + y)) * (1.0 / (x + y))) else: tmp = (x / (x + y)) / (y + (x + (x + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1e-294) tmp = Float64(1.0 / Float64(Float64(x / y) * Float64(x + 1.0))); elseif (y <= 2.8e-13) tmp = Float64(x * Float64(Float64(y / Float64(x + y)) * Float64(1.0 / Float64(x + y)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + Float64(x + Float64(x + 1.0)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -1e-294)
tmp = 1.0 / ((x / y) * (x + 1.0));
elseif (y <= 2.8e-13)
tmp = x * ((y / (x + y)) * (1.0 / (x + y)));
else
tmp = (x / (x + y)) / (y + (x + (x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -1e-294], N[(1.0 / N[(N[(x / y), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-13], N[(x * N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-294}:\\
\;\;\;\;\frac{1}{\frac{x}{y} \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \left(\frac{y}{x + y} \cdot \frac{1}{x + y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + \left(x + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if y < -1.00000000000000002e-294Initial program 70.8%
times-frac88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around 0 44.2%
associate-/r*49.7%
+-commutative49.7%
Simplified49.7%
clear-num49.7%
inv-pow49.7%
div-inv49.7%
clear-num49.7%
Applied egg-rr49.7%
unpow-149.7%
*-commutative49.7%
Simplified49.7%
if -1.00000000000000002e-294 < y < 2.8000000000000002e-13Initial program 72.9%
associate-*l*72.9%
+-commutative72.9%
+-commutative72.9%
+-commutative72.9%
*-commutative72.9%
associate-*l*72.9%
times-frac81.5%
+-commutative81.5%
+-commutative81.5%
associate-+l+81.5%
Simplified81.5%
Taylor expanded in x around 0 64.6%
+-commutative64.6%
Simplified64.6%
Taylor expanded in y around 0 64.6%
associate-/r*82.9%
div-inv82.9%
Applied egg-rr82.9%
if 2.8000000000000002e-13 < y Initial program 73.7%
associate-*l*73.6%
+-commutative73.6%
+-commutative73.6%
+-commutative73.6%
associate-*l*73.7%
*-commutative73.7%
associate-*r/82.3%
*-commutative82.3%
distribute-rgt1-in79.6%
fma-def82.3%
+-commutative82.3%
+-commutative82.3%
cube-unmult82.4%
+-commutative82.4%
Simplified82.4%
associate-*r/73.7%
*-commutative73.7%
fma-udef73.6%
cube-mult73.6%
distribute-rgt1-in73.7%
*-commutative73.7%
+-commutative73.7%
associate-+r+73.7%
frac-times93.6%
*-commutative93.6%
clear-num93.6%
associate-/r*99.8%
frac-times99.8%
*-un-lft-identity99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in y around -inf 80.1%
mul-1-neg80.1%
unsub-neg80.1%
neg-mul-180.1%
distribute-lft-in80.1%
metadata-eval80.1%
neg-mul-180.1%
+-commutative80.1%
+-commutative80.1%
unsub-neg80.1%
+-commutative80.1%
unsub-neg80.1%
Simplified80.1%
Final simplification66.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.4e-6) (* (/ y (+ y (+ x 1.0))) (/ 1.0 x)) (/ (* x (/ y (+ x y))) (* (+ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.4e-6) {
tmp = (y / (y + (x + 1.0))) * (1.0 / x);
} else {
tmp = (x * (y / (x + y))) / ((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.4d-6)) then
tmp = (y / (y + (x + 1.0d0))) * (1.0d0 / x)
else
tmp = (x * (y / (x + y))) / ((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.4e-6) {
tmp = (y / (y + (x + 1.0))) * (1.0 / x);
} else {
tmp = (x * (y / (x + y))) / ((x + y) * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.4e-6: tmp = (y / (y + (x + 1.0))) * (1.0 / x) else: tmp = (x * (y / (x + y))) / ((x + y) * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.4e-6) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) * Float64(1.0 / x)); else tmp = Float64(Float64(x * Float64(y / Float64(x + y))) / Float64(Float64(x + y) * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.4e-6)
tmp = (y / (y + (x + 1.0))) * (1.0 / x);
else
tmp = (x * (y / (x + y))) / ((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.4e-6], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-6}:\\
\;\;\;\;\frac{y}{y + \left(x + 1\right)} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{x + y}}{\left(x + y\right) \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -2.3999999999999999e-6Initial program 63.9%
times-frac86.5%
+-commutative86.5%
associate-+l+86.5%
Simplified86.5%
Taylor expanded in x around inf 80.7%
if -2.3999999999999999e-6 < x Initial program 74.8%
associate-*l*74.8%
+-commutative74.8%
+-commutative74.8%
+-commutative74.8%
*-commutative74.8%
associate-*l*74.8%
times-frac88.8%
+-commutative88.8%
+-commutative88.8%
associate-+l+88.8%
Simplified88.8%
Taylor expanded in x around 0 83.3%
+-commutative83.3%
Simplified83.3%
associate-/r*91.4%
frac-times87.6%
+-commutative87.6%
+-commutative87.6%
Applied egg-rr87.6%
Final simplification85.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.56e-24) (* (/ y (+ y (+ x 1.0))) (/ 1.0 x)) (/ (/ x (+ x y)) (* (+ x y) (/ (+ y 1.0) y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.56e-24) {
tmp = (y / (y + (x + 1.0))) * (1.0 / 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 <= (-1.56d-24)) then
tmp = (y / (y + (x + 1.0d0))) * (1.0d0 / 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 <= -1.56e-24) {
tmp = (y / (y + (x + 1.0))) * (1.0 / 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 <= -1.56e-24: tmp = (y / (y + (x + 1.0))) * (1.0 / 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 <= -1.56e-24) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) * Float64(1.0 / 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 <= -1.56e-24)
tmp = (y / (y + (x + 1.0))) * (1.0 / 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, -1.56e-24], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $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 -1.56 \cdot 10^{-24}:\\
\;\;\;\;\frac{y}{y + \left(x + 1\right)} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{\left(x + y\right) \cdot \frac{y + 1}{y}}\\
\end{array}
\end{array}
if x < -1.56e-24Initial program 65.0%
times-frac86.9%
+-commutative86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in x around inf 79.8%
if -1.56e-24 < x Initial program 74.5%
associate-*l*74.5%
+-commutative74.5%
+-commutative74.5%
+-commutative74.5%
associate-*l*74.5%
*-commutative74.5%
associate-*r/83.4%
*-commutative83.4%
distribute-rgt1-in71.4%
fma-def83.4%
+-commutative83.4%
+-commutative83.4%
cube-unmult83.5%
+-commutative83.5%
Simplified83.5%
associate-*r/74.5%
*-commutative74.5%
fma-udef62.5%
cube-mult62.5%
distribute-rgt1-in74.5%
*-commutative74.5%
+-commutative74.5%
associate-+r+74.5%
frac-times88.7%
*-commutative88.7%
clear-num88.7%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 85.7%
+-commutative85.7%
Simplified85.7%
Final simplification84.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.4e-18) (/ 1.0 (* x (/ (+ y (+ x 1.0)) y))) (/ (/ y (+ x y)) (* (+ x y) (/ (+ y 1.0) x)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.4e-18) {
tmp = 1.0 / (x * ((y + (x + 1.0)) / y));
} else {
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / 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 <= (-2.4d-18)) then
tmp = 1.0d0 / (x * ((y + (x + 1.0d0)) / y))
else
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0d0) / x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.4e-18) {
tmp = 1.0 / (x * ((y + (x + 1.0)) / y));
} else {
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.4e-18: tmp = 1.0 / (x * ((y + (x + 1.0)) / y)) else: tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / x)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.4e-18) tmp = Float64(1.0 / Float64(x * Float64(Float64(y + Float64(x + 1.0)) / y))); else tmp = Float64(Float64(y / Float64(x + y)) / Float64(Float64(x + y) * Float64(Float64(y + 1.0) / x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.4e-18)
tmp = 1.0 / (x * ((y + (x + 1.0)) / y));
else
tmp = (y / (x + y)) / ((x + y) * ((y + 1.0) / 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, -2.4e-18], N[(1.0 / N[(x * N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-18}:\\
\;\;\;\;\frac{1}{x \cdot \frac{y + \left(x + 1\right)}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{\left(x + y\right) \cdot \frac{y + 1}{x}}\\
\end{array}
\end{array}
if x < -2.39999999999999994e-18Initial program 64.5%
times-frac86.7%
+-commutative86.7%
associate-+l+86.7%
Simplified86.7%
Taylor expanded in x around inf 79.5%
*-commutative79.5%
clear-num79.4%
associate-+r+79.4%
+-commutative79.4%
associate-+r+79.4%
frac-times79.3%
metadata-eval79.3%
associate-+r+79.3%
+-commutative79.3%
associate-+r+79.3%
Applied egg-rr79.3%
if -2.39999999999999994e-18 < x Initial program 74.6%
associate-*l*74.6%
+-commutative74.6%
+-commutative74.6%
+-commutative74.6%
*-commutative74.6%
associate-*l*74.6%
times-frac88.8%
+-commutative88.8%
+-commutative88.8%
associate-+l+88.8%
Simplified88.8%
Taylor expanded in x around 0 83.2%
+-commutative83.2%
Simplified83.2%
*-commutative83.2%
clear-num83.1%
associate-/r*91.3%
frac-times85.7%
*-un-lft-identity85.7%
+-commutative85.7%
+-commutative85.7%
Applied egg-rr85.7%
Final simplification84.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (/ x (+ x y)) (* (+ x y) (/ (+ x (+ y 1.0)) y))))
assert(x < y);
double code(double x, double y) {
return (x / (x + y)) / ((x + y) * ((x + (y + 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 = (x / (x + y)) / ((x + y) * ((x + (y + 1.0d0)) / y))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (x + y)) / ((x + y) * ((x + (y + 1.0)) / y));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (x + y)) / ((x + y) * ((x + (y + 1.0)) / y))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(x + y)) / Float64(Float64(x + y) * Float64(Float64(x + Float64(y + 1.0)) / y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (x + y)) / ((x + y) * ((x + (y + 1.0)) / 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[(x + y), $MachinePrecision] * N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{x + y}}{\left(x + y\right) \cdot \frac{x + \left(y + 1\right)}{y}}
\end{array}
Initial program 72.1%
associate-*l*72.1%
+-commutative72.1%
+-commutative72.1%
+-commutative72.1%
associate-*l*72.1%
*-commutative72.1%
associate-*r/81.4%
*-commutative81.4%
distribute-rgt1-in62.4%
fma-def81.4%
+-commutative81.4%
+-commutative81.4%
cube-unmult81.4%
+-commutative81.4%
Simplified81.4%
associate-*r/72.2%
*-commutative72.2%
fma-udef55.3%
cube-mult55.3%
distribute-rgt1-in72.1%
*-commutative72.1%
+-commutative72.1%
associate-+r+72.1%
frac-times88.2%
*-commutative88.2%
clear-num88.2%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (/ y (+ x y)) (* (+ x y) (/ (+ x (+ y 1.0)) x))))
assert(x < y);
double code(double x, double y) {
return (y / (x + y)) / ((x + y) * ((x + (y + 1.0)) / x));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (x + y)) / ((x + y) * ((x + (y + 1.0d0)) / x))
end function
assert x < y;
public static double code(double x, double y) {
return (y / (x + y)) / ((x + y) * ((x + (y + 1.0)) / x));
}
[x, y] = sort([x, y]) def code(x, y): return (y / (x + y)) / ((x + y) * ((x + (y + 1.0)) / x))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y / Float64(x + y)) / Float64(Float64(x + y) * Float64(Float64(x + Float64(y + 1.0)) / x))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y / (x + y)) / ((x + y) * ((x + (y + 1.0)) / x));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{x + y}}{\left(x + y\right) \cdot \frac{x + \left(y + 1\right)}{x}}
\end{array}
Initial program 72.1%
associate-*l*72.1%
+-commutative72.1%
+-commutative72.1%
+-commutative72.1%
associate-*l*72.1%
*-commutative72.1%
associate-*r/81.4%
*-commutative81.4%
distribute-rgt1-in62.4%
fma-def81.4%
+-commutative81.4%
+-commutative81.4%
cube-unmult81.4%
+-commutative81.4%
Simplified81.4%
associate-*r/72.2%
fma-udef55.3%
cube-mult55.3%
distribute-rgt1-in72.1%
*-commutative72.1%
+-commutative72.1%
associate-+r+72.1%
frac-times88.3%
*-commutative88.3%
associate-/r*99.7%
clear-num99.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 1.05e-106)
(/ (/ y x) (+ x 1.0))
(if (<= y 5.2e-15)
(* x (/ y (* (+ x y) (+ x y))))
(/ (/ x (+ x y)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.05e-106) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 5.2e-15) {
tmp = x * (y / ((x + y) * (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 (y <= 1.05d-106) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 5.2d-15) then
tmp = x * (y / ((x + y) * (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 (y <= 1.05e-106) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 5.2e-15) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.05e-106: tmp = (y / x) / (x + 1.0) elif y <= 5.2e-15: tmp = x * (y / ((x + y) * (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 (y <= 1.05e-106) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 5.2e-15) tmp = Float64(x * Float64(y / Float64(Float64(x + y) * 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 (y <= 1.05e-106)
tmp = (y / x) / (x + 1.0);
elseif (y <= 5.2e-15)
tmp = x * (y / ((x + y) * (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[y, 1.05e-106], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-15], N[(x * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.05 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if y < 1.05000000000000002e-106Initial program 69.2%
times-frac84.7%
+-commutative84.7%
associate-+l+84.7%
Simplified84.7%
Taylor expanded in y around 0 53.9%
associate-/r*58.0%
+-commutative58.0%
Simplified58.0%
if 1.05000000000000002e-106 < y < 5.20000000000000009e-15Initial program 94.1%
associate-*l*94.1%
+-commutative94.1%
+-commutative94.1%
+-commutative94.1%
*-commutative94.1%
associate-*l*94.1%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 79.3%
+-commutative79.3%
Simplified79.3%
Taylor expanded in y around 0 79.3%
if 5.20000000000000009e-15 < y Initial program 73.7%
associate-*l*73.6%
+-commutative73.6%
+-commutative73.6%
+-commutative73.6%
associate-*l*73.7%
*-commutative73.7%
associate-*r/82.3%
*-commutative82.3%
distribute-rgt1-in79.6%
fma-def82.3%
+-commutative82.3%
+-commutative82.3%
cube-unmult82.4%
+-commutative82.4%
Simplified82.4%
associate-*r/73.7%
*-commutative73.7%
fma-udef73.6%
cube-mult73.6%
distribute-rgt1-in73.7%
*-commutative73.7%
+-commutative73.7%
associate-+r+73.7%
frac-times93.6%
*-commutative93.6%
clear-num93.6%
associate-/r*99.8%
frac-times99.8%
*-un-lft-identity99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
Simplified78.9%
Final simplification65.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -2.2e-293)
(/ 1.0 (* (/ x y) (+ x 1.0)))
(if (<= y 5.2e-15)
(* x (/ (/ y (+ x y)) (+ x y)))
(/ (/ x (+ x y)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.2e-293) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else if (y <= 5.2e-15) {
tmp = x * ((y / (x + y)) / (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 (y <= (-2.2d-293)) then
tmp = 1.0d0 / ((x / y) * (x + 1.0d0))
else if (y <= 5.2d-15) then
tmp = x * ((y / (x + y)) / (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 (y <= -2.2e-293) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else if (y <= 5.2e-15) {
tmp = x * ((y / (x + y)) / (x + y));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -2.2e-293: tmp = 1.0 / ((x / y) * (x + 1.0)) elif y <= 5.2e-15: tmp = x * ((y / (x + y)) / (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 (y <= -2.2e-293) tmp = Float64(1.0 / Float64(Float64(x / y) * Float64(x + 1.0))); elseif (y <= 5.2e-15) tmp = Float64(x * Float64(Float64(y / Float64(x + y)) / 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 (y <= -2.2e-293)
tmp = 1.0 / ((x / y) * (x + 1.0));
elseif (y <= 5.2e-15)
tmp = x * ((y / (x + y)) / (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[y, -2.2e-293], N[(1.0 / N[(N[(x / y), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-15], N[(x * N[(N[(y / N[(x + y), $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}\;y \leq -2.2 \cdot 10^{-293}:\\
\;\;\;\;\frac{1}{\frac{x}{y} \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{\frac{y}{x + y}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if y < -2.2e-293Initial program 70.6%
times-frac88.1%
+-commutative88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 43.8%
associate-/r*49.3%
+-commutative49.3%
Simplified49.3%
clear-num49.3%
inv-pow49.3%
div-inv49.3%
clear-num49.3%
Applied egg-rr49.3%
unpow-149.3%
*-commutative49.3%
Simplified49.3%
if -2.2e-293 < y < 5.20000000000000009e-15Initial program 73.4%
associate-*l*73.4%
+-commutative73.4%
+-commutative73.4%
+-commutative73.4%
*-commutative73.4%
associate-*l*73.4%
times-frac81.8%
+-commutative81.8%
+-commutative81.8%
associate-+l+81.8%
Simplified81.8%
Taylor expanded in x around 0 65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in y around 0 65.2%
associate-/r*83.2%
div-inv83.2%
Applied egg-rr83.2%
associate-*r/83.2%
*-rgt-identity83.2%
Simplified83.2%
if 5.20000000000000009e-15 < y Initial program 73.7%
associate-*l*73.6%
+-commutative73.6%
+-commutative73.6%
+-commutative73.6%
associate-*l*73.7%
*-commutative73.7%
associate-*r/82.3%
*-commutative82.3%
distribute-rgt1-in79.6%
fma-def82.3%
+-commutative82.3%
+-commutative82.3%
cube-unmult82.4%
+-commutative82.4%
Simplified82.4%
associate-*r/73.7%
*-commutative73.7%
fma-udef73.6%
cube-mult73.6%
distribute-rgt1-in73.7%
*-commutative73.7%
+-commutative73.7%
associate-+r+73.7%
frac-times93.6%
*-commutative93.6%
clear-num93.6%
associate-/r*99.8%
frac-times99.8%
*-un-lft-identity99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
Simplified78.9%
Final simplification65.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -9.2e-296)
(/ 1.0 (* (/ x y) (+ x 1.0)))
(if (<= y 5e-15)
(* x (/ (/ y (+ x y)) (+ x y)))
(/ (* x (/ 1.0 (+ x y))) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -9.2e-296) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else if (y <= 5e-15) {
tmp = x * ((y / (x + y)) / (x + y));
} else {
tmp = (x * (1.0 / (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 <= (-9.2d-296)) then
tmp = 1.0d0 / ((x / y) * (x + 1.0d0))
else if (y <= 5d-15) then
tmp = x * ((y / (x + y)) / (x + y))
else
tmp = (x * (1.0d0 / (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 <= -9.2e-296) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else if (y <= 5e-15) {
tmp = x * ((y / (x + y)) / (x + y));
} else {
tmp = (x * (1.0 / (x + y))) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -9.2e-296: tmp = 1.0 / ((x / y) * (x + 1.0)) elif y <= 5e-15: tmp = x * ((y / (x + y)) / (x + y)) else: tmp = (x * (1.0 / (x + y))) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -9.2e-296) tmp = Float64(1.0 / Float64(Float64(x / y) * Float64(x + 1.0))); elseif (y <= 5e-15) tmp = Float64(x * Float64(Float64(y / Float64(x + y)) / Float64(x + y))); else tmp = Float64(Float64(x * Float64(1.0 / 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 <= -9.2e-296)
tmp = 1.0 / ((x / y) * (x + 1.0));
elseif (y <= 5e-15)
tmp = x * ((y / (x + y)) / (x + y));
else
tmp = (x * (1.0 / (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, -9.2e-296], N[(1.0 / N[(N[(x / y), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-15], N[(x * N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{-296}:\\
\;\;\;\;\frac{1}{\frac{x}{y} \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{\frac{y}{x + y}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{x + y}}{y + 1}\\
\end{array}
\end{array}
if y < -9.20000000000000016e-296Initial program 70.8%
times-frac88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around 0 44.2%
associate-/r*49.7%
+-commutative49.7%
Simplified49.7%
clear-num49.7%
inv-pow49.7%
div-inv49.7%
clear-num49.7%
Applied egg-rr49.7%
unpow-149.7%
*-commutative49.7%
Simplified49.7%
if -9.20000000000000016e-296 < y < 4.99999999999999999e-15Initial program 72.9%
associate-*l*72.9%
+-commutative72.9%
+-commutative72.9%
+-commutative72.9%
*-commutative72.9%
associate-*l*72.9%
times-frac81.5%
+-commutative81.5%
+-commutative81.5%
associate-+l+81.5%
Simplified81.5%
Taylor expanded in x around 0 64.6%
+-commutative64.6%
Simplified64.6%
Taylor expanded in y around 0 64.6%
associate-/r*82.9%
div-inv82.9%
Applied egg-rr82.9%
associate-*r/82.9%
*-rgt-identity82.9%
Simplified82.9%
if 4.99999999999999999e-15 < y Initial program 73.7%
associate-*l*73.6%
+-commutative73.6%
+-commutative73.6%
+-commutative73.6%
associate-*l*73.7%
*-commutative73.7%
associate-*r/82.3%
*-commutative82.3%
distribute-rgt1-in79.6%
fma-def82.3%
+-commutative82.3%
+-commutative82.3%
cube-unmult82.4%
+-commutative82.4%
Simplified82.4%
associate-*r/73.7%
*-commutative73.7%
fma-udef73.6%
cube-mult73.6%
distribute-rgt1-in73.7%
*-commutative73.7%
+-commutative73.7%
associate-+r+73.7%
frac-times93.6%
*-commutative93.6%
clear-num93.6%
associate-/r*99.8%
frac-times99.8%
*-un-lft-identity99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
Simplified78.9%
div-inv78.9%
Applied egg-rr78.9%
Final simplification65.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -8.2e-37) (* (/ y (+ y (+ x 1.0))) (/ 1.0 x)) (/ (/ x (+ x y)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -8.2e-37) {
tmp = (y / (y + (x + 1.0))) * (1.0 / x);
} 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 <= (-8.2d-37)) then
tmp = (y / (y + (x + 1.0d0))) * (1.0d0 / x)
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 <= -8.2e-37) {
tmp = (y / (y + (x + 1.0))) * (1.0 / x);
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -8.2e-37: tmp = (y / (y + (x + 1.0))) * (1.0 / x) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -8.2e-37) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) * Float64(1.0 / x)); 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 <= -8.2e-37)
tmp = (y / (y + (x + 1.0))) * (1.0 / x);
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, -8.2e-37], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $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 -8.2 \cdot 10^{-37}:\\
\;\;\;\;\frac{y}{y + \left(x + 1\right)} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -8.1999999999999996e-37Initial program 65.0%
times-frac86.9%
+-commutative86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in x around inf 79.8%
if -8.1999999999999996e-37 < x Initial program 74.5%
associate-*l*74.5%
+-commutative74.5%
+-commutative74.5%
+-commutative74.5%
associate-*l*74.5%
*-commutative74.5%
associate-*r/83.4%
*-commutative83.4%
distribute-rgt1-in71.4%
fma-def83.4%
+-commutative83.4%
+-commutative83.4%
cube-unmult83.5%
+-commutative83.5%
Simplified83.5%
associate-*r/74.5%
*-commutative74.5%
fma-udef62.5%
cube-mult62.5%
distribute-rgt1-in74.5%
*-commutative74.5%
+-commutative74.5%
associate-+r+74.5%
frac-times88.7%
*-commutative88.7%
clear-num88.7%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 64.2%
+-commutative64.2%
Simplified64.2%
Final simplification68.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.5e+184) (* (/ 1.0 x) (/ y x)) (if (<= x -8.5e-37) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.5e+184) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -8.5e-37) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.5d+184)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-8.5d-37)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.5e+184) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -8.5e-37) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.5e+184: tmp = (1.0 / x) * (y / x) elif x <= -8.5e-37: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.5e+184) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -8.5e-37) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.5e+184)
tmp = (1.0 / x) * (y / x);
elseif (x <= -8.5e-37)
tmp = y / (x * (x + 1.0));
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.5e+184], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-37], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+184}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-37}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -2.4999999999999999e184Initial program 60.3%
times-frac81.7%
+-commutative81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around inf 96.4%
Taylor expanded in x around inf 96.2%
if -2.4999999999999999e184 < x < -8.5000000000000007e-37Initial program 68.1%
times-frac90.2%
+-commutative90.2%
associate-+l+90.2%
Simplified90.2%
Taylor expanded in y around 0 68.7%
if -8.5000000000000007e-37 < x Initial program 74.5%
times-frac88.7%
+-commutative88.7%
associate-+l+88.7%
Simplified88.7%
Taylor expanded in x around 0 63.7%
+-commutative63.7%
Simplified63.7%
Final simplification67.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.9e+183) (* (/ 1.0 x) (/ y x)) (if (<= x -3.8e-37) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.9e+183) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -3.8e-37) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.9d+183)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-3.8d-37)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.9e+183) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -3.8e-37) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.9e+183: tmp = (1.0 / x) * (y / x) elif x <= -3.8e-37: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.9e+183) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -3.8e-37) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.9e+183)
tmp = (1.0 / x) * (y / x);
elseif (x <= -3.8e-37)
tmp = y / (x * (x + 1.0));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.9e+183], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.8e-37], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+183}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-37}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.9000000000000001e183Initial program 60.3%
times-frac81.7%
+-commutative81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around inf 96.4%
Taylor expanded in x around inf 96.2%
if -2.9000000000000001e183 < x < -3.8000000000000004e-37Initial program 68.1%
times-frac90.2%
+-commutative90.2%
associate-+l+90.2%
Simplified90.2%
Taylor expanded in y around 0 68.7%
if -3.8000000000000004e-37 < x Initial program 74.5%
associate-*l*74.5%
+-commutative74.5%
+-commutative74.5%
+-commutative74.5%
associate-*l*74.5%
*-commutative74.5%
associate-*r/83.4%
*-commutative83.4%
distribute-rgt1-in71.4%
fma-def83.4%
+-commutative83.4%
+-commutative83.4%
cube-unmult83.5%
+-commutative83.5%
Simplified83.5%
associate-*r/74.5%
*-commutative74.5%
fma-udef62.5%
cube-mult62.5%
distribute-rgt1-in74.5%
*-commutative74.5%
+-commutative74.5%
associate-+r+74.5%
frac-times88.7%
*-commutative88.7%
clear-num88.7%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 64.2%
+-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 63.8%
Final simplification67.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.05e-36) (/ 1.0 (* (/ x y) (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.05e-36) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.05d-36)) then
tmp = 1.0d0 / ((x / y) * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.05e-36) {
tmp = 1.0 / ((x / y) * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.05e-36: tmp = 1.0 / ((x / y) * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.05e-36) tmp = Float64(1.0 / Float64(Float64(x / y) * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.05e-36)
tmp = 1.0 / ((x / y) * (x + 1.0));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.05e-36], N[(1.0 / N[(N[(x / y), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-36}:\\
\;\;\;\;\frac{1}{\frac{x}{y} \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.04999999999999995e-36Initial program 65.0%
times-frac86.9%
+-commutative86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in y around 0 73.8%
associate-/r*79.3%
+-commutative79.3%
Simplified79.3%
clear-num79.2%
inv-pow79.2%
div-inv79.2%
clear-num79.2%
Applied egg-rr79.2%
unpow-179.2%
*-commutative79.2%
Simplified79.2%
if -1.04999999999999995e-36 < x Initial program 74.5%
associate-*l*74.5%
+-commutative74.5%
+-commutative74.5%
+-commutative74.5%
associate-*l*74.5%
*-commutative74.5%
associate-*r/83.4%
*-commutative83.4%
distribute-rgt1-in71.4%
fma-def83.4%
+-commutative83.4%
+-commutative83.4%
cube-unmult83.5%
+-commutative83.5%
Simplified83.5%
associate-*r/74.5%
*-commutative74.5%
fma-udef62.5%
cube-mult62.5%
distribute-rgt1-in74.5%
*-commutative74.5%
+-commutative74.5%
associate-+r+74.5%
frac-times88.7%
*-commutative88.7%
clear-num88.7%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 64.2%
+-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 63.8%
Final simplification67.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.9e-104) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ x y)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.9e-104) {
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 (y <= 1.9d-104) 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 (y <= 1.9e-104) {
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 y <= 1.9e-104: 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 (y <= 1.9e-104) 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 (y <= 1.9e-104)
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[y, 1.9e-104], 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}\;y \leq 1.9 \cdot 10^{-104}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if y < 1.9e-104Initial program 69.2%
times-frac84.7%
+-commutative84.7%
associate-+l+84.7%
Simplified84.7%
Taylor expanded in y around 0 53.9%
associate-/r*58.0%
+-commutative58.0%
Simplified58.0%
if 1.9e-104 < y Initial program 77.5%
associate-*l*77.5%
+-commutative77.5%
+-commutative77.5%
+-commutative77.5%
associate-*l*77.5%
*-commutative77.5%
associate-*r/85.5%
*-commutative85.5%
distribute-rgt1-in81.1%
fma-def85.5%
+-commutative85.5%
+-commutative85.5%
cube-unmult85.6%
+-commutative85.6%
Simplified85.6%
associate-*r/77.5%
*-commutative77.5%
fma-udef75.3%
cube-mult75.3%
distribute-rgt1-in77.5%
*-commutative77.5%
+-commutative77.5%
associate-+r+77.5%
frac-times94.7%
*-commutative94.7%
clear-num94.7%
associate-/r*99.7%
frac-times99.8%
*-un-lft-identity99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 72.5%
+-commutative72.5%
Simplified72.5%
Final simplification63.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.0) (* (/ 1.0 x) (/ y x)) (if (<= x -3.5e-201) (- (/ y x) y) (/ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -3.5e-201) {
tmp = (y / x) - 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 (x <= (-1.0d0)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-3.5d-201)) then
tmp = (y / x) - 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 (x <= -1.0) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -3.5e-201) {
tmp = (y / x) - y;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = (1.0 / x) * (y / x) elif x <= -3.5e-201: tmp = (y / x) - y else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -3.5e-201) tmp = Float64(Float64(y / x) - 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 (x <= -1.0)
tmp = (1.0 / x) * (y / x);
elseif (x <= -3.5e-201)
tmp = (y / x) - 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[LessEqual[x, -1.0], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.5e-201], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-201}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1Initial program 62.7%
times-frac86.0%
+-commutative86.0%
associate-+l+86.0%
Simplified86.0%
Taylor expanded in x around inf 81.7%
Taylor expanded in x around inf 80.0%
if -1 < x < -3.50000000000000008e-201Initial program 78.3%
times-frac88.3%
+-commutative88.3%
associate-+l+88.3%
Simplified88.3%
Taylor expanded in y around 0 33.4%
associate-/r*33.4%
+-commutative33.4%
Simplified33.4%
Taylor expanded in x around 0 31.9%
neg-mul-131.9%
+-commutative31.9%
unsub-neg31.9%
Simplified31.9%
if -3.50000000000000008e-201 < x Initial program 74.1%
times-frac89.1%
+-commutative89.1%
associate-+l+89.1%
Simplified89.1%
Taylor expanded in x around 0 61.8%
+-commutative61.8%
Simplified61.8%
Taylor expanded in y around 0 45.4%
Final simplification51.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4.2e+18) (* (/ 1.0 x) (/ y x)) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.2e+18) {
tmp = (1.0 / x) * (y / x);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.2d+18)) then
tmp = (1.0d0 / x) * (y / x)
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.2e+18) {
tmp = (1.0 / x) * (y / x);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.2e+18: tmp = (1.0 / x) * (y / x) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.2e+18) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.2e+18)
tmp = (1.0 / x) * (y / x);
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.2e+18], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+18}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -4.2e18Initial program 61.5%
times-frac85.6%
+-commutative85.6%
associate-+l+85.6%
Simplified85.6%
Taylor expanded in x around inf 82.7%
Taylor expanded in x around inf 82.3%
if -4.2e18 < x Initial program 75.3%
times-frac89.0%
+-commutative89.0%
associate-+l+89.0%
Simplified89.0%
Taylor expanded in x around 0 63.3%
+-commutative63.3%
Simplified63.3%
Final simplification67.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.3e-37) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.3e-37) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.3d-37)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.3e-37) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.3e-37: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.3e-37) 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 (x <= -3.3e-37)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.3e-37], 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}\;x \leq -3.3 \cdot 10^{-37}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -3.29999999999999982e-37Initial program 65.0%
times-frac86.9%
+-commutative86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in y around 0 73.8%
associate-/r*79.3%
+-commutative79.3%
Simplified79.3%
if -3.29999999999999982e-37 < x Initial program 74.5%
associate-*l*74.5%
+-commutative74.5%
+-commutative74.5%
+-commutative74.5%
associate-*l*74.5%
*-commutative74.5%
associate-*r/83.4%
*-commutative83.4%
distribute-rgt1-in71.4%
fma-def83.4%
+-commutative83.4%
+-commutative83.4%
cube-unmult83.5%
+-commutative83.5%
Simplified83.5%
associate-*r/74.5%
*-commutative74.5%
fma-udef62.5%
cube-mult62.5%
distribute-rgt1-in74.5%
*-commutative74.5%
+-commutative74.5%
associate-+r+74.5%
frac-times88.7%
*-commutative88.7%
clear-num88.7%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 64.2%
+-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 63.8%
Final simplification67.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -0.45) (/ 1.0 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -0.45) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-0.45d0)) then
tmp = 1.0d0 / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -0.45) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -0.45: tmp = 1.0 / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -0.45) tmp = Float64(1.0 / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -0.45)
tmp = 1.0 / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -0.45], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.45:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -0.450000000000000011Initial program 62.7%
times-frac86.0%
+-commutative86.0%
associate-+l+86.0%
Simplified86.0%
Taylor expanded in x around inf 81.7%
Taylor expanded in y around inf 6.1%
if -0.450000000000000011 < x Initial program 75.0%
times-frac88.9%
+-commutative88.9%
associate-+l+88.9%
Simplified88.9%
Taylor expanded in x around 0 63.5%
+-commutative63.5%
Simplified63.5%
Taylor expanded in y around 0 41.3%
Final simplification33.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.5e-212) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.5e-212) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.5d-212) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.5e-212) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.5e-212: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.5e-212) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 3.5e-212)
tmp = y / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.5e-212], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{-212}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 3.4999999999999998e-212Initial program 69.6%
times-frac86.5%
+-commutative86.5%
associate-+l+86.5%
Simplified86.5%
Taylor expanded in y around 0 51.7%
associate-/r*56.4%
+-commutative56.4%
Simplified56.4%
Taylor expanded in x around 0 32.6%
if 3.4999999999999998e-212 < y Initial program 75.4%
times-frac90.5%
+-commutative90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 63.8%
+-commutative63.8%
Simplified63.8%
Taylor expanded in y around 0 39.4%
Final simplification35.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 x))
assert(x < y);
double code(double x, double y) {
return 1.0 / x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / x
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{x}
\end{array}
Initial program 72.1%
times-frac88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in x around inf 47.9%
Taylor expanded in y around inf 4.1%
Final simplification4.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 1.0)
assert(x < y);
double code(double x, double y) {
return 1.0;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
assert x < y;
public static double code(double x, double y) {
return 1.0;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0
x, y = sort([x, y]) function code(x, y) return 1.0 end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := 1.0
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
1
\end{array}
Initial program 72.1%
associate-*l*72.1%
+-commutative72.1%
+-commutative72.1%
+-commutative72.1%
associate-*l*72.1%
*-commutative72.1%
associate-*r/81.4%
*-commutative81.4%
distribute-rgt1-in62.4%
fma-def81.4%
+-commutative81.4%
+-commutative81.4%
cube-unmult81.4%
+-commutative81.4%
Simplified81.4%
associate-*r/72.2%
*-commutative72.2%
fma-udef55.3%
cube-mult55.3%
distribute-rgt1-in72.1%
*-commutative72.1%
+-commutative72.1%
associate-+r+72.1%
frac-times88.2%
*-commutative88.2%
clear-num88.2%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 53.8%
+-commutative53.8%
Simplified53.8%
Taylor expanded in y around 0 3.6%
Final simplification3.6%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2023320
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))