
(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 19 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 (+ 1.0 (/ y x))) (+ y x)) (+ x (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
return ((y / (1.0 + (y / x))) / (y + x)) / (x + (y + 1.0));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (1.0d0 + (y / x))) / (y + x)) / (x + (y + 1.0d0))
end function
assert x < y;
public static double code(double x, double y) {
return ((y / (1.0 + (y / x))) / (y + x)) / (x + (y + 1.0));
}
[x, y] = sort([x, y]) def code(x, y): return ((y / (1.0 + (y / x))) / (y + x)) / (x + (y + 1.0))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(y / Float64(1.0 + Float64(y / x))) / Float64(y + x)) / Float64(x + Float64(y + 1.0))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((y / (1.0 + (y / x))) / (y + x)) / (x + (y + 1.0));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(y / N[(1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{\frac{y}{1 + \frac{y}{x}}}{y + x}}{x + \left(y + 1\right)}
\end{array}
Initial program 68.8%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6468.8%
Simplified68.8%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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 x around inf
+-lowering-+.f64N/A
/-lowering-/.f6499.8%
Simplified99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 9.5e-152)
(/ (/ y (+ y x)) (+ x (+ y 1.0)))
(if (<= y 3200000.0)
(* x (/ (/ 1.0 (+ y x)) (+ y (+ 1.0 x))))
(/ (/ (/ x (+ y x)) (+ y x)) (/ (+ y x) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 9.5e-152) {
tmp = (y / (y + x)) / (x + (y + 1.0));
} else if (y <= 3200000.0) {
tmp = x * ((1.0 / (y + x)) / (y + (1.0 + x)));
} else {
tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 9.5d-152) then
tmp = (y / (y + x)) / (x + (y + 1.0d0))
else if (y <= 3200000.0d0) then
tmp = x * ((1.0d0 / (y + x)) / (y + (1.0d0 + x)))
else
tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 9.5e-152) {
tmp = (y / (y + x)) / (x + (y + 1.0));
} else if (y <= 3200000.0) {
tmp = x * ((1.0 / (y + x)) / (y + (1.0 + x)));
} else {
tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 9.5e-152: tmp = (y / (y + x)) / (x + (y + 1.0)) elif y <= 3200000.0: tmp = x * ((1.0 / (y + x)) / (y + (1.0 + x))) else: tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 9.5e-152) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + Float64(y + 1.0))); elseif (y <= 3200000.0) tmp = Float64(x * Float64(Float64(1.0 / Float64(y + x)) / Float64(y + Float64(1.0 + x)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) / Float64(y + x)) / Float64(Float64(y + x) / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 9.5e-152)
tmp = (y / (y + x)) / (x + (y + 1.0));
elseif (y <= 3200000.0)
tmp = x * ((1.0 / (y + x)) / (y + (1.0 + x)));
else
tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 9.5e-152], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3200000.0], N[(x * N[(N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{-152}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 3200000:\\
\;\;\;\;x \cdot \frac{\frac{1}{y + x}}{y + \left(1 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{x}{y + x}}{y + x}}{\frac{y + x}{y}}\\
\end{array}
\end{array}
if y < 9.49999999999999925e-152Initial program 68.5%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6468.6%
Simplified68.6%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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 0
Simplified62.8%
if 9.49999999999999925e-152 < y < 3.2e6Initial program 86.6%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6486.6%
Simplified86.6%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified43.7%
div-invN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6475.4%
Applied egg-rr75.4%
if 3.2e6 < y Initial program 60.6%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.6%
Simplified60.6%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
associate-/l/N/A
associate-/r/N/A
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified99.9%
Final simplification75.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -7.8e-105)
t_0
(if (<= y 2.05e-170) (/ y x) (if (<= y 2.4e+24) t_0 (/ (/ x y) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -7.8e-105) {
tmp = t_0;
} else if (y <= 2.05e-170) {
tmp = y / x;
} else if (y <= 2.4e+24) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y / (x * x)
if (y <= (-7.8d-105)) then
tmp = t_0
else if (y <= 2.05d-170) then
tmp = y / x
else if (y <= 2.4d+24) then
tmp = t_0
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -7.8e-105) {
tmp = t_0;
} else if (y <= 2.05e-170) {
tmp = y / x;
} else if (y <= 2.4e+24) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -7.8e-105: tmp = t_0 elif y <= 2.05e-170: tmp = y / x elif y <= 2.4e+24: tmp = t_0 else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -7.8e-105) tmp = t_0; elseif (y <= 2.05e-170) tmp = Float64(y / x); elseif (y <= 2.4e+24) tmp = t_0; else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * x);
tmp = 0.0;
if (y <= -7.8e-105)
tmp = t_0;
elseif (y <= 2.05e-170)
tmp = y / x;
elseif (y <= 2.4e+24)
tmp = t_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_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.8e-105], t$95$0, If[LessEqual[y, 2.05e-170], N[(y / x), $MachinePrecision], If[LessEqual[y, 2.4e+24], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{-105}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-170}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -7.8e-105 or 2.04999999999999983e-170 < y < 2.4000000000000001e24Initial program 75.5%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6475.5%
Simplified75.5%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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 x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6442.8%
Simplified42.8%
if -7.8e-105 < y < 2.04999999999999983e-170Initial program 66.8%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6466.8%
Simplified66.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6484.6%
Simplified84.6%
Taylor expanded in x around 0
/-lowering-/.f6470.9%
Simplified70.9%
if 2.4000000000000001e24 < y Initial program 60.0%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.0%
Simplified60.0%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.0%
Simplified75.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6474.8%
Applied egg-rr74.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -4.1e-103)
t_0
(if (<= y 5.4e-168) (/ y x) (if (<= y 1.7e+23) t_0 (/ x (* y y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -4.1e-103) {
tmp = t_0;
} else if (y <= 5.4e-168) {
tmp = y / x;
} else if (y <= 1.7e+23) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y / (x * x)
if (y <= (-4.1d-103)) then
tmp = t_0
else if (y <= 5.4d-168) then
tmp = y / x
else if (y <= 1.7d+23) then
tmp = t_0
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -4.1e-103) {
tmp = t_0;
} else if (y <= 5.4e-168) {
tmp = y / x;
} else if (y <= 1.7e+23) {
tmp = t_0;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -4.1e-103: tmp = t_0 elif y <= 5.4e-168: tmp = y / x elif y <= 1.7e+23: tmp = t_0 else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -4.1e-103) tmp = t_0; elseif (y <= 5.4e-168) tmp = Float64(y / x); elseif (y <= 1.7e+23) tmp = t_0; else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * x);
tmp = 0.0;
if (y <= -4.1e-103)
tmp = t_0;
elseif (y <= 5.4e-168)
tmp = y / x;
elseif (y <= 1.7e+23)
tmp = t_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_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.1e-103], t$95$0, If[LessEqual[y, 5.4e-168], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.7e+23], t$95$0, N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -4.1 \cdot 10^{-103}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-168}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+23}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -4.09999999999999996e-103 or 5.40000000000000031e-168 < y < 1.69999999999999996e23Initial program 75.7%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6475.7%
Simplified75.7%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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 x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6443.1%
Simplified43.1%
if -4.09999999999999996e-103 < y < 5.40000000000000031e-168Initial program 66.7%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6466.7%
Simplified66.7%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6483.5%
Simplified83.5%
Taylor expanded in x around 0
/-lowering-/.f6470.0%
Simplified70.0%
if 1.69999999999999996e23 < y Initial program 60.0%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.0%
Simplified60.0%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.0%
Simplified75.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.0) (/ (/ (/ x (+ y x)) (+ y x)) (/ (+ y x) y)) (/ (/ (/ y (+ 1.0 (/ y x))) (+ y x)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y);
} else {
tmp = ((y / (1.0 + (y / x))) / (y + 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) :: tmp
if (x <= (-1.0d0)) then
tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y)
else
tmp = ((y / (1.0d0 + (y / x))) / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y);
} else {
tmp = ((y / (1.0 + (y / x))) / (y + x)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y) else: tmp = ((y / (1.0 + (y / x))) / (y + x)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(Float64(x / Float64(y + x)) / Float64(y + x)) / Float64(Float64(y + x) / y)); else tmp = Float64(Float64(Float64(y / Float64(1.0 + Float64(y / x))) / Float64(y + x)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = ((x / (y + x)) / (y + x)) / ((y + x) / y);
else
tmp = ((y / (1.0 + (y / x))) / (y + 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_] := If[LessEqual[x, -1.0], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{\frac{x}{y + x}}{y + x}}{\frac{y + x}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{1 + \frac{y}{x}}}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -1Initial program 60.9%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.9%
Simplified60.9%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
associate-/l/N/A
associate-/r/N/A
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified99.3%
if -1 < x Initial program 72.3%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6472.3%
Simplified72.3%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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 x around inf
+-lowering-+.f64N/A
/-lowering-/.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f6486.6%
Simplified86.6%
Final simplification90.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y 5.5e-106)
(/ (/ y (+ y x)) t_0)
(if (<= y 6.5e+19) (/ (/ x y) t_0) (/ x (* (+ y x) (+ y x)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 5.5e-106) {
tmp = (y / (y + x)) / t_0;
} else if (y <= 6.5e+19) {
tmp = (x / y) / t_0;
} else {
tmp = x / ((y + x) * (y + x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= 5.5d-106) then
tmp = (y / (y + x)) / t_0
else if (y <= 6.5d+19) then
tmp = (x / y) / t_0
else
tmp = x / ((y + x) * (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 5.5e-106) {
tmp = (y / (y + x)) / t_0;
} else if (y <= 6.5e+19) {
tmp = (x / y) / t_0;
} else {
tmp = x / ((y + x) * (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 5.5e-106: tmp = (y / (y + x)) / t_0 elif y <= 6.5e+19: tmp = (x / y) / t_0 else: tmp = x / ((y + x) * (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 5.5e-106) tmp = Float64(Float64(y / Float64(y + x)) / t_0); elseif (y <= 6.5e+19) tmp = Float64(Float64(x / y) / t_0); else tmp = Float64(x / Float64(Float64(y + x) * Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= 5.5e-106)
tmp = (y / (y + x)) / t_0;
elseif (y <= 6.5e+19)
tmp = (x / y) / t_0;
else
tmp = x / ((y + x) * (y + x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.5e-106], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y, 6.5e+19], N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 5.5 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{t\_0}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\end{array}
\end{array}
if y < 5.5000000000000001e-106Initial program 69.4%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6469.4%
Simplified69.4%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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 0
Simplified63.9%
if 5.5000000000000001e-106 < y < 6.5e19Initial program 88.7%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6488.7%
Simplified88.7%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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
/-lowering-/.f6448.0%
Simplified48.0%
if 6.5e19 < y Initial program 60.0%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.0%
Simplified60.0%
Taylor expanded in y around inf
Simplified59.4%
times-fracN/A
*-commutativeN/A
associate-/r*N/A
*-inversesN/A
div-invN/A
clear-numN/A
un-div-invN/A
clear-numN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6483.5%
Applied egg-rr83.5%
Final simplification67.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y 9.2e-106)
(/ (/ y x) t_0)
(if (<= y 6.5e+19) (/ (/ x y) t_0) (/ x (* (+ y x) (+ y x)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 9.2e-106) {
tmp = (y / x) / t_0;
} else if (y <= 6.5e+19) {
tmp = (x / y) / t_0;
} else {
tmp = x / ((y + x) * (y + x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= 9.2d-106) then
tmp = (y / x) / t_0
else if (y <= 6.5d+19) then
tmp = (x / y) / t_0
else
tmp = x / ((y + x) * (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 9.2e-106) {
tmp = (y / x) / t_0;
} else if (y <= 6.5e+19) {
tmp = (x / y) / t_0;
} else {
tmp = x / ((y + x) * (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 9.2e-106: tmp = (y / x) / t_0 elif y <= 6.5e+19: tmp = (x / y) / t_0 else: tmp = x / ((y + x) * (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 9.2e-106) tmp = Float64(Float64(y / x) / t_0); elseif (y <= 6.5e+19) tmp = Float64(Float64(x / y) / t_0); else tmp = Float64(x / Float64(Float64(y + x) * Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= 9.2e-106)
tmp = (y / x) / t_0;
elseif (y <= 6.5e+19)
tmp = (x / y) / t_0;
else
tmp = x / ((y + x) * (y + x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9.2e-106], N[(N[(y / x), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y, 6.5e+19], N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 9.2 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{y}{x}}{t\_0}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\end{array}
\end{array}
if y < 9.2000000000000004e-106Initial program 69.4%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6469.4%
Simplified69.4%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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 0
/-lowering-/.f6463.2%
Simplified63.2%
if 9.2000000000000004e-106 < y < 6.5e19Initial program 88.7%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6488.7%
Simplified88.7%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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
/-lowering-/.f6448.0%
Simplified48.0%
if 6.5e19 < y Initial program 60.0%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.0%
Simplified60.0%
Taylor expanded in y around inf
Simplified59.4%
times-fracN/A
*-commutativeN/A
associate-/r*N/A
*-inversesN/A
div-invN/A
clear-numN/A
un-div-invN/A
clear-numN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6483.5%
Applied egg-rr83.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 9.2e-106) (/ (/ y x) (+ 1.0 x)) (if (<= y 6.5e+19) (/ (/ x y) (+ x (+ y 1.0))) (/ x (* (+ y x) (+ y x))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 9.2e-106) {
tmp = (y / x) / (1.0 + x);
} else if (y <= 6.5e+19) {
tmp = (x / y) / (x + (y + 1.0));
} else {
tmp = x / ((y + x) * (y + x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 9.2d-106) then
tmp = (y / x) / (1.0d0 + x)
else if (y <= 6.5d+19) then
tmp = (x / y) / (x + (y + 1.0d0))
else
tmp = x / ((y + x) * (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 9.2e-106) {
tmp = (y / x) / (1.0 + x);
} else if (y <= 6.5e+19) {
tmp = (x / y) / (x + (y + 1.0));
} else {
tmp = x / ((y + x) * (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 9.2e-106: tmp = (y / x) / (1.0 + x) elif y <= 6.5e+19: tmp = (x / y) / (x + (y + 1.0)) else: tmp = x / ((y + x) * (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 9.2e-106) tmp = Float64(Float64(y / x) / Float64(1.0 + x)); elseif (y <= 6.5e+19) tmp = Float64(Float64(x / y) / Float64(x + Float64(y + 1.0))); else tmp = Float64(x / Float64(Float64(y + x) * Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 9.2e-106)
tmp = (y / x) / (1.0 + x);
elseif (y <= 6.5e+19)
tmp = (x / y) / (x + (y + 1.0));
else
tmp = x / ((y + x) * (y + x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 9.2e-106], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+19], N[(N[(x / y), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{y}{x}}{1 + x}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\end{array}
\end{array}
if y < 9.2000000000000004e-106Initial program 69.4%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6469.4%
Simplified69.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6463.0%
Simplified63.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6463.1%
Applied egg-rr63.1%
if 9.2000000000000004e-106 < y < 6.5e19Initial program 88.7%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6488.7%
Simplified88.7%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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
/-lowering-/.f6448.0%
Simplified48.0%
if 6.5e19 < y Initial program 60.0%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.0%
Simplified60.0%
Taylor expanded in y around inf
Simplified59.4%
times-fracN/A
*-commutativeN/A
associate-/r*N/A
*-inversesN/A
div-invN/A
clear-numN/A
un-div-invN/A
clear-numN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6483.5%
Applied egg-rr83.5%
Final simplification67.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 9.2e-106) (/ (/ y x) (+ 1.0 x)) (if (<= y 5500000.0) (/ x (* y (+ y 1.0))) (/ x (* (+ y x) (+ y x))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 9.2e-106) {
tmp = (y / x) / (1.0 + x);
} else if (y <= 5500000.0) {
tmp = x / (y * (y + 1.0));
} else {
tmp = x / ((y + x) * (y + x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 9.2d-106) then
tmp = (y / x) / (1.0d0 + x)
else if (y <= 5500000.0d0) then
tmp = x / (y * (y + 1.0d0))
else
tmp = x / ((y + x) * (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 9.2e-106) {
tmp = (y / x) / (1.0 + x);
} else if (y <= 5500000.0) {
tmp = x / (y * (y + 1.0));
} else {
tmp = x / ((y + x) * (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 9.2e-106: tmp = (y / x) / (1.0 + x) elif y <= 5500000.0: tmp = x / (y * (y + 1.0)) else: tmp = x / ((y + x) * (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 9.2e-106) tmp = Float64(Float64(y / x) / Float64(1.0 + x)); elseif (y <= 5500000.0) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(x / Float64(Float64(y + x) * Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 9.2e-106)
tmp = (y / x) / (1.0 + x);
elseif (y <= 5500000.0)
tmp = x / (y * (y + 1.0));
else
tmp = x / ((y + x) * (y + x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 9.2e-106], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5500000.0], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{y}{x}}{1 + x}\\
\mathbf{elif}\;y \leq 5500000:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\end{array}
\end{array}
if y < 9.2000000000000004e-106Initial program 69.4%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6469.4%
Simplified69.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6463.0%
Simplified63.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6463.1%
Applied egg-rr63.1%
if 9.2000000000000004e-106 < y < 5.5e6Initial program 88.2%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6488.2%
Simplified88.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6449.4%
Simplified49.4%
if 5.5e6 < y Initial program 60.6%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.6%
Simplified60.6%
Taylor expanded in y around inf
Simplified58.6%
times-fracN/A
*-commutativeN/A
associate-/r*N/A
*-inversesN/A
div-invN/A
clear-numN/A
un-div-invN/A
clear-numN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6482.3%
Applied egg-rr82.3%
Final simplification67.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3e-145) (/ (/ y (+ y x)) (+ x (+ y 1.0))) (* x (/ (/ 1.0 (+ y x)) (+ y (+ 1.0 x))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3e-145) {
tmp = (y / (y + x)) / (x + (y + 1.0));
} else {
tmp = x * ((1.0 / (y + x)) / (y + (1.0 + x)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3d-145) then
tmp = (y / (y + x)) / (x + (y + 1.0d0))
else
tmp = x * ((1.0d0 / (y + x)) / (y + (1.0d0 + x)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3e-145) {
tmp = (y / (y + x)) / (x + (y + 1.0));
} else {
tmp = x * ((1.0 / (y + x)) / (y + (1.0 + x)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3e-145: tmp = (y / (y + x)) / (x + (y + 1.0)) else: tmp = x * ((1.0 / (y + x)) / (y + (1.0 + x))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3e-145) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + Float64(y + 1.0))); else tmp = Float64(x * Float64(Float64(1.0 / Float64(y + x)) / Float64(y + Float64(1.0 + x)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 3e-145)
tmp = (y / (y + x)) / (x + (y + 1.0));
else
tmp = x * ((1.0 / (y + x)) / (y + (1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3e-145], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{-145}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{y + x}}{y + \left(1 + x\right)}\\
\end{array}
\end{array}
if y < 2.99999999999999992e-145Initial program 68.5%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6468.6%
Simplified68.6%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/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 0
Simplified62.8%
if 2.99999999999999992e-145 < y Initial program 69.1%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6469.1%
Simplified69.1%
associate-/r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified64.4%
div-invN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6480.0%
Applied egg-rr80.0%
Final simplification70.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.0) (/ (/ y x) x) (if (<= x -4.6e-102) (/ y x) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -4.6e-102) {
tmp = y / x;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-4.6d-102)) then
tmp = y / x
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -4.6e-102) {
tmp = y / x;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) / x elif x <= -4.6e-102: tmp = y / x else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -4.6e-102) tmp = Float64(y / x); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = (y / x) / x;
elseif (x <= -4.6e-102)
tmp = y / x;
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -4.6e-102], N[(y / x), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{-102}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 60.9%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.9%
Simplified60.9%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.4%
Simplified79.4%
if -1 < x < -4.59999999999999973e-102Initial program 81.5%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6481.5%
Simplified81.5%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6439.3%
Simplified39.3%
Taylor expanded in x around 0
/-lowering-/.f6439.3%
Simplified39.3%
if -4.59999999999999973e-102 < x Initial program 71.4%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6471.4%
Simplified71.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6463.0%
Simplified63.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (/ (/ x (+ y x)) (+ x (+ y 1.0))) (/ y (+ y x))))
assert(x < y);
double code(double x, double y) {
return ((x / (y + x)) / (x + (y + 1.0))) * (y / (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)) / (x + (y + 1.0d0))) * (y / (y + x))
end function
assert x < y;
public static double code(double x, double y) {
return ((x / (y + x)) / (x + (y + 1.0))) * (y / (y + x));
}
[x, y] = sort([x, y]) def code(x, y): return ((x / (y + x)) / (x + (y + 1.0))) * (y / (y + x))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(x / Float64(y + x)) / Float64(x + Float64(y + 1.0))) * Float64(y / Float64(y + x))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((x / (y + x)) / (x + (y + 1.0))) * (y / (y + x));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{y + x}}{x + \left(y + 1\right)} \cdot \frac{y}{y + x}
\end{array}
Initial program 68.8%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6468.8%
Simplified68.8%
times-fracN/A
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Final simplification99.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.0) (/ (/ y x) x) (if (<= x -4.9e-219) (/ y x) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -4.9e-219) {
tmp = y / x;
} 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.0d0)) then
tmp = (y / x) / x
else if (x <= (-4.9d-219)) then
tmp = y / x
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.0) {
tmp = (y / x) / x;
} else if (x <= -4.9e-219) {
tmp = y / x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) / x elif x <= -4.9e-219: tmp = y / x else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -4.9e-219) tmp = Float64(y / x); 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.0)
tmp = (y / x) / x;
elseif (x <= -4.9e-219)
tmp = y / x;
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.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -4.9e-219], N[(y / x), $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:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -4.9 \cdot 10^{-219}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1Initial program 60.9%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6460.9%
Simplified60.9%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.4%
Simplified79.4%
if -1 < x < -4.8999999999999999e-219Initial program 72.0%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6472.1%
Simplified72.1%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6430.7%
Simplified30.7%
Taylor expanded in x around 0
/-lowering-/.f6430.7%
Simplified30.7%
if -4.8999999999999999e-219 < x Initial program 72.4%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6472.4%
Simplified72.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6444.8%
Simplified44.8%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6444.8%
Applied egg-rr44.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 9.2e-106) (/ (/ y x) (+ 1.0 x)) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 9.2e-106) {
tmp = (y / x) / (1.0 + 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 (y <= 9.2d-106) then
tmp = (y / x) / (1.0d0 + 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 (y <= 9.2e-106) {
tmp = (y / x) / (1.0 + x);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 9.2e-106: tmp = (y / x) / (1.0 + x) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 9.2e-106) tmp = Float64(Float64(y / x) / Float64(1.0 + 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 (y <= 9.2e-106)
tmp = (y / x) / (1.0 + 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[y, 9.2e-106], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{y}{x}}{1 + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 9.2000000000000004e-106Initial program 69.4%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6469.4%
Simplified69.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6463.0%
Simplified63.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6463.1%
Applied egg-rr63.1%
if 9.2000000000000004e-106 < y Initial program 67.7%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6467.7%
Simplified67.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6467.6%
Simplified67.6%
Final simplification64.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 9.2e-106) (/ y (* x (+ 1.0 x))) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 9.2e-106) {
tmp = y / (x * (1.0 + 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 (y <= 9.2d-106) then
tmp = y / (x * (1.0d0 + 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 (y <= 9.2e-106) {
tmp = y / (x * (1.0 + x));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 9.2e-106: tmp = y / (x * (1.0 + x)) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 9.2e-106) tmp = Float64(y / Float64(x * Float64(1.0 + 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 (y <= 9.2e-106)
tmp = y / (x * (1.0 + 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[y, 9.2e-106], N[(y / N[(x * N[(1.0 + x), $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}\;y \leq 9.2 \cdot 10^{-106}:\\
\;\;\;\;\frac{y}{x \cdot \left(1 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 9.2000000000000004e-106Initial program 69.4%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6469.4%
Simplified69.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6463.0%
Simplified63.0%
if 9.2000000000000004e-106 < y Initial program 67.7%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6467.7%
Simplified67.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6467.6%
Simplified67.6%
Final simplification64.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.2e-36) (/ y x) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.2e-36) {
tmp = y / x;
} 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.2d-36) then
tmp = y / x
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.2e-36) {
tmp = y / x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.2e-36: tmp = y / x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.2e-36) tmp = Float64(y / x); 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.2e-36)
tmp = y / x;
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.2e-36], N[(y / x), $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.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1.2e-36Initial program 70.7%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6470.7%
Simplified70.7%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6462.3%
Simplified62.3%
Taylor expanded in x around 0
/-lowering-/.f6436.9%
Simplified36.9%
if 1.2e-36 < y Initial program 64.5%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6464.5%
Simplified64.5%
Taylor expanded in y around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6466.4%
Simplified66.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ y x))
assert(x < y);
double code(double x, double y) {
return 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
end function
assert x < y;
public static double code(double x, double y) {
return y / x;
}
[x, y] = sort([x, y]) def code(x, y): return y / x
x, y = sort([x, y]) function code(x, y) return Float64(y / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = y / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(y / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{x}
\end{array}
Initial program 68.8%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6468.8%
Simplified68.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6449.3%
Simplified49.3%
Taylor expanded in x around 0
/-lowering-/.f6426.1%
Simplified26.1%
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 68.8%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6468.8%
Simplified68.8%
Taylor expanded in y around inf
Simplified35.2%
Taylor expanded in x around inf
/-lowering-/.f644.1%
Simplified4.1%
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 68.8%
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6468.8%
Simplified68.8%
times-fracN/A
associate-*r/N/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6451.3%
Simplified51.3%
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 2024138
(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))))