
(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 22 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 (/ x (+ y x))) (+ x (+ y 1.0))) (+ y x)))
assert(x < y);
double code(double x, double y) {
return ((y * (x / (y + x))) / (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 * (x / (y + x))) / (x + (y + 1.0d0))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
return ((y * (x / (y + x))) / (x + (y + 1.0))) / (y + x);
}
[x, y] = sort([x, y]) def code(x, y): return ((y * (x / (y + x))) / (x + (y + 1.0))) / (y + x)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(y * Float64(x / Float64(y + x))) / Float64(x + Float64(y + 1.0))) / Float64(y + x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((y * (x / (y + x))) / (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[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y \cdot \frac{x}{y + x}}{x + \left(y + 1\right)}}{y + x}
\end{array}
Initial program 63.3%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+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 -70000000000.0)
(* (/ x (+ y x)) (/ (/ y (+ y x)) (+ y x)))
(if (<= x -3.2e-236)
(/ (/ y (+ x 1.0)) (* x (+ 1.0 (/ y x))))
(/ (/ x (+ x (+ y 1.0))) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -70000000000.0) {
tmp = (x / (y + x)) * ((y / (y + x)) / (y + x));
} else if (x <= -3.2e-236) {
tmp = (y / (x + 1.0)) / (x * (1.0 + (y / x)));
} else {
tmp = (x / (x + (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 <= (-70000000000.0d0)) then
tmp = (x / (y + x)) * ((y / (y + x)) / (y + x))
else if (x <= (-3.2d-236)) then
tmp = (y / (x + 1.0d0)) / (x * (1.0d0 + (y / x)))
else
tmp = (x / (x + (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 <= -70000000000.0) {
tmp = (x / (y + x)) * ((y / (y + x)) / (y + x));
} else if (x <= -3.2e-236) {
tmp = (y / (x + 1.0)) / (x * (1.0 + (y / x)));
} else {
tmp = (x / (x + (y + 1.0))) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -70000000000.0: tmp = (x / (y + x)) * ((y / (y + x)) / (y + x)) elif x <= -3.2e-236: tmp = (y / (x + 1.0)) / (x * (1.0 + (y / x))) else: tmp = (x / (x + (y + 1.0))) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -70000000000.0) tmp = Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(y + x)) / Float64(y + x))); elseif (x <= -3.2e-236) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x * Float64(1.0 + Float64(y / x)))); else tmp = Float64(Float64(x / Float64(x + 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 <= -70000000000.0)
tmp = (x / (y + x)) * ((y / (y + x)) / (y + x));
elseif (x <= -3.2e-236)
tmp = (y / (x + 1.0)) / (x * (1.0 + (y / x)));
else
tmp = (x / (x + (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, -70000000000.0], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.2e-236], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x * N[(1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -70000000000:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{y + x}}{y + x}\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-236}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x \cdot \left(1 + \frac{y}{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y + x}\\
\end{array}
\end{array}
if x < -7e10Initial program 52.6%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
associate-/l*N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified99.8%
if -7e10 < x < -3.2e-236Initial program 81.8%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6447.1%
Simplified47.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6454.9%
Simplified54.9%
if -3.2e-236 < x Initial program 61.3%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified48.6%
Final simplification61.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -3.35e+69)
(/ (/ y x) x)
(if (<= y 3.2e-190)
(/ y (* x (+ x 1.0)))
(if (<= y 4.05e+15) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ y x))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -3.35e+69) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
tmp = y / (x * (x + 1.0));
} else if (y <= 4.05e+15) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (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 <= (-3.35d+69)) then
tmp = (y / x) / x
else if (y <= 3.2d-190) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 4.05d+15) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -3.35e+69) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
tmp = y / (x * (x + 1.0));
} else if (y <= 4.05e+15) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -3.35e+69: tmp = (y / x) / x elif y <= 3.2e-190: tmp = y / (x * (x + 1.0)) elif y <= 4.05e+15: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -3.35e+69) tmp = Float64(Float64(y / x) / x); elseif (y <= 3.2e-190) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 4.05e+15) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -3.35e+69)
tmp = (y / x) / x;
elseif (y <= 3.2e-190)
tmp = y / (x * (x + 1.0));
elseif (y <= 4.05e+15)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) / (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, -3.35e+69], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.2e-190], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.05e+15], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.35 \cdot 10^{+69}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 4.05 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < -3.35000000000000005e69Initial program 37.6%
Taylor expanded in x around inf
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f641.4%
Simplified1.4%
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
/-lowering-/.f64N/A
/-lowering-/.f6428.4%
Applied egg-rr28.4%
if -3.35000000000000005e69 < y < 3.2000000000000001e-190Initial program 67.7%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6479.8%
Simplified79.8%
if 3.2000000000000001e-190 < y < 4.05e15Initial program 82.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6435.5%
Simplified35.5%
if 4.05e15 < y Initial program 64.6%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
/-lowering-/.f6475.8%
Simplified75.8%
Final simplification59.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -3.5e+69)
(/ (/ y x) x)
(if (<= y 3.2e-190)
(/ y (* x (+ x 1.0)))
(if (<= y 3e+103) (/ x (* y (+ y 1.0))) (/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -3.5e+69) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
tmp = y / (x * (x + 1.0));
} else if (y <= 3e+103) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-3.5d+69)) then
tmp = (y / x) / x
else if (y <= 3.2d-190) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 3d+103) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -3.5e+69) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
tmp = y / (x * (x + 1.0));
} else if (y <= 3e+103) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -3.5e+69: tmp = (y / x) / x elif y <= 3.2e-190: tmp = y / (x * (x + 1.0)) elif y <= 3e+103: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -3.5e+69) tmp = Float64(Float64(y / x) / x); elseif (y <= 3.2e-190) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 3e+103) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -3.5e+69)
tmp = (y / x) / x;
elseif (y <= 3.2e-190)
tmp = y / (x * (x + 1.0));
elseif (y <= 3e+103)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -3.5e+69], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.2e-190], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+103], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+103}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -3.49999999999999987e69Initial program 37.6%
Taylor expanded in x around inf
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f641.4%
Simplified1.4%
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
/-lowering-/.f64N/A
/-lowering-/.f6428.4%
Applied egg-rr28.4%
if -3.49999999999999987e69 < y < 3.2000000000000001e-190Initial program 67.7%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6479.8%
Simplified79.8%
if 3.2000000000000001e-190 < y < 3e103Initial program 79.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6439.4%
Simplified39.4%
if 3e103 < y Initial program 59.8%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6480.3%
Simplified80.3%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6491.7%
Applied egg-rr91.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -4.6e-188)
(/ (/ y x) x)
(if (<= y 3.2e-190)
(/ y (+ y x))
(if (<= y 4e+101) (/ x (* y (+ y 1.0))) (/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -4.6e-188) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
tmp = y / (y + x);
} else if (y <= 4e+101) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-4.6d-188)) then
tmp = (y / x) / x
else if (y <= 3.2d-190) then
tmp = y / (y + x)
else if (y <= 4d+101) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -4.6e-188) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
tmp = y / (y + x);
} else if (y <= 4e+101) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -4.6e-188: tmp = (y / x) / x elif y <= 3.2e-190: tmp = y / (y + x) elif y <= 4e+101: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -4.6e-188) tmp = Float64(Float64(y / x) / x); elseif (y <= 3.2e-190) tmp = Float64(y / Float64(y + x)); elseif (y <= 4e+101) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -4.6e-188)
tmp = (y / x) / x;
elseif (y <= 3.2e-190)
tmp = y / (y + x);
elseif (y <= 4e+101)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -4.6e-188], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.2e-190], N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+101], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-188}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{y}{y + x}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+101}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -4.6e-188Initial program 57.0%
Taylor expanded in x around inf
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.7%
Simplified20.7%
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
/-lowering-/.f64N/A
/-lowering-/.f6439.2%
Applied egg-rr39.2%
if -4.6e-188 < y < 3.2000000000000001e-190Initial program 55.9%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6486.6%
Simplified86.6%
Taylor expanded in x around 0
Simplified72.5%
if 3.2000000000000001e-190 < y < 3.9999999999999999e101Initial program 79.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6439.4%
Simplified39.4%
if 3.9999999999999999e101 < y Initial program 59.8%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6480.3%
Simplified80.3%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6491.7%
Applied egg-rr91.7%
Final simplification53.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -9e-188) (/ (/ y x) x) (if (<= y 3.2e-190) (/ y (+ y x)) (if (<= y 1.0) (/ x y) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -9e-188) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
tmp = y / (y + x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-9d-188)) then
tmp = (y / x) / x
else if (y <= 3.2d-190) then
tmp = y / (y + x)
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -9e-188) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
tmp = y / (y + x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -9e-188: tmp = (y / x) / x elif y <= 3.2e-190: tmp = y / (y + x) elif y <= 1.0: tmp = x / y else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -9e-188) tmp = Float64(Float64(y / x) / x); elseif (y <= 3.2e-190) tmp = Float64(y / Float64(y + x)); elseif (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -9e-188)
tmp = (y / x) / x;
elseif (y <= 3.2e-190)
tmp = y / (y + x);
elseif (y <= 1.0)
tmp = x / y;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -9e-188], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.2e-190], N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-188}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{y}{y + x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -8.99999999999999986e-188Initial program 57.0%
Taylor expanded in x around inf
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.7%
Simplified20.7%
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
/-lowering-/.f64N/A
/-lowering-/.f6439.2%
Applied egg-rr39.2%
if -8.99999999999999986e-188 < y < 3.2000000000000001e-190Initial program 55.9%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6486.6%
Simplified86.6%
Taylor expanded in x around 0
Simplified72.5%
if 3.2000000000000001e-190 < y < 1Initial program 84.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6436.2%
Simplified36.2%
Taylor expanded in y around 0
/-lowering-/.f6434.9%
Simplified34.9%
if 1 < y Initial program 63.6%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
Final simplification53.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -1.4e-187) (/ y (* x x)) (if (<= y 2.7e-190) (/ y (+ y x)) (if (<= y 1.0) (/ x y) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1.4e-187) {
tmp = y / (x * x);
} else if (y <= 2.7e-190) {
tmp = y / (y + x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.4d-187)) then
tmp = y / (x * x)
else if (y <= 2.7d-190) then
tmp = y / (y + x)
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -1.4e-187) {
tmp = y / (x * x);
} else if (y <= 2.7e-190) {
tmp = y / (y + x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1.4e-187: tmp = y / (x * x) elif y <= 2.7e-190: tmp = y / (y + x) elif y <= 1.0: tmp = x / y else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1.4e-187) tmp = Float64(y / Float64(x * x)); elseif (y <= 2.7e-190) tmp = Float64(y / Float64(y + x)); elseif (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -1.4e-187)
tmp = y / (x * x);
elseif (y <= 2.7e-190)
tmp = y / (y + x);
elseif (y <= 1.0)
tmp = x / y;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -1.4e-187], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-190], N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-187}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-190}:\\
\;\;\;\;\frac{y}{y + x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -1.4e-187Initial program 57.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6432.1%
Simplified32.1%
if -1.4e-187 < y < 2.6999999999999999e-190Initial program 55.9%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6486.6%
Simplified86.6%
Taylor expanded in x around 0
Simplified72.5%
if 2.6999999999999999e-190 < y < 1Initial program 84.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6436.2%
Simplified36.2%
Taylor expanded in y around 0
/-lowering-/.f6434.9%
Simplified34.9%
if 1 < y Initial program 63.6%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.1%
Applied egg-rr74.1%
Final simplification50.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -1.85e-187) (/ y (* x x)) (if (<= y 3.2e-190) (/ y (+ y x)) (if (<= y 1.0) (/ x y) (/ x (* y y))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1.85e-187) {
tmp = y / (x * x);
} else if (y <= 3.2e-190) {
tmp = y / (y + x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.85d-187)) then
tmp = y / (x * x)
else if (y <= 3.2d-190) then
tmp = y / (y + x)
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -1.85e-187) {
tmp = y / (x * x);
} else if (y <= 3.2e-190) {
tmp = y / (y + x);
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1.85e-187: tmp = y / (x * x) elif y <= 3.2e-190: tmp = y / (y + x) elif y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1.85e-187) tmp = Float64(y / Float64(x * x)); elseif (y <= 3.2e-190) tmp = Float64(y / Float64(y + x)); elseif (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.85e-187)
tmp = y / (x * x);
elseif (y <= 3.2e-190)
tmp = y / (y + x);
elseif (y <= 1.0)
tmp = x / y;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -1.85e-187], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-190], N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision], 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.85 \cdot 10^{-187}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{y}{y + x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -1.85000000000000005e-187Initial program 57.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6432.1%
Simplified32.1%
if -1.85000000000000005e-187 < y < 3.2000000000000001e-190Initial program 55.9%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6486.6%
Simplified86.6%
Taylor expanded in x around 0
Simplified72.5%
if 3.2000000000000001e-190 < y < 1Initial program 84.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6436.2%
Simplified36.2%
Taylor expanded in y around 0
/-lowering-/.f6434.9%
Simplified34.9%
if 1 < y Initial program 63.6%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
Final simplification49.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -2e-187) (/ y (* x x)) (if (<= y 3.2e-190) (/ y x) (if (<= y 1.0) (/ x y) (/ x (* y y))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2e-187) {
tmp = y / (x * x);
} else if (y <= 3.2e-190) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2d-187)) then
tmp = y / (x * x)
else if (y <= 3.2d-190) then
tmp = y / x
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -2e-187) {
tmp = y / (x * x);
} else if (y <= 3.2e-190) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -2e-187: tmp = y / (x * x) elif y <= 3.2e-190: tmp = y / x elif y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2e-187) tmp = Float64(y / Float64(x * x)); elseif (y <= 3.2e-190) tmp = Float64(y / x); elseif (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 <= -2e-187)
tmp = y / (x * x);
elseif (y <= 3.2e-190)
tmp = y / x;
elseif (y <= 1.0)
tmp = x / y;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -2e-187], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-190], N[(y / x), $MachinePrecision], 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 -2 \cdot 10^{-187}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -2e-187Initial program 57.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6432.1%
Simplified32.1%
if -2e-187 < y < 3.2000000000000001e-190Initial program 55.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6486.6%
Simplified86.6%
Taylor expanded in x around 0
/-lowering-/.f6472.5%
Simplified72.5%
if 3.2000000000000001e-190 < y < 1Initial program 84.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6436.2%
Simplified36.2%
Taylor expanded in y around 0
/-lowering-/.f6434.9%
Simplified34.9%
if 1 < y Initial program 63.6%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
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)) (+ y x)))) (if (<= x -1.0) (* (/ x (+ y x)) t_0) (* t_0 (/ x (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double t_0 = (y / (y + x)) / (y + x);
double tmp;
if (x <= -1.0) {
tmp = (x / (y + x)) * t_0;
} else {
tmp = t_0 * (x / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y / (y + x)) / (y + x)
if (x <= (-1.0d0)) then
tmp = (x / (y + x)) * t_0
else
tmp = t_0 * (x / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / (y + x)) / (y + x);
double tmp;
if (x <= -1.0) {
tmp = (x / (y + x)) * t_0;
} else {
tmp = t_0 * (x / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / (y + x)) / (y + x) tmp = 0 if x <= -1.0: tmp = (x / (y + x)) * t_0 else: tmp = t_0 * (x / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / Float64(y + x)) / Float64(y + x)) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(x / Float64(y + x)) * t_0); else tmp = Float64(t_0 * Float64(x / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / (y + x)) / (y + x);
tmp = 0.0;
if (x <= -1.0)
tmp = (x / (y + x)) * t_0;
else
tmp = t_0 * (x / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{y + x}}{y + x}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{x}{y + x} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -1Initial program 55.6%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
associate-/l*N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified97.4%
if -1 < x Initial program 65.8%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
associate-/l*N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.7%
Applied egg-rr99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6486.6%
Simplified86.6%
Final simplification89.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -7e+65) (/ (/ y x) x) (if (<= y 3.2e-190) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -7e+65) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
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 (y <= (-7d+65)) then
tmp = (y / x) / x
else if (y <= 3.2d-190) 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 (y <= -7e+65) {
tmp = (y / x) / x;
} else if (y <= 3.2e-190) {
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 y <= -7e+65: tmp = (y / x) / x elif y <= 3.2e-190: 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 (y <= -7e+65) tmp = Float64(Float64(y / x) / x); elseif (y <= 3.2e-190) 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 (y <= -7e+65)
tmp = (y / x) / x;
elseif (y <= 3.2e-190)
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[y, -7e+65], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.2e-190], 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}\;y \leq -7 \cdot 10^{+65}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if y < -7.0000000000000002e65Initial program 38.7%
Taylor expanded in x around inf
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.2%
Simplified3.2%
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
/-lowering-/.f64N/A
/-lowering-/.f6429.7%
Applied egg-rr29.7%
if -7.0000000000000002e65 < y < 3.2000000000000001e-190Initial program 67.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6479.6%
Simplified79.6%
if 3.2000000000000001e-190 < y Initial program 72.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6453.5%
Simplified53.5%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6457.5%
Applied egg-rr57.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (/ x (+ x (+ y 1.0))) (/ (/ y (+ y x)) (+ y x))))
assert(x < y);
double code(double x, double y) {
return (x / (x + (y + 1.0))) * ((y / (y + 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 = (x / (x + (y + 1.0d0))) * ((y / (y + x)) / (y + x))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (x + (y + 1.0))) * ((y / (y + x)) / (y + x));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (x + (y + 1.0))) * ((y / (y + x)) / (y + x))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(x + Float64(y + 1.0))) * Float64(Float64(y / Float64(y + x)) / Float64(y + x))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (x + (y + 1.0))) * ((y / (y + x)) / (y + x));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{x + \left(y + 1\right)} \cdot \frac{\frac{y}{y + x}}{y + x}
\end{array}
Initial program 63.3%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
associate-/l*N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.2e-190) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x (+ x (+ y 1.0))) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.2e-190) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (x + (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 (y <= 3.2d-190) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = (x / (x + (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 (y <= 3.2e-190) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (x + (y + 1.0))) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.2e-190: tmp = (y / (y + x)) / (x + 1.0) else: tmp = (x / (x + (y + 1.0))) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.2e-190) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 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 (y <= 3.2e-190)
tmp = (y / (y + x)) / (x + 1.0);
else
tmp = (x / (x + (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[y, 3.2e-190], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y + x}\\
\end{array}
\end{array}
if y < 3.2000000000000001e-190Initial program 56.6%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6461.4%
Simplified61.4%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6461.4%
Applied egg-rr61.4%
if 3.2000000000000001e-190 < y Initial program 72.7%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified58.6%
Final simplification60.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.2e-190) (/ y x) (if (<= y 1.0) (/ x y) (/ x (* y y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.2e-190) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.2d-190) then
tmp = y / x
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.2e-190) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.2e-190: tmp = y / x elif y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.2e-190) tmp = Float64(y / x); elseif (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 <= 3.2e-190)
tmp = y / x;
elseif (y <= 1.0)
tmp = x / y;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.2e-190], N[(y / x), $MachinePrecision], 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 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 3.2000000000000001e-190Initial program 56.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6456.2%
Simplified56.2%
Taylor expanded in x around 0
/-lowering-/.f6436.3%
Simplified36.3%
if 3.2000000000000001e-190 < y < 1Initial program 84.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6436.2%
Simplified36.2%
Taylor expanded in y around 0
/-lowering-/.f6434.9%
Simplified34.9%
if 1 < y Initial program 63.6%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6467.1%
Simplified67.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.2e-190) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.2e-190) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (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 (y <= 3.2d-190) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = (x / (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 (y <= 3.2e-190) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.2e-190: tmp = (y / (y + x)) / (x + 1.0) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.2e-190) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / 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 (y <= 3.2e-190)
tmp = (y / (y + x)) / (x + 1.0);
else
tmp = (x / (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[y, 3.2e-190], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 3.2000000000000001e-190Initial program 56.6%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6461.4%
Simplified61.4%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6461.4%
Applied egg-rr61.4%
if 3.2000000000000001e-190 < y Initial program 72.7%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+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-+.f6457.9%
Simplified57.9%
Final simplification59.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.2e-190) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.2e-190) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (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 (y <= 3.2d-190) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = (x / (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 (y <= 3.2e-190) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.2e-190: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.2e-190) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(x / 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 (y <= 3.2e-190)
tmp = (y / (x + 1.0)) / (y + x);
else
tmp = (x / (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[y, 3.2e-190], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 3.2000000000000001e-190Initial program 56.6%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6461.4%
Simplified61.4%
if 3.2000000000000001e-190 < y Initial program 72.7%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+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-+.f6457.9%
Simplified57.9%
Final simplification59.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.2e-190) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.2e-190) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (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 (y <= 3.2d-190) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (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 (y <= 3.2e-190) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.2e-190: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.2e-190) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / 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 (y <= 3.2e-190)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / (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[y, 3.2e-190], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 3.2000000000000001e-190Initial program 56.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6456.2%
Simplified56.2%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6460.8%
Applied egg-rr60.8%
if 3.2000000000000001e-190 < y Initial program 72.7%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+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-+.f6457.9%
Simplified57.9%
Final simplification59.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.2e-190) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.2e-190) {
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 (y <= 3.2d-190) 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 (y <= 3.2e-190) {
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 y <= 3.2e-190: 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 (y <= 3.2e-190) tmp = Float64(Float64(y / 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 (y <= 3.2e-190)
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[y, 3.2e-190], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $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}\;y \leq 3.2 \cdot 10^{-190}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if y < 3.2000000000000001e-190Initial program 56.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6456.2%
Simplified56.2%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6460.8%
Applied egg-rr60.8%
if 3.2000000000000001e-190 < y Initial program 72.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6453.5%
Simplified53.5%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6457.5%
Applied egg-rr57.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.2e-236) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.2e-236) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.2d-236)) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.2e-236) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.2e-236: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.2e-236) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.2e-236)
tmp = y / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.2e-236], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -3.2e-236Initial program 66.1%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6454.1%
Simplified54.1%
Taylor expanded in x around 0
/-lowering-/.f6434.9%
Simplified34.9%
if -3.2e-236 < x Initial program 61.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6445.9%
Simplified45.9%
Taylor expanded in y around 0
/-lowering-/.f6430.3%
Simplified30.3%
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 63.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6444.3%
Simplified44.3%
Taylor expanded in y around 0
/-lowering-/.f6423.8%
Simplified23.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 y))
assert(x < y);
double code(double x, double y) {
return 1.0 / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / y
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / y;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / y
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{y}
\end{array}
Initial program 63.3%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6429.6%
Simplified29.6%
Taylor expanded in x around inf
/-lowering-/.f644.2%
Simplified4.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 1.0)
assert(x < y);
double code(double x, double y) {
return 1.0;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
assert x < y;
public static double code(double x, double y) {
return 1.0;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0
x, y = sort([x, y]) function code(x, y) return 1.0 end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := 1.0
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
1
\end{array}
Initial program 63.3%
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6454.0%
Simplified54.0%
Taylor expanded in x around 0
Simplified3.6%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2024152
(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))))