
(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 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (/ (/ y (+ y x)) (+ y x)) (/ x (+ x (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
return ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0d0)))
end function
assert x < y;
public static double code(double x, double y) {
return ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0)));
}
[x, y] = sort([x, y]) def code(x, y): return ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0)))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(y / Float64(y + x)) / Float64(y + x)) * Float64(x / Float64(x + Float64(y + 1.0)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{y + x}}{y + x} \cdot \frac{x}{x + \left(y + 1\right)}
\end{array}
Initial program 72.8%
associate-/r*76.9%
+-commutative76.9%
+-commutative76.9%
+-commutative76.9%
associate-/l/72.8%
times-frac89.4%
*-commutative89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
associate-+l+89.4%
Simplified89.4%
associate-/r*99.7%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Final simplification99.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* (+ y x) (+ y x)))) (t_1 (+ x (+ y 1.0))))
(if (<= x -2.4e+160)
(* (/ y t_1) (/ 1.0 x))
(if (<= x -2.9)
(* (/ y x) t_0)
(if (<= x -6.8e-192)
(* t_0 (/ y (+ y 1.0)))
(* (/ x t_1) (/ 1.0 (+ y x))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / ((y + x) * (y + x));
double t_1 = x + (y + 1.0);
double tmp;
if (x <= -2.4e+160) {
tmp = (y / t_1) * (1.0 / x);
} else if (x <= -2.9) {
tmp = (y / x) * t_0;
} else if (x <= -6.8e-192) {
tmp = t_0 * (y / (y + 1.0));
} else {
tmp = (x / t_1) * (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) :: t_1
real(8) :: tmp
t_0 = x / ((y + x) * (y + x))
t_1 = x + (y + 1.0d0)
if (x <= (-2.4d+160)) then
tmp = (y / t_1) * (1.0d0 / x)
else if (x <= (-2.9d0)) then
tmp = (y / x) * t_0
else if (x <= (-6.8d-192)) then
tmp = t_0 * (y / (y + 1.0d0))
else
tmp = (x / t_1) * (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) * (y + x));
double t_1 = x + (y + 1.0);
double tmp;
if (x <= -2.4e+160) {
tmp = (y / t_1) * (1.0 / x);
} else if (x <= -2.9) {
tmp = (y / x) * t_0;
} else if (x <= -6.8e-192) {
tmp = t_0 * (y / (y + 1.0));
} else {
tmp = (x / t_1) * (1.0 / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / ((y + x) * (y + x)) t_1 = x + (y + 1.0) tmp = 0 if x <= -2.4e+160: tmp = (y / t_1) * (1.0 / x) elif x <= -2.9: tmp = (y / x) * t_0 elif x <= -6.8e-192: tmp = t_0 * (y / (y + 1.0)) else: tmp = (x / t_1) * (1.0 / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(Float64(y + x) * Float64(y + x))) t_1 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -2.4e+160) tmp = Float64(Float64(y / t_1) * Float64(1.0 / x)); elseif (x <= -2.9) tmp = Float64(Float64(y / x) * t_0); elseif (x <= -6.8e-192) tmp = Float64(t_0 * Float64(y / Float64(y + 1.0))); else tmp = Float64(Float64(x / t_1) * Float64(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) * (y + x));
t_1 = x + (y + 1.0);
tmp = 0.0;
if (x <= -2.4e+160)
tmp = (y / t_1) * (1.0 / x);
elseif (x <= -2.9)
tmp = (y / x) * t_0;
elseif (x <= -6.8e-192)
tmp = t_0 * (y / (y + 1.0));
else
tmp = (x / t_1) * (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[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.4e+160], N[(N[(y / t$95$1), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9], N[(N[(y / x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, -6.8e-192], N[(t$95$0 * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$1), $MachinePrecision] * N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
t_1 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+160}:\\
\;\;\;\;\frac{y}{t_1} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2.9:\\
\;\;\;\;\frac{y}{x} \cdot t_0\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-192}:\\
\;\;\;\;t_0 \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t_1} \cdot \frac{1}{y + x}\\
\end{array}
\end{array}
if x < -2.4000000000000001e160Initial program 59.0%
times-frac74.3%
associate-+l+74.3%
Simplified74.3%
Taylor expanded in x around inf 92.6%
if -2.4000000000000001e160 < x < -2.89999999999999991Initial program 62.9%
times-frac92.9%
associate-+l+92.9%
Simplified92.9%
Taylor expanded in x around inf 81.4%
if -2.89999999999999991 < x < -6.80000000000000003e-192Initial program 94.8%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
Simplified99.6%
if -6.80000000000000003e-192 < x Initial program 72.2%
associate-/r*75.0%
+-commutative75.0%
+-commutative75.0%
+-commutative75.0%
associate-/l/72.2%
times-frac88.9%
*-commutative88.9%
+-commutative88.9%
+-commutative88.9%
+-commutative88.9%
associate-+l+88.9%
Simplified88.9%
associate-/r*99.7%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in y around inf 53.5%
Final simplification69.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 x) (+ y x)))) (t_1 (/ y (+ x (+ y 1.0)))))
(if (<= x -3.1e+160)
(* t_1 (/ 1.0 x))
(if (<= x -3.0)
(* (/ y x) t_0)
(if (<= x -1.28e-154)
(* t_0 (/ y (+ y 1.0)))
(* t_1 (/ (/ x y) (+ y x))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / ((y + x) * (y + x));
double t_1 = y / (x + (y + 1.0));
double tmp;
if (x <= -3.1e+160) {
tmp = t_1 * (1.0 / x);
} else if (x <= -3.0) {
tmp = (y / x) * t_0;
} else if (x <= -1.28e-154) {
tmp = t_0 * (y / (y + 1.0));
} else {
tmp = t_1 * ((x / y) / (y + x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / ((y + x) * (y + x))
t_1 = y / (x + (y + 1.0d0))
if (x <= (-3.1d+160)) then
tmp = t_1 * (1.0d0 / x)
else if (x <= (-3.0d0)) then
tmp = (y / x) * t_0
else if (x <= (-1.28d-154)) then
tmp = t_0 * (y / (y + 1.0d0))
else
tmp = t_1 * ((x / y) / (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) * (y + x));
double t_1 = y / (x + (y + 1.0));
double tmp;
if (x <= -3.1e+160) {
tmp = t_1 * (1.0 / x);
} else if (x <= -3.0) {
tmp = (y / x) * t_0;
} else if (x <= -1.28e-154) {
tmp = t_0 * (y / (y + 1.0));
} else {
tmp = t_1 * ((x / y) / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / ((y + x) * (y + x)) t_1 = y / (x + (y + 1.0)) tmp = 0 if x <= -3.1e+160: tmp = t_1 * (1.0 / x) elif x <= -3.0: tmp = (y / x) * t_0 elif x <= -1.28e-154: tmp = t_0 * (y / (y + 1.0)) else: tmp = t_1 * ((x / y) / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(Float64(y + x) * Float64(y + x))) t_1 = Float64(y / Float64(x + Float64(y + 1.0))) tmp = 0.0 if (x <= -3.1e+160) tmp = Float64(t_1 * Float64(1.0 / x)); elseif (x <= -3.0) tmp = Float64(Float64(y / x) * t_0); elseif (x <= -1.28e-154) tmp = Float64(t_0 * Float64(y / Float64(y + 1.0))); else tmp = Float64(t_1 * Float64(Float64(x / y) / Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / ((y + x) * (y + x));
t_1 = y / (x + (y + 1.0));
tmp = 0.0;
if (x <= -3.1e+160)
tmp = t_1 * (1.0 / x);
elseif (x <= -3.0)
tmp = (y / x) * t_0;
elseif (x <= -1.28e-154)
tmp = t_0 * (y / (y + 1.0));
else
tmp = t_1 * ((x / y) / (y + x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.1e+160], N[(t$95$1 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.0], N[(N[(y / x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, -1.28e-154], N[(t$95$0 * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
t_1 := \frac{y}{x + \left(y + 1\right)}\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{+160}:\\
\;\;\;\;t_1 \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -3:\\
\;\;\;\;\frac{y}{x} \cdot t_0\\
\mathbf{elif}\;x \leq -1.28 \cdot 10^{-154}:\\
\;\;\;\;t_0 \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if x < -3.0999999999999998e160Initial program 59.0%
times-frac74.3%
associate-+l+74.3%
Simplified74.3%
Taylor expanded in x around inf 92.6%
if -3.0999999999999998e160 < x < -3Initial program 62.9%
times-frac92.9%
associate-+l+92.9%
Simplified92.9%
Taylor expanded in x around inf 81.4%
if -3 < x < -1.28000000000000005e-154Initial program 93.3%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
Simplified99.6%
if -1.28000000000000005e-154 < x Initial program 73.8%
times-frac89.6%
associate-+l+89.6%
Simplified89.6%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 55.2%
Final simplification68.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 x) (+ y x)))))
(if (<= x -2.4e+160)
(* (/ (/ y x) (+ y x)) (- 1.0 (/ (+ y 1.0) x)))
(if (<= x -2.9)
(* (/ y x) t_0)
(if (<= x -1.28e-154)
(* t_0 (/ y (+ y 1.0)))
(* (/ y (+ x (+ y 1.0))) (/ (/ x y) (+ y x))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / ((y + x) * (y + x));
double tmp;
if (x <= -2.4e+160) {
tmp = ((y / x) / (y + x)) * (1.0 - ((y + 1.0) / x));
} else if (x <= -2.9) {
tmp = (y / x) * t_0;
} else if (x <= -1.28e-154) {
tmp = t_0 * (y / (y + 1.0));
} else {
tmp = (y / (x + (y + 1.0))) * ((x / y) / (y + x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / ((y + x) * (y + x))
if (x <= (-2.4d+160)) then
tmp = ((y / x) / (y + x)) * (1.0d0 - ((y + 1.0d0) / x))
else if (x <= (-2.9d0)) then
tmp = (y / x) * t_0
else if (x <= (-1.28d-154)) then
tmp = t_0 * (y / (y + 1.0d0))
else
tmp = (y / (x + (y + 1.0d0))) * ((x / y) / (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) * (y + x));
double tmp;
if (x <= -2.4e+160) {
tmp = ((y / x) / (y + x)) * (1.0 - ((y + 1.0) / x));
} else if (x <= -2.9) {
tmp = (y / x) * t_0;
} else if (x <= -1.28e-154) {
tmp = t_0 * (y / (y + 1.0));
} else {
tmp = (y / (x + (y + 1.0))) * ((x / y) / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / ((y + x) * (y + x)) tmp = 0 if x <= -2.4e+160: tmp = ((y / x) / (y + x)) * (1.0 - ((y + 1.0) / x)) elif x <= -2.9: tmp = (y / x) * t_0 elif x <= -1.28e-154: tmp = t_0 * (y / (y + 1.0)) else: tmp = (y / (x + (y + 1.0))) * ((x / y) / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(Float64(y + x) * Float64(y + x))) tmp = 0.0 if (x <= -2.4e+160) tmp = Float64(Float64(Float64(y / x) / Float64(y + x)) * Float64(1.0 - Float64(Float64(y + 1.0) / x))); elseif (x <= -2.9) tmp = Float64(Float64(y / x) * t_0); elseif (x <= -1.28e-154) tmp = Float64(t_0 * Float64(y / Float64(y + 1.0))); else tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(Float64(x / y) / Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / ((y + x) * (y + x));
tmp = 0.0;
if (x <= -2.4e+160)
tmp = ((y / x) / (y + x)) * (1.0 - ((y + 1.0) / x));
elseif (x <= -2.9)
tmp = (y / x) * t_0;
elseif (x <= -1.28e-154)
tmp = t_0 * (y / (y + 1.0));
else
tmp = (y / (x + (y + 1.0))) * ((x / y) / (y + x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.4e+160], N[(N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(y + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9], N[(N[(y / x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, -1.28e-154], N[(t$95$0 * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+160}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x} \cdot \left(1 - \frac{y + 1}{x}\right)\\
\mathbf{elif}\;x \leq -2.9:\\
\;\;\;\;\frac{y}{x} \cdot t_0\\
\mathbf{elif}\;x \leq -1.28 \cdot 10^{-154}:\\
\;\;\;\;t_0 \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if x < -2.4000000000000001e160Initial program 59.0%
associate-/r*59.0%
+-commutative59.0%
+-commutative59.0%
+-commutative59.0%
associate-/l/59.0%
times-frac74.3%
*-commutative74.3%
+-commutative74.3%
+-commutative74.3%
+-commutative74.3%
associate-+l+74.3%
Simplified74.3%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 92.8%
Taylor expanded in x around inf 92.5%
mul-1-neg92.5%
unsub-neg92.5%
+-commutative92.5%
Simplified92.5%
if -2.4000000000000001e160 < x < -2.89999999999999991Initial program 62.9%
times-frac92.9%
associate-+l+92.9%
Simplified92.9%
Taylor expanded in x around inf 81.4%
if -2.89999999999999991 < x < -1.28000000000000005e-154Initial program 93.3%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
Simplified99.6%
if -1.28000000000000005e-154 < x Initial program 73.8%
times-frac89.6%
associate-+l+89.6%
Simplified89.6%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 55.2%
Final simplification68.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 x) (+ y x)))) (t_1 (+ x (+ y 1.0))))
(if (<= x -1.85e+160)
(* (/ x t_1) (/ (/ y x) (+ y x)))
(if (<= x -3.0)
(* (/ y x) t_0)
(if (<= x -1.28e-154)
(* t_0 (/ y (+ y 1.0)))
(* (/ y t_1) (/ (/ x y) (+ y x))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / ((y + x) * (y + x));
double t_1 = x + (y + 1.0);
double tmp;
if (x <= -1.85e+160) {
tmp = (x / t_1) * ((y / x) / (y + x));
} else if (x <= -3.0) {
tmp = (y / x) * t_0;
} else if (x <= -1.28e-154) {
tmp = t_0 * (y / (y + 1.0));
} else {
tmp = (y / t_1) * ((x / y) / (y + x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / ((y + x) * (y + x))
t_1 = x + (y + 1.0d0)
if (x <= (-1.85d+160)) then
tmp = (x / t_1) * ((y / x) / (y + x))
else if (x <= (-3.0d0)) then
tmp = (y / x) * t_0
else if (x <= (-1.28d-154)) then
tmp = t_0 * (y / (y + 1.0d0))
else
tmp = (y / t_1) * ((x / y) / (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) * (y + x));
double t_1 = x + (y + 1.0);
double tmp;
if (x <= -1.85e+160) {
tmp = (x / t_1) * ((y / x) / (y + x));
} else if (x <= -3.0) {
tmp = (y / x) * t_0;
} else if (x <= -1.28e-154) {
tmp = t_0 * (y / (y + 1.0));
} else {
tmp = (y / t_1) * ((x / y) / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / ((y + x) * (y + x)) t_1 = x + (y + 1.0) tmp = 0 if x <= -1.85e+160: tmp = (x / t_1) * ((y / x) / (y + x)) elif x <= -3.0: tmp = (y / x) * t_0 elif x <= -1.28e-154: tmp = t_0 * (y / (y + 1.0)) else: tmp = (y / t_1) * ((x / y) / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(Float64(y + x) * Float64(y + x))) t_1 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -1.85e+160) tmp = Float64(Float64(x / t_1) * Float64(Float64(y / x) / Float64(y + x))); elseif (x <= -3.0) tmp = Float64(Float64(y / x) * t_0); elseif (x <= -1.28e-154) tmp = Float64(t_0 * Float64(y / Float64(y + 1.0))); else tmp = Float64(Float64(y / t_1) * Float64(Float64(x / y) / Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / ((y + x) * (y + x));
t_1 = x + (y + 1.0);
tmp = 0.0;
if (x <= -1.85e+160)
tmp = (x / t_1) * ((y / x) / (y + x));
elseif (x <= -3.0)
tmp = (y / x) * t_0;
elseif (x <= -1.28e-154)
tmp = t_0 * (y / (y + 1.0));
else
tmp = (y / t_1) * ((x / y) / (y + x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.85e+160], N[(N[(x / t$95$1), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.0], N[(N[(y / x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, -1.28e-154], N[(t$95$0 * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / t$95$1), $MachinePrecision] * N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
t_1 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{+160}:\\
\;\;\;\;\frac{x}{t_1} \cdot \frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -3:\\
\;\;\;\;\frac{y}{x} \cdot t_0\\
\mathbf{elif}\;x \leq -1.28 \cdot 10^{-154}:\\
\;\;\;\;t_0 \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t_1} \cdot \frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if x < -1.85000000000000008e160Initial program 59.0%
associate-/r*59.0%
+-commutative59.0%
+-commutative59.0%
+-commutative59.0%
associate-/l/59.0%
times-frac74.3%
*-commutative74.3%
+-commutative74.3%
+-commutative74.3%
+-commutative74.3%
associate-+l+74.3%
Simplified74.3%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 92.8%
if -1.85000000000000008e160 < x < -3Initial program 62.9%
times-frac92.9%
associate-+l+92.9%
Simplified92.9%
Taylor expanded in x around inf 81.4%
if -3 < x < -1.28000000000000005e-154Initial program 93.3%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
Simplified99.6%
if -1.28000000000000005e-154 < x Initial program 73.8%
times-frac89.6%
associate-+l+89.6%
Simplified89.6%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 55.2%
Final simplification68.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.9e+160)
(* (/ x (+ x (+ y 1.0))) (/ (/ y x) (+ y x)))
(if (<= x -2.8)
(* (/ y x) (/ x (* (+ y x) (+ y x))))
(* (/ (/ y (+ y x)) (+ y x)) (/ x (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.9e+160) {
tmp = (x / (x + (y + 1.0))) * ((y / x) / (y + x));
} else if (x <= -2.8) {
tmp = (y / x) * (x / ((y + x) * (y + x)));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.9d+160)) then
tmp = (x / (x + (y + 1.0d0))) * ((y / x) / (y + x))
else if (x <= (-2.8d0)) then
tmp = (y / x) * (x / ((y + x) * (y + x)))
else
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.9e+160) {
tmp = (x / (x + (y + 1.0))) * ((y / x) / (y + x));
} else if (x <= -2.8) {
tmp = (y / x) * (x / ((y + x) * (y + x)));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.9e+160: tmp = (x / (x + (y + 1.0))) * ((y / x) / (y + x)) elif x <= -2.8: tmp = (y / x) * (x / ((y + x) * (y + x))) else: tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.9e+160) tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) * Float64(Float64(y / x) / Float64(y + x))); elseif (x <= -2.8) tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(Float64(y / Float64(y + x)) / Float64(y + x)) * Float64(x / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.9e+160)
tmp = (x / (x + (y + 1.0))) * ((y / x) / (y + x));
elseif (x <= -2.8)
tmp = (y / x) * (x / ((y + x) * (y + x)));
else
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.9e+160], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.8], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+160}:\\
\;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -2.8:\\
\;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{y + x} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -1.90000000000000006e160Initial program 59.0%
associate-/r*59.0%
+-commutative59.0%
+-commutative59.0%
+-commutative59.0%
associate-/l/59.0%
times-frac74.3%
*-commutative74.3%
+-commutative74.3%
+-commutative74.3%
+-commutative74.3%
associate-+l+74.3%
Simplified74.3%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 92.8%
if -1.90000000000000006e160 < x < -2.7999999999999998Initial program 62.9%
times-frac92.9%
associate-+l+92.9%
Simplified92.9%
Taylor expanded in x around inf 81.4%
if -2.7999999999999998 < x Initial program 77.0%
associate-/r*79.7%
+-commutative79.7%
+-commutative79.7%
+-commutative79.7%
associate-/l/77.0%
times-frac91.2%
*-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l+91.2%
Simplified91.2%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 89.7%
+-commutative83.0%
Simplified89.7%
Final simplification88.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.9e+160)
(* (/ x (+ x (+ y 1.0))) (/ (/ y x) (+ y x)))
(if (<= x -2.6)
(* (/ y x) (/ x (* (+ y x) (+ y x))))
(/ (/ x (* (+ y x) (/ (+ y 1.0) y))) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.9e+160) {
tmp = (x / (x + (y + 1.0))) * ((y / x) / (y + x));
} else if (x <= -2.6) {
tmp = (y / x) * (x / ((y + x) * (y + x)));
} else {
tmp = (x / ((y + x) * ((y + 1.0) / y))) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.9d+160)) then
tmp = (x / (x + (y + 1.0d0))) * ((y / x) / (y + x))
else if (x <= (-2.6d0)) then
tmp = (y / x) * (x / ((y + x) * (y + x)))
else
tmp = (x / ((y + x) * ((y + 1.0d0) / y))) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.9e+160) {
tmp = (x / (x + (y + 1.0))) * ((y / x) / (y + x));
} else if (x <= -2.6) {
tmp = (y / x) * (x / ((y + x) * (y + x)));
} else {
tmp = (x / ((y + x) * ((y + 1.0) / y))) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.9e+160: tmp = (x / (x + (y + 1.0))) * ((y / x) / (y + x)) elif x <= -2.6: tmp = (y / x) * (x / ((y + x) * (y + x))) else: tmp = (x / ((y + x) * ((y + 1.0) / y))) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.9e+160) tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) * Float64(Float64(y / x) / Float64(y + x))); elseif (x <= -2.6) tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(Float64(y + 1.0) / y))) / 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.9e+160)
tmp = (x / (x + (y + 1.0))) * ((y / x) / (y + x));
elseif (x <= -2.6)
tmp = (y / x) * (x / ((y + x) * (y + x)));
else
tmp = (x / ((y + x) * ((y + 1.0) / y))) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.9e+160], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+160}:\\
\;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -2.6:\\
\;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\left(y + x\right) \cdot \frac{y + 1}{y}}}{y + x}\\
\end{array}
\end{array}
if x < -1.90000000000000006e160Initial program 59.0%
associate-/r*59.0%
+-commutative59.0%
+-commutative59.0%
+-commutative59.0%
associate-/l/59.0%
times-frac74.3%
*-commutative74.3%
+-commutative74.3%
+-commutative74.3%
+-commutative74.3%
associate-+l+74.3%
Simplified74.3%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 92.8%
if -1.90000000000000006e160 < x < -2.60000000000000009Initial program 62.9%
times-frac92.9%
associate-+l+92.9%
Simplified92.9%
Taylor expanded in x around inf 81.4%
if -2.60000000000000009 < x Initial program 77.0%
associate-/r*79.7%
+-commutative79.7%
+-commutative79.7%
+-commutative79.7%
associate-/l/77.0%
times-frac91.2%
*-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l+91.2%
Simplified91.2%
Taylor expanded in x around 0 83.0%
+-commutative83.0%
Simplified83.0%
associate-/r*89.7%
frac-times84.8%
+-commutative84.8%
+-commutative84.8%
Applied egg-rr84.8%
*-un-lft-identity84.8%
+-commutative84.8%
times-frac84.0%
*-commutative84.0%
+-commutative84.0%
Applied egg-rr84.0%
associate-*l/84.1%
*-lft-identity84.1%
associate-/l*84.4%
associate-/r/84.4%
Simplified84.4%
Final simplification85.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(* (/ y x) (/ 1.0 x))
(if (<= x -8e-97)
(- (/ y x) y)
(if (<= x -5.5e-112)
(/ x (* y y))
(if (<= x -3.3e-118)
(/ y x)
(if (<= x 3.7e-231) (/ x y) (/ 1.0 (/ y (/ x y)))))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -8e-97) {
tmp = (y / x) - y;
} else if (x <= -5.5e-112) {
tmp = x / (y * y);
} else if (x <= -3.3e-118) {
tmp = y / x;
} else if (x <= 3.7e-231) {
tmp = x / y;
} else {
tmp = 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.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-8d-97)) then
tmp = (y / x) - y
else if (x <= (-5.5d-112)) then
tmp = x / (y * y)
else if (x <= (-3.3d-118)) then
tmp = y / x
else if (x <= 3.7d-231) then
tmp = x / y
else
tmp = 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.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -8e-97) {
tmp = (y / x) - y;
} else if (x <= -5.5e-112) {
tmp = x / (y * y);
} else if (x <= -3.3e-118) {
tmp = y / x;
} else if (x <= 3.7e-231) {
tmp = x / y;
} else {
tmp = 1.0 / (y / (x / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) * (1.0 / x) elif x <= -8e-97: tmp = (y / x) - y elif x <= -5.5e-112: tmp = x / (y * y) elif x <= -3.3e-118: tmp = y / x elif x <= 3.7e-231: tmp = x / y else: tmp = 1.0 / (y / (x / y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -8e-97) tmp = Float64(Float64(y / x) - y); elseif (x <= -5.5e-112) tmp = Float64(x / Float64(y * y)); elseif (x <= -3.3e-118) tmp = Float64(y / x); elseif (x <= 3.7e-231) tmp = Float64(x / y); else tmp = Float64(1.0 / Float64(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.0)
tmp = (y / x) * (1.0 / x);
elseif (x <= -8e-97)
tmp = (y / x) - y;
elseif (x <= -5.5e-112)
tmp = x / (y * y);
elseif (x <= -3.3e-118)
tmp = y / x;
elseif (x <= 3.7e-231)
tmp = x / y;
else
tmp = 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.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-97], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -5.5e-112], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.3e-118], N[(y / x), $MachinePrecision], If[LessEqual[x, 3.7e-231], N[(x / y), $MachinePrecision], N[(1.0 / N[(y / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-112}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-231}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{\frac{x}{y}}}\\
\end{array}
\end{array}
if x < -1Initial program 61.1%
times-frac84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in x around inf 78.1%
Taylor expanded in x around inf 74.2%
if -1 < x < -8.00000000000000029e-97Initial program 93.6%
times-frac99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 45.5%
associate-/r*45.5%
+-commutative45.5%
Simplified45.5%
Taylor expanded in x around 0 45.5%
neg-mul-145.5%
+-commutative45.5%
unsub-neg45.5%
Simplified45.5%
if -8.00000000000000029e-97 < x < -5.5e-112Initial program 99.7%
associate-/r*99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
associate-/r*99.7%
associate-*l/100.0%
*-commutative100.0%
*-commutative100.0%
distribute-rgt1-in100.0%
fma-def100.0%
+-commutative100.0%
+-commutative100.0%
cube-unmult100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
unpow2100.0%
Simplified100.0%
if -5.5e-112 < x < -3.3e-118Initial program 98.4%
times-frac98.4%
associate-+l+98.4%
Simplified98.4%
Taylor expanded in y around 0 1.8%
associate-/r*1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around 0 1.8%
neg-mul-11.8%
+-commutative1.8%
unsub-neg1.8%
Simplified1.8%
Taylor expanded in x around 0 1.8%
if -3.3e-118 < x < 3.69999999999999993e-231Initial program 71.9%
times-frac88.9%
associate-+l+88.9%
Simplified88.9%
Taylor expanded in x around 0 93.4%
+-commutative93.4%
Simplified93.4%
Taylor expanded in y around 0 87.8%
if 3.69999999999999993e-231 < x Initial program 75.9%
associate-/r*79.6%
+-commutative79.6%
+-commutative79.6%
+-commutative79.6%
associate-/r*75.9%
associate-*l/87.0%
*-commutative87.0%
*-commutative87.0%
distribute-rgt1-in78.3%
fma-def87.0%
+-commutative87.0%
+-commutative87.0%
cube-unmult87.0%
+-commutative87.0%
Simplified87.0%
Taylor expanded in y around inf 31.2%
unpow231.2%
Simplified31.2%
clear-num30.7%
inv-pow30.7%
Applied egg-rr30.7%
unpow-130.7%
associate-/l*31.6%
Simplified31.6%
Final simplification56.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 5.6e-251)
(/ (/ y x) (+ x 1.0))
(if (<= y 0.0051)
(* x (/ (/ y (+ y x)) (+ y x)))
(if (<= y 3.1e+155)
(/ x (* (+ y x) (+ y x)))
(* (/ x (+ x (+ y 1.0))) (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 5.6e-251) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 0.0051) {
tmp = x * ((y / (y + x)) / (y + x));
} else if (y <= 3.1e+155) {
tmp = x / ((y + x) * (y + x));
} else {
tmp = (x / (x + (y + 1.0))) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 5.6d-251) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 0.0051d0) then
tmp = x * ((y / (y + x)) / (y + x))
else if (y <= 3.1d+155) then
tmp = x / ((y + x) * (y + x))
else
tmp = (x / (x + (y + 1.0d0))) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 5.6e-251) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 0.0051) {
tmp = x * ((y / (y + x)) / (y + x));
} else if (y <= 3.1e+155) {
tmp = x / ((y + x) * (y + x));
} else {
tmp = (x / (x + (y + 1.0))) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 5.6e-251: tmp = (y / x) / (x + 1.0) elif y <= 0.0051: tmp = x * ((y / (y + x)) / (y + x)) elif y <= 3.1e+155: tmp = x / ((y + x) * (y + x)) else: tmp = (x / (x + (y + 1.0))) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 5.6e-251) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 0.0051) tmp = Float64(x * Float64(Float64(y / Float64(y + x)) / Float64(y + x))); elseif (y <= 3.1e+155) tmp = Float64(x / Float64(Float64(y + x) * Float64(y + x))); else tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 5.6e-251)
tmp = (y / x) / (x + 1.0);
elseif (y <= 0.0051)
tmp = x * ((y / (y + x)) / (y + x));
elseif (y <= 3.1e+155)
tmp = x / ((y + x) * (y + x));
else
tmp = (x / (x + (y + 1.0))) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 5.6e-251], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.0051], N[(x * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e+155], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.6 \cdot 10^{-251}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 0.0051:\\
\;\;\;\;x \cdot \frac{\frac{y}{y + x}}{y + x}\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+155}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 5.59999999999999978e-251Initial program 73.7%
times-frac90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in y around 0 50.4%
associate-/r*51.5%
+-commutative51.5%
Simplified51.5%
if 5.59999999999999978e-251 < y < 0.0051000000000000004Initial program 83.5%
associate-/r*85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
associate-/l/83.5%
times-frac94.0%
*-commutative94.0%
+-commutative94.0%
+-commutative94.0%
+-commutative94.0%
associate-+l+94.0%
Simplified94.0%
Taylor expanded in x around 0 78.8%
+-commutative78.8%
Simplified78.8%
Taylor expanded in y around 0 78.4%
associate-/r*99.6%
div-inv99.6%
Applied egg-rr84.0%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified84.0%
if 0.0051000000000000004 < y < 3.09999999999999989e155Initial program 62.0%
times-frac81.9%
associate-+l+81.9%
Simplified81.9%
Taylor expanded in y around inf 55.0%
if 3.09999999999999989e155 < y Initial program 62.2%
associate-/r*62.2%
+-commutative62.2%
+-commutative62.2%
+-commutative62.2%
associate-/l/62.2%
times-frac84.3%
*-commutative84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around inf 91.6%
Final simplification63.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3e-10) (/ (/ y x) (/ (+ y x) (/ x (+ (+ y x) 1.0)))) (/ (/ x (* (+ y x) (/ (+ y 1.0) y))) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3e-10) {
tmp = (y / x) / ((y + x) / (x / ((y + x) + 1.0)));
} else {
tmp = (x / ((y + x) * ((y + 1.0) / y))) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3d-10)) then
tmp = (y / x) / ((y + x) / (x / ((y + x) + 1.0d0)))
else
tmp = (x / ((y + x) * ((y + 1.0d0) / y))) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3e-10) {
tmp = (y / x) / ((y + x) / (x / ((y + x) + 1.0)));
} else {
tmp = (x / ((y + x) * ((y + 1.0) / y))) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3e-10: tmp = (y / x) / ((y + x) / (x / ((y + x) + 1.0))) else: tmp = (x / ((y + x) * ((y + 1.0) / y))) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3e-10) tmp = Float64(Float64(y / x) / Float64(Float64(y + x) / Float64(x / Float64(Float64(y + x) + 1.0)))); else tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(Float64(y + 1.0) / y))) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3e-10)
tmp = (y / x) / ((y + x) / (x / ((y + x) + 1.0)));
else
tmp = (x / ((y + x) * ((y + 1.0) / y))) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3e-10], N[(N[(y / x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] / N[(x / N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{y}{x}}{\frac{y + x}{\frac{x}{\left(y + x\right) + 1}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\left(y + x\right) \cdot \frac{y + 1}{y}}}{y + x}\\
\end{array}
\end{array}
if x < -3e-10Initial program 61.1%
associate-/r*69.2%
+-commutative69.2%
+-commutative69.2%
+-commutative69.2%
associate-/l/61.1%
times-frac84.2%
*-commutative84.2%
+-commutative84.2%
+-commutative84.2%
+-commutative84.2%
associate-+l+84.2%
Simplified84.2%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 76.8%
associate-*l/76.8%
associate-/l*88.6%
associate-+r+88.6%
+-commutative88.6%
Applied egg-rr88.6%
if -3e-10 < x Initial program 77.0%
associate-/r*79.7%
+-commutative79.7%
+-commutative79.7%
+-commutative79.7%
associate-/l/77.0%
times-frac91.2%
*-commutative91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l+91.2%
Simplified91.2%
Taylor expanded in x around 0 83.0%
+-commutative83.0%
Simplified83.0%
associate-/r*89.7%
frac-times84.8%
+-commutative84.8%
+-commutative84.8%
Applied egg-rr84.8%
*-un-lft-identity84.8%
+-commutative84.8%
times-frac84.0%
*-commutative84.0%
+-commutative84.0%
Applied egg-rr84.0%
associate-*l/84.1%
*-lft-identity84.1%
associate-/l*84.4%
associate-/r/84.4%
Simplified84.4%
Final simplification85.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (/ (/ x (+ y x)) (+ y x)) (/ y (+ x (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
return ((x / (y + x)) / (y + x)) * (y / (x + (y + 1.0)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / (y + x)) / (y + x)) * (y / (x + (y + 1.0d0)))
end function
assert x < y;
public static double code(double x, double y) {
return ((x / (y + x)) / (y + x)) * (y / (x + (y + 1.0)));
}
[x, y] = sort([x, y]) def code(x, y): return ((x / (y + x)) / (y + x)) * (y / (x + (y + 1.0)))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(x / Float64(y + x)) / Float64(y + x)) * Float64(y / Float64(x + Float64(y + 1.0)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((x / (y + x)) / (y + x)) * (y / (x + (y + 1.0)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{x + \left(y + 1\right)}
\end{array}
Initial program 72.8%
times-frac89.4%
associate-+l+89.4%
Simplified89.4%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y y))))
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -2.9e-97)
(- (/ y x) y)
(if (<= x -1.28e-111)
t_0
(if (<= x -3.1e-118) (/ y x) (if (<= x 3.7e-231) (/ x y) t_0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -2.9e-97) {
tmp = (y / x) - y;
} else if (x <= -1.28e-111) {
tmp = t_0;
} else if (x <= -3.1e-118) {
tmp = y / x;
} else if (x <= 3.7e-231) {
tmp = x / y;
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y * y)
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-2.9d-97)) then
tmp = (y / x) - y
else if (x <= (-1.28d-111)) then
tmp = t_0
else if (x <= (-3.1d-118)) then
tmp = y / x
else if (x <= 3.7d-231) then
tmp = x / y
else
tmp = t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -2.9e-97) {
tmp = (y / x) - y;
} else if (x <= -1.28e-111) {
tmp = t_0;
} else if (x <= -3.1e-118) {
tmp = y / x;
} else if (x <= 3.7e-231) {
tmp = x / y;
} else {
tmp = t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * y) tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -2.9e-97: tmp = (y / x) - y elif x <= -1.28e-111: tmp = t_0 elif x <= -3.1e-118: tmp = y / x elif x <= 3.7e-231: tmp = x / y else: tmp = t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -2.9e-97) tmp = Float64(Float64(y / x) - y); elseif (x <= -1.28e-111) tmp = t_0; elseif (x <= -3.1e-118) tmp = Float64(y / x); elseif (x <= 3.7e-231) tmp = Float64(x / y); else tmp = t_0; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * y);
tmp = 0.0;
if (x <= -1.0)
tmp = y / (x * x);
elseif (x <= -2.9e-97)
tmp = (y / x) - y;
elseif (x <= -1.28e-111)
tmp = t_0;
elseif (x <= -3.1e-118)
tmp = y / x;
elseif (x <= 3.7e-231)
tmp = x / y;
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9e-97], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -1.28e-111], t$95$0, If[LessEqual[x, -3.1e-118], N[(y / x), $MachinePrecision], If[LessEqual[x, 3.7e-231], N[(x / y), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -1.28 \cdot 10^{-111}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-231}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1Initial program 61.1%
associate-/r*69.2%
+-commutative69.2%
+-commutative69.2%
+-commutative69.2%
associate-/r*61.1%
associate-*l/76.1%
*-commutative76.1%
*-commutative76.1%
distribute-rgt1-in31.0%
fma-def76.1%
+-commutative76.1%
+-commutative76.1%
cube-unmult76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in x around inf 67.3%
unpow267.3%
Simplified67.3%
if -1 < x < -2.8999999999999999e-97Initial program 94.0%
times-frac99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 43.0%
associate-/r*43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around 0 43.0%
neg-mul-143.0%
+-commutative43.0%
unsub-neg43.0%
Simplified43.0%
if -2.8999999999999999e-97 < x < -1.27999999999999997e-111 or 3.69999999999999993e-231 < x Initial program 76.7%
associate-/r*80.2%
+-commutative80.2%
+-commutative80.2%
+-commutative80.2%
associate-/r*76.7%
associate-*l/87.4%
*-commutative87.4%
*-commutative87.4%
distribute-rgt1-in79.0%
fma-def87.4%
+-commutative87.4%
+-commutative87.4%
cube-unmult87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in y around inf 33.5%
unpow233.5%
Simplified33.5%
if -1.27999999999999997e-111 < x < -3.1000000000000001e-118Initial program 98.4%
times-frac98.4%
associate-+l+98.4%
Simplified98.4%
Taylor expanded in y around 0 1.8%
associate-/r*1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around 0 1.8%
neg-mul-11.8%
+-commutative1.8%
unsub-neg1.8%
Simplified1.8%
Taylor expanded in x around 0 1.8%
if -3.1000000000000001e-118 < x < 3.69999999999999993e-231Initial program 71.9%
times-frac88.9%
associate-+l+88.9%
Simplified88.9%
Taylor expanded in x around 0 93.4%
+-commutative93.4%
Simplified93.4%
Taylor expanded in y around 0 87.8%
Final simplification54.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 y))))
(if (<= x -1.0)
(* (/ y x) (/ 1.0 x))
(if (<= x -1.06e-97)
(- (/ y x) y)
(if (<= x -1.8e-113)
t_0
(if (<= x -5.5e-118) (/ y x) (if (<= x 3.7e-231) (/ x y) t_0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -1.06e-97) {
tmp = (y / x) - y;
} else if (x <= -1.8e-113) {
tmp = t_0;
} else if (x <= -5.5e-118) {
tmp = y / x;
} else if (x <= 3.7e-231) {
tmp = x / y;
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y * y)
if (x <= (-1.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-1.06d-97)) then
tmp = (y / x) - y
else if (x <= (-1.8d-113)) then
tmp = t_0
else if (x <= (-5.5d-118)) then
tmp = y / x
else if (x <= 3.7d-231) then
tmp = x / y
else
tmp = t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -1.06e-97) {
tmp = (y / x) - y;
} else if (x <= -1.8e-113) {
tmp = t_0;
} else if (x <= -5.5e-118) {
tmp = y / x;
} else if (x <= 3.7e-231) {
tmp = x / y;
} else {
tmp = t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * y) tmp = 0 if x <= -1.0: tmp = (y / x) * (1.0 / x) elif x <= -1.06e-97: tmp = (y / x) - y elif x <= -1.8e-113: tmp = t_0 elif x <= -5.5e-118: tmp = y / x elif x <= 3.7e-231: tmp = x / y else: tmp = t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -1.06e-97) tmp = Float64(Float64(y / x) - y); elseif (x <= -1.8e-113) tmp = t_0; elseif (x <= -5.5e-118) tmp = Float64(y / x); elseif (x <= 3.7e-231) tmp = Float64(x / y); else tmp = t_0; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * y);
tmp = 0.0;
if (x <= -1.0)
tmp = (y / x) * (1.0 / x);
elseif (x <= -1.06e-97)
tmp = (y / x) - y;
elseif (x <= -1.8e-113)
tmp = t_0;
elseif (x <= -5.5e-118)
tmp = y / x;
elseif (x <= 3.7e-231)
tmp = x / y;
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.06e-97], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -1.8e-113], t$95$0, If[LessEqual[x, -5.5e-118], N[(y / x), $MachinePrecision], If[LessEqual[x, 3.7e-231], N[(x / y), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-113}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-231}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1Initial program 61.1%
times-frac84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in x around inf 78.1%
Taylor expanded in x around inf 74.2%
if -1 < x < -1.06000000000000006e-97Initial program 94.0%
times-frac99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 43.0%
associate-/r*43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around 0 43.0%
neg-mul-143.0%
+-commutative43.0%
unsub-neg43.0%
Simplified43.0%
if -1.06000000000000006e-97 < x < -1.79999999999999987e-113 or 3.69999999999999993e-231 < x Initial program 76.7%
associate-/r*80.2%
+-commutative80.2%
+-commutative80.2%
+-commutative80.2%
associate-/r*76.7%
associate-*l/87.4%
*-commutative87.4%
*-commutative87.4%
distribute-rgt1-in79.0%
fma-def87.4%
+-commutative87.4%
+-commutative87.4%
cube-unmult87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in y around inf 33.5%
unpow233.5%
Simplified33.5%
if -1.79999999999999987e-113 < x < -5.5000000000000003e-118Initial program 98.4%
times-frac98.4%
associate-+l+98.4%
Simplified98.4%
Taylor expanded in y around 0 1.8%
associate-/r*1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around 0 1.8%
neg-mul-11.8%
+-commutative1.8%
unsub-neg1.8%
Simplified1.8%
Taylor expanded in x around 0 1.8%
if -5.5000000000000003e-118 < x < 3.69999999999999993e-231Initial program 71.9%
times-frac88.9%
associate-+l+88.9%
Simplified88.9%
Taylor expanded in x around 0 93.4%
+-commutative93.4%
Simplified93.4%
Taylor expanded in y around 0 87.8%
Final simplification56.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -7.2e-19)
(* (/ y (+ x (+ y 1.0))) (/ 1.0 x))
(if (<= x -2.4e-152)
(* x (/ y (* (+ y x) (+ y x))))
(/ (/ x (+ y 1.0)) y))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -7.2e-19) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else if (x <= -2.4e-152) {
tmp = x * (y / ((y + x) * (y + x)));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-7.2d-19)) then
tmp = (y / (x + (y + 1.0d0))) * (1.0d0 / x)
else if (x <= (-2.4d-152)) then
tmp = x * (y / ((y + x) * (y + x)))
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -7.2e-19) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else if (x <= -2.4e-152) {
tmp = x * (y / ((y + x) * (y + x)));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -7.2e-19: tmp = (y / (x + (y + 1.0))) * (1.0 / x) elif x <= -2.4e-152: tmp = x * (y / ((y + x) * (y + x))) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -7.2e-19) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(1.0 / x)); elseif (x <= -2.4e-152) tmp = Float64(x * Float64(y / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -7.2e-19)
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
elseif (x <= -2.4e-152)
tmp = x * (y / ((y + x) * (y + x)));
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -7.2e-19], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.4e-152], N[(x * N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-152}:\\
\;\;\;\;x \cdot \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -7.2000000000000002e-19Initial program 60.8%
times-frac84.7%
associate-+l+84.7%
Simplified84.7%
Taylor expanded in x around inf 75.6%
if -7.2000000000000002e-19 < x < -2.4e-152Initial program 96.2%
associate-/r*96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
associate-/l/96.2%
times-frac99.5%
*-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in y around 0 67.0%
if -2.4e-152 < x Initial program 73.8%
times-frac89.6%
associate-+l+89.6%
Simplified89.6%
Taylor expanded in x around 0 54.2%
+-commutative54.2%
Simplified54.2%
*-un-lft-identity54.2%
times-frac54.9%
+-commutative54.9%
Applied egg-rr54.9%
associate-*l/55.0%
*-lft-identity55.0%
+-commutative55.0%
Simplified55.0%
Final simplification61.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.02e-84) (* (/ y (+ x (+ y 1.0))) (/ 1.0 x)) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.02e-84) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.02d-84)) then
tmp = (y / (x + (y + 1.0d0))) * (1.0d0 / x)
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.02e-84) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.02e-84: tmp = (y / (x + (y + 1.0))) * (1.0 / x) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.02e-84) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(1.0 / x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.02e-84)
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.02e-84], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.02 \cdot 10^{-84}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -2.02e-84Initial program 66.5%
times-frac87.0%
associate-+l+87.0%
Simplified87.0%
Taylor expanded in x around inf 72.1%
if -2.02e-84 < x Initial program 75.7%
times-frac90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 58.1%
+-commutative58.1%
Simplified58.1%
*-un-lft-identity58.1%
times-frac58.7%
+-commutative58.7%
Applied egg-rr58.7%
associate-*l/58.8%
*-lft-identity58.8%
+-commutative58.8%
Simplified58.8%
Final simplification63.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.0) (* (/ y x) (/ 1.0 x)) (if (<= x -2.02e-84) (- (/ y x) y) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.02e-84) {
tmp = (y / x) - y;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-2.02d-84)) then
tmp = (y / x) - y
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.02e-84) {
tmp = (y / x) - y;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) * (1.0 / x) elif x <= -2.02e-84: tmp = (y / x) - y else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -2.02e-84) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = (y / x) * (1.0 / x);
elseif (x <= -2.02e-84)
tmp = (y / x) - y;
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.02e-84], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2.02 \cdot 10^{-84}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 61.1%
times-frac84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in x around inf 78.1%
Taylor expanded in x around inf 74.2%
if -1 < x < -2.02e-84Initial program 92.8%
times-frac99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 51.7%
associate-/r*51.7%
+-commutative51.7%
Simplified51.7%
Taylor expanded in x around 0 51.7%
neg-mul-151.7%
+-commutative51.7%
unsub-neg51.7%
Simplified51.7%
if -2.02e-84 < x Initial program 75.7%
times-frac90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 58.1%
+-commutative58.1%
Simplified58.1%
Final simplification62.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.85e+160) (* (/ y x) (/ 1.0 x)) (if (<= x -2.65e-89) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.85e+160) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.65e-89) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.85d+160)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-2.65d-89)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.85e+160) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.65e-89) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.85e+160: tmp = (y / x) * (1.0 / x) elif x <= -2.65e-89: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.85e+160) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -2.65e-89) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.85e+160)
tmp = (y / x) * (1.0 / x);
elseif (x <= -2.65e-89)
tmp = y / (x * (x + 1.0));
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.85e+160], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.65e-89], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+160}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2.65 \cdot 10^{-89}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1.85000000000000008e160Initial program 59.0%
times-frac74.3%
associate-+l+74.3%
Simplified74.3%
Taylor expanded in x around inf 74.3%
Taylor expanded in x around inf 92.5%
if -1.85000000000000008e160 < x < -2.65e-89Initial program 71.2%
times-frac94.8%
associate-+l+94.8%
Simplified94.8%
Taylor expanded in y around 0 60.8%
if -2.65e-89 < x Initial program 75.7%
times-frac90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 58.1%
+-commutative58.1%
Simplified58.1%
Final simplification62.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2e+160) (* (/ y x) (/ 1.0 x)) (if (<= x -2.02e-84) (/ y (+ x (* x x))) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2e+160) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.02e-84) {
tmp = y / (x + (x * x));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2d+160)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-2.02d-84)) then
tmp = y / (x + (x * x))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2e+160) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.02e-84) {
tmp = y / (x + (x * x));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2e+160: tmp = (y / x) * (1.0 / x) elif x <= -2.02e-84: tmp = y / (x + (x * x)) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2e+160) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -2.02e-84) tmp = Float64(y / Float64(x + Float64(x * x))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2e+160)
tmp = (y / x) * (1.0 / x);
elseif (x <= -2.02e-84)
tmp = y / (x + (x * x));
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2e+160], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.02e-84], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+160}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2.02 \cdot 10^{-84}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -2.00000000000000001e160Initial program 59.0%
times-frac74.3%
associate-+l+74.3%
Simplified74.3%
Taylor expanded in x around inf 74.3%
Taylor expanded in x around inf 92.5%
if -2.00000000000000001e160 < x < -2.02e-84Initial program 71.2%
associate-/r*83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
associate-/l/71.2%
times-frac94.6%
*-commutative94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
associate-+l+94.6%
Simplified94.6%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 60.8%
distribute-rgt-in60.9%
*-lft-identity60.9%
Simplified60.9%
if -2.02e-84 < x Initial program 75.7%
times-frac90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 58.1%
+-commutative58.1%
Simplified58.1%
Final simplification62.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4.5e+160) (* (/ y x) (/ 1.0 x)) (if (<= x -2e-84) (/ y (+ x (* x x))) (/ (/ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.5e+160) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2e-84) {
tmp = y / (x + (x * x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.5d+160)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-2d-84)) then
tmp = y / (x + (x * x))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.5e+160) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2e-84) {
tmp = y / (x + (x * x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.5e+160: tmp = (y / x) * (1.0 / x) elif x <= -2e-84: tmp = y / (x + (x * x)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.5e+160) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -2e-84) tmp = Float64(y / Float64(x + Float64(x * x))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.5e+160)
tmp = (y / x) * (1.0 / x);
elseif (x <= -2e-84)
tmp = y / (x + (x * x));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.5e+160], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-84], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+160}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-84}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -4.4999999999999998e160Initial program 59.0%
times-frac74.3%
associate-+l+74.3%
Simplified74.3%
Taylor expanded in x around inf 74.3%
Taylor expanded in x around inf 92.5%
if -4.4999999999999998e160 < x < -2.0000000000000001e-84Initial program 71.2%
associate-/r*83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
associate-/l/71.2%
times-frac94.6%
*-commutative94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
associate-+l+94.6%
Simplified94.6%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 60.8%
distribute-rgt-in60.9%
*-lft-identity60.9%
Simplified60.9%
if -2.0000000000000001e-84 < x Initial program 75.7%
associate-/r*78.1%
+-commutative78.1%
+-commutative78.1%
+-commutative78.1%
associate-/l/75.7%
times-frac90.5%
*-commutative90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
associate-+l+90.5%
Simplified90.5%
associate-/r*99.7%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 58.1%
associate-/r*58.8%
+-commutative58.8%
Simplified58.8%
Final simplification63.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.25e+160) (* (/ y x) (/ 1.0 x)) (if (<= x -2.02e-84) (/ y (+ x (* x x))) (/ (/ x (+ y 1.0)) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.25e+160) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.02e-84) {
tmp = y / (x + (x * x));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.25d+160)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-2.02d-84)) then
tmp = y / (x + (x * x))
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.25e+160) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2.02e-84) {
tmp = y / (x + (x * x));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.25e+160: tmp = (y / x) * (1.0 / x) elif x <= -2.02e-84: tmp = y / (x + (x * x)) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.25e+160) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -2.02e-84) tmp = Float64(y / Float64(x + Float64(x * x))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.25e+160)
tmp = (y / x) * (1.0 / x);
elseif (x <= -2.02e-84)
tmp = y / (x + (x * x));
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.25e+160], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.02e-84], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{+160}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2.02 \cdot 10^{-84}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -2.2499999999999999e160Initial program 59.0%
times-frac74.3%
associate-+l+74.3%
Simplified74.3%
Taylor expanded in x around inf 74.3%
Taylor expanded in x around inf 92.5%
if -2.2499999999999999e160 < x < -2.02e-84Initial program 71.2%
associate-/r*83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
associate-/l/71.2%
times-frac94.6%
*-commutative94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
associate-+l+94.6%
Simplified94.6%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 60.8%
distribute-rgt-in60.9%
*-lft-identity60.9%
Simplified60.9%
if -2.02e-84 < x Initial program 75.7%
times-frac90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 58.1%
+-commutative58.1%
Simplified58.1%
*-un-lft-identity58.1%
times-frac58.7%
+-commutative58.7%
Applied egg-rr58.7%
associate-*l/58.8%
*-lft-identity58.8%
+-commutative58.8%
Simplified58.8%
Final simplification63.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 5.5e-110) (/ y x) (if (<= y 0.76) (- (/ x y) x) (/ x (* y y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 5.5e-110) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (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 (y <= 5.5d-110) then
tmp = y / x
else if (y <= 0.76d0) then
tmp = (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 (y <= 5.5e-110) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 5.5e-110: tmp = y / x elif y <= 0.76: tmp = (x / y) - x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 5.5e-110) tmp = Float64(y / x); elseif (y <= 0.76) tmp = Float64(Float64(x / y) - x); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 5.5e-110)
tmp = y / x;
elseif (y <= 0.76)
tmp = (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[y, 5.5e-110], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.76], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.5 \cdot 10^{-110}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 0.76:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 5.4999999999999998e-110Initial program 75.5%
times-frac90.3%
associate-+l+90.3%
Simplified90.3%
Taylor expanded in y around 0 56.2%
associate-/r*57.1%
+-commutative57.1%
Simplified57.1%
Taylor expanded in x around 0 16.3%
neg-mul-116.3%
+-commutative16.3%
unsub-neg16.3%
Simplified16.3%
Taylor expanded in x around 0 39.3%
if 5.4999999999999998e-110 < y < 0.76000000000000001Initial program 82.3%
times-frac99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 48.7%
+-commutative48.7%
Simplified48.7%
Taylor expanded in y around 0 48.7%
neg-mul-148.7%
+-commutative48.7%
unsub-neg48.7%
Simplified48.7%
if 0.76000000000000001 < y Initial program 62.1%
associate-/r*68.0%
+-commutative68.0%
+-commutative68.0%
+-commutative68.0%
associate-/r*62.1%
associate-*l/75.8%
*-commutative75.8%
*-commutative75.8%
distribute-rgt1-in71.9%
fma-def75.8%
+-commutative75.8%
+-commutative75.8%
cube-unmult75.8%
+-commutative75.8%
Simplified75.8%
Taylor expanded in y around inf 64.8%
unpow264.8%
Simplified64.8%
Final simplification46.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4.5e-85) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.5e-85) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.5d-85)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.5e-85) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.5e-85: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.5e-85) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.5e-85)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.5e-85], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -4.50000000000000004e-85Initial program 66.5%
times-frac87.0%
associate-+l+87.0%
Simplified87.0%
Taylor expanded in y around 0 66.0%
associate-/r*71.8%
+-commutative71.8%
Simplified71.8%
if -4.50000000000000004e-85 < x Initial program 75.7%
times-frac90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 58.1%
+-commutative58.1%
Simplified58.1%
*-un-lft-identity58.1%
times-frac58.7%
+-commutative58.7%
Applied egg-rr58.7%
associate-*l/58.8%
*-lft-identity58.8%
+-commutative58.8%
Simplified58.8%
Final simplification62.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.3e-118) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.3e-118) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.3d-118)) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.3e-118) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.3e-118: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.3e-118) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.3e-118)
tmp = y / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.3e-118], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1.3e-118Initial program 69.5%
times-frac88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 60.3%
associate-/r*65.6%
+-commutative65.6%
Simplified65.6%
Taylor expanded in x around 0 11.0%
neg-mul-111.0%
+-commutative11.0%
unsub-neg11.0%
Simplified11.0%
Taylor expanded in x around 0 30.7%
if -1.3e-118 < x Initial program 74.6%
times-frac90.1%
associate-+l+90.1%
Simplified90.1%
Taylor expanded in x around 0 56.1%
+-commutative56.1%
Simplified56.1%
Taylor expanded in y around 0 40.3%
Final simplification36.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ x y))
assert(x < y);
double code(double x, double y) {
return x / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
assert x < y;
public static double code(double x, double y) {
return x / y;
}
[x, y] = sort([x, y]) def code(x, y): return x / y
x, y = sort([x, y]) function code(x, y) return Float64(x / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = x / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y}
\end{array}
Initial program 72.8%
times-frac89.4%
associate-+l+89.4%
Simplified89.4%
Taylor expanded in x around 0 48.1%
+-commutative48.1%
Simplified48.1%
Taylor expanded in y around 0 28.3%
Final simplification28.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (- y))
assert(x < y);
double code(double x, double y) {
return -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 = -y
end function
assert x < y;
public static double code(double x, double y) {
return -y;
}
[x, y] = sort([x, y]) def code(x, y): return -y
x, y = sort([x, y]) function code(x, y) return Float64(-y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = -y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := (-y)
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
-y
\end{array}
Initial program 72.8%
times-frac89.4%
associate-+l+89.4%
Simplified89.4%
Taylor expanded in y around 0 48.0%
associate-/r*50.4%
+-commutative50.4%
Simplified50.4%
Taylor expanded in x around 0 12.1%
neg-mul-112.1%
+-commutative12.1%
unsub-neg12.1%
Simplified12.1%
Taylor expanded in x around inf 3.6%
neg-mul-13.6%
Simplified3.6%
Final simplification3.6%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2023293
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))