
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (* (/ y (+ y (+ 1.0 x))) (/ x (+ y x))) (+ y x)))
assert(x < y);
double code(double x, double y) {
return ((y / (y + (1.0 + x))) * (x / (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 = ((y / (y + (1.0d0 + x))) * (x / (y + x))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
return ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x);
}
[x, y] = sort([x, y]) def code(x, y): return ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(y / Float64(y + Float64(1.0 + x))) * Float64(x / Float64(y + x))) / Float64(y + x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((y / (y + (1.0 + x))) * (x / (y + x))) / (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[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{y + \left(1 + x\right)} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Initial program 67.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.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 -1.25e+118)
(/ (/ y x) x)
(if (<= y 4.4e+163)
(* (/ x (+ y x)) (/ y (* (+ y (+ 1.0 x)) (+ y x))))
(/ (/ x (+ 1.0 (fma x (+ 2.0 (/ 1.0 y)) y))) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1.25e+118) {
tmp = (y / x) / x;
} else if (y <= 4.4e+163) {
tmp = (x / (y + x)) * (y / ((y + (1.0 + x)) * (y + x)));
} else {
tmp = (x / (1.0 + fma(x, (2.0 + (1.0 / y)), y))) / (y + x);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1.25e+118) tmp = Float64(Float64(y / x) / x); elseif (y <= 4.4e+163) tmp = Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + Float64(1.0 + x)) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(1.0 + fma(x, Float64(2.0 + Float64(1.0 / y)), y))) / Float64(y + x)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -1.25e+118], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 4.4e+163], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + N[(x * N[(2.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+118}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+163}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{y}{\left(y + \left(1 + x\right)\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + \mathsf{fma}\left(x, 2 + \frac{1}{y}, y\right)}}{y + x}\\
\end{array}
\end{array}
if y < -1.24999999999999993e118Initial program 46.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6415.3
Applied rewrites15.3%
Applied rewrites22.4%
if -1.24999999999999993e118 < y < 4.39999999999999973e163Initial program 73.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
if 4.39999999999999973e163 < y Initial program 63.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f6490.5
Applied rewrites90.5%
Final simplification82.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.35e+111)
(/ (/ y x) (+ y x))
(if (<= x -48000000.0)
(* y (/ x (* (+ y (+ 1.0 x)) (* (+ y x) (+ y x)))))
(if (<= x 9.5e-80)
(* (/ x (+ y x)) (/ y (* (+ y x) (+ y 1.0))))
(/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.35e+111) {
tmp = (y / x) / (y + x);
} else if (x <= -48000000.0) {
tmp = y * (x / ((y + (1.0 + x)) * ((y + x) * (y + x))));
} else if (x <= 9.5e-80) {
tmp = (x / (y + x)) * (y / ((y + x) * (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 (x <= (-1.35d+111)) then
tmp = (y / x) / (y + x)
else if (x <= (-48000000.0d0)) then
tmp = y * (x / ((y + (1.0d0 + x)) * ((y + x) * (y + x))))
else if (x <= 9.5d-80) then
tmp = (x / (y + x)) * (y / ((y + x) * (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 (x <= -1.35e+111) {
tmp = (y / x) / (y + x);
} else if (x <= -48000000.0) {
tmp = y * (x / ((y + (1.0 + x)) * ((y + x) * (y + x))));
} else if (x <= 9.5e-80) {
tmp = (x / (y + x)) * (y / ((y + x) * (y + 1.0)));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.35e+111: tmp = (y / x) / (y + x) elif x <= -48000000.0: tmp = y * (x / ((y + (1.0 + x)) * ((y + x) * (y + x)))) elif x <= 9.5e-80: tmp = (x / (y + x)) * (y / ((y + x) * (y + 1.0))) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.35e+111) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -48000000.0) tmp = Float64(y * Float64(x / Float64(Float64(y + Float64(1.0 + x)) * Float64(Float64(y + x) * Float64(y + x))))); elseif (x <= 9.5e-80) tmp = Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + x) * 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 (x <= -1.35e+111)
tmp = (y / x) / (y + x);
elseif (x <= -48000000.0)
tmp = y * (x / ((y + (1.0 + x)) * ((y + x) * (y + x))));
elseif (x <= 9.5e-80)
tmp = (x / (y + x)) * (y / ((y + x) * (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[x, -1.35e+111], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -48000000.0], N[(y * N[(x / N[(N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-80], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.35 \cdot 10^{+111}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -48000000:\\
\;\;\;\;y \cdot \frac{x}{\left(y + \left(1 + x\right)\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.3499999999999999e111Initial program 57.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
lower-/.f6489.2
Applied rewrites89.2%
if -1.3499999999999999e111 < x < -4.8e7Initial program 74.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6491.3
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f6491.3
Applied rewrites91.3%
if -4.8e7 < x < 9.5000000000000003e-80Initial program 74.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f6499.4
Applied rewrites99.4%
if 9.5000000000000003e-80 < x Initial program 61.6%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6435.5
Applied rewrites35.5%
Applied rewrites36.4%
Final simplification75.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -1.25e+118)
(/ (/ y x) x)
(if (<= y 4.4e+163)
(* (/ x (+ y x)) (/ y (* (+ y (+ 1.0 x)) (+ y x))))
(/ (/ (fma (- x) (/ (* x 3.0) y) x) y) y))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1.25e+118) {
tmp = (y / x) / x;
} else if (y <= 4.4e+163) {
tmp = (x / (y + x)) * (y / ((y + (1.0 + x)) * (y + x)));
} else {
tmp = (fma(-x, ((x * 3.0) / y), x) / y) / y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1.25e+118) tmp = Float64(Float64(y / x) / x); elseif (y <= 4.4e+163) tmp = Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + Float64(1.0 + x)) * Float64(y + x)))); else tmp = Float64(Float64(fma(Float64(-x), Float64(Float64(x * 3.0) / y), x) / y) / y); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -1.25e+118], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 4.4e+163], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[((-x) * N[(N[(x * 3.0), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+118}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+163}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{y}{\left(y + \left(1 + x\right)\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-x, \frac{x \cdot 3}{y}, x\right)}{y}}{y}\\
\end{array}
\end{array}
if y < -1.24999999999999993e118Initial program 46.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6415.3
Applied rewrites15.3%
Applied rewrites22.4%
if -1.24999999999999993e118 < y < 4.39999999999999973e163Initial program 73.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
if 4.39999999999999973e163 < y Initial program 63.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
lower-/.f64N/A
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6483.6
Applied rewrites83.6%
Taylor expanded in x around inf
Applied rewrites83.6%
Applied rewrites89.7%
Final simplification82.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= y -1.25e+118)
(/ (/ y x) x)
(if (<= y 4.4e+163)
(* t_0 (/ y (* (+ y (+ 1.0 x)) (+ y x))))
(/ (* t_0 1.0) (+ y x))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (y <= -1.25e+118) {
tmp = (y / x) / x;
} else if (y <= 4.4e+163) {
tmp = t_0 * (y / ((y + (1.0 + x)) * (y + x)));
} else {
tmp = (t_0 * 1.0) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y + x)
if (y <= (-1.25d+118)) then
tmp = (y / x) / x
else if (y <= 4.4d+163) then
tmp = t_0 * (y / ((y + (1.0d0 + x)) * (y + x)))
else
tmp = (t_0 * 1.0d0) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (y <= -1.25e+118) {
tmp = (y / x) / x;
} else if (y <= 4.4e+163) {
tmp = t_0 * (y / ((y + (1.0 + x)) * (y + x)));
} else {
tmp = (t_0 * 1.0) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + x) tmp = 0 if y <= -1.25e+118: tmp = (y / x) / x elif y <= 4.4e+163: tmp = t_0 * (y / ((y + (1.0 + x)) * (y + x))) else: tmp = (t_0 * 1.0) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (y <= -1.25e+118) tmp = Float64(Float64(y / x) / x); elseif (y <= 4.4e+163) tmp = Float64(t_0 * Float64(y / Float64(Float64(y + Float64(1.0 + x)) * Float64(y + x)))); else tmp = Float64(Float64(t_0 * 1.0) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + x);
tmp = 0.0;
if (y <= -1.25e+118)
tmp = (y / x) / x;
elseif (y <= 4.4e+163)
tmp = t_0 * (y / ((y + (1.0 + x)) * (y + x)));
else
tmp = (t_0 * 1.0) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+118], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 4.4e+163], N[(t$95$0 * N[(y / N[(N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+118}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+163}:\\
\;\;\;\;t\_0 \cdot \frac{y}{\left(y + \left(1 + x\right)\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 \cdot 1}{y + x}\\
\end{array}
\end{array}
if y < -1.24999999999999993e118Initial program 46.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6415.3
Applied rewrites15.3%
Applied rewrites22.4%
if -1.24999999999999993e118 < y < 4.39999999999999973e163Initial program 73.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
if 4.39999999999999973e163 < y Initial program 63.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
Applied rewrites90.5%
Final simplification82.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.95e+68)
(/ (/ y x) (+ y x))
(if (<= x 1.06e-8)
(* x (/ (/ y (* (+ y (+ 1.0 x)) (+ y x))) (+ y x)))
(/ (/ x y) y))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.95e+68) {
tmp = (y / x) / (y + x);
} else if (x <= 1.06e-8) {
tmp = x * ((y / ((y + (1.0 + x)) * (y + x))) / (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.95d+68)) then
tmp = (y / x) / (y + x)
else if (x <= 1.06d-8) then
tmp = x * ((y / ((y + (1.0d0 + x)) * (y + x))) / (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.95e+68) {
tmp = (y / x) / (y + x);
} else if (x <= 1.06e-8) {
tmp = x * ((y / ((y + (1.0 + x)) * (y + x))) / (y + x));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.95e+68: tmp = (y / x) / (y + x) elif x <= 1.06e-8: tmp = x * ((y / ((y + (1.0 + x)) * (y + x))) / (y + x)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.95e+68) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= 1.06e-8) tmp = Float64(x * Float64(Float64(y / Float64(Float64(y + Float64(1.0 + x)) * Float64(y + x))) / 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.95e+68)
tmp = (y / x) / (y + x);
elseif (x <= 1.06e-8)
tmp = x * ((y / ((y + (1.0 + x)) * (y + x))) / (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.95e+68], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.06e-8], N[(x * N[(N[(y / N[(N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $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.95 \cdot 10^{+68}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \frac{\frac{y}{\left(y + \left(1 + x\right)\right) \cdot \left(y + x\right)}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.95000000000000009e68Initial program 59.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
lower-/.f6484.0
Applied rewrites84.0%
if -1.95000000000000009e68 < x < 1.06000000000000006e-8Initial program 76.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
div-invN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites99.0%
if 1.06000000000000006e-8 < x Initial program 55.5%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6432.0
Applied rewrites32.0%
Applied rewrites33.2%
Final simplification77.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.35e+111)
(/ (/ y x) (+ y x))
(if (<= x -2.9e-162)
(* y (/ x (* (+ y (+ 1.0 x)) (* (+ y x) (+ y x)))))
(/ (/ x (+ y 1.0)) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.35e+111) {
tmp = (y / x) / (y + x);
} else if (x <= -2.9e-162) {
tmp = y * (x / ((y + (1.0 + x)) * ((y + x) * (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 (x <= (-1.35d+111)) then
tmp = (y / x) / (y + x)
else if (x <= (-2.9d-162)) then
tmp = y * (x / ((y + (1.0d0 + x)) * ((y + x) * (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 (x <= -1.35e+111) {
tmp = (y / x) / (y + x);
} else if (x <= -2.9e-162) {
tmp = y * (x / ((y + (1.0 + x)) * ((y + x) * (y + x))));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.35e+111: tmp = (y / x) / (y + x) elif x <= -2.9e-162: tmp = y * (x / ((y + (1.0 + x)) * ((y + x) * (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 (x <= -1.35e+111) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -2.9e-162) tmp = Float64(y * Float64(x / Float64(Float64(y + Float64(1.0 + x)) * Float64(Float64(y + x) * 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 (x <= -1.35e+111)
tmp = (y / x) / (y + x);
elseif (x <= -2.9e-162)
tmp = y * (x / ((y + (1.0 + x)) * ((y + x) * (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[x, -1.35e+111], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9e-162], N[(y * N[(x / N[(N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;x \leq -1.35 \cdot 10^{+111}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-162}:\\
\;\;\;\;y \cdot \frac{x}{\left(y + \left(1 + x\right)\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -1.3499999999999999e111Initial program 57.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
lower-/.f6489.2
Applied rewrites89.2%
if -1.3499999999999999e111 < x < -2.9000000000000001e-162Initial program 83.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6494.5
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f6494.5
Applied rewrites94.5%
if -2.9000000000000001e-162 < x Initial program 64.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6459.3
Applied rewrites59.3%
Final simplification71.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.15e+19)
(/ (/ y x) (+ y x))
(if (<= x -2.9e-162)
(* y (/ x (* (* (+ y x) (+ y x)) (+ y 1.0))))
(/ (/ x (+ y 1.0)) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.15e+19) {
tmp = (y / x) / (y + x);
} else if (x <= -2.9e-162) {
tmp = y * (x / (((y + x) * (y + x)) * (y + 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 (x <= (-1.15d+19)) then
tmp = (y / x) / (y + x)
else if (x <= (-2.9d-162)) then
tmp = y * (x / (((y + x) * (y + x)) * (y + 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 (x <= -1.15e+19) {
tmp = (y / x) / (y + x);
} else if (x <= -2.9e-162) {
tmp = y * (x / (((y + x) * (y + x)) * (y + 1.0)));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.15e+19: tmp = (y / x) / (y + x) elif x <= -2.9e-162: tmp = y * (x / (((y + x) * (y + x)) * (y + 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 (x <= -1.15e+19) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -2.9e-162) tmp = Float64(y * Float64(x / Float64(Float64(Float64(y + x) * Float64(y + x)) * Float64(y + 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 (x <= -1.15e+19)
tmp = (y / x) / (y + x);
elseif (x <= -2.9e-162)
tmp = y * (x / (((y + x) * (y + x)) * (y + 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[x, -1.15e+19], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9e-162], N[(y * N[(x / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $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}\;x \leq -1.15 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-162}:\\
\;\;\;\;y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -1.15e19Initial program 60.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f6481.0
Applied rewrites81.0%
if -1.15e19 < x < -2.9000000000000001e-162Initial program 88.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6494.7
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f6494.7
Applied rewrites94.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f6488.3
Applied rewrites88.3%
if -2.9000000000000001e-162 < x Initial program 64.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6459.3
Applied rewrites59.3%
Final simplification68.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (fma y y y))))
(if (<= x -1.3e+19)
(/ (/ y x) (+ y x))
(if (<= x -2.76e-45)
t_0
(if (<= x -3.4e-93)
(/ y (fma x x x))
(if (<= x 1.06e-8) t_0 (/ (/ x y) y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / fma(y, y, y);
double tmp;
if (x <= -1.3e+19) {
tmp = (y / x) / (y + x);
} else if (x <= -2.76e-45) {
tmp = t_0;
} else if (x <= -3.4e-93) {
tmp = y / fma(x, x, x);
} else if (x <= 1.06e-8) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / fma(y, y, y)) tmp = 0.0 if (x <= -1.3e+19) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -2.76e-45) tmp = t_0; elseif (x <= -3.4e-93) tmp = Float64(y / fma(x, x, x)); elseif (x <= 1.06e-8) tmp = t_0; else tmp = Float64(Float64(x / y) / y); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e+19], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.76e-45], t$95$0, If[LessEqual[x, -3.4e-93], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.06e-8], 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{x}{\mathsf{fma}\left(y, y, y\right)}\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -2.76 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.3e19Initial program 60.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f6481.0
Applied rewrites81.0%
if -1.3e19 < x < -2.7599999999999999e-45 or -3.40000000000000001e-93 < x < 1.06000000000000006e-8Initial program 76.4%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6480.0
Applied rewrites80.0%
if -2.7599999999999999e-45 < x < -3.40000000000000001e-93Initial program 80.4%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6477.8
Applied rewrites77.8%
if 1.06000000000000006e-8 < x Initial program 55.5%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6432.0
Applied rewrites32.0%
Applied rewrites33.2%
Final simplification66.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (fma y y y))))
(if (<= x -1.3e+19)
(/ (/ y x) x)
(if (<= x -2.76e-45)
t_0
(if (<= x -3.4e-93)
(/ y (fma x x x))
(if (<= x 1.06e-8) t_0 (/ (/ x y) y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / fma(y, y, y);
double tmp;
if (x <= -1.3e+19) {
tmp = (y / x) / x;
} else if (x <= -2.76e-45) {
tmp = t_0;
} else if (x <= -3.4e-93) {
tmp = y / fma(x, x, x);
} else if (x <= 1.06e-8) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / fma(y, y, y)) tmp = 0.0 if (x <= -1.3e+19) tmp = Float64(Float64(y / x) / x); elseif (x <= -2.76e-45) tmp = t_0; elseif (x <= -3.4e-93) tmp = Float64(y / fma(x, x, x)); elseif (x <= 1.06e-8) tmp = t_0; else tmp = Float64(Float64(x / y) / y); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e+19], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.76e-45], t$95$0, If[LessEqual[x, -3.4e-93], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.06e-8], 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{x}{\mathsf{fma}\left(y, y, y\right)}\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.76 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.3e19Initial program 60.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6478.4
Applied rewrites78.4%
Applied rewrites80.8%
if -1.3e19 < x < -2.7599999999999999e-45 or -3.40000000000000001e-93 < x < 1.06000000000000006e-8Initial program 76.4%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6480.0
Applied rewrites80.0%
if -2.7599999999999999e-45 < x < -3.40000000000000001e-93Initial program 80.4%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6477.8
Applied rewrites77.8%
if 1.06000000000000006e-8 < x Initial program 55.5%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6432.0
Applied rewrites32.0%
Applied rewrites33.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ x (+ y 1.0)) (+ y x))))
(if (<= x -1.3e+19)
(/ (/ y x) (+ y x))
(if (<= x -2.8e-45) t_0 (if (<= x -3.4e-93) (/ y (fma x x x)) t_0)))))assert(x < y);
double code(double x, double y) {
double t_0 = (x / (y + 1.0)) / (y + x);
double tmp;
if (x <= -1.3e+19) {
tmp = (y / x) / (y + x);
} else if (x <= -2.8e-45) {
tmp = t_0;
} else if (x <= -3.4e-93) {
tmp = y / fma(x, x, x);
} else {
tmp = t_0;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)) tmp = 0.0 if (x <= -1.3e+19) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -2.8e-45) tmp = t_0; elseif (x <= -3.4e-93) tmp = Float64(y / fma(x, x, x)); else tmp = t_0; end return 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[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e+19], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.8e-45], t$95$0, If[LessEqual[x, -3.4e-93], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{x}{y + 1}}{y + x}\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.3e19Initial program 60.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f6481.0
Applied rewrites81.0%
if -1.3e19 < x < -2.8000000000000001e-45 or -3.40000000000000001e-93 < x Initial program 68.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6461.7
Applied rewrites61.7%
if -2.8000000000000001e-45 < x < -3.40000000000000001e-93Initial program 80.4%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6477.8
Applied rewrites77.8%
Final simplification67.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.4e-93) (/ y (fma x x x)) (if (<= x 1.06e-8) (/ x (fma y y y)) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4e-93) {
tmp = y / fma(x, x, x);
} else if (x <= 1.06e-8) {
tmp = x / fma(y, y, y);
} else {
tmp = (x / y) / y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4e-93) tmp = Float64(y / fma(x, x, x)); elseif (x <= 1.06e-8) tmp = Float64(x / fma(y, y, y)); else tmp = Float64(Float64(x / y) / y); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.4e-93], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.06e-8], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -3.40000000000000001e-93Initial program 67.4%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6472.8
Applied rewrites72.8%
if -3.40000000000000001e-93 < x < 1.06000000000000006e-8Initial program 75.0%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6481.4
Applied rewrites81.4%
if 1.06000000000000006e-8 < x Initial program 55.5%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6432.0
Applied rewrites32.0%
Applied rewrites33.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.4e-93) (/ (/ y (+ 1.0 x)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4e-93) {
tmp = (y / (1.0 + x)) / (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 (x <= (-3.4d-93)) then
tmp = (y / (1.0d0 + x)) / (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 (x <= -3.4e-93) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4e-93: tmp = (y / (1.0 + x)) / (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 (x <= -3.4e-93) tmp = Float64(Float64(y / Float64(1.0 + x)) / 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 (x <= -3.4e-93)
tmp = (y / (1.0 + x)) / (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[x, -3.4e-93], N[(N[(y / N[(1.0 + x), $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}\;x \leq -3.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -3.40000000000000001e-93Initial program 67.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6474.6
Applied rewrites74.6%
if -3.40000000000000001e-93 < x Initial program 66.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f6461.5
Applied rewrites61.5%
Final simplification65.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.4e-93) (/ y (fma x x x)) (/ x (fma y y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4e-93) {
tmp = y / fma(x, x, x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4e-93) tmp = Float64(y / fma(x, x, x)); else tmp = Float64(x / fma(y, y, y)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.4e-93], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -3.40000000000000001e-93Initial program 67.4%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6472.8
Applied rewrites72.8%
if -3.40000000000000001e-93 < x Initial program 66.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6460.6
Applied rewrites60.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.3e+19) (/ y (* x x)) (/ x (fma y y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.3e+19) {
tmp = y / (x * x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.3e+19) tmp = Float64(y / Float64(x * x)); else tmp = Float64(x / fma(y, y, y)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.3e+19], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -1.3e19Initial program 60.8%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6478.4
Applied rewrites78.4%
if -1.3e19 < x Initial program 68.9%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6458.6
Applied rewrites58.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.3e+19) (/ y (* x x)) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.3e+19) {
tmp = y / (x * 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.3d+19)) then
tmp = y / (x * 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.3e+19) {
tmp = y / (x * x);
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.3e+19: tmp = y / (x * x) else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.3e+19) tmp = Float64(y / Float64(x * 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 (x <= -1.3e+19)
tmp = y / (x * 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.3e+19], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if x < -1.3e19Initial program 60.8%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6478.4
Applied rewrites78.4%
if -1.3e19 < x Initial program 68.9%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6444.6
Applied rewrites44.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ x (* y y)))
assert(x < y);
double code(double x, double y) {
return x / (y * 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 * y)
end function
assert x < y;
public static double code(double x, double y) {
return x / (y * y);
}
[x, y] = sort([x, y]) def code(x, y): return x / (y * y)
x, y = sort([x, y]) function code(x, y) return Float64(x / Float64(y * y)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = x / (y * y);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y \cdot y}
\end{array}
Initial program 67.0%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6439.5
Applied rewrites39.5%
(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 2024220
(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))))