
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (* (/ x (+ x y)) (/ y (+ (+ x y) 1.0))) (+ x y)))
assert(x < y);
double code(double x, double y) {
return ((x / (x + y)) * (y / ((x + y) + 1.0))) / (x + y);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / (x + y)) * (y / ((x + y) + 1.0d0))) / (x + y)
end function
assert x < y;
public static double code(double x, double y) {
return ((x / (x + y)) * (y / ((x + y) + 1.0))) / (x + y);
}
[x, y] = sort([x, y]) def code(x, y): return ((x / (x + y)) * (y / ((x + y) + 1.0))) / (x + y)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(x / Float64(x + y)) * Float64(y / Float64(Float64(x + y) + 1.0))) / Float64(x + y)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((x / (x + y)) * (y / ((x + y) + 1.0))) / (x + y);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{x + y} \cdot \frac{y}{\left(x + y\right) + 1}}{x + y}
\end{array}
Initial program 68.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
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 -2.1e-62)
(/ (/ (fma (fma 3.0 y 1.0) (/ (- y) x) y) x) x)
(if (<= y 1.15e+106)
(/ (* (/ x (+ x y)) y) (* (+ (+ x y) 1.0) (+ x y)))
(/ (/ (- x (* (/ (fma 2.0 x 1.0) y) x)) y) (+ x y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.1e-62) {
tmp = (fma(fma(3.0, y, 1.0), (-y / x), y) / x) / x;
} else if (y <= 1.15e+106) {
tmp = ((x / (x + y)) * y) / (((x + y) + 1.0) * (x + y));
} else {
tmp = ((x - ((fma(2.0, x, 1.0) / y) * x)) / y) / (x + y);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2.1e-62) tmp = Float64(Float64(fma(fma(3.0, y, 1.0), Float64(Float64(-y) / x), y) / x) / x); elseif (y <= 1.15e+106) tmp = Float64(Float64(Float64(x / Float64(x + y)) * y) / Float64(Float64(Float64(x + y) + 1.0) * Float64(x + y))); else tmp = Float64(Float64(Float64(x - Float64(Float64(fma(2.0, x, 1.0) / y) * x)) / y) / Float64(x + 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, -2.1e-62], N[(N[(N[(N[(3.0 * y + 1.0), $MachinePrecision] * N[((-y) / x), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.15e+106], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - N[(N[(N[(2.0 * x + 1.0), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(3, y, 1\right), \frac{-y}{x}, y\right)}{x}}{x}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+106}:\\
\;\;\;\;\frac{\frac{x}{x + y} \cdot y}{\left(\left(x + y\right) + 1\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x - \frac{\mathsf{fma}\left(2, x, 1\right)}{y} \cdot x}{y}}{x + y}\\
\end{array}
\end{array}
if y < -2.0999999999999999e-62Initial program 67.1%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-fma.f6433.4
Applied rewrites33.4%
Applied rewrites40.4%
if -2.0999999999999999e-62 < y < 1.1500000000000001e106Initial program 76.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
Applied rewrites99.2%
if 1.1500000000000001e106 < y Initial program 47.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
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6414.2
Applied rewrites14.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6488.0
Applied rewrites88.0%
Final simplification80.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= y -2.1e-62)
(/ (/ (fma (fma 3.0 y 1.0) (/ (- y) x) y) x) x)
(if (<= y 6.3e+131)
(/ (* t_0 y) (* (+ (+ x y) 1.0) (+ x y)))
(* (/ (- 1.0 (/ (fma 2.0 x 1.0) y)) y) t_0)))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= -2.1e-62) {
tmp = (fma(fma(3.0, y, 1.0), (-y / x), y) / x) / x;
} else if (y <= 6.3e+131) {
tmp = (t_0 * y) / (((x + y) + 1.0) * (x + y));
} else {
tmp = ((1.0 - (fma(2.0, x, 1.0) / y)) / y) * t_0;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= -2.1e-62) tmp = Float64(Float64(fma(fma(3.0, y, 1.0), Float64(Float64(-y) / x), y) / x) / x); elseif (y <= 6.3e+131) tmp = Float64(Float64(t_0 * y) / Float64(Float64(Float64(x + y) + 1.0) * Float64(x + y))); else tmp = Float64(Float64(Float64(1.0 - Float64(fma(2.0, x, 1.0) / y)) / y) * 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[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e-62], N[(N[(N[(N[(3.0 * y + 1.0), $MachinePrecision] * N[((-y) / x), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 6.3e+131], N[(N[(t$95$0 * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(2.0 * x + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(3, y, 1\right), \frac{-y}{x}, y\right)}{x}}{x}\\
\mathbf{elif}\;y \leq 6.3 \cdot 10^{+131}:\\
\;\;\;\;\frac{t\_0 \cdot y}{\left(\left(x + y\right) + 1\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \frac{\mathsf{fma}\left(2, x, 1\right)}{y}}{y} \cdot t\_0\\
\end{array}
\end{array}
if y < -2.0999999999999999e-62Initial program 67.1%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-fma.f6433.4
Applied rewrites33.4%
Applied rewrites40.4%
if -2.0999999999999999e-62 < y < 6.29999999999999996e131Initial program 75.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
Applied rewrites99.2%
if 6.29999999999999996e131 < y Initial program 43.5%
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
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6475.6
lift-+.f64N/A
+-commutativeN/A
Applied rewrites75.6%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6486.4
Applied rewrites86.4%
Final simplification80.9%
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 -2.1e-62)
(/ (/ (fma (fma 3.0 y 1.0) (/ (- y) x) y) x) x)
(if (<= y 1.15e+106)
(/ (* (/ x (+ x y)) y) (* t_0 (+ x y)))
(/ (* (/ x y) (/ y t_0)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double t_0 = (x + y) + 1.0;
double tmp;
if (y <= -2.1e-62) {
tmp = (fma(fma(3.0, y, 1.0), (-y / x), y) / x) / x;
} else if (y <= 1.15e+106) {
tmp = ((x / (x + y)) * y) / (t_0 * (x + y));
} else {
tmp = ((x / y) * (y / t_0)) / (x + y);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(x + y) + 1.0) tmp = 0.0 if (y <= -2.1e-62) tmp = Float64(Float64(fma(fma(3.0, y, 1.0), Float64(Float64(-y) / x), y) / x) / x); elseif (y <= 1.15e+106) tmp = Float64(Float64(Float64(x / Float64(x + y)) * y) / Float64(t_0 * Float64(x + y))); else tmp = Float64(Float64(Float64(x / y) * Float64(y / t_0)) / Float64(x + 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[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[y, -2.1e-62], N[(N[(N[(N[(3.0 * y + 1.0), $MachinePrecision] * N[((-y) / x), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.15e+106], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(t$95$0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \left(x + y\right) + 1\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(3, y, 1\right), \frac{-y}{x}, y\right)}{x}}{x}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+106}:\\
\;\;\;\;\frac{\frac{x}{x + y} \cdot y}{t\_0 \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y} \cdot \frac{y}{t\_0}}{x + y}\\
\end{array}
\end{array}
if y < -2.0999999999999999e-62Initial program 67.1%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-fma.f6433.4
Applied rewrites33.4%
Applied rewrites40.4%
if -2.0999999999999999e-62 < y < 1.1500000000000001e106Initial program 76.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
Applied rewrites99.2%
if 1.1500000000000001e106 < y Initial program 47.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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f6488.2
Applied rewrites88.2%
Final simplification80.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -2.1e-62)
(/ (/ (fma (fma 3.0 y 1.0) (/ (- y) x) y) x) x)
(if (<= y 1.15e+106)
(/ (* (/ x (+ x y)) y) (* (+ (+ x y) 1.0) (+ x y)))
(/ (/ x (+ 1.0 y)) (+ x y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.1e-62) {
tmp = (fma(fma(3.0, y, 1.0), (-y / x), y) / x) / x;
} else if (y <= 1.15e+106) {
tmp = ((x / (x + y)) * y) / (((x + y) + 1.0) * (x + y));
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2.1e-62) tmp = Float64(Float64(fma(fma(3.0, y, 1.0), Float64(Float64(-y) / x), y) / x) / x); elseif (y <= 1.15e+106) tmp = Float64(Float64(Float64(x / Float64(x + y)) * y) / Float64(Float64(Float64(x + y) + 1.0) * Float64(x + y))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + 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, -2.1e-62], N[(N[(N[(N[(3.0 * y + 1.0), $MachinePrecision] * N[((-y) / x), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.15e+106], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(3, y, 1\right), \frac{-y}{x}, y\right)}{x}}{x}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+106}:\\
\;\;\;\;\frac{\frac{x}{x + y} \cdot y}{\left(\left(x + y\right) + 1\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if y < -2.0999999999999999e-62Initial program 67.1%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-fma.f6433.4
Applied rewrites33.4%
Applied rewrites40.4%
if -2.0999999999999999e-62 < y < 1.1500000000000001e106Initial program 76.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
Applied rewrites99.2%
if 1.1500000000000001e106 < y Initial program 47.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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6487.9
Applied rewrites87.9%
Final simplification80.9%
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.8e-63)
(/ (* 1.0 (/ y t_0)) (+ x y))
(if (<= y 1.15e+106)
(/ (* (/ x (+ x y)) y) (* t_0 (+ x y)))
(/ (/ x (+ 1.0 y)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double t_0 = (x + y) + 1.0;
double tmp;
if (y <= -5.8e-63) {
tmp = (1.0 * (y / t_0)) / (x + y);
} else if (y <= 1.15e+106) {
tmp = ((x / (x + y)) * y) / (t_0 * (x + y));
} else {
tmp = (x / (1.0 + 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) :: t_0
real(8) :: tmp
t_0 = (x + y) + 1.0d0
if (y <= (-5.8d-63)) then
tmp = (1.0d0 * (y / t_0)) / (x + y)
else if (y <= 1.15d+106) then
tmp = ((x / (x + y)) * y) / (t_0 * (x + y))
else
tmp = (x / (1.0d0 + y)) / (x + y)
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.8e-63) {
tmp = (1.0 * (y / t_0)) / (x + y);
} else if (y <= 1.15e+106) {
tmp = ((x / (x + y)) * y) / (t_0 * (x + y));
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (x + y) + 1.0 tmp = 0 if y <= -5.8e-63: tmp = (1.0 * (y / t_0)) / (x + y) elif y <= 1.15e+106: tmp = ((x / (x + y)) * y) / (t_0 * (x + y)) else: tmp = (x / (1.0 + y)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(x + y) + 1.0) tmp = 0.0 if (y <= -5.8e-63) tmp = Float64(Float64(1.0 * Float64(y / t_0)) / Float64(x + y)); elseif (y <= 1.15e+106) tmp = Float64(Float64(Float64(x / Float64(x + y)) * y) / Float64(t_0 * Float64(x + y))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y)); 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.8e-63)
tmp = (1.0 * (y / t_0)) / (x + y);
elseif (y <= 1.15e+106)
tmp = ((x / (x + y)) * y) / (t_0 * (x + y));
else
tmp = (x / (1.0 + 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_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[y, -5.8e-63], N[(N[(1.0 * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+106], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(t$95$0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \left(x + y\right) + 1\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{-63}:\\
\;\;\;\;\frac{1 \cdot \frac{y}{t\_0}}{x + y}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+106}:\\
\;\;\;\;\frac{\frac{x}{x + y} \cdot y}{t\_0 \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if y < -5.7999999999999995e-63Initial program 67.6%
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
Applied rewrites99.7%
Taylor expanded in x around inf
Applied rewrites42.9%
if -5.7999999999999995e-63 < y < 1.1500000000000001e106Initial program 75.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
Applied rewrites99.2%
if 1.1500000000000001e106 < y Initial program 47.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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6487.9
Applied rewrites87.9%
Final simplification81.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (+ x y) 1.0)))
(if (<= y -5.8e-63)
(/ (* 1.0 (/ y t_0)) (+ x y))
(if (<= y 5.3e+132)
(* (/ x (* t_0 (+ x y))) (/ y (+ x y)))
(/ (/ x (+ 1.0 y)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double t_0 = (x + y) + 1.0;
double tmp;
if (y <= -5.8e-63) {
tmp = (1.0 * (y / t_0)) / (x + y);
} else if (y <= 5.3e+132) {
tmp = (x / (t_0 * (x + y))) * (y / (x + y));
} else {
tmp = (x / (1.0 + 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) :: t_0
real(8) :: tmp
t_0 = (x + y) + 1.0d0
if (y <= (-5.8d-63)) then
tmp = (1.0d0 * (y / t_0)) / (x + y)
else if (y <= 5.3d+132) then
tmp = (x / (t_0 * (x + y))) * (y / (x + y))
else
tmp = (x / (1.0d0 + y)) / (x + y)
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.8e-63) {
tmp = (1.0 * (y / t_0)) / (x + y);
} else if (y <= 5.3e+132) {
tmp = (x / (t_0 * (x + y))) * (y / (x + y));
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (x + y) + 1.0 tmp = 0 if y <= -5.8e-63: tmp = (1.0 * (y / t_0)) / (x + y) elif y <= 5.3e+132: tmp = (x / (t_0 * (x + y))) * (y / (x + y)) else: tmp = (x / (1.0 + y)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(x + y) + 1.0) tmp = 0.0 if (y <= -5.8e-63) tmp = Float64(Float64(1.0 * Float64(y / t_0)) / Float64(x + y)); elseif (y <= 5.3e+132) tmp = Float64(Float64(x / Float64(t_0 * Float64(x + y))) * Float64(y / Float64(x + y))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y)); 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.8e-63)
tmp = (1.0 * (y / t_0)) / (x + y);
elseif (y <= 5.3e+132)
tmp = (x / (t_0 * (x + y))) * (y / (x + y));
else
tmp = (x / (1.0 + 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_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[y, -5.8e-63], N[(N[(1.0 * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.3e+132], N[(N[(x / N[(t$95$0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \left(x + y\right) + 1\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{-63}:\\
\;\;\;\;\frac{1 \cdot \frac{y}{t\_0}}{x + y}\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{+132}:\\
\;\;\;\;\frac{x}{t\_0 \cdot \left(x + y\right)} \cdot \frac{y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if y < -5.7999999999999995e-63Initial program 67.6%
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
Applied rewrites99.7%
Taylor expanded in x around inf
Applied rewrites42.9%
if -5.7999999999999995e-63 < y < 5.3e132Initial program 75.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.2
Applied rewrites99.2%
if 5.3e132 < y Initial program 44.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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6485.8
Applied rewrites85.8%
Final simplification81.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (+ x y) 1.0)))
(if (<= y -5.8e-63)
(/ (* 1.0 (/ y t_0)) (+ x y))
(if (<= y 1.15e+106)
(* (/ y (* t_0 (+ x y))) (/ x (+ x y)))
(/ (/ x (+ 1.0 y)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double t_0 = (x + y) + 1.0;
double tmp;
if (y <= -5.8e-63) {
tmp = (1.0 * (y / t_0)) / (x + y);
} else if (y <= 1.15e+106) {
tmp = (y / (t_0 * (x + y))) * (x / (x + y));
} else {
tmp = (x / (1.0 + 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) :: t_0
real(8) :: tmp
t_0 = (x + y) + 1.0d0
if (y <= (-5.8d-63)) then
tmp = (1.0d0 * (y / t_0)) / (x + y)
else if (y <= 1.15d+106) then
tmp = (y / (t_0 * (x + y))) * (x / (x + y))
else
tmp = (x / (1.0d0 + y)) / (x + y)
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.8e-63) {
tmp = (1.0 * (y / t_0)) / (x + y);
} else if (y <= 1.15e+106) {
tmp = (y / (t_0 * (x + y))) * (x / (x + y));
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (x + y) + 1.0 tmp = 0 if y <= -5.8e-63: tmp = (1.0 * (y / t_0)) / (x + y) elif y <= 1.15e+106: tmp = (y / (t_0 * (x + y))) * (x / (x + y)) else: tmp = (x / (1.0 + y)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(x + y) + 1.0) tmp = 0.0 if (y <= -5.8e-63) tmp = Float64(Float64(1.0 * Float64(y / t_0)) / Float64(x + y)); elseif (y <= 1.15e+106) tmp = Float64(Float64(y / Float64(t_0 * Float64(x + y))) * Float64(x / Float64(x + y))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y)); 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.8e-63)
tmp = (1.0 * (y / t_0)) / (x + y);
elseif (y <= 1.15e+106)
tmp = (y / (t_0 * (x + y))) * (x / (x + y));
else
tmp = (x / (1.0 + 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_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[y, -5.8e-63], N[(N[(1.0 * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+106], N[(N[(y / N[(t$95$0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \left(x + y\right) + 1\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{-63}:\\
\;\;\;\;\frac{1 \cdot \frac{y}{t\_0}}{x + y}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+106}:\\
\;\;\;\;\frac{y}{t\_0 \cdot \left(x + y\right)} \cdot \frac{x}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if y < -5.7999999999999995e-63Initial program 67.6%
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
Applied rewrites99.7%
Taylor expanded in x around inf
Applied rewrites42.9%
if -5.7999999999999995e-63 < y < 1.1500000000000001e106Initial program 75.8%
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
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.2
lift-+.f64N/A
+-commutativeN/A
Applied rewrites99.2%
if 1.1500000000000001e106 < y Initial program 47.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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6487.9
Applied rewrites87.9%
Final simplification81.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.65e-11)
(/ (* 1.0 (/ y (+ (+ x y) 1.0))) (+ x y))
(if (<= x 3e-87)
(/ (* (/ x (+ x y)) y) (* (+ 1.0 y) (+ x y)))
(/ (/ x (+ 1.0 y)) (+ x y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.65e-11) {
tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y);
} else if (x <= 3e-87) {
tmp = ((x / (x + y)) * y) / ((1.0 + y) * (x + y));
} else {
tmp = (x / (1.0 + 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 (x <= (-1.65d-11)) then
tmp = (1.0d0 * (y / ((x + y) + 1.0d0))) / (x + y)
else if (x <= 3d-87) then
tmp = ((x / (x + y)) * y) / ((1.0d0 + y) * (x + y))
else
tmp = (x / (1.0d0 + y)) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.65e-11) {
tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y);
} else if (x <= 3e-87) {
tmp = ((x / (x + y)) * y) / ((1.0 + y) * (x + y));
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.65e-11: tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y) elif x <= 3e-87: tmp = ((x / (x + y)) * y) / ((1.0 + y) * (x + y)) else: tmp = (x / (1.0 + y)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.65e-11) tmp = Float64(Float64(1.0 * Float64(y / Float64(Float64(x + y) + 1.0))) / Float64(x + y)); elseif (x <= 3e-87) tmp = Float64(Float64(Float64(x / Float64(x + y)) * y) / Float64(Float64(1.0 + y) * Float64(x + y))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.65e-11)
tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y);
elseif (x <= 3e-87)
tmp = ((x / (x + y)) * y) / ((1.0 + y) * (x + y));
else
tmp = (x / (1.0 + 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[x, -1.65e-11], N[(N[(1.0 * N[(y / N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e-87], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(N[(1.0 + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-11}:\\
\;\;\;\;\frac{1 \cdot \frac{y}{\left(x + y\right) + 1}}{x + y}\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-87}:\\
\;\;\;\;\frac{\frac{x}{x + y} \cdot y}{\left(1 + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if x < -1.6500000000000001e-11Initial program 63.2%
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
Applied rewrites99.7%
Taylor expanded in x around inf
Applied rewrites78.4%
if -1.6500000000000001e-11 < x < 3.00000000000000016e-87Initial program 72.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
lower-+.f6499.9
Applied rewrites99.9%
if 3.00000000000000016e-87 < x Initial 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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6431.8
Applied rewrites31.8%
Final simplification70.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.65e-11)
(/ (* 1.0 (/ y (+ (+ x y) 1.0))) (+ x y))
(if (<= x 1e-203)
(* (/ y (* (+ 1.0 y) (+ x y))) (/ x (+ x y)))
(/ (/ x (+ 1.0 y)) (+ x y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.65e-11) {
tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y);
} else if (x <= 1e-203) {
tmp = (y / ((1.0 + y) * (x + y))) * (x / (x + y));
} else {
tmp = (x / (1.0 + 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 (x <= (-1.65d-11)) then
tmp = (1.0d0 * (y / ((x + y) + 1.0d0))) / (x + y)
else if (x <= 1d-203) then
tmp = (y / ((1.0d0 + y) * (x + y))) * (x / (x + y))
else
tmp = (x / (1.0d0 + y)) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.65e-11) {
tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y);
} else if (x <= 1e-203) {
tmp = (y / ((1.0 + y) * (x + y))) * (x / (x + y));
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.65e-11: tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y) elif x <= 1e-203: tmp = (y / ((1.0 + y) * (x + y))) * (x / (x + y)) else: tmp = (x / (1.0 + y)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.65e-11) tmp = Float64(Float64(1.0 * Float64(y / Float64(Float64(x + y) + 1.0))) / Float64(x + y)); elseif (x <= 1e-203) tmp = Float64(Float64(y / Float64(Float64(1.0 + y) * Float64(x + y))) * Float64(x / Float64(x + y))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.65e-11)
tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y);
elseif (x <= 1e-203)
tmp = (y / ((1.0 + y) * (x + y))) * (x / (x + y));
else
tmp = (x / (1.0 + 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[x, -1.65e-11], N[(N[(1.0 * N[(y / N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e-203], N[(N[(y / N[(N[(1.0 + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-11}:\\
\;\;\;\;\frac{1 \cdot \frac{y}{\left(x + y\right) + 1}}{x + y}\\
\mathbf{elif}\;x \leq 10^{-203}:\\
\;\;\;\;\frac{y}{\left(1 + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if x < -1.6500000000000001e-11Initial program 63.2%
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
Applied rewrites99.7%
Taylor expanded in x around inf
Applied rewrites78.4%
if -1.6500000000000001e-11 < x < 1e-203Initial program 69.8%
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
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-+.f6499.8
Applied rewrites99.8%
if 1e-203 < x Initial program 70.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
Applied rewrites99.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6441.2
Applied rewrites41.2%
Final simplification69.8%
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 1.65e-144)
(/ (* 1.0 (/ y t_0)) (+ x y))
(if (<= y 1.45e+91)
(/ (* x y) (* (* (+ x y) (+ x y)) t_0))
(/ (/ x (+ 1.0 y)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double t_0 = (x + y) + 1.0;
double tmp;
if (y <= 1.65e-144) {
tmp = (1.0 * (y / t_0)) / (x + y);
} else if (y <= 1.45e+91) {
tmp = (x * y) / (((x + y) * (x + y)) * t_0);
} else {
tmp = (x / (1.0 + 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) :: t_0
real(8) :: tmp
t_0 = (x + y) + 1.0d0
if (y <= 1.65d-144) then
tmp = (1.0d0 * (y / t_0)) / (x + y)
else if (y <= 1.45d+91) then
tmp = (x * y) / (((x + y) * (x + y)) * t_0)
else
tmp = (x / (1.0d0 + y)) / (x + y)
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 <= 1.65e-144) {
tmp = (1.0 * (y / t_0)) / (x + y);
} else if (y <= 1.45e+91) {
tmp = (x * y) / (((x + y) * (x + y)) * t_0);
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (x + y) + 1.0 tmp = 0 if y <= 1.65e-144: tmp = (1.0 * (y / t_0)) / (x + y) elif y <= 1.45e+91: tmp = (x * y) / (((x + y) * (x + y)) * t_0) else: tmp = (x / (1.0 + y)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(x + y) + 1.0) tmp = 0.0 if (y <= 1.65e-144) tmp = Float64(Float64(1.0 * Float64(y / t_0)) / Float64(x + y)); elseif (y <= 1.45e+91) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * t_0)); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y)); 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 <= 1.65e-144)
tmp = (1.0 * (y / t_0)) / (x + y);
elseif (y <= 1.45e+91)
tmp = (x * y) / (((x + y) * (x + y)) * t_0);
else
tmp = (x / (1.0 + 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_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[y, 1.65e-144], N[(N[(1.0 * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+91], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \left(x + y\right) + 1\\
\mathbf{if}\;y \leq 1.65 \cdot 10^{-144}:\\
\;\;\;\;\frac{1 \cdot \frac{y}{t\_0}}{x + y}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+91}:\\
\;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if y < 1.64999999999999998e-144Initial program 68.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
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites63.3%
if 1.64999999999999998e-144 < y < 1.45000000000000007e91Initial program 85.7%
if 1.45000000000000007e91 < y Initial program 50.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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
Final simplification72.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 1.65e-144)
(/ (* 1.0 (/ y (+ (+ x y) 1.0))) (+ x y))
(if (<= y 1.2)
(/ (* x y) (* (+ x 1.0) (* (+ x y) (+ x y))))
(/ (/ x (+ 1.0 y)) (+ x y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.65e-144) {
tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y);
} else if (y <= 1.2) {
tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y)));
} else {
tmp = (x / (1.0 + 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 <= 1.65d-144) then
tmp = (1.0d0 * (y / ((x + y) + 1.0d0))) / (x + y)
else if (y <= 1.2d0) then
tmp = (x * y) / ((x + 1.0d0) * ((x + y) * (x + y)))
else
tmp = (x / (1.0d0 + y)) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.65e-144) {
tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y);
} else if (y <= 1.2) {
tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y)));
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.65e-144: tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y) elif y <= 1.2: tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y))) else: tmp = (x / (1.0 + y)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.65e-144) tmp = Float64(Float64(1.0 * Float64(y / Float64(Float64(x + y) + 1.0))) / Float64(x + y)); elseif (y <= 1.2) tmp = Float64(Float64(x * y) / Float64(Float64(x + 1.0) * Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.65e-144)
tmp = (1.0 * (y / ((x + y) + 1.0))) / (x + y);
elseif (y <= 1.2)
tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y)));
else
tmp = (x / (1.0 + 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, 1.65e-144], N[(N[(1.0 * N[(y / N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2], N[(N[(x * y), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{-144}:\\
\;\;\;\;\frac{1 \cdot \frac{y}{\left(x + y\right) + 1}}{x + y}\\
\mathbf{elif}\;y \leq 1.2:\\
\;\;\;\;\frac{x \cdot y}{\left(x + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if y < 1.64999999999999998e-144Initial program 68.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
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites63.3%
if 1.64999999999999998e-144 < y < 1.19999999999999996Initial program 86.4%
Taylor expanded in y around 0
lower-+.f6483.9
Applied rewrites83.9%
if 1.19999999999999996 < y Initial program 59.6%
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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6478.4
Applied rewrites78.4%
Final simplification70.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 1.65e-144)
(/ (/ y (+ x 1.0)) (+ x y))
(if (<= y 1.2)
(/ (* x y) (* (+ x 1.0) (* (+ x y) (+ x y))))
(/ (/ x (+ 1.0 y)) (+ x y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.65e-144) {
tmp = (y / (x + 1.0)) / (x + y);
} else if (y <= 1.2) {
tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y)));
} else {
tmp = (x / (1.0 + 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 <= 1.65d-144) then
tmp = (y / (x + 1.0d0)) / (x + y)
else if (y <= 1.2d0) then
tmp = (x * y) / ((x + 1.0d0) * ((x + y) * (x + y)))
else
tmp = (x / (1.0d0 + y)) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.65e-144) {
tmp = (y / (x + 1.0)) / (x + y);
} else if (y <= 1.2) {
tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y)));
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.65e-144: tmp = (y / (x + 1.0)) / (x + y) elif y <= 1.2: tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y))) else: tmp = (x / (1.0 + y)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.65e-144) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); elseif (y <= 1.2) tmp = Float64(Float64(x * y) / Float64(Float64(x + 1.0) * Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.65e-144)
tmp = (y / (x + 1.0)) / (x + y);
elseif (y <= 1.2)
tmp = (x * y) / ((x + 1.0) * ((x + y) * (x + y)));
else
tmp = (x / (1.0 + 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, 1.65e-144], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2], N[(N[(x * y), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{-144}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{elif}\;y \leq 1.2:\\
\;\;\;\;\frac{x \cdot y}{\left(x + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if y < 1.64999999999999998e-144Initial program 68.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
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6462.8
Applied rewrites62.8%
if 1.64999999999999998e-144 < y < 1.19999999999999996Initial program 86.4%
Taylor expanded in y around 0
lower-+.f6483.9
Applied rewrites83.9%
if 1.19999999999999996 < y Initial program 59.6%
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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6478.4
Applied rewrites78.4%
Final simplification69.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -2.1e-62) (/ (/ y x) (+ x y)) (if (<= y 2.1e-95) (/ y (fma x x x)) (/ (/ x (+ 1.0 y)) (+ x y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.1e-62) {
tmp = (y / x) / (x + y);
} else if (y <= 2.1e-95) {
tmp = y / fma(x, x, x);
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2.1e-62) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (y <= 2.1e-95) tmp = Float64(y / fma(x, x, x)); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + 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, -2.1e-62], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-95], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if y < -2.0999999999999999e-62Initial program 67.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
Applied rewrites99.7%
Taylor expanded in x around inf
lower-/.f6440.6
Applied rewrites40.6%
if -2.0999999999999999e-62 < y < 2.1e-95Initial program 74.0%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6482.8
Applied rewrites82.8%
if 2.1e-95 < y Initial program 63.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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6470.3
Applied rewrites70.3%
Final simplification66.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -2.1e-62) (/ (/ y x) (+ x y)) (if (<= y 2.7e+18) (/ y (fma x x x)) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.1e-62) {
tmp = (y / x) / (x + y);
} else if (y <= 2.7e+18) {
tmp = y / fma(x, x, x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2.1e-62) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (y <= 2.7e+18) tmp = Float64(y / fma(x, x, x)); 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[y, -2.1e-62], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+18], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+18}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -2.0999999999999999e-62Initial program 67.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
Applied rewrites99.7%
Taylor expanded in x around inf
lower-/.f6440.6
Applied rewrites40.6%
if -2.0999999999999999e-62 < y < 2.7e18Initial program 75.0%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6479.2
Applied rewrites79.2%
if 2.7e18 < y Initial program 56.7%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6475.3
Applied rewrites75.3%
Applied rewrites83.4%
Final simplification69.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -2.1e-62) (/ (/ y x) x) (if (<= y 2.7e+18) (/ y (fma x x x)) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.1e-62) {
tmp = (y / x) / x;
} else if (y <= 2.7e+18) {
tmp = y / fma(x, x, x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2.1e-62) tmp = Float64(Float64(y / x) / x); elseif (y <= 2.7e+18) tmp = Float64(y / fma(x, x, x)); 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[y, -2.1e-62], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.7e+18], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+18}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -2.0999999999999999e-62Initial program 67.1%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites39.9%
if -2.0999999999999999e-62 < y < 2.7e18Initial program 75.0%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6479.2
Applied rewrites79.2%
if 2.7e18 < y Initial program 56.7%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6475.3
Applied rewrites75.3%
Applied rewrites83.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.1e-95) (/ (/ y (+ x 1.0)) (+ x y)) (/ (/ x (+ 1.0 y)) (+ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.1e-95) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (1.0 + 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 <= 2.1d-95) then
tmp = (y / (x + 1.0d0)) / (x + y)
else
tmp = (x / (1.0d0 + y)) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.1e-95) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (1.0 + y)) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.1e-95: tmp = (y / (x + 1.0)) / (x + y) else: tmp = (x / (1.0 + y)) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.1e-95) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.1e-95)
tmp = (y / (x + 1.0)) / (x + y);
else
tmp = (x / (1.0 + 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, 2.1e-95], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{-95}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
\end{array}
\end{array}
if y < 2.1e-95Initial program 71.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
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6465.0
Applied rewrites65.0%
if 2.1e-95 < y Initial program 63.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
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6470.3
Applied rewrites70.3%
Final simplification66.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.7e+18) (/ y (fma x x x)) (/ (/ x y) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.7e+18) {
tmp = y / fma(x, x, x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.7e+18) tmp = Float64(y / fma(x, x, x)); 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[y, 2.7e+18], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{+18}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 2.7e18Initial program 72.1%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6463.4
Applied rewrites63.4%
if 2.7e18 < y Initial program 56.7%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6475.3
Applied rewrites75.3%
Applied rewrites83.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.1e-95) (/ y (fma x x x)) (/ x (fma y y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.1e-95) {
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 (y <= 2.1e-95) 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[y, 2.1e-95], 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}\;y \leq 2.1 \cdot 10^{-95}:\\
\;\;\;\;\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 y < 2.1e-95Initial program 71.1%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6463.0
Applied rewrites63.0%
if 2.1e-95 < y Initial program 63.0%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6464.1
Applied rewrites64.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -350000000.0) (/ y (* x x)) (/ x (fma y y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -350000000.0) {
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 <= -350000000.0) 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, -350000000.0], 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 -350000000:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -3.5e8Initial program 62.6%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6475.5
Applied rewrites75.5%
if -3.5e8 < x Initial program 70.3%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6455.8
Applied rewrites55.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.7e+18) (/ y (* x x)) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.7e+18) {
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 (y <= 2.7d+18) 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 (y <= 2.7e+18) {
tmp = y / (x * x);
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.7e+18: tmp = y / (x * x) else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.7e+18) 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 (y <= 2.7e+18)
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[y, 2.7e+18], 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}\;y \leq 2.7 \cdot 10^{+18}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 2.7e18Initial program 72.1%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6448.1
Applied rewrites48.1%
if 2.7e18 < y Initial program 56.7%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6475.3
Applied rewrites75.3%
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 68.3%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6434.2
Applied rewrites34.2%
(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 2024296
(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))))