
(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 23 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)) (/ (/ x (+ y (+ x 1.0))) (+ y x))))
assert(x < y);
double code(double x, double y) {
return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + x)) * ((x / (y + (x + 1.0d0))) / (y + x))
end function
assert x < y;
public static double code(double x, double y) {
return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
}
[x, y] = sort([x, y]) def code(x, y): return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x}
\end{array}
Initial program 67.1%
associate-+r+67.1%
*-commutative67.1%
frac-times88.2%
associate-*l/81.8%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))))
(if (<= y 3.9e-200)
(/ (/ y (+ x 1.0)) x)
(if (<= y 1.15e-134)
(/ (/ x (+ y (+ x 1.0))) (+ y x))
(if (<= y 5e-95)
(/ t_0 (+ x 1.0))
(if (<= y 36000000000.0)
(/ x (* (+ y x) (+ y 1.0)))
(* (/ t_0 (+ y x)) (/ x y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.15e-134) {
tmp = (x / (y + (x + 1.0))) / (y + x);
} else if (y <= 5e-95) {
tmp = t_0 / (x + 1.0);
} else if (y <= 36000000000.0) {
tmp = x / ((y + x) * (y + 1.0));
} else {
tmp = (t_0 / (y + x)) * (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 = y / (y + x)
if (y <= 3.9d-200) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 1.15d-134) then
tmp = (x / (y + (x + 1.0d0))) / (y + x)
else if (y <= 5d-95) then
tmp = t_0 / (x + 1.0d0)
else if (y <= 36000000000.0d0) then
tmp = x / ((y + x) * (y + 1.0d0))
else
tmp = (t_0 / (y + x)) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.15e-134) {
tmp = (x / (y + (x + 1.0))) / (y + x);
} else if (y <= 5e-95) {
tmp = t_0 / (x + 1.0);
} else if (y <= 36000000000.0) {
tmp = x / ((y + x) * (y + 1.0));
} else {
tmp = (t_0 / (y + x)) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (y + x) tmp = 0 if y <= 3.9e-200: tmp = (y / (x + 1.0)) / x elif y <= 1.15e-134: tmp = (x / (y + (x + 1.0))) / (y + x) elif y <= 5e-95: tmp = t_0 / (x + 1.0) elif y <= 36000000000.0: tmp = x / ((y + x) * (y + 1.0)) else: tmp = (t_0 / (y + x)) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (y <= 3.9e-200) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 1.15e-134) tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x)); elseif (y <= 5e-95) tmp = Float64(t_0 / Float64(x + 1.0)); elseif (y <= 36000000000.0) tmp = Float64(x / Float64(Float64(y + x) * Float64(y + 1.0))); else tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (y + x);
tmp = 0.0;
if (y <= 3.9e-200)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 1.15e-134)
tmp = (x / (y + (x + 1.0))) / (y + x);
elseif (y <= 5e-95)
tmp = t_0 / (x + 1.0);
elseif (y <= 36000000000.0)
tmp = x / ((y + x) * (y + 1.0));
else
tmp = (t_0 / (y + x)) * (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[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.15e-134], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-95], N[(t$95$0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 36000000000.0], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y + x}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{t_0}{x + 1}\\
\mathbf{elif}\;y \leq 36000000000:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y + x} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < 3.89999999999999999e-200Initial program 65.9%
associate-*l*65.9%
+-commutative65.9%
+-commutative65.9%
+-commutative65.9%
associate-*l*65.9%
*-commutative65.9%
times-frac84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around 0 56.4%
+-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
times-frac59.2%
Applied egg-rr59.2%
associate-*l/59.3%
*-lft-identity59.3%
Simplified59.3%
if 3.89999999999999999e-200 < y < 1.15e-134Initial program 70.0%
associate-+r+70.0%
*-commutative70.0%
frac-times92.1%
associate-*l/70.0%
times-frac100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 34.4%
if 1.15e-134 < y < 4.9999999999999998e-95Initial program 86.1%
associate-+r+86.1%
*-commutative86.1%
frac-times99.8%
associate-*l/86.1%
times-frac100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
clear-num100.0%
un-div-inv100.0%
+-commutative100.0%
div-inv99.8%
clear-num99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 77.7%
+-commutative77.7%
Simplified77.7%
if 4.9999999999999998e-95 < y < 3.6e10Initial program 87.3%
associate-*l*87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
associate-*l*87.3%
associate-*l/94.4%
*-commutative94.4%
*-commutative94.4%
distribute-rgt1-in90.6%
fma-def94.4%
+-commutative94.4%
+-commutative94.4%
cube-unmult94.5%
+-commutative94.5%
Simplified94.5%
fma-udef90.7%
cube-mult90.6%
distribute-rgt1-in94.4%
associate-+r+94.4%
*-commutative94.4%
associate-*l*94.4%
associate-+r+94.4%
+-commutative94.4%
associate-+l+94.4%
Applied egg-rr94.4%
Taylor expanded in x around 0 38.2%
expm1-log1p-u38.2%
expm1-udef5.4%
associate-/r*5.4%
distribute-lft-in5.4%
*-rgt-identity5.4%
pow25.4%
Applied egg-rr5.4%
expm1-def38.5%
expm1-log1p38.5%
associate-*r/38.5%
associate-*r/31.2%
associate-/l/31.1%
+-commutative31.1%
unpow231.1%
*-rgt-identity31.1%
distribute-lft-in31.1%
associate-*r*31.1%
times-frac38.5%
*-inverses38.5%
Simplified38.5%
if 3.6e10 < y Initial program 59.4%
associate-*l*59.4%
+-commutative59.4%
+-commutative59.4%
+-commutative59.4%
associate-*l*59.4%
*-commutative59.4%
times-frac90.0%
+-commutative90.0%
+-commutative90.0%
+-commutative90.0%
associate-+l+90.0%
Simplified90.0%
Taylor expanded in y around inf 78.4%
associate-/r*82.0%
div-inv82.0%
Applied egg-rr82.0%
associate-*r/82.0%
*-rgt-identity82.0%
Simplified82.0%
Final simplification62.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 2e-21)
(* (/ y (+ y x)) (/ (/ x (+ x 1.0)) (+ y x)))
(if (<= y 7.8e+154)
(* (/ y (* (+ y x) (+ y x))) (/ x (+ x (+ y 1.0))))
(* (/ 1.0 y) (/ 1.0 (/ (+ y (+ x 1.0)) x))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2e-21) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else if (y <= 7.8e+154) {
tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0)));
} else {
tmp = (1.0 / y) * (1.0 / ((y + (x + 1.0)) / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2d-21) then
tmp = (y / (y + x)) * ((x / (x + 1.0d0)) / (y + x))
else if (y <= 7.8d+154) then
tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0d0)))
else
tmp = (1.0d0 / y) * (1.0d0 / ((y + (x + 1.0d0)) / x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2e-21) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else if (y <= 7.8e+154) {
tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0)));
} else {
tmp = (1.0 / y) * (1.0 / ((y + (x + 1.0)) / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2e-21: tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x)) elif y <= 7.8e+154: tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0))) else: tmp = (1.0 / y) * (1.0 / ((y + (x + 1.0)) / x)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2e-21) tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(x + 1.0)) / Float64(y + x))); elseif (y <= 7.8e+154) tmp = Float64(Float64(y / Float64(Float64(y + x) * Float64(y + x))) * Float64(x / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(1.0 / y) * Float64(1.0 / Float64(Float64(y + Float64(x + 1.0)) / x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2e-21)
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
elseif (y <= 7.8e+154)
tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0)));
else
tmp = (1.0 / y) * (1.0 / ((y + (x + 1.0)) / x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2e-21], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+154], N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(1.0 / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-21}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+154}:\\
\;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{1}{\frac{y + \left(x + 1\right)}{x}}\\
\end{array}
\end{array}
if y < 1.99999999999999982e-21Initial program 69.6%
associate-+r+69.6%
*-commutative69.6%
frac-times87.2%
associate-*l/78.2%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 85.3%
+-commutative85.3%
Simplified85.3%
if 1.99999999999999982e-21 < y < 7.8000000000000006e154Initial program 62.0%
associate-*l*62.0%
+-commutative62.0%
+-commutative62.0%
+-commutative62.0%
associate-*l*62.0%
*-commutative62.0%
times-frac93.1%
+-commutative93.1%
+-commutative93.1%
+-commutative93.1%
associate-+l+93.1%
Simplified93.1%
if 7.8000000000000006e154 < y Initial program 59.8%
associate-*l*59.8%
+-commutative59.8%
+-commutative59.8%
+-commutative59.8%
associate-*l*59.8%
*-commutative59.8%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around inf 96.0%
clear-num96.1%
inv-pow96.1%
associate-+r+96.1%
+-commutative96.1%
associate-+l+96.1%
Applied egg-rr96.1%
unpow-196.1%
Simplified96.1%
Final simplification88.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))) (t_1 (/ y (+ y x))))
(if (<= y -3.05e+26)
(/ t_1 (+ x (+ y (+ y 1.0))))
(if (<= y 7.2e+154)
(* t_1 (/ x (* (+ y x) t_0)))
(* (/ 1.0 y) (/ 1.0 (/ t_0 x)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = y / (y + x);
double tmp;
if (y <= -3.05e+26) {
tmp = t_1 / (x + (y + (y + 1.0)));
} else if (y <= 7.2e+154) {
tmp = t_1 * (x / ((y + x) * t_0));
} else {
tmp = (1.0 / y) * (1.0 / (t_0 / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y + (x + 1.0d0)
t_1 = y / (y + x)
if (y <= (-3.05d+26)) then
tmp = t_1 / (x + (y + (y + 1.0d0)))
else if (y <= 7.2d+154) then
tmp = t_1 * (x / ((y + x) * t_0))
else
tmp = (1.0d0 / y) * (1.0d0 / (t_0 / x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = y / (y + x);
double tmp;
if (y <= -3.05e+26) {
tmp = t_1 / (x + (y + (y + 1.0)));
} else if (y <= 7.2e+154) {
tmp = t_1 * (x / ((y + x) * t_0));
} else {
tmp = (1.0 / y) * (1.0 / (t_0 / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) t_1 = y / (y + x) tmp = 0 if y <= -3.05e+26: tmp = t_1 / (x + (y + (y + 1.0))) elif y <= 7.2e+154: tmp = t_1 * (x / ((y + x) * t_0)) else: tmp = (1.0 / y) * (1.0 / (t_0 / x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) t_1 = Float64(y / Float64(y + x)) tmp = 0.0 if (y <= -3.05e+26) tmp = Float64(t_1 / Float64(x + Float64(y + Float64(y + 1.0)))); elseif (y <= 7.2e+154) tmp = Float64(t_1 * Float64(x / Float64(Float64(y + x) * t_0))); else tmp = Float64(Float64(1.0 / y) * Float64(1.0 / Float64(t_0 / x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y + (x + 1.0);
t_1 = y / (y + x);
tmp = 0.0;
if (y <= -3.05e+26)
tmp = t_1 / (x + (y + (y + 1.0)));
elseif (y <= 7.2e+154)
tmp = t_1 * (x / ((y + x) * t_0));
else
tmp = (1.0 / y) * (1.0 / (t_0 / 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[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.05e+26], N[(t$95$1 / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+154], N[(t$95$1 * N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(1.0 / N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
t_1 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq -3.05 \cdot 10^{+26}:\\
\;\;\;\;\frac{t_1}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+154}:\\
\;\;\;\;t_1 \cdot \frac{x}{\left(y + x\right) \cdot t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{1}{\frac{t_0}{x}}\\
\end{array}
\end{array}
if y < -3.0500000000000001e26Initial program 59.6%
associate-+r+59.6%
*-commutative59.6%
frac-times87.8%
associate-*l/87.8%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
clear-num99.8%
un-div-inv99.8%
+-commutative99.8%
div-inv99.8%
clear-num99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around -inf 41.2%
neg-mul-141.2%
distribute-lft-in41.2%
mul-1-neg41.2%
remove-double-neg41.2%
distribute-lft-in41.2%
metadata-eval41.2%
neg-mul-141.2%
distribute-lft-in41.2%
metadata-eval41.2%
mul-1-neg41.2%
remove-double-neg41.2%
+-commutative41.2%
Simplified41.2%
if -3.0500000000000001e26 < y < 7.2000000000000001e154Initial program 71.0%
associate-+r+71.0%
*-commutative71.0%
associate-*l*71.0%
times-frac98.4%
associate-+r+98.4%
+-commutative98.4%
associate-+l+98.4%
Applied egg-rr98.4%
if 7.2000000000000001e154 < y Initial program 59.8%
associate-*l*59.8%
+-commutative59.8%
+-commutative59.8%
+-commutative59.8%
associate-*l*59.8%
*-commutative59.8%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around inf 96.0%
clear-num96.1%
inv-pow96.1%
associate-+r+96.1%
+-commutative96.1%
associate-+l+96.1%
Applied egg-rr96.1%
unpow-196.1%
Simplified96.1%
Final simplification86.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))))
(if (<= y 5.9e-161)
(/ t_0 (+ x (+ y (+ y 1.0))))
(if (<= y 180000000.0)
(* (/ x (+ x 1.0)) (/ y (* (+ y x) (+ y x))))
(* (/ t_0 (+ y x)) (/ x y))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (y <= 5.9e-161) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else if (y <= 180000000.0) {
tmp = (x / (x + 1.0)) * (y / ((y + x) * (y + x)));
} else {
tmp = (t_0 / (y + x)) * (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 = y / (y + x)
if (y <= 5.9d-161) then
tmp = t_0 / (x + (y + (y + 1.0d0)))
else if (y <= 180000000.0d0) then
tmp = (x / (x + 1.0d0)) * (y / ((y + x) * (y + x)))
else
tmp = (t_0 / (y + x)) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (y <= 5.9e-161) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else if (y <= 180000000.0) {
tmp = (x / (x + 1.0)) * (y / ((y + x) * (y + x)));
} else {
tmp = (t_0 / (y + x)) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (y + x) tmp = 0 if y <= 5.9e-161: tmp = t_0 / (x + (y + (y + 1.0))) elif y <= 180000000.0: tmp = (x / (x + 1.0)) * (y / ((y + x) * (y + x))) else: tmp = (t_0 / (y + x)) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (y <= 5.9e-161) tmp = Float64(t_0 / Float64(x + Float64(y + Float64(y + 1.0)))); elseif (y <= 180000000.0) tmp = Float64(Float64(x / Float64(x + 1.0)) * Float64(y / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (y + x);
tmp = 0.0;
if (y <= 5.9e-161)
tmp = t_0 / (x + (y + (y + 1.0)));
elseif (y <= 180000000.0)
tmp = (x / (x + 1.0)) * (y / ((y + x) * (y + x)));
else
tmp = (t_0 / (y + x)) * (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[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.9e-161], N[(t$95$0 / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 180000000.0], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq 5.9 \cdot 10^{-161}:\\
\;\;\;\;\frac{t_0}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{elif}\;y \leq 180000000:\\
\;\;\;\;\frac{x}{x + 1} \cdot \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y + x} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < 5.9000000000000002e-161Initial program 66.8%
associate-+r+66.8%
*-commutative66.8%
frac-times84.3%
associate-*l/77.2%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
clear-num99.7%
un-div-inv99.8%
+-commutative99.8%
div-inv99.7%
clear-num99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around -inf 61.5%
neg-mul-161.5%
distribute-lft-in61.5%
mul-1-neg61.5%
remove-double-neg61.5%
distribute-lft-in61.5%
metadata-eval61.5%
neg-mul-161.5%
distribute-lft-in61.5%
metadata-eval61.5%
mul-1-neg61.5%
remove-double-neg61.5%
+-commutative61.5%
Simplified61.5%
if 5.9000000000000002e-161 < y < 1.8e8Initial program 83.6%
associate-*l*83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
associate-*l*83.6%
*-commutative83.6%
times-frac99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 98.5%
+-commutative98.5%
Simplified98.5%
if 1.8e8 < y Initial program 58.7%
associate-*l*58.7%
+-commutative58.7%
+-commutative58.7%
+-commutative58.7%
associate-*l*58.7%
*-commutative58.7%
times-frac90.1%
+-commutative90.1%
+-commutative90.1%
+-commutative90.1%
associate-+l+90.1%
Simplified90.1%
Taylor expanded in y around inf 77.3%
associate-/r*80.9%
div-inv80.9%
Applied egg-rr80.9%
associate-*r/80.9%
*-rgt-identity80.9%
Simplified80.9%
Final simplification72.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= y -3.2e+26)
(* (/ y x) (/ 1.0 x))
(if (<= y 3.9e-200)
t_0
(if (<= y 1.05e-134)
(/ x y)
(if (<= y 5e-95)
t_0
(if (<= y 7.2e+154)
(/ x (* y (+ y 1.0)))
(* (/ 1.0 y) (/ x y)))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= -3.2e+26) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 3.9e-200) {
tmp = t_0;
} else if (y <= 1.05e-134) {
tmp = x / y;
} else if (y <= 5e-95) {
tmp = t_0;
} else if (y <= 7.2e+154) {
tmp = x / (y * (y + 1.0));
} 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) :: t_0
real(8) :: tmp
t_0 = y / (x * (x + 1.0d0))
if (y <= (-3.2d+26)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 3.9d-200) then
tmp = t_0
else if (y <= 1.05d-134) then
tmp = x / y
else if (y <= 5d-95) then
tmp = t_0
else if (y <= 7.2d+154) then
tmp = x / (y * (y + 1.0d0))
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 t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= -3.2e+26) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 3.9e-200) {
tmp = t_0;
} else if (y <= 1.05e-134) {
tmp = x / y;
} else if (y <= 5e-95) {
tmp = t_0;
} else if (y <= 7.2e+154) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if y <= -3.2e+26: tmp = (y / x) * (1.0 / x) elif y <= 3.9e-200: tmp = t_0 elif y <= 1.05e-134: tmp = x / y elif y <= 5e-95: tmp = t_0 elif y <= 7.2e+154: tmp = x / (y * (y + 1.0)) else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (y <= -3.2e+26) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 3.9e-200) tmp = t_0; elseif (y <= 1.05e-134) tmp = Float64(x / y); elseif (y <= 5e-95) tmp = t_0; elseif (y <= 7.2e+154) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(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 = y / (x * (x + 1.0));
tmp = 0.0;
if (y <= -3.2e+26)
tmp = (y / x) * (1.0 / x);
elseif (y <= 3.9e-200)
tmp = t_0;
elseif (y <= 1.05e-134)
tmp = x / y;
elseif (y <= 5e-95)
tmp = t_0;
elseif (y <= 7.2e+154)
tmp = x / (y * (y + 1.0));
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_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e+26], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-200], t$95$0, If[LessEqual[y, 1.05e-134], N[(x / y), $MachinePrecision], If[LessEqual[y, 5e-95], t$95$0, If[LessEqual[y, 7.2e+154], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -3.20000000000000029e26Initial program 60.6%
associate-+r+60.6%
*-commutative60.6%
frac-times87.6%
associate-*l/87.6%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 37.8%
Taylor expanded in y around 0 37.1%
if -3.20000000000000029e26 < y < 3.89999999999999999e-200 or 1.05e-134 < y < 4.9999999999999998e-95Initial program 70.0%
associate-*l*70.1%
+-commutative70.1%
+-commutative70.1%
+-commutative70.1%
associate-*l*70.0%
*-commutative70.0%
times-frac83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
associate-+l+83.7%
Simplified83.7%
Taylor expanded in y around 0 71.9%
+-commutative71.9%
Simplified71.9%
if 3.89999999999999999e-200 < y < 1.05e-134Initial program 70.0%
associate-*l*70.0%
+-commutative70.0%
+-commutative70.0%
+-commutative70.0%
associate-*l*70.0%
*-commutative70.0%
times-frac92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
associate-+l+92.1%
Simplified92.1%
Taylor expanded in x around 0 32.4%
+-commutative32.4%
Simplified32.4%
Taylor expanded in y around 0 32.4%
if 4.9999999999999998e-95 < y < 7.2000000000000001e154Initial program 71.7%
associate-*l*71.7%
+-commutative71.7%
+-commutative71.7%
+-commutative71.7%
associate-*l*71.7%
*-commutative71.7%
times-frac95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
associate-+l+95.4%
Simplified95.4%
Taylor expanded in x around 0 47.6%
+-commutative47.6%
Simplified47.6%
if 7.2000000000000001e154 < y Initial program 59.8%
associate-*l*59.8%
+-commutative59.8%
+-commutative59.8%
+-commutative59.8%
associate-*l*59.8%
*-commutative59.8%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around inf 96.0%
Taylor expanded in y around inf 96.0%
Final simplification61.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 3.9e-200)
(/ (/ y (+ x 1.0)) x)
(if (<= y 1.05e-134)
(/ x y)
(if (<= y 2.6e-95)
(/ y (* x (+ x 1.0)))
(if (<= y 7.2e+154)
(/ x (* y (+ y 1.0)))
(* (/ x y) (/ 1.0 (+ y x))))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = x / y;
} else if (y <= 2.6e-95) {
tmp = y / (x * (x + 1.0));
} else if (y <= 7.2e+154) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / (y + x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.9d-200) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 1.05d-134) then
tmp = x / y
else if (y <= 2.6d-95) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 7.2d+154) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) * (1.0d0 / (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = x / y;
} else if (y <= 2.6e-95) {
tmp = y / (x * (x + 1.0));
} else if (y <= 7.2e+154) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.9e-200: tmp = (y / (x + 1.0)) / x elif y <= 1.05e-134: tmp = x / y elif y <= 2.6e-95: tmp = y / (x * (x + 1.0)) elif y <= 7.2e+154: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) * (1.0 / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.9e-200) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 1.05e-134) tmp = Float64(x / y); elseif (y <= 2.6e-95) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 7.2e+154) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) * Float64(1.0 / Float64(y + x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 3.9e-200)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 1.05e-134)
tmp = x / y;
elseif (y <= 2.6e-95)
tmp = y / (x * (x + 1.0));
elseif (y <= 7.2e+154)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) * (1.0 / (y + x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(x / y), $MachinePrecision], If[LessEqual[y, 2.6e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+154], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y + x}\\
\end{array}
\end{array}
if y < 3.89999999999999999e-200Initial program 65.9%
associate-*l*65.9%
+-commutative65.9%
+-commutative65.9%
+-commutative65.9%
associate-*l*65.9%
*-commutative65.9%
times-frac84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around 0 56.4%
+-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
times-frac59.2%
Applied egg-rr59.2%
associate-*l/59.3%
*-lft-identity59.3%
Simplified59.3%
if 3.89999999999999999e-200 < y < 1.05e-134Initial program 70.0%
associate-*l*70.0%
+-commutative70.0%
+-commutative70.0%
+-commutative70.0%
associate-*l*70.0%
*-commutative70.0%
times-frac92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
associate-+l+92.1%
Simplified92.1%
Taylor expanded in x around 0 32.4%
+-commutative32.4%
Simplified32.4%
Taylor expanded in y around 0 32.4%
if 1.05e-134 < y < 2.60000000000000001e-95Initial program 86.1%
associate-*l*86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
associate-*l*86.1%
*-commutative86.1%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 77.2%
+-commutative77.2%
Simplified77.2%
if 2.60000000000000001e-95 < y < 7.2000000000000001e154Initial program 71.7%
associate-*l*71.7%
+-commutative71.7%
+-commutative71.7%
+-commutative71.7%
associate-*l*71.7%
*-commutative71.7%
times-frac95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
associate-+l+95.4%
Simplified95.4%
Taylor expanded in x around 0 47.6%
+-commutative47.6%
Simplified47.6%
if 7.2000000000000001e154 < y Initial program 59.8%
associate-*l*59.8%
+-commutative59.8%
+-commutative59.8%
+-commutative59.8%
associate-*l*59.8%
*-commutative59.8%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around inf 88.2%
associate-/r*96.1%
div-inv96.1%
Applied egg-rr96.1%
associate-*r/96.1%
*-rgt-identity96.1%
Simplified96.1%
Taylor expanded in y around inf 96.0%
Final simplification61.1%
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 (+ x 1.0))))))
(if (<= y 3.9e-200)
(/ (/ y (+ x 1.0)) x)
(if (<= y 1.05e-134)
t_0
(if (<= y 5e-95)
(/ y (* x (+ x 1.0)))
(if (<= y 8.8e+154) t_0 (* (/ x y) (/ 1.0 (+ y x)))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * (y + (x + 1.0)));
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = t_0;
} else if (y <= 5e-95) {
tmp = y / (x * (x + 1.0));
} else if (y <= 8.8e+154) {
tmp = t_0;
} else {
tmp = (x / y) * (1.0 / (y + x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y * (y + (x + 1.0d0)))
if (y <= 3.9d-200) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 1.05d-134) then
tmp = t_0
else if (y <= 5d-95) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 8.8d+154) then
tmp = t_0
else
tmp = (x / y) * (1.0d0 / (y + x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * (y + (x + 1.0)));
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = t_0;
} else if (y <= 5e-95) {
tmp = y / (x * (x + 1.0));
} else if (y <= 8.8e+154) {
tmp = t_0;
} else {
tmp = (x / y) * (1.0 / (y + x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * (y + (x + 1.0))) tmp = 0 if y <= 3.9e-200: tmp = (y / (x + 1.0)) / x elif y <= 1.05e-134: tmp = t_0 elif y <= 5e-95: tmp = y / (x * (x + 1.0)) elif y <= 8.8e+154: tmp = t_0 else: tmp = (x / y) * (1.0 / (y + x)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * Float64(y + Float64(x + 1.0)))) tmp = 0.0 if (y <= 3.9e-200) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 1.05e-134) tmp = t_0; elseif (y <= 5e-95) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 8.8e+154) tmp = t_0; else tmp = Float64(Float64(x / y) * 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 * (y + (x + 1.0)));
tmp = 0.0;
if (y <= 3.9e-200)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 1.05e-134)
tmp = t_0;
elseif (y <= 5e-95)
tmp = y / (x * (x + 1.0));
elseif (y <= 8.8e+154)
tmp = t_0;
else
tmp = (x / y) * (1.0 / (y + x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], t$95$0, If[LessEqual[y, 5e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.8e+154], t$95$0, N[(N[(x / y), $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}{y \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y + x}\\
\end{array}
\end{array}
if y < 3.89999999999999999e-200Initial program 65.9%
associate-*l*65.9%
+-commutative65.9%
+-commutative65.9%
+-commutative65.9%
associate-*l*65.9%
*-commutative65.9%
times-frac84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around 0 56.4%
+-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
times-frac59.2%
Applied egg-rr59.2%
associate-*l/59.3%
*-lft-identity59.3%
Simplified59.3%
if 3.89999999999999999e-200 < y < 1.05e-134 or 4.9999999999999998e-95 < y < 8.8000000000000004e154Initial program 71.4%
associate-*l*71.4%
+-commutative71.4%
+-commutative71.4%
+-commutative71.4%
associate-*l*71.4%
*-commutative71.4%
times-frac94.8%
+-commutative94.8%
+-commutative94.8%
+-commutative94.8%
associate-+l+94.8%
Simplified94.8%
Taylor expanded in y around inf 44.0%
*-commutative44.0%
associate-+r+44.0%
+-commutative44.0%
associate-+r+44.0%
frac-times45.5%
*-rgt-identity45.5%
Applied egg-rr45.5%
if 1.05e-134 < y < 4.9999999999999998e-95Initial program 86.1%
associate-*l*86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
associate-*l*86.1%
*-commutative86.1%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 77.2%
+-commutative77.2%
Simplified77.2%
if 8.8000000000000004e154 < y Initial program 59.8%
associate-*l*59.8%
+-commutative59.8%
+-commutative59.8%
+-commutative59.8%
associate-*l*59.8%
*-commutative59.8%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around inf 88.2%
associate-/r*96.1%
div-inv96.1%
Applied egg-rr96.1%
associate-*r/96.1%
*-rgt-identity96.1%
Simplified96.1%
Taylor expanded in y around inf 96.0%
Final simplification61.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 1.0))))) (if (<= x -3.4e-156) (* (/ t_0 (+ y x)) (/ y x)) (/ t_0 y))))
assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + (x + 1.0));
double tmp;
if (x <= -3.4e-156) {
tmp = (t_0 / (y + x)) * (y / x);
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = x / (y + (x + 1.0d0))
if (x <= (-3.4d-156)) then
tmp = (t_0 / (y + x)) * (y / x)
else
tmp = t_0 / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + (x + 1.0));
double tmp;
if (x <= -3.4e-156) {
tmp = (t_0 / (y + x)) * (y / x);
} else {
tmp = t_0 / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + (x + 1.0)) tmp = 0 if x <= -3.4e-156: tmp = (t_0 / (y + x)) * (y / x) else: tmp = t_0 / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + Float64(x + 1.0))) tmp = 0.0 if (x <= -3.4e-156) tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(y / x)); else tmp = Float64(t_0 / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + (x + 1.0));
tmp = 0.0;
if (x <= -3.4e-156)
tmp = (t_0 / (y + x)) * (y / x);
else
tmp = t_0 / 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[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-156], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + \left(x + 1\right)}\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{-156}:\\
\;\;\;\;\frac{t_0}{y + x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y}\\
\end{array}
\end{array}
if x < -3.3999999999999999e-156Initial program 62.7%
associate-+r+62.7%
*-commutative62.7%
frac-times93.4%
associate-*l/88.7%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 78.3%
if -3.3999999999999999e-156 < x Initial program 69.2%
associate-*l*69.2%
+-commutative69.2%
+-commutative69.2%
+-commutative69.2%
associate-*l*69.2%
*-commutative69.2%
times-frac85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
associate-+l+85.6%
Simplified85.6%
Taylor expanded in y around inf 55.5%
associate-*l/55.6%
*-un-lft-identity55.6%
associate-+r+55.6%
+-commutative55.6%
associate-+r+55.6%
Applied egg-rr55.6%
Final simplification63.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))))
(if (<= y 54000000.0)
(* t_0 (/ (/ x (+ x 1.0)) (+ y x)))
(* (/ t_0 (+ y x)) (/ x y)))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (y <= 54000000.0) {
tmp = t_0 * ((x / (x + 1.0)) / (y + x));
} else {
tmp = (t_0 / (y + x)) * (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 = y / (y + x)
if (y <= 54000000.0d0) then
tmp = t_0 * ((x / (x + 1.0d0)) / (y + x))
else
tmp = (t_0 / (y + x)) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (y <= 54000000.0) {
tmp = t_0 * ((x / (x + 1.0)) / (y + x));
} else {
tmp = (t_0 / (y + x)) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (y + x) tmp = 0 if y <= 54000000.0: tmp = t_0 * ((x / (x + 1.0)) / (y + x)) else: tmp = (t_0 / (y + x)) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (y <= 54000000.0) tmp = Float64(t_0 * Float64(Float64(x / Float64(x + 1.0)) / Float64(y + x))); else tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (y + x);
tmp = 0.0;
if (y <= 54000000.0)
tmp = t_0 * ((x / (x + 1.0)) / (y + x));
else
tmp = (t_0 / (y + x)) * (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[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 54000000.0], N[(t$95$0 * N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq 54000000:\\
\;\;\;\;t_0 \cdot \frac{\frac{x}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y + x} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < 5.4e7Initial program 70.2%
associate-+r+70.2%
*-commutative70.2%
frac-times87.4%
associate-*l/78.7%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 85.4%
+-commutative85.4%
Simplified85.4%
if 5.4e7 < y Initial program 58.7%
associate-*l*58.7%
+-commutative58.7%
+-commutative58.7%
+-commutative58.7%
associate-*l*58.7%
*-commutative58.7%
times-frac90.1%
+-commutative90.1%
+-commutative90.1%
+-commutative90.1%
associate-+l+90.1%
Simplified90.1%
Taylor expanded in y around inf 77.3%
associate-/r*80.9%
div-inv80.9%
Applied egg-rr80.9%
associate-*r/80.9%
*-rgt-identity80.9%
Simplified80.9%
Final simplification84.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ y x) (/ 1.0 x))))
(if (<= y -9.4e-135)
t_0
(if (<= y 3.9e-200)
(/ y x)
(if (<= y 3.3e-20)
(/ x y)
(if (<= y 3.4e+27) t_0 (* (/ 1.0 y) (/ x y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / x) * (1.0 / x);
double tmp;
if (y <= -9.4e-135) {
tmp = t_0;
} else if (y <= 3.9e-200) {
tmp = y / x;
} else if (y <= 3.3e-20) {
tmp = x / y;
} else if (y <= 3.4e+27) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = (y / x) * (1.0d0 / x)
if (y <= (-9.4d-135)) then
tmp = t_0
else if (y <= 3.9d-200) then
tmp = y / x
else if (y <= 3.3d-20) then
tmp = x / y
else if (y <= 3.4d+27) then
tmp = t_0
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 t_0 = (y / x) * (1.0 / x);
double tmp;
if (y <= -9.4e-135) {
tmp = t_0;
} else if (y <= 3.9e-200) {
tmp = y / x;
} else if (y <= 3.3e-20) {
tmp = x / y;
} else if (y <= 3.4e+27) {
tmp = t_0;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / x) * (1.0 / x) tmp = 0 if y <= -9.4e-135: tmp = t_0 elif y <= 3.9e-200: tmp = y / x elif y <= 3.3e-20: tmp = x / y elif y <= 3.4e+27: tmp = t_0 else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / x) * Float64(1.0 / x)) tmp = 0.0 if (y <= -9.4e-135) tmp = t_0; elseif (y <= 3.9e-200) tmp = Float64(y / x); elseif (y <= 3.3e-20) tmp = Float64(x / y); elseif (y <= 3.4e+27) tmp = t_0; else tmp = Float64(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 = (y / x) * (1.0 / x);
tmp = 0.0;
if (y <= -9.4e-135)
tmp = t_0;
elseif (y <= 3.9e-200)
tmp = y / x;
elseif (y <= 3.3e-20)
tmp = x / y;
elseif (y <= 3.4e+27)
tmp = t_0;
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_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.4e-135], t$95$0, If[LessEqual[y, 3.9e-200], N[(y / x), $MachinePrecision], If[LessEqual[y, 3.3e-20], N[(x / y), $MachinePrecision], If[LessEqual[y, 3.4e+27], t$95$0, N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{if}\;y \leq -9.4 \cdot 10^{-135}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+27}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -9.39999999999999952e-135 or 3.3e-20 < y < 3.4e27Initial program 70.7%
associate-+r+70.7%
*-commutative70.7%
frac-times93.2%
associate-*l/89.8%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 44.7%
Taylor expanded in y around 0 44.1%
if -9.39999999999999952e-135 < y < 3.89999999999999999e-200Initial program 58.8%
associate-*l*58.8%
+-commutative58.8%
+-commutative58.8%
+-commutative58.8%
associate-*l*58.8%
*-commutative58.8%
times-frac71.8%
+-commutative71.8%
+-commutative71.8%
+-commutative71.8%
associate-+l+71.8%
Simplified71.8%
Taylor expanded in y around 0 86.3%
+-commutative86.3%
Simplified86.3%
Taylor expanded in x around 0 80.1%
if 3.89999999999999999e-200 < y < 3.3e-20Initial program 82.4%
associate-*l*82.4%
+-commutative82.4%
+-commutative82.4%
+-commutative82.4%
associate-*l*82.4%
*-commutative82.4%
times-frac97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
associate-+l+97.2%
Simplified97.2%
Taylor expanded in x around 0 34.2%
+-commutative34.2%
Simplified34.2%
Taylor expanded in y around 0 34.2%
if 3.4e27 < y Initial program 59.2%
associate-*l*59.2%
+-commutative59.2%
+-commutative59.2%
+-commutative59.2%
associate-*l*59.2%
*-commutative59.2%
times-frac89.2%
+-commutative89.2%
+-commutative89.2%
+-commutative89.2%
associate-+l+89.2%
Simplified89.2%
Taylor expanded in y around inf 79.5%
Taylor expanded in y around inf 79.2%
Final simplification59.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 3.9e-200)
(/ (/ y (+ x 1.0)) x)
(if (<= y 1.05e-134)
(/ x y)
(if (<= y 5e-95)
(/ y (* x (+ x 1.0)))
(if (<= y 8.2e+154) (/ x (* y (+ y 1.0))) (* (/ 1.0 y) (/ x y)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = x / y;
} else if (y <= 5e-95) {
tmp = y / (x * (x + 1.0));
} else if (y <= 8.2e+154) {
tmp = x / (y * (y + 1.0));
} 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 (y <= 3.9d-200) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 1.05d-134) then
tmp = x / y
else if (y <= 5d-95) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 8.2d+154) then
tmp = x / (y * (y + 1.0d0))
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 (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = x / y;
} else if (y <= 5e-95) {
tmp = y / (x * (x + 1.0));
} else if (y <= 8.2e+154) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.9e-200: tmp = (y / (x + 1.0)) / x elif y <= 1.05e-134: tmp = x / y elif y <= 5e-95: tmp = y / (x * (x + 1.0)) elif y <= 8.2e+154: tmp = x / (y * (y + 1.0)) else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.9e-200) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 1.05e-134) tmp = Float64(x / y); elseif (y <= 5e-95) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 8.2e+154) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(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 <= 3.9e-200)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 1.05e-134)
tmp = x / y;
elseif (y <= 5e-95)
tmp = y / (x * (x + 1.0));
elseif (y <= 8.2e+154)
tmp = x / (y * (y + 1.0));
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[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(x / y), $MachinePrecision], If[LessEqual[y, 5e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+154], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < 3.89999999999999999e-200Initial program 65.9%
associate-*l*65.9%
+-commutative65.9%
+-commutative65.9%
+-commutative65.9%
associate-*l*65.9%
*-commutative65.9%
times-frac84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around 0 56.4%
+-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
times-frac59.2%
Applied egg-rr59.2%
associate-*l/59.3%
*-lft-identity59.3%
Simplified59.3%
if 3.89999999999999999e-200 < y < 1.05e-134Initial program 70.0%
associate-*l*70.0%
+-commutative70.0%
+-commutative70.0%
+-commutative70.0%
associate-*l*70.0%
*-commutative70.0%
times-frac92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
associate-+l+92.1%
Simplified92.1%
Taylor expanded in x around 0 32.4%
+-commutative32.4%
Simplified32.4%
Taylor expanded in y around 0 32.4%
if 1.05e-134 < y < 4.9999999999999998e-95Initial program 86.1%
associate-*l*86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
associate-*l*86.1%
*-commutative86.1%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 77.2%
+-commutative77.2%
Simplified77.2%
if 4.9999999999999998e-95 < y < 8.2e154Initial program 71.7%
associate-*l*71.7%
+-commutative71.7%
+-commutative71.7%
+-commutative71.7%
associate-*l*71.7%
*-commutative71.7%
times-frac95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
associate-+l+95.4%
Simplified95.4%
Taylor expanded in x around 0 47.6%
+-commutative47.6%
Simplified47.6%
if 8.2e154 < y Initial program 59.8%
associate-*l*59.8%
+-commutative59.8%
+-commutative59.8%
+-commutative59.8%
associate-*l*59.8%
*-commutative59.8%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around inf 96.0%
Taylor expanded in y around inf 96.0%
Final simplification61.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 3.9e-200)
(/ (/ y (+ x 1.0)) x)
(if (<= y 1.05e-134)
(/ x (* y (+ y (+ x 1.0))))
(if (<= y 5e-95) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ x (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = x / (y * (y + (x + 1.0)));
} else if (y <= 5e-95) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (x + (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.9d-200) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 1.05d-134) then
tmp = x / (y * (y + (x + 1.0d0)))
else if (y <= 5d-95) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (x + (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = x / (y * (y + (x + 1.0)));
} else if (y <= 5e-95) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (x + (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.9e-200: tmp = (y / (x + 1.0)) / x elif y <= 1.05e-134: tmp = x / (y * (y + (x + 1.0))) elif y <= 5e-95: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (x + (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.9e-200) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 1.05e-134) tmp = Float64(x / Float64(y * Float64(y + Float64(x + 1.0)))); elseif (y <= 5e-95) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / 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 (y <= 3.9e-200)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 1.05e-134)
tmp = x / (y * (y + (x + 1.0)));
elseif (y <= 5e-95)
tmp = y / (x * (x + 1.0));
else
tmp = (x / y) / (x + (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(x / N[(y * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 3.89999999999999999e-200Initial program 65.9%
associate-*l*65.9%
+-commutative65.9%
+-commutative65.9%
+-commutative65.9%
associate-*l*65.9%
*-commutative65.9%
times-frac84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around 0 56.4%
+-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
times-frac59.2%
Applied egg-rr59.2%
associate-*l/59.3%
*-lft-identity59.3%
Simplified59.3%
if 3.89999999999999999e-200 < y < 1.05e-134Initial program 70.0%
associate-*l*70.0%
+-commutative70.0%
+-commutative70.0%
+-commutative70.0%
associate-*l*70.0%
*-commutative70.0%
times-frac92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
associate-+l+92.1%
Simplified92.1%
Taylor expanded in y around inf 32.5%
*-commutative32.5%
associate-+r+32.5%
+-commutative32.5%
associate-+r+32.5%
frac-times32.8%
*-rgt-identity32.8%
Applied egg-rr32.8%
if 1.05e-134 < y < 4.9999999999999998e-95Initial program 86.1%
associate-*l*86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
associate-*l*86.1%
*-commutative86.1%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 77.2%
+-commutative77.2%
Simplified77.2%
if 4.9999999999999998e-95 < y Initial program 67.1%
associate-*l*67.1%
+-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l*67.1%
*-commutative67.1%
times-frac92.6%
+-commutative92.6%
+-commutative92.6%
+-commutative92.6%
associate-+l+92.6%
Simplified92.6%
Taylor expanded in y around inf 65.8%
*-commutative65.8%
associate-+r+65.8%
+-commutative65.8%
associate-+r+65.8%
frac-times63.9%
*-rgt-identity63.9%
Applied egg-rr63.9%
*-un-lft-identity63.9%
times-frac65.9%
associate-+r+65.9%
+-commutative65.9%
associate-+l+65.9%
Applied egg-rr65.9%
associate-*l/65.9%
*-lft-identity65.9%
Simplified65.9%
Final simplification60.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= y 3.9e-200)
(/ (/ y (+ x 1.0)) x)
(if (<= y 1.05e-134)
(/ x (* y t_0))
(if (<= y 4.3e-95) (/ y (* x (+ x 1.0))) (/ (/ x t_0) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = x / (y * t_0);
} else if (y <= 4.3e-95) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / t_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) :: t_0
real(8) :: tmp
t_0 = y + (x + 1.0d0)
if (y <= 3.9d-200) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 1.05d-134) then
tmp = x / (y * t_0)
else if (y <= 4.3d-95) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / t_0) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = x / (y * t_0);
} else if (y <= 4.3e-95) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / t_0) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if y <= 3.9e-200: tmp = (y / (x + 1.0)) / x elif y <= 1.05e-134: tmp = x / (y * t_0) elif y <= 4.3e-95: tmp = y / (x * (x + 1.0)) else: tmp = (x / t_0) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (y <= 3.9e-200) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 1.05e-134) tmp = Float64(x / Float64(y * t_0)); elseif (y <= 4.3e-95) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / t_0) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y + (x + 1.0);
tmp = 0.0;
if (y <= 3.9e-200)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 1.05e-134)
tmp = x / (y * t_0);
elseif (y <= 4.3e-95)
tmp = y / (x * (x + 1.0));
else
tmp = (x / t_0) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(x / N[(y * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{y \cdot t_0}\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t_0}}{y}\\
\end{array}
\end{array}
if y < 3.89999999999999999e-200Initial program 65.9%
associate-*l*65.9%
+-commutative65.9%
+-commutative65.9%
+-commutative65.9%
associate-*l*65.9%
*-commutative65.9%
times-frac84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around 0 56.4%
+-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
times-frac59.2%
Applied egg-rr59.2%
associate-*l/59.3%
*-lft-identity59.3%
Simplified59.3%
if 3.89999999999999999e-200 < y < 1.05e-134Initial program 70.0%
associate-*l*70.0%
+-commutative70.0%
+-commutative70.0%
+-commutative70.0%
associate-*l*70.0%
*-commutative70.0%
times-frac92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
associate-+l+92.1%
Simplified92.1%
Taylor expanded in y around inf 32.5%
*-commutative32.5%
associate-+r+32.5%
+-commutative32.5%
associate-+r+32.5%
frac-times32.8%
*-rgt-identity32.8%
Applied egg-rr32.8%
if 1.05e-134 < y < 4.29999999999999997e-95Initial program 86.1%
associate-*l*86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
associate-*l*86.1%
*-commutative86.1%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 77.2%
+-commutative77.2%
Simplified77.2%
if 4.29999999999999997e-95 < y Initial program 67.1%
associate-*l*67.1%
+-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l*67.1%
*-commutative67.1%
times-frac92.6%
+-commutative92.6%
+-commutative92.6%
+-commutative92.6%
associate-+l+92.6%
Simplified92.6%
Taylor expanded in y around inf 65.8%
associate-*l/65.9%
*-un-lft-identity65.9%
associate-+r+65.9%
+-commutative65.9%
associate-+r+65.9%
Applied egg-rr65.9%
Final simplification60.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= y 3.9e-200)
(/ (/ y (+ x 1.0)) x)
(if (<= y 1.3e-134)
(/ x (* y t_0))
(if (<= y 5e-95) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x t_0) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.3e-134) {
tmp = x / (y * t_0);
} else if (y <= 5e-95) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / t_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) :: t_0
real(8) :: tmp
t_0 = y + (x + 1.0d0)
if (y <= 3.9d-200) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 1.3d-134) then
tmp = x / (y * t_0)
else if (y <= 5d-95) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = (x / t_0) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.3e-134) {
tmp = x / (y * t_0);
} else if (y <= 5e-95) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / t_0) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if y <= 3.9e-200: tmp = (y / (x + 1.0)) / x elif y <= 1.3e-134: tmp = x / (y * t_0) elif y <= 5e-95: tmp = (y / (y + x)) / (x + 1.0) else: tmp = (x / t_0) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (y <= 3.9e-200) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 1.3e-134) tmp = Float64(x / Float64(y * t_0)); elseif (y <= 5e-95) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / t_0) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y + (x + 1.0);
tmp = 0.0;
if (y <= 3.9e-200)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 1.3e-134)
tmp = x / (y * t_0);
elseif (y <= 5e-95)
tmp = (y / (y + x)) / (x + 1.0);
else
tmp = (x / t_0) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.3e-134], N[(x / N[(y * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-95], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{y \cdot t_0}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t_0}}{y}\\
\end{array}
\end{array}
if y < 3.89999999999999999e-200Initial program 65.9%
associate-*l*65.9%
+-commutative65.9%
+-commutative65.9%
+-commutative65.9%
associate-*l*65.9%
*-commutative65.9%
times-frac84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around 0 56.4%
+-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
times-frac59.2%
Applied egg-rr59.2%
associate-*l/59.3%
*-lft-identity59.3%
Simplified59.3%
if 3.89999999999999999e-200 < y < 1.30000000000000011e-134Initial program 70.0%
associate-*l*70.0%
+-commutative70.0%
+-commutative70.0%
+-commutative70.0%
associate-*l*70.0%
*-commutative70.0%
times-frac92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
associate-+l+92.1%
Simplified92.1%
Taylor expanded in y around inf 32.5%
*-commutative32.5%
associate-+r+32.5%
+-commutative32.5%
associate-+r+32.5%
frac-times32.8%
*-rgt-identity32.8%
Applied egg-rr32.8%
if 1.30000000000000011e-134 < y < 4.9999999999999998e-95Initial program 86.1%
associate-+r+86.1%
*-commutative86.1%
frac-times99.8%
associate-*l/86.1%
times-frac100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
clear-num100.0%
un-div-inv100.0%
+-commutative100.0%
div-inv99.8%
clear-num99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 77.7%
+-commutative77.7%
Simplified77.7%
if 4.9999999999999998e-95 < y Initial program 67.1%
associate-*l*67.1%
+-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l*67.1%
*-commutative67.1%
times-frac92.6%
+-commutative92.6%
+-commutative92.6%
+-commutative92.6%
associate-+l+92.6%
Simplified92.6%
Taylor expanded in y around inf 65.8%
associate-*l/65.9%
*-un-lft-identity65.9%
associate-+r+65.9%
+-commutative65.9%
associate-+r+65.9%
Applied egg-rr65.9%
Final simplification60.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 (+ x 1.0)))))
(if (<= y 3.9e-200)
(/ (/ y (+ x 1.0)) x)
(if (<= y 1.05e-134)
(/ t_0 (+ y x))
(if (<= y 5e-95) (/ (/ y (+ y x)) (+ x 1.0)) (/ t_0 y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + (x + 1.0));
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = t_0 / (y + x);
} else if (y <= 5e-95) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = x / (y + (x + 1.0d0))
if (y <= 3.9d-200) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 1.05d-134) then
tmp = t_0 / (y + x)
else if (y <= 5d-95) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = t_0 / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + (x + 1.0));
double tmp;
if (y <= 3.9e-200) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 1.05e-134) {
tmp = t_0 / (y + x);
} else if (y <= 5e-95) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = t_0 / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + (x + 1.0)) tmp = 0 if y <= 3.9e-200: tmp = (y / (x + 1.0)) / x elif y <= 1.05e-134: tmp = t_0 / (y + x) elif y <= 5e-95: tmp = (y / (y + x)) / (x + 1.0) else: tmp = t_0 / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + Float64(x + 1.0))) tmp = 0.0 if (y <= 3.9e-200) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 1.05e-134) tmp = Float64(t_0 / Float64(y + x)); elseif (y <= 5e-95) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); else tmp = Float64(t_0 / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + (x + 1.0));
tmp = 0.0;
if (y <= 3.9e-200)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 1.05e-134)
tmp = t_0 / (y + x);
elseif (y <= 5e-95)
tmp = (y / (y + x)) / (x + 1.0);
else
tmp = t_0 / 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[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-95], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + \left(x + 1\right)}\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;\frac{t_0}{y + x}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y}\\
\end{array}
\end{array}
if y < 3.89999999999999999e-200Initial program 65.9%
associate-*l*65.9%
+-commutative65.9%
+-commutative65.9%
+-commutative65.9%
associate-*l*65.9%
*-commutative65.9%
times-frac84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around 0 56.4%
+-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
times-frac59.2%
Applied egg-rr59.2%
associate-*l/59.3%
*-lft-identity59.3%
Simplified59.3%
if 3.89999999999999999e-200 < y < 1.05e-134Initial program 70.0%
associate-+r+70.0%
*-commutative70.0%
frac-times92.1%
associate-*l/70.0%
times-frac100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 34.4%
if 1.05e-134 < y < 4.9999999999999998e-95Initial program 86.1%
associate-+r+86.1%
*-commutative86.1%
frac-times99.8%
associate-*l/86.1%
times-frac100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
clear-num100.0%
un-div-inv100.0%
+-commutative100.0%
div-inv99.8%
clear-num99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 77.7%
+-commutative77.7%
Simplified77.7%
if 4.9999999999999998e-95 < y Initial program 67.1%
associate-*l*67.1%
+-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l*67.1%
*-commutative67.1%
times-frac92.6%
+-commutative92.6%
+-commutative92.6%
+-commutative92.6%
associate-+l+92.6%
Simplified92.6%
Taylor expanded in y around inf 65.8%
associate-*l/65.9%
*-un-lft-identity65.9%
associate-+r+65.9%
+-commutative65.9%
associate-+r+65.9%
Applied egg-rr65.9%
Final simplification61.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -1.2e+41)
(/ x (* y x))
(if (<= y 3.4e-200)
(/ y x)
(if (<= y 4.6) (- (/ x y) x) (* (/ 1.0 y) (/ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1.2e+41) {
tmp = x / (y * x);
} else if (y <= 3.4e-200) {
tmp = y / x;
} else if (y <= 4.6) {
tmp = (x / y) - x;
} 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 (y <= (-1.2d+41)) then
tmp = x / (y * x)
else if (y <= 3.4d-200) then
tmp = y / x
else if (y <= 4.6d0) then
tmp = (x / y) - x
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 (y <= -1.2e+41) {
tmp = x / (y * x);
} else if (y <= 3.4e-200) {
tmp = y / x;
} else if (y <= 4.6) {
tmp = (x / y) - x;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1.2e+41: tmp = x / (y * x) elif y <= 3.4e-200: tmp = y / x elif y <= 4.6: tmp = (x / y) - x else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1.2e+41) tmp = Float64(x / Float64(y * x)); elseif (y <= 3.4e-200) tmp = Float64(y / x); elseif (y <= 4.6) tmp = Float64(Float64(x / y) - x); else tmp = Float64(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.2e+41)
tmp = x / (y * x);
elseif (y <= 3.4e-200)
tmp = y / x;
elseif (y <= 4.6)
tmp = (x / y) - x;
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[y, -1.2e+41], N[(x / N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-200], N[(y / x), $MachinePrecision], If[LessEqual[y, 4.6], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{y \cdot x}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-200}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 4.6:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -1.2000000000000001e41Initial program 56.3%
associate-*l*56.3%
+-commutative56.3%
+-commutative56.3%
+-commutative56.3%
associate-*l*56.3%
*-commutative56.3%
times-frac86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in y around inf 68.4%
*-commutative68.4%
associate-+r+68.4%
+-commutative68.4%
associate-+r+68.4%
frac-times81.9%
*-rgt-identity81.9%
Applied egg-rr81.9%
Taylor expanded in x around inf 27.6%
if -1.2000000000000001e41 < y < 3.4000000000000003e-200Initial program 70.4%
associate-*l*70.4%
+-commutative70.4%
+-commutative70.4%
+-commutative70.4%
associate-*l*70.4%
*-commutative70.4%
times-frac83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
associate-+l+83.3%
Simplified83.3%
Taylor expanded in y around 0 70.9%
+-commutative70.9%
Simplified70.9%
Taylor expanded in x around 0 50.8%
if 3.4000000000000003e-200 < y < 4.5999999999999996Initial program 83.5%
associate-*l*83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
associate-*l*83.5%
*-commutative83.5%
times-frac97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
associate-+l+97.4%
Simplified97.4%
Taylor expanded in x around 0 34.3%
+-commutative34.3%
Simplified34.3%
Taylor expanded in y around 0 34.3%
neg-mul-134.3%
+-commutative34.3%
unsub-neg34.3%
Simplified34.3%
if 4.5999999999999996 < y Initial program 59.3%
associate-*l*59.3%
+-commutative59.3%
+-commutative59.3%
+-commutative59.3%
associate-*l*59.3%
*-commutative59.3%
times-frac90.3%
+-commutative90.3%
+-commutative90.3%
+-commutative90.3%
associate-+l+90.3%
Simplified90.3%
Taylor expanded in y around inf 74.4%
Taylor expanded in y around inf 73.9%
Final simplification50.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -2.05e-135)
(* (/ y x) (/ 1.0 x))
(if (<= y 3.9e-200)
(/ y x)
(if (<= y 1.2e+155) (/ x (* y (+ y 1.0))) (* (/ 1.0 y) (/ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.05e-135) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 3.9e-200) {
tmp = y / x;
} else if (y <= 1.2e+155) {
tmp = x / (y * (y + 1.0));
} 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 (y <= (-2.05d-135)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 3.9d-200) then
tmp = y / x
else if (y <= 1.2d+155) then
tmp = x / (y * (y + 1.0d0))
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 (y <= -2.05e-135) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 3.9e-200) {
tmp = y / x;
} else if (y <= 1.2e+155) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -2.05e-135: tmp = (y / x) * (1.0 / x) elif y <= 3.9e-200: tmp = y / x elif y <= 1.2e+155: tmp = x / (y * (y + 1.0)) else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2.05e-135) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 3.9e-200) tmp = Float64(y / x); elseif (y <= 1.2e+155) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(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.05e-135)
tmp = (y / x) * (1.0 / x);
elseif (y <= 3.9e-200)
tmp = y / x;
elseif (y <= 1.2e+155)
tmp = x / (y * (y + 1.0));
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[y, -2.05e-135], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-200], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.2e+155], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{-135}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+155}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -2.05000000000000005e-135Initial program 70.6%
associate-+r+70.6%
*-commutative70.6%
frac-times92.5%
associate-*l/88.6%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 41.6%
Taylor expanded in y around 0 41.0%
if -2.05000000000000005e-135 < y < 3.89999999999999999e-200Initial program 58.8%
associate-*l*58.8%
+-commutative58.8%
+-commutative58.8%
+-commutative58.8%
associate-*l*58.8%
*-commutative58.8%
times-frac71.8%
+-commutative71.8%
+-commutative71.8%
+-commutative71.8%
associate-+l+71.8%
Simplified71.8%
Taylor expanded in y around 0 86.3%
+-commutative86.3%
Simplified86.3%
Taylor expanded in x around 0 80.1%
if 3.89999999999999999e-200 < y < 1.2000000000000001e155Initial program 72.7%
associate-*l*72.7%
+-commutative72.7%
+-commutative72.7%
+-commutative72.7%
associate-*l*72.7%
*-commutative72.7%
times-frac95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
associate-+l+95.2%
Simplified95.2%
Taylor expanded in x around 0 42.4%
+-commutative42.4%
Simplified42.4%
if 1.2000000000000001e155 < y Initial program 59.8%
associate-*l*59.8%
+-commutative59.8%
+-commutative59.8%
+-commutative59.8%
associate-*l*59.8%
*-commutative59.8%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around inf 96.0%
Taylor expanded in y around inf 96.0%
Final simplification57.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -1.2e+41) (/ x (* y x)) (if (<= y 3.9e-200) (/ y x) (/ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1.2e+41) {
tmp = x / (y * x);
} else if (y <= 3.9e-200) {
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 (y <= (-1.2d+41)) then
tmp = x / (y * x)
else if (y <= 3.9d-200) 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 (y <= -1.2e+41) {
tmp = x / (y * x);
} else if (y <= 3.9e-200) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1.2e+41: tmp = x / (y * x) elif y <= 3.9e-200: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1.2e+41) tmp = Float64(x / Float64(y * x)); elseif (y <= 3.9e-200) 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 (y <= -1.2e+41)
tmp = x / (y * x);
elseif (y <= 3.9e-200)
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[y, -1.2e+41], N[(x / N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-200], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{y \cdot x}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < -1.2000000000000001e41Initial program 56.3%
associate-*l*56.3%
+-commutative56.3%
+-commutative56.3%
+-commutative56.3%
associate-*l*56.3%
*-commutative56.3%
times-frac86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in y around inf 68.4%
*-commutative68.4%
associate-+r+68.4%
+-commutative68.4%
associate-+r+68.4%
frac-times81.9%
*-rgt-identity81.9%
Applied egg-rr81.9%
Taylor expanded in x around inf 27.6%
if -1.2000000000000001e41 < y < 3.89999999999999999e-200Initial program 70.4%
associate-*l*70.4%
+-commutative70.4%
+-commutative70.4%
+-commutative70.4%
associate-*l*70.4%
*-commutative70.4%
times-frac83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
associate-+l+83.3%
Simplified83.3%
Taylor expanded in y around 0 70.9%
+-commutative70.9%
Simplified70.9%
Taylor expanded in x around 0 50.8%
if 3.89999999999999999e-200 < y Initial program 68.5%
associate-*l*68.5%
+-commutative68.5%
+-commutative68.5%
+-commutative68.5%
associate-*l*68.5%
*-commutative68.5%
times-frac93.0%
+-commutative93.0%
+-commutative93.0%
+-commutative93.0%
associate-+l+93.0%
Simplified93.0%
Taylor expanded in x around 0 57.1%
+-commutative57.1%
Simplified57.1%
Taylor expanded in y around 0 29.4%
Final simplification37.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.9e-200) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.9e-200) {
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 (y <= 3.9d-200) 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 (y <= 3.9e-200) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.9e-200: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.9e-200) 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 (y <= 3.9e-200)
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[y, 3.9e-200], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 3.89999999999999999e-200Initial program 65.9%
associate-*l*65.9%
+-commutative65.9%
+-commutative65.9%
+-commutative65.9%
associate-*l*65.9%
*-commutative65.9%
times-frac84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in y around 0 56.4%
+-commutative56.4%
Simplified56.4%
Taylor expanded in x around 0 35.4%
if 3.89999999999999999e-200 < y Initial program 68.5%
associate-*l*68.5%
+-commutative68.5%
+-commutative68.5%
+-commutative68.5%
associate-*l*68.5%
*-commutative68.5%
times-frac93.0%
+-commutative93.0%
+-commutative93.0%
+-commutative93.0%
associate-+l+93.0%
Simplified93.0%
Taylor expanded in x around 0 57.1%
+-commutative57.1%
Simplified57.1%
Taylor expanded in y around 0 29.4%
Final simplification32.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 x))
assert(x < y);
double code(double x, double y) {
return 1.0 / x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / x
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{x}
\end{array}
Initial program 67.1%
associate-+r+67.1%
*-commutative67.1%
frac-times88.2%
associate-*l/81.8%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 40.6%
Taylor expanded in y around inf 4.4%
Final simplification4.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 y))
assert(x < y);
double code(double x, double y) {
return 1.0 / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / y
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / y;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / y
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{y}
\end{array}
Initial program 67.1%
associate-*l*67.1%
+-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l*67.1%
*-commutative67.1%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around inf 50.0%
Taylor expanded in x around inf 4.3%
Final simplification4.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ x y))
assert(x < y);
double code(double x, double y) {
return x / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
assert x < y;
public static double code(double x, double y) {
return x / y;
}
[x, y] = sort([x, y]) def code(x, y): return x / y
x, y = sort([x, y]) function code(x, y) return Float64(x / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = x / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y}
\end{array}
Initial program 67.1%
associate-*l*67.1%
+-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l*67.1%
*-commutative67.1%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in x around 0 50.9%
+-commutative50.9%
Simplified50.9%
Taylor expanded in y around 0 25.9%
Final simplification25.9%
(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 2023322
(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))))