
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (/ y (* (+ y x) (/ (+ y (+ x 1.0)) x))) (+ y x)))
assert(x < y);
double code(double x, double y) {
return (y / ((y + x) * ((y + (x + 1.0)) / x))) / (y + x);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / ((y + x) * ((y + (x + 1.0d0)) / x))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
return (y / ((y + x) * ((y + (x + 1.0)) / x))) / (y + x);
}
[x, y] = sort([x, y]) def code(x, y): return (y / ((y + x) * ((y + (x + 1.0)) / x))) / (y + x)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y / Float64(Float64(y + x) * Float64(Float64(y + Float64(x + 1.0)) / x))) / Float64(y + x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y / ((y + x) * ((y + (x + 1.0)) / x))) / (y + x);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{\left(y + x\right) \cdot \frac{y + \left(x + 1\right)}{x}}}{y + x}
\end{array}
Initial program 70.9%
*-commutative70.9%
associate-*l*70.9%
times-frac96.2%
+-commutative96.2%
+-commutative96.2%
associate-+r+96.2%
+-commutative96.2%
associate-+l+96.2%
Applied egg-rr96.2%
clear-num95.5%
un-div-inv95.5%
+-commutative95.5%
*-un-lft-identity95.5%
times-frac99.0%
/-rgt-identity99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Applied egg-rr99.0%
*-un-lft-identity99.0%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Applied egg-rr99.6%
associate-*l/99.7%
*-lft-identity99.7%
associate-/l/99.0%
*-commutative99.0%
+-commutative99.0%
Simplified99.0%
Final simplification99.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 2.7e-22)
(/ (/ y (+ y x)) (* (+ y x) (/ (+ x 1.0) x)))
(if (<= y 1.16e+128)
(* x (/ y (* (* (+ y x) (+ y x)) (+ x (+ y 1.0)))))
(/ (/ y (* (+ y x) (/ (+ y 1.0) x))) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.7e-22) {
tmp = (y / (y + x)) / ((y + x) * ((x + 1.0) / x));
} else if (y <= 1.16e+128) {
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0))));
} else {
tmp = (y / ((y + x) * ((y + 1.0) / x))) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.7d-22) then
tmp = (y / (y + x)) / ((y + x) * ((x + 1.0d0) / x))
else if (y <= 1.16d+128) then
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0d0))))
else
tmp = (y / ((y + x) * ((y + 1.0d0) / x))) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.7e-22) {
tmp = (y / (y + x)) / ((y + x) * ((x + 1.0) / x));
} else if (y <= 1.16e+128) {
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0))));
} else {
tmp = (y / ((y + x) * ((y + 1.0) / x))) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.7e-22: tmp = (y / (y + x)) / ((y + x) * ((x + 1.0) / x)) elif y <= 1.16e+128: tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0)))) else: tmp = (y / ((y + x) * ((y + 1.0) / x))) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.7e-22) tmp = Float64(Float64(y / Float64(y + x)) / Float64(Float64(y + x) * Float64(Float64(x + 1.0) / x))); elseif (y <= 1.16e+128) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * Float64(y + x)) * Float64(x + Float64(y + 1.0))))); else tmp = Float64(Float64(y / Float64(Float64(y + x) * Float64(Float64(y + 1.0) / x))) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.7e-22)
tmp = (y / (y + x)) / ((y + x) * ((x + 1.0) / x));
elseif (y <= 1.16e+128)
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0))));
else
tmp = (y / ((y + x) * ((y + 1.0) / x))) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.7e-22], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.16e+128], N[(x * N[(y / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \frac{x + 1}{x}}\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\left(y + x\right) \cdot \frac{y + 1}{x}}}{y + x}\\
\end{array}
\end{array}
if y < 2.7000000000000002e-22Initial program 70.4%
*-commutative70.4%
associate-*l*70.4%
times-frac96.6%
+-commutative96.6%
+-commutative96.6%
associate-+r+96.6%
+-commutative96.6%
associate-+l+96.6%
Applied egg-rr96.6%
clear-num96.2%
un-div-inv96.2%
+-commutative96.2%
*-un-lft-identity96.2%
times-frac99.3%
/-rgt-identity99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in y around 0 79.8%
+-commutative79.8%
Simplified79.8%
if 2.7000000000000002e-22 < y < 1.1600000000000001e128Initial program 85.2%
associate-/l*94.0%
associate-+l+94.0%
Simplified94.0%
if 1.1600000000000001e128 < y Initial program 52.7%
*-commutative52.7%
associate-*l*52.7%
times-frac86.9%
+-commutative86.9%
+-commutative86.9%
associate-+r+86.9%
+-commutative86.9%
associate-+l+86.9%
Applied egg-rr86.9%
clear-num86.9%
un-div-inv86.9%
+-commutative86.9%
*-un-lft-identity86.9%
times-frac99.8%
/-rgt-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-un-lft-identity99.8%
times-frac99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
associate-*l/99.9%
*-lft-identity99.9%
associate-/l/99.9%
*-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 74.3%
+-commutative74.3%
Simplified74.3%
Final simplification81.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ y (+ y x)) (+ x 1.0))))
(if (<= x -0.0065)
t_0
(if (<= x -3.9e-13)
(/ -1.0 (/ (* y (- -1.0 y)) x))
(if (<= x -3e-68) t_0 (/ (/ x (+ y 1.0)) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / (y + x)) / (x + 1.0);
double tmp;
if (x <= -0.0065) {
tmp = t_0;
} else if (x <= -3.9e-13) {
tmp = -1.0 / ((y * (-1.0 - y)) / x);
} else if (x <= -3e-68) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (y / (y + x)) / (x + 1.0d0)
if (x <= (-0.0065d0)) then
tmp = t_0
else if (x <= (-3.9d-13)) then
tmp = (-1.0d0) / ((y * ((-1.0d0) - y)) / x)
else if (x <= (-3d-68)) then
tmp = t_0
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 t_0 = (y / (y + x)) / (x + 1.0);
double tmp;
if (x <= -0.0065) {
tmp = t_0;
} else if (x <= -3.9e-13) {
tmp = -1.0 / ((y * (-1.0 - y)) / x);
} else if (x <= -3e-68) {
tmp = t_0;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / (y + x)) / (x + 1.0) tmp = 0 if x <= -0.0065: tmp = t_0 elif x <= -3.9e-13: tmp = -1.0 / ((y * (-1.0 - y)) / x) elif x <= -3e-68: tmp = t_0 else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)) tmp = 0.0 if (x <= -0.0065) tmp = t_0; elseif (x <= -3.9e-13) tmp = Float64(-1.0 / Float64(Float64(y * Float64(-1.0 - y)) / x)); elseif (x <= -3e-68) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / (y + x)) / (x + 1.0);
tmp = 0.0;
if (x <= -0.0065)
tmp = t_0;
elseif (x <= -3.9e-13)
tmp = -1.0 / ((y * (-1.0 - y)) / x);
elseif (x <= -3e-68)
tmp = t_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_] := Block[{t$95$0 = N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0065], t$95$0, If[LessEqual[x, -3.9e-13], N[(-1.0 / N[(N[(y * N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3e-68], t$95$0, N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{if}\;x \leq -0.0065:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -3.9 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{\frac{y \cdot \left(-1 - y\right)}{x}}\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-68}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -0.0064999999999999997 or -3.90000000000000004e-13 < x < -3e-68Initial program 68.7%
*-commutative68.7%
associate-*l*68.7%
times-frac93.9%
+-commutative93.9%
+-commutative93.9%
associate-+r+93.9%
+-commutative93.9%
associate-+l+93.9%
Applied egg-rr93.9%
clear-num93.9%
un-div-inv93.9%
+-commutative93.9%
*-un-lft-identity93.9%
times-frac99.7%
/-rgt-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 67.3%
+-commutative67.3%
Simplified67.3%
if -0.0064999999999999997 < x < -3.90000000000000004e-13Initial program 100.0%
associate-/l*99.2%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in x around 0 99.2%
associate-/r*99.2%
+-commutative99.2%
Simplified99.2%
associate-/l/99.2%
*-commutative99.2%
div-inv99.2%
clear-num100.0%
frac-2neg100.0%
metadata-eval100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
fma-define100.0%
Applied egg-rr100.0%
distribute-neg-frac100.0%
neg-mul-1100.0%
fma-undefine100.0%
unpow2100.0%
+-commutative100.0%
*-lft-identity100.0%
unpow2100.0%
distribute-rgt-in100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-lft-neg-in100.0%
mul-1-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
if -3e-68 < x Initial program 71.5%
associate-/l*86.6%
associate-+l+86.6%
Simplified86.6%
Taylor expanded in x around 0 57.6%
+-commutative57.6%
Simplified57.6%
*-un-lft-identity57.6%
times-frac56.9%
Applied egg-rr56.9%
associate-*l/57.0%
*-lft-identity57.0%
Simplified57.0%
Final simplification60.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.05e+30)
(/ (/ y x) x)
(if (or (<= x -2e-12) (not (<= x -5.6e-67)))
(/ x (* y (+ y 1.0)))
(/ y (* x (+ x 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.05e+30) {
tmp = (y / x) / x;
} else if ((x <= -2e-12) || !(x <= -5.6e-67)) {
tmp = x / (y * (y + 1.0));
} else {
tmp = 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 (x <= (-1.05d+30)) then
tmp = (y / x) / x
else if ((x <= (-2d-12)) .or. (.not. (x <= (-5.6d-67)))) then
tmp = x / (y * (y + 1.0d0))
else
tmp = 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 (x <= -1.05e+30) {
tmp = (y / x) / x;
} else if ((x <= -2e-12) || !(x <= -5.6e-67)) {
tmp = x / (y * (y + 1.0));
} else {
tmp = y / (x * (x + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.05e+30: tmp = (y / x) / x elif (x <= -2e-12) or not (x <= -5.6e-67): tmp = x / (y * (y + 1.0)) else: tmp = y / (x * (x + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.05e+30) tmp = Float64(Float64(y / x) / x); elseif ((x <= -2e-12) || !(x <= -5.6e-67)) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = 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 (x <= -1.05e+30)
tmp = (y / x) / x;
elseif ((x <= -2e-12) || ~((x <= -5.6e-67)))
tmp = x / (y * (y + 1.0));
else
tmp = 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[x, -1.05e+30], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[Or[LessEqual[x, -2e-12], N[Not[LessEqual[x, -5.6e-67]], $MachinePrecision]], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+30}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-12} \lor \neg \left(x \leq -5.6 \cdot 10^{-67}\right):\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\end{array}
\end{array}
if x < -1.05e30Initial program 67.3%
*-commutative67.3%
associate-*l*67.3%
times-frac92.2%
+-commutative92.2%
+-commutative92.2%
associate-+r+92.2%
+-commutative92.2%
associate-+l+92.2%
Applied egg-rr92.2%
clear-num92.2%
un-div-inv92.2%
+-commutative92.2%
*-un-lft-identity92.2%
times-frac99.8%
/-rgt-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 73.3%
Taylor expanded in y around 0 72.9%
if -1.05e30 < x < -1.99999999999999996e-12 or -5.60000000000000021e-67 < x Initial program 72.0%
associate-/l*86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in x around 0 58.8%
+-commutative58.8%
Simplified58.8%
if -1.99999999999999996e-12 < x < -5.60000000000000021e-67Initial program 71.6%
associate-/l*90.0%
associate-+l+90.0%
Simplified90.0%
Taylor expanded in y around 0 62.9%
Final simplification62.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -4.5e+34)
(/ (/ y x) x)
(if (<= x -5.8e-13)
(/ (/ x y) (+ y x))
(if (<= x -3.7e-69) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.5e+34) {
tmp = (y / x) / x;
} else if (x <= -5.8e-13) {
tmp = (x / y) / (y + x);
} else if (x <= -3.7e-69) {
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 <= (-4.5d+34)) then
tmp = (y / x) / x
else if (x <= (-5.8d-13)) then
tmp = (x / y) / (y + x)
else if (x <= (-3.7d-69)) 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 <= -4.5e+34) {
tmp = (y / x) / x;
} else if (x <= -5.8e-13) {
tmp = (x / y) / (y + x);
} else if (x <= -3.7e-69) {
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 <= -4.5e+34: tmp = (y / x) / x elif x <= -5.8e-13: tmp = (x / y) / (y + x) elif x <= -3.7e-69: 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 <= -4.5e+34) tmp = Float64(Float64(y / x) / x); elseif (x <= -5.8e-13) tmp = Float64(Float64(x / y) / Float64(y + x)); elseif (x <= -3.7e-69) 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 <= -4.5e+34)
tmp = (y / x) / x;
elseif (x <= -5.8e-13)
tmp = (x / y) / (y + x);
elseif (x <= -3.7e-69)
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, -4.5e+34], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -5.8e-13], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.7e-69], 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 -4.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-69}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -4.5e34Initial program 67.3%
*-commutative67.3%
associate-*l*67.3%
times-frac91.8%
+-commutative91.8%
+-commutative91.8%
associate-+r+91.8%
+-commutative91.8%
associate-+l+91.8%
Applied egg-rr91.8%
clear-num91.8%
un-div-inv91.8%
+-commutative91.8%
*-un-lft-identity91.8%
times-frac99.8%
/-rgt-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 76.9%
Taylor expanded in y around 0 76.5%
if -4.5e34 < x < -5.7999999999999995e-13Initial program 77.4%
*-commutative77.4%
associate-*l*77.5%
times-frac99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+l+99.5%
Applied egg-rr99.5%
clear-num99.5%
un-div-inv99.5%
+-commutative99.5%
*-un-lft-identity99.5%
times-frac99.5%
/-rgt-identity99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
Applied egg-rr99.5%
*-un-lft-identity99.5%
times-frac99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
associate-+l+99.3%
Applied egg-rr99.3%
associate-*l/99.8%
*-lft-identity99.8%
associate-/l/99.6%
*-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 85.0%
if -5.7999999999999995e-13 < x < -3.7000000000000002e-69Initial program 71.6%
associate-/l*90.0%
associate-+l+90.0%
Simplified90.0%
Taylor expanded in y around 0 62.9%
if -3.7000000000000002e-69 < x Initial program 71.5%
associate-/l*86.6%
associate-+l+86.6%
Simplified86.6%
Taylor expanded in x around 0 57.6%
+-commutative57.6%
Simplified57.6%
Final simplification63.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -4.1e+34)
(/ (/ y x) x)
(if (<= x -6e-12)
(/ (/ x y) (+ y x))
(if (<= x -4.6e-66) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.1e+34) {
tmp = (y / x) / x;
} else if (x <= -6e-12) {
tmp = (x / y) / (y + x);
} else if (x <= -4.6e-66) {
tmp = y / (x * (x + 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 <= (-4.1d+34)) then
tmp = (y / x) / x
else if (x <= (-6d-12)) then
tmp = (x / y) / (y + x)
else if (x <= (-4.6d-66)) then
tmp = y / (x * (x + 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 <= -4.1e+34) {
tmp = (y / x) / x;
} else if (x <= -6e-12) {
tmp = (x / y) / (y + x);
} else if (x <= -4.6e-66) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.1e+34: tmp = (y / x) / x elif x <= -6e-12: tmp = (x / y) / (y + x) elif x <= -4.6e-66: tmp = y / (x * (x + 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 <= -4.1e+34) tmp = Float64(Float64(y / x) / x); elseif (x <= -6e-12) tmp = Float64(Float64(x / y) / Float64(y + x)); elseif (x <= -4.6e-66) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / 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 <= -4.1e+34)
tmp = (y / x) / x;
elseif (x <= -6e-12)
tmp = (x / y) / (y + x);
elseif (x <= -4.6e-66)
tmp = y / (x * (x + 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, -4.1e+34], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -6e-12], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.6e-66], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{+34}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -4.0999999999999998e34Initial program 67.3%
*-commutative67.3%
associate-*l*67.3%
times-frac91.8%
+-commutative91.8%
+-commutative91.8%
associate-+r+91.8%
+-commutative91.8%
associate-+l+91.8%
Applied egg-rr91.8%
clear-num91.8%
un-div-inv91.8%
+-commutative91.8%
*-un-lft-identity91.8%
times-frac99.8%
/-rgt-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 76.9%
Taylor expanded in y around 0 76.5%
if -4.0999999999999998e34 < x < -6.0000000000000003e-12Initial program 77.4%
*-commutative77.4%
associate-*l*77.5%
times-frac99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+l+99.5%
Applied egg-rr99.5%
clear-num99.5%
un-div-inv99.5%
+-commutative99.5%
*-un-lft-identity99.5%
times-frac99.5%
/-rgt-identity99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
Applied egg-rr99.5%
*-un-lft-identity99.5%
times-frac99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
associate-+l+99.3%
Applied egg-rr99.3%
associate-*l/99.8%
*-lft-identity99.8%
associate-/l/99.6%
*-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 85.0%
if -6.0000000000000003e-12 < x < -4.59999999999999984e-66Initial program 71.6%
associate-/l*90.0%
associate-+l+90.0%
Simplified90.0%
Taylor expanded in y around 0 62.9%
if -4.59999999999999984e-66 < x Initial program 71.5%
associate-/l*86.6%
associate-+l+86.6%
Simplified86.6%
Taylor expanded in x around 0 57.6%
+-commutative57.6%
Simplified57.6%
*-un-lft-identity57.6%
times-frac56.9%
Applied egg-rr56.9%
associate-*l/57.0%
*-lft-identity57.0%
Simplified57.0%
Final simplification63.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -0.0035)
(/ (/ y x) (+ x 1.0))
(if (<= x -1e-12)
(/ x (* y (+ y 1.0)))
(if (<= x -1.7e-66) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -0.0035) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -1e-12) {
tmp = x / (y * (y + 1.0));
} else if (x <= -1.7e-66) {
tmp = y / (x * (x + 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 <= (-0.0035d0)) then
tmp = (y / x) / (x + 1.0d0)
else if (x <= (-1d-12)) then
tmp = x / (y * (y + 1.0d0))
else if (x <= (-1.7d-66)) then
tmp = y / (x * (x + 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 <= -0.0035) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -1e-12) {
tmp = x / (y * (y + 1.0));
} else if (x <= -1.7e-66) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -0.0035: tmp = (y / x) / (x + 1.0) elif x <= -1e-12: tmp = x / (y * (y + 1.0)) elif x <= -1.7e-66: tmp = y / (x * (x + 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 <= -0.0035) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (x <= -1e-12) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (x <= -1.7e-66) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / 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 <= -0.0035)
tmp = (y / x) / (x + 1.0);
elseif (x <= -1e-12)
tmp = x / (y * (y + 1.0));
elseif (x <= -1.7e-66)
tmp = y / (x * (x + 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, -0.0035], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-12], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-66], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0035:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -0.00350000000000000007Initial program 68.3%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in y around 0 68.9%
associate-/r*67.4%
+-commutative67.4%
Simplified67.4%
if -0.00350000000000000007 < x < -9.9999999999999998e-13Initial program 100.0%
associate-/l*99.2%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in x around 0 99.2%
+-commutative99.2%
Simplified99.2%
if -9.9999999999999998e-13 < x < -1.69999999999999999e-66Initial program 71.6%
associate-/l*90.0%
associate-+l+90.0%
Simplified90.0%
Taylor expanded in y around 0 62.9%
if -1.69999999999999999e-66 < x Initial program 71.5%
associate-/l*86.6%
associate-+l+86.6%
Simplified86.6%
Taylor expanded in x around 0 57.6%
+-commutative57.6%
Simplified57.6%
*-un-lft-identity57.6%
times-frac56.9%
Applied egg-rr56.9%
associate-*l/57.0%
*-lft-identity57.0%
Simplified57.0%
Final simplification60.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -0.145)
(/ (/ y x) (+ x 1.0))
(if (<= x -9e-12)
(/ -1.0 (/ (* y (- -1.0 y)) x))
(if (<= x -3e-66) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -0.145) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -9e-12) {
tmp = -1.0 / ((y * (-1.0 - y)) / x);
} else if (x <= -3e-66) {
tmp = y / (x * (x + 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 <= (-0.145d0)) then
tmp = (y / x) / (x + 1.0d0)
else if (x <= (-9d-12)) then
tmp = (-1.0d0) / ((y * ((-1.0d0) - y)) / x)
else if (x <= (-3d-66)) then
tmp = y / (x * (x + 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 <= -0.145) {
tmp = (y / x) / (x + 1.0);
} else if (x <= -9e-12) {
tmp = -1.0 / ((y * (-1.0 - y)) / x);
} else if (x <= -3e-66) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -0.145: tmp = (y / x) / (x + 1.0) elif x <= -9e-12: tmp = -1.0 / ((y * (-1.0 - y)) / x) elif x <= -3e-66: tmp = y / (x * (x + 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 <= -0.145) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (x <= -9e-12) tmp = Float64(-1.0 / Float64(Float64(y * Float64(-1.0 - y)) / x)); elseif (x <= -3e-66) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / 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 <= -0.145)
tmp = (y / x) / (x + 1.0);
elseif (x <= -9e-12)
tmp = -1.0 / ((y * (-1.0 - y)) / x);
elseif (x <= -3e-66)
tmp = y / (x * (x + 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, -0.145], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9e-12], N[(-1.0 / N[(N[(y * N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3e-66], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.145:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\frac{y \cdot \left(-1 - y\right)}{x}}\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -0.14499999999999999Initial program 68.3%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in y around 0 68.9%
associate-/r*67.4%
+-commutative67.4%
Simplified67.4%
if -0.14499999999999999 < x < -8.99999999999999962e-12Initial program 100.0%
associate-/l*99.2%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in x around 0 99.2%
associate-/r*99.2%
+-commutative99.2%
Simplified99.2%
associate-/l/99.2%
*-commutative99.2%
div-inv99.2%
clear-num100.0%
frac-2neg100.0%
metadata-eval100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
fma-define100.0%
Applied egg-rr100.0%
distribute-neg-frac100.0%
neg-mul-1100.0%
fma-undefine100.0%
unpow2100.0%
+-commutative100.0%
*-lft-identity100.0%
unpow2100.0%
distribute-rgt-in100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-lft-neg-in100.0%
mul-1-neg100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
if -8.99999999999999962e-12 < x < -3.0000000000000002e-66Initial program 71.6%
associate-/l*90.0%
associate-+l+90.0%
Simplified90.0%
Taylor expanded in y around 0 62.9%
if -3.0000000000000002e-66 < x Initial program 71.5%
associate-/l*86.6%
associate-+l+86.6%
Simplified86.6%
Taylor expanded in x around 0 57.6%
+-commutative57.6%
Simplified57.6%
*-un-lft-identity57.6%
times-frac56.9%
Applied egg-rr56.9%
associate-*l/57.0%
*-lft-identity57.0%
Simplified57.0%
Final simplification60.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -0.055) (* (/ x (* (+ y x) (+ y (+ x 1.0)))) (/ y x)) (/ (/ y (* (+ y x) (/ (+ y 1.0) x))) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -0.055) {
tmp = (x / ((y + x) * (y + (x + 1.0)))) * (y / x);
} else {
tmp = (y / ((y + x) * ((y + 1.0) / x))) / (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 <= (-0.055d0)) then
tmp = (x / ((y + x) * (y + (x + 1.0d0)))) * (y / x)
else
tmp = (y / ((y + x) * ((y + 1.0d0) / x))) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -0.055) {
tmp = (x / ((y + x) * (y + (x + 1.0)))) * (y / x);
} else {
tmp = (y / ((y + x) * ((y + 1.0) / x))) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -0.055: tmp = (x / ((y + x) * (y + (x + 1.0)))) * (y / x) else: tmp = (y / ((y + x) * ((y + 1.0) / x))) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -0.055) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + Float64(x + 1.0)))) * Float64(y / x)); else tmp = Float64(Float64(y / Float64(Float64(y + x) * Float64(Float64(y + 1.0) / x))) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -0.055)
tmp = (x / ((y + x) * (y + (x + 1.0)))) * (y / x);
else
tmp = (y / ((y + x) * ((y + 1.0) / x))) / (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, -0.055], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.055:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\left(y + x\right) \cdot \frac{y + 1}{x}}}{y + x}\\
\end{array}
\end{array}
if x < -0.0550000000000000003Initial program 68.3%
*-commutative68.3%
associate-*l*68.3%
times-frac93.1%
+-commutative93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+l+93.1%
Applied egg-rr93.1%
Taylor expanded in y around 0 79.3%
if -0.0550000000000000003 < x Initial program 71.8%
*-commutative71.8%
associate-*l*71.9%
times-frac97.4%
+-commutative97.4%
+-commutative97.4%
associate-+r+97.4%
+-commutative97.4%
associate-+l+97.4%
Applied egg-rr97.4%
clear-num96.4%
un-div-inv96.4%
+-commutative96.4%
*-un-lft-identity96.4%
times-frac98.7%
/-rgt-identity98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
associate-+l+98.7%
+-commutative98.7%
Applied egg-rr98.7%
*-un-lft-identity98.7%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Applied egg-rr99.6%
associate-*l/99.6%
*-lft-identity99.6%
associate-/l/98.8%
*-commutative98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 81.0%
+-commutative81.0%
Simplified81.0%
Final simplification80.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 0.013) (/ (/ y (+ y x)) (* (+ y x) (/ (+ x 1.0) x))) (/ x (* (+ y x) (+ y (+ x 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 0.013) {
tmp = (y / (y + x)) / ((y + x) * ((x + 1.0) / x));
} else {
tmp = x / ((y + x) * (y + (x + 1.0)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 0.013d0) then
tmp = (y / (y + x)) / ((y + x) * ((x + 1.0d0) / x))
else
tmp = x / ((y + x) * (y + (x + 1.0d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 0.013) {
tmp = (y / (y + x)) / ((y + x) * ((x + 1.0) / x));
} else {
tmp = x / ((y + x) * (y + (x + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 0.013: tmp = (y / (y + x)) / ((y + x) * ((x + 1.0) / x)) else: tmp = x / ((y + x) * (y + (x + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 0.013) tmp = Float64(Float64(y / Float64(y + x)) / Float64(Float64(y + x) * Float64(Float64(x + 1.0) / x))); else tmp = Float64(x / Float64(Float64(y + x) * Float64(y + 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 <= 0.013)
tmp = (y / (y + x)) / ((y + x) * ((x + 1.0) / x));
else
tmp = x / ((y + x) * (y + (x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 0.013], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.013:\\
\;\;\;\;\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \frac{x + 1}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if y < 0.0129999999999999994Initial program 71.1%
*-commutative71.1%
associate-*l*71.1%
times-frac96.7%
+-commutative96.7%
+-commutative96.7%
associate-+r+96.7%
+-commutative96.7%
associate-+l+96.7%
Applied egg-rr96.7%
clear-num96.3%
un-div-inv96.3%
+-commutative96.3%
*-un-lft-identity96.3%
times-frac99.3%
/-rgt-identity99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in y around 0 80.3%
+-commutative80.3%
Simplified80.3%
if 0.0129999999999999994 < y Initial program 70.1%
*-commutative70.1%
associate-*l*70.1%
times-frac94.4%
+-commutative94.4%
+-commutative94.4%
associate-+r+94.4%
+-commutative94.4%
associate-+l+94.4%
Applied egg-rr94.4%
Taylor expanded in y around inf 90.5%
Final simplification82.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -0.39) (/ (/ y x) x) (if (<= x 7e-123) (/ 1.0 (/ y x)) (+ 1.0 (+ -1.0 (/ x y))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -0.39) {
tmp = (y / x) / x;
} else if (x <= 7e-123) {
tmp = 1.0 / (y / x);
} else {
tmp = 1.0 + (-1.0 + (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.39d0)) then
tmp = (y / x) / x
else if (x <= 7d-123) then
tmp = 1.0d0 / (y / x)
else
tmp = 1.0d0 + ((-1.0d0) + (x / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -0.39) {
tmp = (y / x) / x;
} else if (x <= 7e-123) {
tmp = 1.0 / (y / x);
} else {
tmp = 1.0 + (-1.0 + (x / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -0.39: tmp = (y / x) / x elif x <= 7e-123: tmp = 1.0 / (y / x) else: tmp = 1.0 + (-1.0 + (x / y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -0.39) tmp = Float64(Float64(y / x) / x); elseif (x <= 7e-123) tmp = Float64(1.0 / Float64(y / x)); else tmp = Float64(1.0 + Float64(-1.0 + 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.39)
tmp = (y / x) / x;
elseif (x <= 7e-123)
tmp = 1.0 / (y / x);
else
tmp = 1.0 + (-1.0 + (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.39], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 7e-123], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.39:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-123}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(-1 + \frac{x}{y}\right)\\
\end{array}
\end{array}
if x < -0.39000000000000001Initial program 68.3%
*-commutative68.3%
associate-*l*68.3%
times-frac93.1%
+-commutative93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+l+93.1%
Applied egg-rr93.1%
clear-num93.0%
un-div-inv93.0%
+-commutative93.0%
*-un-lft-identity93.0%
times-frac99.7%
/-rgt-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 66.5%
Taylor expanded in y around 0 66.0%
if -0.39000000000000001 < x < 6.9999999999999997e-123Initial program 64.3%
associate-/l*82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in x around 0 74.6%
associate-/r*74.7%
+-commutative74.7%
Simplified74.7%
Taylor expanded in y around 0 52.1%
div-inv52.2%
clear-num52.6%
Applied egg-rr52.6%
if 6.9999999999999997e-123 < x Initial program 80.6%
associate-/l*92.2%
associate-+l+92.2%
Simplified92.2%
Taylor expanded in x around 0 35.8%
associate-/r*35.8%
+-commutative35.8%
Simplified35.8%
Taylor expanded in y around 0 7.0%
div-inv7.0%
expm1-log1p-u6.0%
expm1-undefine14.4%
log1p-undefine14.4%
add-exp-log15.4%
Applied egg-rr15.4%
associate--l+15.4%
Simplified15.4%
Final simplification43.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (/ y (+ y x)) (/ x (* (+ y x) (+ y (+ x 1.0))))))
assert(x < y);
double code(double x, double y) {
return (y / (y + x)) * (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 / (y + x)) * (x / ((y + x) * (y + (x + 1.0d0))))
end function
assert x < y;
public static double code(double x, double y) {
return (y / (y + x)) * (x / ((y + x) * (y + (x + 1.0))));
}
[x, y] = sort([x, y]) def code(x, y): return (y / (y + x)) * (x / ((y + x) * (y + (x + 1.0))))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(y + x) * Float64(y + Float64(x + 1.0))))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y / (y + x)) * (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[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}
\end{array}
Initial program 70.9%
*-commutative70.9%
associate-*l*70.9%
times-frac96.2%
+-commutative96.2%
+-commutative96.2%
associate-+r+96.2%
+-commutative96.2%
associate-+l+96.2%
Applied egg-rr96.2%
Final simplification96.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.4e-246) (/ (/ y x) (+ x 1.0)) (/ x (* (+ y x) (+ y (+ x 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.4e-246) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = x / ((y + x) * (y + (x + 1.0)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.4d-246) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = x / ((y + x) * (y + (x + 1.0d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.4e-246) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = x / ((y + x) * (y + (x + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.4e-246: tmp = (y / x) / (x + 1.0) else: tmp = x / ((y + x) * (y + (x + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.4e-246) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(x / Float64(Float64(y + x) * Float64(y + 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 <= 3.4e-246)
tmp = (y / x) / (x + 1.0);
else
tmp = x / ((y + x) * (y + (x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.4e-246], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{-246}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if y < 3.4000000000000001e-246Initial program 67.8%
associate-/l*82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in y around 0 52.5%
associate-/r*53.1%
+-commutative53.1%
Simplified53.1%
if 3.4000000000000001e-246 < y Initial program 74.9%
*-commutative74.9%
associate-*l*74.9%
times-frac97.3%
+-commutative97.3%
+-commutative97.3%
associate-+r+97.3%
+-commutative97.3%
associate-+l+97.3%
Applied egg-rr97.3%
Taylor expanded in y around inf 75.5%
Final simplification62.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.55e+28) (/ (/ y x) x) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.55e+28) {
tmp = (y / x) / x;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.55d+28)) then
tmp = (y / x) / x
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.55e+28) {
tmp = (y / x) / x;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.55e+28: tmp = (y / x) / x else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.55e+28) tmp = Float64(Float64(y / x) / 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 <= -1.55e+28)
tmp = (y / x) / x;
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.55e+28], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+28}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1.55e28Initial program 67.3%
*-commutative67.3%
associate-*l*67.3%
times-frac92.2%
+-commutative92.2%
+-commutative92.2%
associate-+r+92.2%
+-commutative92.2%
associate-+l+92.2%
Applied egg-rr92.2%
clear-num92.2%
un-div-inv92.2%
+-commutative92.2%
*-un-lft-identity92.2%
times-frac99.8%
/-rgt-identity99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 73.3%
Taylor expanded in y around 0 72.9%
if -1.55e28 < x Initial program 72.0%
associate-/l*86.5%
associate-+l+86.5%
Simplified86.5%
Taylor expanded in x around 0 57.5%
+-commutative57.5%
Simplified57.5%
Final simplification61.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -0.39) (/ (/ y x) x) (/ 1.0 (/ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -0.39) {
tmp = (y / x) / x;
} 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 <= (-0.39d0)) then
tmp = (y / x) / x
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 <= -0.39) {
tmp = (y / x) / x;
} else {
tmp = 1.0 / (y / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -0.39: tmp = (y / x) / x else: tmp = 1.0 / (y / x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -0.39) tmp = Float64(Float64(y / x) / x); 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 <= -0.39)
tmp = (y / x) / x;
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, -0.39], N[(N[(y / x), $MachinePrecision] / x), $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 -0.39:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\end{array}
\end{array}
if x < -0.39000000000000001Initial program 68.3%
*-commutative68.3%
associate-*l*68.3%
times-frac93.1%
+-commutative93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+l+93.1%
Applied egg-rr93.1%
clear-num93.0%
un-div-inv93.0%
+-commutative93.0%
*-un-lft-identity93.0%
times-frac99.7%
/-rgt-identity99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 66.5%
Taylor expanded in y around 0 66.0%
if -0.39000000000000001 < x Initial program 71.8%
associate-/l*87.0%
associate-+l+87.0%
Simplified87.0%
Taylor expanded in x around 0 56.6%
associate-/r*56.7%
+-commutative56.7%
Simplified56.7%
Taylor expanded in y around 0 31.2%
div-inv31.3%
clear-num31.6%
Applied egg-rr31.6%
Final simplification40.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 (/ y x)))
assert(x < y);
double code(double x, double y) {
return 1.0 / (y / x);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / (y / x)
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / (y / x);
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / (y / x)
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / Float64(y / x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / (y / x);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{\frac{y}{x}}
\end{array}
Initial program 70.9%
associate-/l*85.3%
associate-+l+85.3%
Simplified85.3%
Taylor expanded in x around 0 50.1%
associate-/r*50.1%
+-commutative50.1%
Simplified50.1%
Taylor expanded in y around 0 23.7%
div-inv23.7%
clear-num23.9%
Applied egg-rr23.9%
Final simplification23.9%
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 70.9%
*-commutative70.9%
associate-*l*70.9%
times-frac96.2%
+-commutative96.2%
+-commutative96.2%
associate-+r+96.2%
+-commutative96.2%
associate-+l+96.2%
Applied egg-rr96.2%
clear-num95.5%
un-div-inv95.5%
+-commutative95.5%
*-un-lft-identity95.5%
times-frac99.0%
/-rgt-identity99.0%
+-commutative99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 36.7%
Taylor expanded in y around inf 4.2%
Final simplification4.2%
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 70.9%
associate-/l*85.3%
associate-+l+85.3%
Simplified85.3%
Taylor expanded in x around 0 50.2%
+-commutative50.2%
Simplified50.2%
Taylor expanded in y around 0 23.7%
Final simplification23.7%
(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 2024066
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))