
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (* (/ y (/ (+ y x) x)) (/ 1.0 (+ x (+ y 1.0)))) (+ y x)))
assert(x < y);
double code(double x, double y) {
return ((y / ((y + x) / x)) * (1.0 / (x + (y + 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 = ((y / ((y + x) / x)) * (1.0d0 / (x + (y + 1.0d0)))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
return ((y / ((y + x) / x)) * (1.0 / (x + (y + 1.0)))) / (y + x);
}
[x, y] = sort([x, y]) def code(x, y): return ((y / ((y + x) / x)) * (1.0 / (x + (y + 1.0)))) / (y + x)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(y / Float64(Float64(y + x) / x)) * Float64(1.0 / Float64(x + Float64(y + 1.0)))) / Float64(y + x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((y / ((y + x) / x)) * (1.0 / (x + (y + 1.0)))) / (y + x);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(y / N[(N[(y + x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{\frac{y + x}{x}} \cdot \frac{1}{x + \left(y + 1\right)}}{y + x}
\end{array}
Initial program 67.3%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
div-invN/A
associate-*l/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1e+17)
(/ (/ y x) x)
(if (<= x -1.25e-150)
(/ x (* y y))
(if (<= x 1.3e-165) (/ x y) (* (/ x y) (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1e+17) {
tmp = (y / x) / x;
} else if (x <= -1.25e-150) {
tmp = x / (y * y);
} else if (x <= 1.3e-165) {
tmp = x / y;
} 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 <= (-1d+17)) then
tmp = (y / x) / x
else if (x <= (-1.25d-150)) then
tmp = x / (y * y)
else if (x <= 1.3d-165) then
tmp = x / y
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 <= -1e+17) {
tmp = (y / x) / x;
} else if (x <= -1.25e-150) {
tmp = x / (y * y);
} else if (x <= 1.3e-165) {
tmp = x / y;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1e+17: tmp = (y / x) / x elif x <= -1.25e-150: tmp = x / (y * y) elif x <= 1.3e-165: tmp = x / y else: tmp = (x / y) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1e+17) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.25e-150) tmp = Float64(x / Float64(y * y)); elseif (x <= 1.3e-165) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1e+17)
tmp = (y / x) / x;
elseif (x <= -1.25e-150)
tmp = x / (y * y);
elseif (x <= 1.3e-165)
tmp = x / y;
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, -1e+17], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.25e-150], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-165], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-150}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-165}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -1e17Initial program 64.4%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6486.4%
Applied egg-rr86.4%
Taylor expanded in x around inf
Simplified83.4%
Taylor expanded in x around inf
/-lowering-/.f6483.0%
Simplified83.0%
if -1e17 < x < -1.24999999999999997e-150Initial program 84.0%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6452.2%
Simplified52.2%
if -1.24999999999999997e-150 < x < 1.30000000000000004e-165Initial program 54.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6488.6%
Simplified88.6%
Taylor expanded in y around 0
/-lowering-/.f6484.4%
Simplified84.4%
if 1.30000000000000004e-165 < x Initial program 72.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6434.9%
Simplified34.9%
associate-/r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6437.6%
Applied egg-rr37.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.12e+15)
(/ (/ y x) x)
(if (<= x -1.25e-151)
(/ x (* y y))
(if (<= x 2.7e-164) (/ x y) (/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.12e+15) {
tmp = (y / x) / x;
} else if (x <= -1.25e-151) {
tmp = x / (y * y);
} else if (x <= 2.7e-164) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.12d+15)) then
tmp = (y / x) / x
else if (x <= (-1.25d-151)) then
tmp = x / (y * y)
else if (x <= 2.7d-164) then
tmp = x / y
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.12e+15) {
tmp = (y / x) / x;
} else if (x <= -1.25e-151) {
tmp = x / (y * y);
} else if (x <= 2.7e-164) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.12e+15: tmp = (y / x) / x elif x <= -1.25e-151: tmp = x / (y * y) elif x <= 2.7e-164: tmp = x / y else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.12e+15) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.25e-151) tmp = Float64(x / Float64(y * y)); elseif (x <= 2.7e-164) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.12e+15)
tmp = (y / x) / x;
elseif (x <= -1.25e-151)
tmp = x / (y * y);
elseif (x <= 2.7e-164)
tmp = x / y;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.12e+15], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.25e-151], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-164], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-151}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-164}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.12e15Initial program 65.1%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6486.7%
Applied egg-rr86.7%
Taylor expanded in x around inf
Simplified81.8%
Taylor expanded in x around inf
/-lowering-/.f6481.5%
Simplified81.5%
if -1.12e15 < x < -1.25000000000000001e-151Initial program 83.5%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6450.7%
Simplified50.7%
if -1.25000000000000001e-151 < x < 2.7000000000000001e-164Initial program 54.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6488.6%
Simplified88.6%
Taylor expanded in y around 0
/-lowering-/.f6484.4%
Simplified84.4%
if 2.7000000000000001e-164 < x Initial program 72.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6434.9%
Simplified34.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6437.6%
Applied egg-rr37.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -125000000000.0)
(/ y (* x x))
(if (<= x -3.5e-150)
(/ x (* y y))
(if (<= x 3.7e-164) (/ x y) (/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -125000000000.0) {
tmp = y / (x * x);
} else if (x <= -3.5e-150) {
tmp = x / (y * y);
} else if (x <= 3.7e-164) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-125000000000.0d0)) then
tmp = y / (x * x)
else if (x <= (-3.5d-150)) then
tmp = x / (y * y)
else if (x <= 3.7d-164) then
tmp = x / y
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -125000000000.0) {
tmp = y / (x * x);
} else if (x <= -3.5e-150) {
tmp = x / (y * y);
} else if (x <= 3.7e-164) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -125000000000.0: tmp = y / (x * x) elif x <= -3.5e-150: tmp = x / (y * y) elif x <= 3.7e-164: tmp = x / y else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -125000000000.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -3.5e-150) tmp = Float64(x / Float64(y * y)); elseif (x <= 3.7e-164) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -125000000000.0)
tmp = y / (x * x);
elseif (x <= -3.5e-150)
tmp = x / (y * y);
elseif (x <= 3.7e-164)
tmp = x / y;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -125000000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.5e-150], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e-164], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -125000000000:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-150}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-164}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.25e11Initial program 65.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6474.0%
Simplified74.0%
if -1.25e11 < x < -3.4999999999999998e-150Initial program 83.0%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6449.3%
Simplified49.3%
if -3.4999999999999998e-150 < x < 3.6999999999999999e-164Initial program 54.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6488.6%
Simplified88.6%
Taylor expanded in y around 0
/-lowering-/.f6484.4%
Simplified84.4%
if 3.6999999999999999e-164 < x Initial program 72.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6434.9%
Simplified34.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6437.6%
Applied egg-rr37.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y y))))
(if (<= x -1.9e+15)
(/ y (* x x))
(if (<= x -5.2e-152) t_0 (if (<= x 5.1e-164) (/ x y) t_0)))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.9e+15) {
tmp = y / (x * x);
} else if (x <= -5.2e-152) {
tmp = t_0;
} else if (x <= 5.1e-164) {
tmp = x / y;
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y * y)
if (x <= (-1.9d+15)) then
tmp = y / (x * x)
else if (x <= (-5.2d-152)) then
tmp = t_0
else if (x <= 5.1d-164) then
tmp = x / y
else
tmp = t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.9e+15) {
tmp = y / (x * x);
} else if (x <= -5.2e-152) {
tmp = t_0;
} else if (x <= 5.1e-164) {
tmp = x / y;
} else {
tmp = t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * y) tmp = 0 if x <= -1.9e+15: tmp = y / (x * x) elif x <= -5.2e-152: tmp = t_0 elif x <= 5.1e-164: tmp = x / y else: tmp = t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (x <= -1.9e+15) tmp = Float64(y / Float64(x * x)); elseif (x <= -5.2e-152) tmp = t_0; elseif (x <= 5.1e-164) tmp = Float64(x / y); else tmp = t_0; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * y);
tmp = 0.0;
if (x <= -1.9e+15)
tmp = y / (x * x);
elseif (x <= -5.2e-152)
tmp = t_0;
elseif (x <= 5.1e-164)
tmp = x / y;
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.9e+15], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.2e-152], t$95$0, If[LessEqual[x, 5.1e-164], N[(x / y), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+15}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-152}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-164}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.9e15Initial program 65.1%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.4%
Simplified75.4%
if -1.9e15 < x < -5.20000000000000026e-152 or 5.10000000000000036e-164 < x Initial program 75.3%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6439.0%
Simplified39.0%
if -5.20000000000000026e-152 < x < 5.10000000000000036e-164Initial program 54.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6488.6%
Simplified88.6%
Taylor expanded in y around 0
/-lowering-/.f6484.4%
Simplified84.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= x -4000000000.0)
(/ (* y (/ t_0 (+ y x))) (+ y x))
(* t_0 (/ (/ y (+ y 1.0)) (+ y x))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -4000000000.0) {
tmp = (y * (t_0 / (y + x))) / (y + x);
} else {
tmp = t_0 * ((y / (y + 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) :: t_0
real(8) :: tmp
t_0 = x / (y + x)
if (x <= (-4000000000.0d0)) then
tmp = (y * (t_0 / (y + x))) / (y + x)
else
tmp = t_0 * ((y / (y + 1.0d0)) / (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -4000000000.0) {
tmp = (y * (t_0 / (y + x))) / (y + x);
} else {
tmp = t_0 * ((y / (y + 1.0)) / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + x) tmp = 0 if x <= -4000000000.0: tmp = (y * (t_0 / (y + x))) / (y + x) else: tmp = t_0 * ((y / (y + 1.0)) / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (x <= -4000000000.0) tmp = Float64(Float64(y * Float64(t_0 / Float64(y + x))) / Float64(y + x)); else tmp = Float64(t_0 * Float64(Float64(y / Float64(y + 1.0)) / Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + x);
tmp = 0.0;
if (x <= -4000000000.0)
tmp = (y * (t_0 / (y + x))) / (y + x);
else
tmp = t_0 * ((y / (y + 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_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4000000000.0], N[(N[(y * N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;x \leq -4000000000:\\
\;\;\;\;\frac{y \cdot \frac{t\_0}{y + x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{\frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -4e9Initial program 65.8%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
Simplified99.8%
if -4e9 < x Initial program 67.7%
times-fracN/A
associate-*l/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6485.2%
Simplified85.2%
Final simplification88.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= x -4000000000.0)
(* t_0 (/ (/ y (+ y x)) (+ y x)))
(* t_0 (/ (/ y (+ y 1.0)) (+ y x))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -4000000000.0) {
tmp = t_0 * ((y / (y + x)) / (y + x));
} else {
tmp = t_0 * ((y / (y + 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) :: t_0
real(8) :: tmp
t_0 = x / (y + x)
if (x <= (-4000000000.0d0)) then
tmp = t_0 * ((y / (y + x)) / (y + x))
else
tmp = t_0 * ((y / (y + 1.0d0)) / (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (x <= -4000000000.0) {
tmp = t_0 * ((y / (y + x)) / (y + x));
} else {
tmp = t_0 * ((y / (y + 1.0)) / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + x) tmp = 0 if x <= -4000000000.0: tmp = t_0 * ((y / (y + x)) / (y + x)) else: tmp = t_0 * ((y / (y + 1.0)) / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (x <= -4000000000.0) tmp = Float64(t_0 * Float64(Float64(y / Float64(y + x)) / Float64(y + x))); else tmp = Float64(t_0 * Float64(Float64(y / Float64(y + 1.0)) / Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + x);
tmp = 0.0;
if (x <= -4000000000.0)
tmp = t_0 * ((y / (y + x)) / (y + x));
else
tmp = t_0 * ((y / (y + 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_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4000000000.0], N[(t$95$0 * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;x \leq -4000000000:\\
\;\;\;\;t\_0 \cdot \frac{\frac{y}{y + x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{\frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -4e9Initial program 65.8%
times-fracN/A
associate-*l/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.7%
Applied egg-rr99.7%
Taylor expanded in x around inf
Simplified99.7%
if -4e9 < x Initial program 67.7%
times-fracN/A
associate-*l/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6485.2%
Simplified85.2%
Final simplification88.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.6e-5) (/ (/ y (+ y (+ x 1.0))) (+ x (* y 2.0))) (* (/ x (+ y x)) (/ (/ y (+ y 1.0)) (+ y x)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.6e-5) {
tmp = (y / (y + (x + 1.0))) / (x + (y * 2.0));
} else {
tmp = (x / (y + x)) * ((y / (y + 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 <= (-2.6d-5)) then
tmp = (y / (y + (x + 1.0d0))) / (x + (y * 2.0d0))
else
tmp = (x / (y + x)) * ((y / (y + 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 <= -2.6e-5) {
tmp = (y / (y + (x + 1.0))) / (x + (y * 2.0));
} else {
tmp = (x / (y + x)) * ((y / (y + 1.0)) / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.6e-5: tmp = (y / (y + (x + 1.0))) / (x + (y * 2.0)) else: tmp = (x / (y + x)) * ((y / (y + 1.0)) / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.6e-5) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(x + Float64(y * 2.0))); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(y + 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 <= -2.6e-5)
tmp = (y / (y + (x + 1.0))) / (x + (y * 2.0));
else
tmp = (x / (y + x)) * ((y / (y + 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, -2.6e-5], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{y}{y + \left(x + 1\right)}}{x + y \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -2.59999999999999984e-5Initial program 68.7%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6488.0%
Applied egg-rr88.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6477.0%
Simplified77.0%
if -2.59999999999999984e-5 < x Initial program 66.9%
times-fracN/A
associate-*l/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6485.7%
Simplified85.7%
Final simplification83.7%
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 1.0))))) (if (<= y 2.4e-148) (/ t_0 (+ x (* y 2.0))) (* (/ t_0 (+ y x)) (/ x y)))))
assert(x < y);
double code(double x, double y) {
double t_0 = y / (y + (x + 1.0));
double tmp;
if (y <= 2.4e-148) {
tmp = t_0 / (x + (y * 2.0));
} else {
tmp = (t_0 / (y + x)) * (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) :: t_0
real(8) :: tmp
t_0 = y / (y + (x + 1.0d0))
if (y <= 2.4d-148) then
tmp = t_0 / (x + (y * 2.0d0))
else
tmp = (t_0 / (y + x)) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (y + (x + 1.0));
double tmp;
if (y <= 2.4e-148) {
tmp = t_0 / (x + (y * 2.0));
} else {
tmp = (t_0 / (y + x)) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (y + (x + 1.0)) tmp = 0 if y <= 2.4e-148: tmp = t_0 / (x + (y * 2.0)) else: tmp = (t_0 / (y + x)) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(y + Float64(x + 1.0))) tmp = 0.0 if (y <= 2.4e-148) tmp = Float64(t_0 / Float64(x + Float64(y * 2.0))); else tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (y + (x + 1.0));
tmp = 0.0;
if (y <= 2.4e-148)
tmp = t_0 / (x + (y * 2.0));
else
tmp = (t_0 / (y + x)) * (x / 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[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.4e-148], N[(t$95$0 / N[(x + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + \left(x + 1\right)}\\
\mathbf{if}\;y \leq 2.4 \cdot 10^{-148}:\\
\;\;\;\;\frac{t\_0}{x + y \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{y + x} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < 2.4000000000000001e-148Initial program 67.8%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6483.8%
Applied egg-rr83.8%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6455.2%
Simplified55.2%
if 2.4000000000000001e-148 < y Initial program 66.2%
times-fracN/A
associate-*l/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.7%
Applied egg-rr99.7%
Taylor expanded in x around 0
/-lowering-/.f6475.0%
Simplified75.0%
Final simplification61.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.35e-157) (/ (/ y (+ y (+ x 1.0))) (+ x (* y 2.0))) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.35e-157) {
tmp = (y / (y + (x + 1.0))) / (x + (y * 2.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 <= (-1.35d-157)) then
tmp = (y / (y + (x + 1.0d0))) / (x + (y * 2.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 <= -1.35e-157) {
tmp = (y / (y + (x + 1.0))) / (x + (y * 2.0));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.35e-157: tmp = (y / (y + (x + 1.0))) / (x + (y * 2.0)) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.35e-157) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(x + Float64(y * 2.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 <= -1.35e-157)
tmp = (y / (y + (x + 1.0))) / (x + (y * 2.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, -1.35e-157], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y * 2.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 -1.35 \cdot 10^{-157}:\\
\;\;\;\;\frac{\frac{y}{y + \left(x + 1\right)}}{x + y \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -1.35e-157Initial program 71.9%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6491.0%
Applied egg-rr91.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6468.3%
Simplified68.3%
if -1.35e-157 < x Initial program 64.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6459.0%
Simplified59.0%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6460.6%
Applied egg-rr60.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4.2e+51) (/ (/ y x) x) (if (<= x -1.15e-113) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.2e+51) {
tmp = (y / x) / x;
} else if (x <= -1.15e-113) {
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.2d+51)) then
tmp = (y / x) / x
else if (x <= (-1.15d-113)) 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.2e+51) {
tmp = (y / x) / x;
} else if (x <= -1.15e-113) {
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.2e+51: tmp = (y / x) / x elif x <= -1.15e-113: 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.2e+51) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.15e-113) 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.2e+51)
tmp = (y / x) / x;
elseif (x <= -1.15e-113)
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.2e+51], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.15e-113], 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.2 \cdot 10^{+51}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-113}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -4.2000000000000002e51Initial program 57.8%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6484.0%
Applied egg-rr84.0%
Taylor expanded in x around inf
Simplified82.6%
Taylor expanded in x around inf
/-lowering-/.f6482.2%
Simplified82.2%
if -4.2000000000000002e51 < x < -1.15000000000000004e-113Initial program 88.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6452.4%
Simplified52.4%
if -1.15000000000000004e-113 < x Initial program 64.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6459.1%
Simplified59.1%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6460.6%
Applied egg-rr60.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4e+51) (/ (/ y x) x) (if (<= x -1.55e-114) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4e+51) {
tmp = (y / x) / x;
} else if (x <= -1.55e-114) {
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 <= (-4d+51)) then
tmp = (y / x) / x
else if (x <= (-1.55d-114)) 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 <= -4e+51) {
tmp = (y / x) / x;
} else if (x <= -1.55e-114) {
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 <= -4e+51: tmp = (y / x) / x elif x <= -1.55e-114: 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 <= -4e+51) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.55e-114) 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 <= -4e+51)
tmp = (y / x) / x;
elseif (x <= -1.55e-114)
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, -4e+51], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.55e-114], 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 \cdot 10^{+51}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-114}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -4e51Initial program 57.8%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6484.0%
Applied egg-rr84.0%
Taylor expanded in x around inf
Simplified82.6%
Taylor expanded in x around inf
/-lowering-/.f6482.2%
Simplified82.2%
if -4e51 < x < -1.55e-114Initial program 88.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6452.4%
Simplified52.4%
if -1.55e-114 < x Initial program 64.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6459.1%
Simplified59.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (/ x (+ y x)) (/ (/ y (+ y (+ x 1.0))) (+ y x))))
assert(x < y);
double code(double x, double y) {
return (x / (y + x)) * ((y / (y + (x + 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 = (x / (y + x)) * ((y / (y + (x + 1.0d0))) / (y + x))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(y + x))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(x + 1\right)}}{y + x}
\end{array}
Initial program 67.3%
times-fracN/A
associate-*l/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -5.5e-112) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -5.5e-112) {
tmp = (y / (x + 1.0)) / (y + x);
} 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 <= (-5.5d-112)) then
tmp = (y / (x + 1.0d0)) / (y + x)
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 <= -5.5e-112) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -5.5e-112: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -5.5e-112) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); 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 <= -5.5e-112)
tmp = (y / (x + 1.0)) / (y + x);
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, -5.5e-112], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $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 -5.5 \cdot 10^{-112}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -5.5e-112Initial program 72.5%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.7%
Applied egg-rr99.7%
div-invN/A
associate-*l/N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f6468.2%
Simplified68.2%
if -5.5e-112 < x Initial program 64.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6459.1%
Simplified59.1%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6460.6%
Applied egg-rr60.6%
Final simplification63.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -6.2e-112) (/ (/ y (+ x 1.0)) x) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -6.2e-112) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-6.2d-112)) then
tmp = (y / (x + 1.0d0)) / x
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -6.2e-112) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -6.2e-112: tmp = (y / (x + 1.0)) / x else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -6.2e-112) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); 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 <= -6.2e-112)
tmp = (y / (x + 1.0)) / x;
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -6.2e-112], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $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 -6.2 \cdot 10^{-112}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -6.1999999999999995e-112Initial program 72.5%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6491.5%
Applied egg-rr91.5%
Taylor expanded in x around inf
Simplified68.2%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6467.8%
Simplified67.8%
if -6.1999999999999995e-112 < x Initial program 64.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6459.1%
Simplified59.1%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6460.6%
Applied egg-rr60.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -7000000000000.0) (/ (/ y x) x) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -7000000000000.0) {
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 <= (-7000000000000.0d0)) 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 <= -7000000000000.0) {
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 <= -7000000000000.0: 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 <= -7000000000000.0) 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 <= -7000000000000.0)
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, -7000000000000.0], 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 -7000000000000:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -7e12Initial program 65.8%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6486.9%
Applied egg-rr86.9%
Taylor expanded in x around inf
Simplified80.3%
Taylor expanded in x around inf
/-lowering-/.f6480.0%
Simplified80.0%
if -7e12 < x Initial program 67.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6457.7%
Simplified57.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.0)
tmp = x / y;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1Initial program 69.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6444.4%
Simplified44.4%
Taylor expanded in y around 0
/-lowering-/.f6431.0%
Simplified31.0%
if 1 < y Initial program 58.1%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6469.1%
Simplified69.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -7500000000.0) (/ 1.0 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -7500000000.0) {
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 <= (-7500000000.0d0)) 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 <= -7500000000.0) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -7500000000.0: tmp = 1.0 / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -7500000000.0) 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 <= -7500000000.0)
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, -7500000000.0], 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 -7500000000:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -7.5e9Initial program 65.8%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6486.9%
Applied egg-rr86.9%
Taylor expanded in x around inf
Simplified80.3%
Taylor expanded in y around inf
/-lowering-/.f646.0%
Simplified6.0%
if -7.5e9 < x Initial program 67.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6457.7%
Simplified57.7%
Taylor expanded in y around 0
/-lowering-/.f6437.5%
Simplified37.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 x))
assert(x < y);
double code(double x, double y) {
return 1.0 / x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / x
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{x}
\end{array}
Initial program 67.3%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6486.1%
Applied egg-rr86.1%
Taylor expanded in x around inf
Simplified49.9%
Taylor expanded in y around inf
/-lowering-/.f644.0%
Simplified4.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 0.5 y))
assert(x < y);
double code(double x, double y) {
return 0.5 / 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 = 0.5d0 / y
end function
assert x < y;
public static double code(double x, double y) {
return 0.5 / y;
}
[x, y] = sort([x, y]) def code(x, y): return 0.5 / y
x, y = sort([x, y]) function code(x, y) return Float64(0.5 / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 0.5 / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(0.5 / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{0.5}{y}
\end{array}
Initial program 67.3%
times-fracN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6486.1%
Applied egg-rr86.1%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6451.6%
Simplified51.6%
Taylor expanded in y around inf
/-lowering-/.f644.0%
Simplified4.0%
(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 2024161
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))