
(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 (/ (/ x (+ y x)) (+ x (+ y 1.0)))) (+ y x)))
assert(x < y);
double code(double x, double y) {
return (y * ((x / (y + x)) / (x + (y + 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 * ((x / (y + x)) / (x + (y + 1.0d0)))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
return (y * ((x / (y + x)) / (x + (y + 1.0)))) / (y + x);
}
[x, y] = sort([x, y]) def code(x, y): return (y * ((x / (y + x)) / (x + (y + 1.0)))) / (y + x)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y * Float64(Float64(x / Float64(y + x)) / Float64(x + Float64(y + 1.0)))) / Float64(y + x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y * ((x / (y + x)) / (x + (y + 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[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y \cdot \frac{\frac{x}{y + x}}{x + \left(y + 1\right)}}{y + x}
\end{array}
Initial program 70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
*-commutative70.3%
distribute-rgt1-in57.1%
fma-define70.3%
+-commutative70.3%
+-commutative70.3%
cube-unmult70.3%
+-commutative70.3%
Simplified70.3%
fma-define57.1%
cube-mult57.1%
distribute-rgt1-in70.3%
*-commutative70.3%
associate-*l*70.3%
times-frac93.5%
associate-+r+93.5%
Applied egg-rr93.5%
associate-*r/93.5%
*-commutative93.5%
+-commutative93.5%
associate-+l+93.5%
frac-times99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*93.4%
*-commutative93.4%
associate-*l/93.4%
associate-/r*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))) (t_1 (+ x (+ y 1.0))))
(if (<= y -3.7e+78)
(/ (/ y x) (+ x 1.0))
(if (<= y 1e-28)
(* x (/ t_0 (* (+ y x) (+ x 1.0))))
(if (<= y 7.6e+90)
(* x (/ y (* t_1 (* (+ y x) (+ y x)))))
(* (/ x y) (/ t_0 t_1)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= -3.7e+78) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1e-28) {
tmp = x * (t_0 / ((y + x) * (x + 1.0)));
} else if (y <= 7.6e+90) {
tmp = x * (y / (t_1 * ((y + x) * (y + x))));
} else {
tmp = (x / y) * (t_0 / t_1);
}
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 / (y + x)
t_1 = x + (y + 1.0d0)
if (y <= (-3.7d+78)) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 1d-28) then
tmp = x * (t_0 / ((y + x) * (x + 1.0d0)))
else if (y <= 7.6d+90) then
tmp = x * (y / (t_1 * ((y + x) * (y + x))))
else
tmp = (x / y) * (t_0 / t_1)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= -3.7e+78) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1e-28) {
tmp = x * (t_0 / ((y + x) * (x + 1.0)));
} else if (y <= 7.6e+90) {
tmp = x * (y / (t_1 * ((y + x) * (y + x))));
} else {
tmp = (x / y) * (t_0 / t_1);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (y + x) t_1 = x + (y + 1.0) tmp = 0 if y <= -3.7e+78: tmp = (y / x) / (x + 1.0) elif y <= 1e-28: tmp = x * (t_0 / ((y + x) * (x + 1.0))) elif y <= 7.6e+90: tmp = x * (y / (t_1 * ((y + x) * (y + x)))) else: tmp = (x / y) * (t_0 / t_1) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(y + x)) t_1 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= -3.7e+78) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 1e-28) tmp = Float64(x * Float64(t_0 / Float64(Float64(y + x) * Float64(x + 1.0)))); elseif (y <= 7.6e+90) tmp = Float64(x * Float64(y / Float64(t_1 * Float64(Float64(y + x) * Float64(y + x))))); else tmp = Float64(Float64(x / y) * Float64(t_0 / t_1)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (y + x);
t_1 = x + (y + 1.0);
tmp = 0.0;
if (y <= -3.7e+78)
tmp = (y / x) / (x + 1.0);
elseif (y <= 1e-28)
tmp = x * (t_0 / ((y + x) * (x + 1.0)));
elseif (y <= 7.6e+90)
tmp = x * (y / (t_1 * ((y + x) * (y + x))));
else
tmp = (x / y) * (t_0 / t_1);
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]}, Block[{t$95$1 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.7e+78], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-28], N[(x * N[(t$95$0 / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e+90], N[(x * N[(y / N[(t$95$1 * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(t$95$0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
t_1 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{+78}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 10^{-28}:\\
\;\;\;\;x \cdot \frac{t\_0}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+90}:\\
\;\;\;\;x \cdot \frac{y}{t\_1 \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{t\_0}{t\_1}\\
\end{array}
\end{array}
if y < -3.69999999999999985e78Initial program 55.1%
+-commutative55.1%
+-commutative55.1%
+-commutative55.1%
*-commutative55.1%
distribute-rgt1-in15.2%
fma-define55.1%
+-commutative55.1%
+-commutative55.1%
cube-unmult55.1%
+-commutative55.1%
Simplified55.1%
fma-define15.2%
cube-mult15.2%
distribute-rgt1-in55.1%
*-commutative55.1%
associate-*l*55.1%
times-frac79.2%
associate-+r+79.2%
Applied egg-rr79.2%
associate-*r/79.1%
*-commutative79.1%
+-commutative79.1%
associate-+l+79.1%
frac-times99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*79.1%
*-commutative79.1%
clear-num79.1%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times97.3%
*-un-lft-identity97.3%
associate-+l+97.3%
+-commutative97.3%
Applied egg-rr97.3%
Taylor expanded in y around 0 17.4%
associate-/r*28.4%
+-commutative28.4%
Simplified28.4%
if -3.69999999999999985e78 < y < 9.99999999999999971e-29Initial program 77.6%
associate-/l*86.1%
associate-+l+86.1%
Simplified86.1%
Taylor expanded in y around 0 76.7%
+-commutative76.7%
Simplified76.7%
*-un-lft-identity76.7%
associate-*l*76.7%
times-frac86.4%
Applied egg-rr86.4%
associate-*r/86.4%
*-commutative86.4%
associate-*r/86.4%
*-rgt-identity86.4%
+-commutative86.4%
*-commutative86.4%
+-commutative86.4%
Simplified86.4%
if 9.99999999999999971e-29 < y < 7.6000000000000002e90Initial program 81.8%
associate-/l*81.9%
associate-+l+81.9%
Simplified81.9%
if 7.6000000000000002e90 < y Initial program 55.4%
+-commutative55.4%
+-commutative55.4%
+-commutative55.4%
*-commutative55.4%
distribute-rgt1-in55.4%
fma-define55.4%
+-commutative55.4%
+-commutative55.4%
cube-unmult55.4%
+-commutative55.4%
Simplified55.4%
fma-define55.4%
cube-mult55.4%
distribute-rgt1-in55.4%
*-commutative55.4%
associate-*l*55.4%
times-frac88.0%
associate-+r+88.0%
Applied egg-rr88.0%
Taylor expanded in x around 0 87.2%
div-inv87.2%
Applied egg-rr87.2%
associate-*r/87.2%
*-rgt-identity87.2%
associate-/r*94.4%
Simplified94.4%
Final simplification76.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2.2e+163)
(/ (/ y x) (+ y x))
(if (<= x -1.95e-14)
(/ y (* (+ y x) (+ x (+ y 1.0))))
(if (<= x -1.5e-162)
(* x (/ y (* (+ y 1.0) (* (+ y x) (+ y x)))))
(/ (/ x y) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.2e+163) {
tmp = (y / x) / (y + x);
} else if (x <= -1.95e-14) {
tmp = y / ((y + x) * (x + (y + 1.0)));
} else if (x <= -1.5e-162) {
tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x))));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.2d+163)) then
tmp = (y / x) / (y + x)
else if (x <= (-1.95d-14)) then
tmp = y / ((y + x) * (x + (y + 1.0d0)))
else if (x <= (-1.5d-162)) then
tmp = x * (y / ((y + 1.0d0) * ((y + x) * (y + x))))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.2e+163) {
tmp = (y / x) / (y + x);
} else if (x <= -1.95e-14) {
tmp = y / ((y + x) * (x + (y + 1.0)));
} else if (x <= -1.5e-162) {
tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x))));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.2e+163: tmp = (y / x) / (y + x) elif x <= -1.95e-14: tmp = y / ((y + x) * (x + (y + 1.0))) elif x <= -1.5e-162: tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x)))) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.2e+163) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -1.95e-14) tmp = Float64(y / Float64(Float64(y + x) * Float64(x + Float64(y + 1.0)))); elseif (x <= -1.5e-162) tmp = Float64(x * Float64(y / Float64(Float64(y + 1.0) * Float64(Float64(y + x) * Float64(y + x))))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.2e+163)
tmp = (y / x) / (y + x);
elseif (x <= -1.95e-14)
tmp = y / ((y + x) * (x + (y + 1.0)));
elseif (x <= -1.5e-162)
tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x))));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.2e+163], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.95e-14], N[(y / N[(N[(y + x), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.5e-162], N[(x * N[(y / N[(N[(y + 1.0), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+163}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-162}:\\
\;\;\;\;x \cdot \frac{y}{\left(y + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.19999999999999986e163Initial program 49.0%
+-commutative49.0%
+-commutative49.0%
+-commutative49.0%
*-commutative49.0%
distribute-rgt1-in0.0%
fma-define49.0%
+-commutative49.0%
+-commutative49.0%
cube-unmult49.0%
+-commutative49.0%
Simplified49.0%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in49.0%
*-commutative49.0%
associate-*l*49.0%
times-frac76.7%
associate-+r+76.7%
Applied egg-rr76.7%
associate-*r/76.7%
*-commutative76.7%
+-commutative76.7%
associate-+l+76.7%
frac-times99.9%
associate-+l+99.9%
+-commutative99.9%
associate-/r*76.7%
*-commutative76.7%
associate-*l/76.7%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 87.9%
if -2.19999999999999986e163 < x < -1.9499999999999999e-14Initial program 75.4%
+-commutative75.4%
+-commutative75.4%
+-commutative75.4%
*-commutative75.4%
distribute-rgt1-in68.1%
fma-define75.4%
+-commutative75.4%
+-commutative75.4%
cube-unmult75.4%
+-commutative75.4%
Simplified75.4%
fma-define68.1%
cube-mult68.1%
distribute-rgt1-in75.4%
*-commutative75.4%
associate-*l*75.4%
times-frac93.2%
associate-+r+93.2%
Applied egg-rr93.2%
Taylor expanded in x around inf 87.6%
if -1.9499999999999999e-14 < x < -1.49999999999999999e-162Initial program 83.3%
associate-/l*97.0%
associate-+l+97.0%
Simplified97.0%
Taylor expanded in x around 0 97.0%
+-commutative97.0%
Simplified97.0%
if -1.49999999999999999e-162 < x Initial program 70.8%
associate-/l*80.8%
associate-+l+80.8%
Simplified80.8%
Taylor expanded in x around 0 55.4%
associate-/r*55.9%
+-commutative55.9%
Simplified55.9%
Final simplification69.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y -1.3e+81)
(/ (/ y x) (+ x 1.0))
(if (<= y 4.1e-15)
(* x (/ (/ y (+ y x)) (* (+ y x) (+ x 1.0))))
(if (<= y 1.1e+155)
(/ x (* (+ y x) t_0))
(* (/ x (+ y x)) (/ 1.0 t_0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= -1.3e+81) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 4.1e-15) {
tmp = x * ((y / (y + x)) / ((y + x) * (x + 1.0)));
} else if (y <= 1.1e+155) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) * (1.0 / t_0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= (-1.3d+81)) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 4.1d-15) then
tmp = x * ((y / (y + x)) / ((y + x) * (x + 1.0d0)))
else if (y <= 1.1d+155) then
tmp = x / ((y + x) * t_0)
else
tmp = (x / (y + x)) * (1.0d0 / t_0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= -1.3e+81) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 4.1e-15) {
tmp = x * ((y / (y + x)) / ((y + x) * (x + 1.0)));
} else if (y <= 1.1e+155) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) * (1.0 / t_0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= -1.3e+81: tmp = (y / x) / (x + 1.0) elif y <= 4.1e-15: tmp = x * ((y / (y + x)) / ((y + x) * (x + 1.0))) elif y <= 1.1e+155: tmp = x / ((y + x) * t_0) else: tmp = (x / (y + x)) * (1.0 / t_0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= -1.3e+81) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 4.1e-15) tmp = Float64(x * Float64(Float64(y / Float64(y + x)) / Float64(Float64(y + x) * Float64(x + 1.0)))); elseif (y <= 1.1e+155) tmp = Float64(x / Float64(Float64(y + x) * t_0)); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / t_0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= -1.3e+81)
tmp = (y / x) / (x + 1.0);
elseif (y <= 4.1e-15)
tmp = x * ((y / (y + x)) / ((y + x) * (x + 1.0)));
elseif (y <= 1.1e+155)
tmp = x / ((y + x) * t_0);
else
tmp = (x / (y + x)) * (1.0 / t_0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+81], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e-15], N[(x * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e+155], N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+81}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+155}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{t\_0}\\
\end{array}
\end{array}
if y < -1.29999999999999996e81Initial program 55.1%
+-commutative55.1%
+-commutative55.1%
+-commutative55.1%
*-commutative55.1%
distribute-rgt1-in15.2%
fma-define55.1%
+-commutative55.1%
+-commutative55.1%
cube-unmult55.1%
+-commutative55.1%
Simplified55.1%
fma-define15.2%
cube-mult15.2%
distribute-rgt1-in55.1%
*-commutative55.1%
associate-*l*55.1%
times-frac79.2%
associate-+r+79.2%
Applied egg-rr79.2%
associate-*r/79.1%
*-commutative79.1%
+-commutative79.1%
associate-+l+79.1%
frac-times99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*79.1%
*-commutative79.1%
clear-num79.1%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times97.3%
*-un-lft-identity97.3%
associate-+l+97.3%
+-commutative97.3%
Applied egg-rr97.3%
Taylor expanded in y around 0 17.4%
associate-/r*28.4%
+-commutative28.4%
Simplified28.4%
if -1.29999999999999996e81 < y < 4.10000000000000036e-15Initial program 77.6%
associate-/l*86.1%
associate-+l+86.1%
Simplified86.1%
Taylor expanded in y around 0 76.7%
+-commutative76.7%
Simplified76.7%
*-un-lft-identity76.7%
associate-*l*76.7%
times-frac86.4%
Applied egg-rr86.4%
associate-*r/86.4%
*-commutative86.4%
associate-*r/86.4%
*-rgt-identity86.4%
+-commutative86.4%
*-commutative86.4%
+-commutative86.4%
Simplified86.4%
if 4.10000000000000036e-15 < y < 1.1000000000000001e155Initial program 72.7%
+-commutative72.7%
+-commutative72.7%
+-commutative72.7%
*-commutative72.7%
distribute-rgt1-in72.4%
fma-define72.7%
+-commutative72.7%
+-commutative72.7%
cube-unmult72.9%
+-commutative72.9%
Simplified72.9%
fma-define72.5%
cube-mult72.4%
distribute-rgt1-in72.7%
*-commutative72.7%
associate-*l*72.7%
times-frac93.6%
associate-+r+93.6%
Applied egg-rr93.6%
Taylor expanded in x around 0 72.3%
associate-*r/72.3%
+-commutative72.3%
Applied egg-rr72.3%
Taylor expanded in x around 0 72.3%
if 1.1000000000000001e155 < y Initial program 55.4%
+-commutative55.4%
+-commutative55.4%
+-commutative55.4%
*-commutative55.4%
distribute-rgt1-in55.4%
fma-define55.4%
+-commutative55.4%
+-commutative55.4%
cube-unmult55.4%
+-commutative55.4%
Simplified55.4%
fma-define55.4%
cube-mult55.4%
distribute-rgt1-in55.4%
*-commutative55.4%
associate-*l*55.4%
times-frac84.1%
associate-+r+84.1%
Applied egg-rr84.1%
Taylor expanded in x around 0 84.1%
associate-*r/84.1%
+-commutative84.1%
Applied egg-rr84.1%
*-un-lft-identity84.1%
associate-/r*93.6%
associate-*l/59.3%
*-un-lft-identity59.3%
times-frac93.6%
/-rgt-identity93.6%
+-commutative93.6%
Applied egg-rr93.6%
*-lft-identity93.6%
associate-/l/84.1%
*-inverses84.1%
*-commutative84.1%
times-frac93.6%
Simplified93.6%
Final simplification74.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y 2.82e-188)
(/ (/ y (+ y x)) (+ x 1.0))
(if (<= y 4.1e-15)
(* x (/ y (* (+ x 1.0) (* (+ y x) (+ y x)))))
(if (<= y 1.35e+154)
(/ x (* (+ y x) t_0))
(* (/ x (+ y x)) (/ 1.0 t_0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2.82e-188) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 4.1e-15) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else if (y <= 1.35e+154) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) * (1.0 / t_0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= 2.82d-188) then
tmp = (y / (y + x)) / (x + 1.0d0)
else if (y <= 4.1d-15) then
tmp = x * (y / ((x + 1.0d0) * ((y + x) * (y + x))))
else if (y <= 1.35d+154) then
tmp = x / ((y + x) * t_0)
else
tmp = (x / (y + x)) * (1.0d0 / t_0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2.82e-188) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 4.1e-15) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else if (y <= 1.35e+154) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) * (1.0 / t_0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 2.82e-188: tmp = (y / (y + x)) / (x + 1.0) elif y <= 4.1e-15: tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x)))) elif y <= 1.35e+154: tmp = x / ((y + x) * t_0) else: tmp = (x / (y + x)) * (1.0 / t_0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 2.82e-188) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); elseif (y <= 4.1e-15) tmp = Float64(x * Float64(y / Float64(Float64(x + 1.0) * Float64(Float64(y + x) * Float64(y + x))))); elseif (y <= 1.35e+154) tmp = Float64(x / Float64(Float64(y + x) * t_0)); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / t_0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= 2.82e-188)
tmp = (y / (y + x)) / (x + 1.0);
elseif (y <= 4.1e-15)
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
elseif (y <= 1.35e+154)
tmp = x / ((y + x) * t_0);
else
tmp = (x / (y + x)) * (1.0 / t_0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.82e-188], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e-15], N[(x * N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 2.82 \cdot 10^{-188}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{t\_0}\\
\end{array}
\end{array}
if y < 2.8200000000000001e-188Initial program 69.2%
+-commutative69.2%
+-commutative69.2%
+-commutative69.2%
*-commutative69.2%
distribute-rgt1-in51.7%
fma-define69.2%
+-commutative69.2%
+-commutative69.2%
cube-unmult69.2%
+-commutative69.2%
Simplified69.2%
*-commutative69.2%
fma-define51.7%
cube-mult51.7%
distribute-rgt1-in69.2%
*-commutative69.2%
associate-*l*69.2%
times-frac93.9%
associate-+r+93.9%
Applied egg-rr93.9%
Taylor expanded in y around 0 57.9%
+-commutative57.9%
Simplified57.9%
un-div-inv57.9%
+-commutative57.9%
Applied egg-rr57.9%
if 2.8200000000000001e-188 < y < 4.10000000000000036e-15Initial program 88.4%
associate-/l*91.0%
associate-+l+91.0%
Simplified91.0%
Taylor expanded in y around 0 91.0%
+-commutative91.0%
Simplified91.0%
if 4.10000000000000036e-15 < y < 1.35000000000000003e154Initial program 72.7%
+-commutative72.7%
+-commutative72.7%
+-commutative72.7%
*-commutative72.7%
distribute-rgt1-in72.4%
fma-define72.7%
+-commutative72.7%
+-commutative72.7%
cube-unmult72.9%
+-commutative72.9%
Simplified72.9%
fma-define72.5%
cube-mult72.4%
distribute-rgt1-in72.7%
*-commutative72.7%
associate-*l*72.7%
times-frac93.6%
associate-+r+93.6%
Applied egg-rr93.6%
Taylor expanded in x around 0 72.3%
associate-*r/72.3%
+-commutative72.3%
Applied egg-rr72.3%
Taylor expanded in x around 0 72.3%
if 1.35000000000000003e154 < y Initial program 55.4%
+-commutative55.4%
+-commutative55.4%
+-commutative55.4%
*-commutative55.4%
distribute-rgt1-in55.4%
fma-define55.4%
+-commutative55.4%
+-commutative55.4%
cube-unmult55.4%
+-commutative55.4%
Simplified55.4%
fma-define55.4%
cube-mult55.4%
distribute-rgt1-in55.4%
*-commutative55.4%
associate-*l*55.4%
times-frac84.1%
associate-+r+84.1%
Applied egg-rr84.1%
Taylor expanded in x around 0 84.1%
associate-*r/84.1%
+-commutative84.1%
Applied egg-rr84.1%
*-un-lft-identity84.1%
associate-/r*93.6%
associate-*l/59.3%
*-un-lft-identity59.3%
times-frac93.6%
/-rgt-identity93.6%
+-commutative93.6%
Applied egg-rr93.6%
*-lft-identity93.6%
associate-/l/84.1%
*-inverses84.1%
*-commutative84.1%
times-frac93.6%
Simplified93.6%
Final simplification67.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y -1.7e+81)
(/ (/ y x) (+ x 1.0))
(if (<= y 6.8e+153)
(* (/ x (+ y x)) (/ y (* (+ y x) t_0)))
(* (/ x y) (/ (/ y (+ y x)) t_0))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= -1.7e+81) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 6.8e+153) {
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
} else {
tmp = (x / y) * ((y / (y + x)) / t_0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= (-1.7d+81)) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 6.8d+153) then
tmp = (x / (y + x)) * (y / ((y + x) * t_0))
else
tmp = (x / y) * ((y / (y + x)) / t_0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= -1.7e+81) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 6.8e+153) {
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
} else {
tmp = (x / y) * ((y / (y + x)) / t_0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= -1.7e+81: tmp = (y / x) / (x + 1.0) elif y <= 6.8e+153: tmp = (x / (y + x)) * (y / ((y + x) * t_0)) else: tmp = (x / y) * ((y / (y + x)) / t_0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= -1.7e+81) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 6.8e+153) tmp = Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + x) * t_0))); else tmp = Float64(Float64(x / y) * Float64(Float64(y / Float64(y + x)) / t_0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= -1.7e+81)
tmp = (y / x) / (x + 1.0);
elseif (y <= 6.8e+153)
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
else
tmp = (x / y) * ((y / (y + x)) / t_0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+81], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+153], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+81}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+153}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{\frac{y}{y + x}}{t\_0}\\
\end{array}
\end{array}
if y < -1.70000000000000001e81Initial program 55.1%
+-commutative55.1%
+-commutative55.1%
+-commutative55.1%
*-commutative55.1%
distribute-rgt1-in15.2%
fma-define55.1%
+-commutative55.1%
+-commutative55.1%
cube-unmult55.1%
+-commutative55.1%
Simplified55.1%
fma-define15.2%
cube-mult15.2%
distribute-rgt1-in55.1%
*-commutative55.1%
associate-*l*55.1%
times-frac79.2%
associate-+r+79.2%
Applied egg-rr79.2%
associate-*r/79.1%
*-commutative79.1%
+-commutative79.1%
associate-+l+79.1%
frac-times99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*79.1%
*-commutative79.1%
clear-num79.1%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times97.3%
*-un-lft-identity97.3%
associate-+l+97.3%
+-commutative97.3%
Applied egg-rr97.3%
Taylor expanded in y around 0 17.4%
associate-/r*28.4%
+-commutative28.4%
Simplified28.4%
if -1.70000000000000001e81 < y < 6.7999999999999995e153Initial program 76.7%
+-commutative76.7%
+-commutative76.7%
+-commutative76.7%
*-commutative76.7%
distribute-rgt1-in68.3%
fma-define76.7%
+-commutative76.7%
+-commutative76.7%
cube-unmult76.7%
+-commutative76.7%
Simplified76.7%
fma-define68.3%
cube-mult68.3%
distribute-rgt1-in76.7%
*-commutative76.7%
associate-*l*76.7%
times-frac98.7%
associate-+r+98.7%
Applied egg-rr98.7%
if 6.7999999999999995e153 < y Initial program 55.4%
+-commutative55.4%
+-commutative55.4%
+-commutative55.4%
*-commutative55.4%
distribute-rgt1-in55.4%
fma-define55.4%
+-commutative55.4%
+-commutative55.4%
cube-unmult55.4%
+-commutative55.4%
Simplified55.4%
fma-define55.4%
cube-mult55.4%
distribute-rgt1-in55.4%
*-commutative55.4%
associate-*l*55.4%
times-frac84.1%
associate-+r+84.1%
Applied egg-rr84.1%
Taylor expanded in x around 0 84.1%
div-inv84.1%
Applied egg-rr84.1%
associate-*r/84.1%
*-rgt-identity84.1%
associate-/r*96.8%
Simplified96.8%
Final simplification85.6%
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 -2.6e+73)
(/ (/ y x) (+ x 1.0))
(if (<= y 4.1e-15)
(* x (/ t_0 (* (+ y x) (+ x 1.0))))
(* (/ x y) (/ t_0 (+ x (+ y 1.0))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (y <= -2.6e+73) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 4.1e-15) {
tmp = x * (t_0 / ((y + x) * (x + 1.0)));
} else {
tmp = (x / y) * (t_0 / (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) :: t_0
real(8) :: tmp
t_0 = y / (y + x)
if (y <= (-2.6d+73)) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 4.1d-15) then
tmp = x * (t_0 / ((y + x) * (x + 1.0d0)))
else
tmp = (x / y) * (t_0 / (x + (y + 1.0d0)))
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 <= -2.6e+73) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 4.1e-15) {
tmp = x * (t_0 / ((y + x) * (x + 1.0)));
} else {
tmp = (x / y) * (t_0 / (x + (y + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (y + x) tmp = 0 if y <= -2.6e+73: tmp = (y / x) / (x + 1.0) elif y <= 4.1e-15: tmp = x * (t_0 / ((y + x) * (x + 1.0))) else: tmp = (x / y) * (t_0 / (x + (y + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (y <= -2.6e+73) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 4.1e-15) tmp = Float64(x * Float64(t_0 / Float64(Float64(y + x) * Float64(x + 1.0)))); else tmp = Float64(Float64(x / y) * Float64(t_0 / Float64(x + Float64(y + 1.0)))); 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 <= -2.6e+73)
tmp = (y / x) / (x + 1.0);
elseif (y <= 4.1e-15)
tmp = x * (t_0 / ((y + x) * (x + 1.0)));
else
tmp = (x / y) * (t_0 / (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_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e+73], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e-15], N[(x * N[(t$95$0 / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(t$95$0 / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+73}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{t\_0}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{t\_0}{x + \left(y + 1\right)}\\
\end{array}
\end{array}
if y < -2.6000000000000001e73Initial program 56.0%
+-commutative56.0%
+-commutative56.0%
+-commutative56.0%
*-commutative56.0%
distribute-rgt1-in16.9%
fma-define56.0%
+-commutative56.0%
+-commutative56.0%
cube-unmult56.0%
+-commutative56.0%
Simplified56.0%
fma-define16.9%
cube-mult16.9%
distribute-rgt1-in56.0%
*-commutative56.0%
associate-*l*56.0%
times-frac79.6%
associate-+r+79.6%
Applied egg-rr79.6%
associate-*r/79.6%
*-commutative79.6%
+-commutative79.6%
associate-+l+79.6%
frac-times99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*79.6%
*-commutative79.6%
clear-num79.6%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times97.4%
*-un-lft-identity97.4%
associate-+l+97.4%
+-commutative97.4%
Applied egg-rr97.4%
Taylor expanded in y around 0 17.0%
associate-/r*27.9%
+-commutative27.9%
Simplified27.9%
if -2.6000000000000001e73 < y < 4.10000000000000036e-15Initial program 77.4%
associate-/l*86.0%
associate-+l+86.0%
Simplified86.0%
Taylor expanded in y around 0 77.2%
+-commutative77.2%
Simplified77.2%
*-un-lft-identity77.2%
associate-*l*77.2%
times-frac87.0%
Applied egg-rr87.0%
associate-*r/86.9%
*-commutative86.9%
associate-*r/87.0%
*-rgt-identity87.0%
+-commutative87.0%
*-commutative87.0%
+-commutative87.0%
Simplified87.0%
if 4.10000000000000036e-15 < y Initial program 64.5%
+-commutative64.5%
+-commutative64.5%
+-commutative64.5%
*-commutative64.5%
distribute-rgt1-in64.3%
fma-define64.5%
+-commutative64.5%
+-commutative64.5%
cube-unmult64.6%
+-commutative64.6%
Simplified64.6%
fma-define64.4%
cube-mult64.3%
distribute-rgt1-in64.5%
*-commutative64.5%
associate-*l*64.5%
times-frac89.1%
associate-+r+89.1%
Applied egg-rr89.1%
Taylor expanded in x around 0 77.9%
div-inv77.9%
Applied egg-rr77.9%
associate-*r/77.9%
*-rgt-identity77.9%
associate-/r*82.5%
Simplified82.5%
Final simplification74.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y 6.8e-134)
(/ (/ y (+ y x)) (+ x 1.0))
(if (<= y 3.4e+154)
(/ x (* (+ y x) t_0))
(* (/ x (+ y x)) (/ 1.0 t_0))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 6.8e-134) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 3.4e+154) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) * (1.0 / t_0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= 6.8d-134) then
tmp = (y / (y + x)) / (x + 1.0d0)
else if (y <= 3.4d+154) then
tmp = x / ((y + x) * t_0)
else
tmp = (x / (y + x)) * (1.0d0 / t_0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 6.8e-134) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 3.4e+154) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) * (1.0 / t_0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 6.8e-134: tmp = (y / (y + x)) / (x + 1.0) elif y <= 3.4e+154: tmp = x / ((y + x) * t_0) else: tmp = (x / (y + x)) * (1.0 / t_0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 6.8e-134) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); elseif (y <= 3.4e+154) tmp = Float64(x / Float64(Float64(y + x) * t_0)); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / t_0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= 6.8e-134)
tmp = (y / (y + x)) / (x + 1.0);
elseif (y <= 3.4e+154)
tmp = x / ((y + x) * t_0);
else
tmp = (x / (y + x)) * (1.0 / t_0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.8e-134], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+154], N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 6.8 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{t\_0}\\
\end{array}
\end{array}
if y < 6.79999999999999954e-134Initial program 70.2%
+-commutative70.2%
+-commutative70.2%
+-commutative70.2%
*-commutative70.2%
distribute-rgt1-in52.5%
fma-define70.2%
+-commutative70.2%
+-commutative70.2%
cube-unmult70.2%
+-commutative70.2%
Simplified70.2%
*-commutative70.2%
fma-define52.5%
cube-mult52.5%
distribute-rgt1-in70.2%
*-commutative70.2%
associate-*l*70.2%
times-frac94.2%
associate-+r+94.2%
Applied egg-rr94.2%
Taylor expanded in y around 0 59.3%
+-commutative59.3%
Simplified59.3%
un-div-inv59.3%
+-commutative59.3%
Applied egg-rr59.3%
if 6.79999999999999954e-134 < y < 3.39999999999999974e154Initial program 78.9%
+-commutative78.9%
+-commutative78.9%
+-commutative78.9%
*-commutative78.9%
distribute-rgt1-in73.0%
fma-define78.9%
+-commutative78.9%
+-commutative78.9%
cube-unmult79.0%
+-commutative79.0%
Simplified79.0%
fma-define73.1%
cube-mult73.0%
distribute-rgt1-in78.9%
*-commutative78.9%
associate-*l*78.8%
times-frac96.1%
associate-+r+96.1%
Applied egg-rr96.1%
Taylor expanded in x around 0 61.1%
associate-*r/61.1%
+-commutative61.1%
Applied egg-rr61.1%
Taylor expanded in x around 0 63.0%
if 3.39999999999999974e154 < y Initial program 55.4%
+-commutative55.4%
+-commutative55.4%
+-commutative55.4%
*-commutative55.4%
distribute-rgt1-in55.4%
fma-define55.4%
+-commutative55.4%
+-commutative55.4%
cube-unmult55.4%
+-commutative55.4%
Simplified55.4%
fma-define55.4%
cube-mult55.4%
distribute-rgt1-in55.4%
*-commutative55.4%
associate-*l*55.4%
times-frac84.1%
associate-+r+84.1%
Applied egg-rr84.1%
Taylor expanded in x around 0 84.1%
associate-*r/84.1%
+-commutative84.1%
Applied egg-rr84.1%
*-un-lft-identity84.1%
associate-/r*93.6%
associate-*l/59.3%
*-un-lft-identity59.3%
times-frac93.6%
/-rgt-identity93.6%
+-commutative93.6%
Applied egg-rr93.6%
*-lft-identity93.6%
associate-/l/84.1%
*-inverses84.1%
*-commutative84.1%
times-frac93.6%
Simplified93.6%
Final simplification64.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -6.4e+83)
(* (/ y x) (/ 1.0 x))
(if (<= y 2.2e-49)
(/ y (* x (+ x 1.0)))
(if (<= y 1.45e+15) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ y x))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -6.4e+83) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 2.2e-49) {
tmp = y / (x * (x + 1.0));
} else if (y <= 1.45e+15) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-6.4d+83)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 2.2d-49) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 1.45d+15) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -6.4e+83) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 2.2e-49) {
tmp = y / (x * (x + 1.0));
} else if (y <= 1.45e+15) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -6.4e+83: tmp = (y / x) * (1.0 / x) elif y <= 2.2e-49: tmp = y / (x * (x + 1.0)) elif y <= 1.45e+15: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -6.4e+83) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 2.2e-49) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 1.45e+15) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -6.4e+83)
tmp = (y / x) * (1.0 / x);
elseif (y <= 2.2e-49)
tmp = y / (x * (x + 1.0));
elseif (y <= 1.45e+15)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -6.4e+83], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-49], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+15], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+83}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < -6.3999999999999998e83Initial program 55.2%
+-commutative55.2%
+-commutative55.2%
+-commutative55.2%
*-commutative55.2%
distribute-rgt1-in13.5%
fma-define55.2%
+-commutative55.2%
+-commutative55.2%
cube-unmult55.2%
+-commutative55.2%
Simplified55.2%
*-commutative55.2%
fma-define13.5%
cube-mult13.5%
distribute-rgt1-in55.2%
*-commutative55.2%
associate-*l*55.2%
times-frac78.2%
associate-+r+78.2%
Applied egg-rr78.2%
Taylor expanded in x around inf 28.2%
Taylor expanded in x around inf 27.5%
if -6.3999999999999998e83 < y < 2.1999999999999999e-49Initial program 76.8%
associate-/l*85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in y around 0 71.0%
+-commutative71.0%
Simplified71.0%
if 2.1999999999999999e-49 < y < 1.45e15Initial program 90.9%
associate-/l*91.0%
associate-+l+91.0%
Simplified91.0%
Taylor expanded in x around 0 58.2%
if 1.45e15 < y Initial program 61.0%
+-commutative61.0%
+-commutative61.0%
+-commutative61.0%
*-commutative61.0%
distribute-rgt1-in60.8%
fma-define61.0%
+-commutative61.0%
+-commutative61.0%
cube-unmult61.1%
+-commutative61.1%
Simplified61.1%
fma-define60.9%
cube-mult60.8%
distribute-rgt1-in61.0%
*-commutative61.0%
associate-*l*61.0%
times-frac87.5%
associate-+r+87.5%
Applied egg-rr87.5%
associate-*r/87.4%
*-commutative87.4%
+-commutative87.4%
associate-+l+87.4%
frac-times99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*87.4%
*-commutative87.4%
associate-*l/87.4%
associate-/r*99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 77.5%
Final simplification64.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -3.5e+82)
(* (/ y x) (/ 1.0 x))
(if (<= y 1.8e-49)
(/ y (* x (+ x 1.0)))
(if (<= y 1e+69) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -3.5e+82) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 1.8e-49) {
tmp = y / (x * (x + 1.0));
} else if (y <= 1e+69) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-3.5d+82)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 1.8d-49) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 1d+69) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -3.5e+82) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 1.8e-49) {
tmp = y / (x * (x + 1.0));
} else if (y <= 1e+69) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -3.5e+82: tmp = (y / x) * (1.0 / x) elif y <= 1.8e-49: tmp = y / (x * (x + 1.0)) elif y <= 1e+69: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -3.5e+82) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 1.8e-49) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 1e+69) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -3.5e+82)
tmp = (y / x) * (1.0 / x);
elseif (y <= 1.8e-49)
tmp = y / (x * (x + 1.0));
elseif (y <= 1e+69)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -3.5e+82], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-49], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+69], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+82}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 10^{+69}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < -3.5e82Initial program 56.2%
+-commutative56.2%
+-commutative56.2%
+-commutative56.2%
*-commutative56.2%
distribute-rgt1-in15.4%
fma-define56.2%
+-commutative56.2%
+-commutative56.2%
cube-unmult56.2%
+-commutative56.2%
Simplified56.2%
*-commutative56.2%
fma-define15.4%
cube-mult15.4%
distribute-rgt1-in56.2%
*-commutative56.2%
associate-*l*56.2%
times-frac78.7%
associate-+r+78.7%
Applied egg-rr78.7%
Taylor expanded in x around inf 27.7%
Taylor expanded in x around inf 26.9%
if -3.5e82 < y < 1.79999999999999985e-49Initial program 76.6%
associate-/l*85.3%
associate-+l+85.3%
Simplified85.3%
Taylor expanded in y around 0 71.5%
+-commutative71.5%
Simplified71.5%
if 1.79999999999999985e-49 < y < 1.0000000000000001e69Initial program 80.9%
associate-/l*81.0%
associate-+l+81.0%
Simplified81.0%
Taylor expanded in x around 0 42.3%
if 1.0000000000000001e69 < y Initial program 59.4%
+-commutative59.4%
+-commutative59.4%
+-commutative59.4%
*-commutative59.4%
distribute-rgt1-in59.4%
fma-define59.4%
+-commutative59.4%
+-commutative59.4%
cube-unmult59.4%
+-commutative59.4%
Simplified59.4%
fma-define59.4%
cube-mult59.4%
distribute-rgt1-in59.4%
*-commutative59.4%
associate-*l*59.4%
times-frac89.1%
associate-+r+89.1%
Applied egg-rr89.1%
Taylor expanded in x around 0 88.4%
Taylor expanded in y around inf 88.2%
Final simplification64.1%
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 -5.5e-259)
t_0
(if (<= y 3.5e-224)
(/ y x)
(if (<= y 9800.0) t_0 (* (/ x y) (/ 1.0 y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / x) * (1.0 / x);
double tmp;
if (y <= -5.5e-259) {
tmp = t_0;
} else if (y <= 3.5e-224) {
tmp = y / x;
} else if (y <= 9800.0) {
tmp = t_0;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y / x) * (1.0d0 / x)
if (y <= (-5.5d-259)) then
tmp = t_0
else if (y <= 3.5d-224) then
tmp = y / x
else if (y <= 9800.0d0) then
tmp = t_0
else
tmp = (x / y) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / x) * (1.0 / x);
double tmp;
if (y <= -5.5e-259) {
tmp = t_0;
} else if (y <= 3.5e-224) {
tmp = y / x;
} else if (y <= 9800.0) {
tmp = t_0;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / x) * (1.0 / x) tmp = 0 if y <= -5.5e-259: tmp = t_0 elif y <= 3.5e-224: tmp = y / x elif y <= 9800.0: tmp = t_0 else: tmp = (x / y) * (1.0 / 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 <= -5.5e-259) tmp = t_0; elseif (y <= 3.5e-224) tmp = Float64(y / x); elseif (y <= 9800.0) tmp = t_0; else tmp = Float64(Float64(x / y) * Float64(1.0 / 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 <= -5.5e-259)
tmp = t_0;
elseif (y <= 3.5e-224)
tmp = y / x;
elseif (y <= 9800.0)
tmp = t_0;
else
tmp = (x / y) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e-259], t$95$0, If[LessEqual[y, 3.5e-224], N[(y / x), $MachinePrecision], If[LessEqual[y, 9800.0], t$95$0, N[(N[(x / y), $MachinePrecision] * N[(1.0 / 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 -5.5 \cdot 10^{-259}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-224}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 9800:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < -5.50000000000000038e-259 or 3.50000000000000019e-224 < y < 9800Initial program 74.9%
+-commutative74.9%
+-commutative74.9%
+-commutative74.9%
*-commutative74.9%
distribute-rgt1-in56.9%
fma-define74.9%
+-commutative74.9%
+-commutative74.9%
cube-unmult74.9%
+-commutative74.9%
Simplified74.9%
*-commutative74.9%
fma-define56.9%
cube-mult56.9%
distribute-rgt1-in74.9%
*-commutative74.9%
associate-*l*74.8%
times-frac93.9%
associate-+r+93.9%
Applied egg-rr93.9%
Taylor expanded in x around inf 41.8%
Taylor expanded in x around inf 41.5%
if -5.50000000000000038e-259 < y < 3.50000000000000019e-224Initial program 61.1%
associate-/l*80.2%
associate-+l+80.2%
Simplified80.2%
Taylor expanded in x around 0 77.1%
+-commutative77.1%
Simplified77.1%
Taylor expanded in y around 0 93.6%
if 9800 < y Initial program 62.4%
+-commutative62.4%
+-commutative62.4%
+-commutative62.4%
*-commutative62.4%
distribute-rgt1-in62.2%
fma-define62.4%
+-commutative62.4%
+-commutative62.4%
cube-unmult62.4%
+-commutative62.4%
Simplified62.4%
fma-define62.2%
cube-mult62.2%
distribute-rgt1-in62.4%
*-commutative62.4%
associate-*l*62.4%
times-frac87.9%
associate-+r+87.9%
Applied egg-rr87.9%
Taylor expanded in x around 0 80.8%
Taylor expanded in y around inf 75.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 6.8e-134)
(/ (/ y (+ y x)) (+ x 1.0))
(if (<= y 1.35e+154)
(/ x (* (+ y x) (+ x (+ y 1.0))))
(* (/ x (+ y x)) (/ 1.0 y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 6.8e-134) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 1.35e+154) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (y + x)) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6.8d-134) then
tmp = (y / (y + x)) / (x + 1.0d0)
else if (y <= 1.35d+154) then
tmp = x / ((y + x) * (x + (y + 1.0d0)))
else
tmp = (x / (y + x)) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 6.8e-134) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 1.35e+154) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (y + x)) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 6.8e-134: tmp = (y / (y + x)) / (x + 1.0) elif y <= 1.35e+154: tmp = x / ((y + x) * (x + (y + 1.0))) else: tmp = (x / (y + x)) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 6.8e-134) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); elseif (y <= 1.35e+154) tmp = Float64(x / Float64(Float64(y + x) * Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 6.8e-134)
tmp = (y / (y + x)) / (x + 1.0);
elseif (y <= 1.35e+154)
tmp = x / ((y + x) * (x + (y + 1.0)));
else
tmp = (x / (y + x)) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 6.8e-134], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.8 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 6.79999999999999954e-134Initial program 70.2%
+-commutative70.2%
+-commutative70.2%
+-commutative70.2%
*-commutative70.2%
distribute-rgt1-in52.5%
fma-define70.2%
+-commutative70.2%
+-commutative70.2%
cube-unmult70.2%
+-commutative70.2%
Simplified70.2%
*-commutative70.2%
fma-define52.5%
cube-mult52.5%
distribute-rgt1-in70.2%
*-commutative70.2%
associate-*l*70.2%
times-frac94.2%
associate-+r+94.2%
Applied egg-rr94.2%
Taylor expanded in y around 0 59.3%
+-commutative59.3%
Simplified59.3%
un-div-inv59.3%
+-commutative59.3%
Applied egg-rr59.3%
if 6.79999999999999954e-134 < y < 1.35000000000000003e154Initial program 78.9%
+-commutative78.9%
+-commutative78.9%
+-commutative78.9%
*-commutative78.9%
distribute-rgt1-in73.0%
fma-define78.9%
+-commutative78.9%
+-commutative78.9%
cube-unmult79.0%
+-commutative79.0%
Simplified79.0%
fma-define73.1%
cube-mult73.0%
distribute-rgt1-in78.9%
*-commutative78.9%
associate-*l*78.8%
times-frac96.1%
associate-+r+96.1%
Applied egg-rr96.1%
Taylor expanded in x around 0 61.1%
associate-*r/61.1%
+-commutative61.1%
Applied egg-rr61.1%
Taylor expanded in x around 0 63.0%
if 1.35000000000000003e154 < y Initial program 55.4%
+-commutative55.4%
+-commutative55.4%
+-commutative55.4%
*-commutative55.4%
distribute-rgt1-in55.4%
fma-define55.4%
+-commutative55.4%
+-commutative55.4%
cube-unmult55.4%
+-commutative55.4%
Simplified55.4%
fma-define55.4%
cube-mult55.4%
distribute-rgt1-in55.4%
*-commutative55.4%
associate-*l*55.4%
times-frac84.1%
associate-+r+84.1%
Applied egg-rr84.1%
Taylor expanded in y around inf 93.5%
Final simplification63.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -1.8e+81) (* (/ y x) (/ 1.0 x)) (if (<= y 1.6e-49) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1.8e+81) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 1.6e-49) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.8d+81)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 1.6d-49) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -1.8e+81) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 1.6e-49) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1.8e+81: tmp = (y / x) * (1.0 / x) elif y <= 1.6e-49: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1.8e+81) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 1.6e-49) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -1.8e+81)
tmp = (y / x) * (1.0 / x);
elseif (y <= 1.6e-49)
tmp = y / (x * (x + 1.0));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -1.8e+81], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-49], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+81}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < -1.80000000000000003e81Initial program 56.2%
+-commutative56.2%
+-commutative56.2%
+-commutative56.2%
*-commutative56.2%
distribute-rgt1-in15.4%
fma-define56.2%
+-commutative56.2%
+-commutative56.2%
cube-unmult56.2%
+-commutative56.2%
Simplified56.2%
*-commutative56.2%
fma-define15.4%
cube-mult15.4%
distribute-rgt1-in56.2%
*-commutative56.2%
associate-*l*56.2%
times-frac78.7%
associate-+r+78.7%
Applied egg-rr78.7%
Taylor expanded in x around inf 27.7%
Taylor expanded in x around inf 26.9%
if -1.80000000000000003e81 < y < 1.60000000000000001e-49Initial program 76.6%
associate-/l*85.3%
associate-+l+85.3%
Simplified85.3%
Taylor expanded in y around 0 71.5%
+-commutative71.5%
Simplified71.5%
if 1.60000000000000001e-49 < y Initial program 66.1%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in x around 0 69.6%
associate-/r*73.8%
+-commutative73.8%
Simplified73.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.0) (* (/ y x) (/ 1.0 x)) (if (<= x -3.05e-85) (/ y x) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.05e-85) {
tmp = y / x;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-3.05d-85)) then
tmp = y / x
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.05e-85) {
tmp = y / x;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) * (1.0 / x) elif x <= -3.05e-85: tmp = y / x else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -3.05e-85) tmp = Float64(y / x); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = (y / x) * (1.0 / x);
elseif (x <= -3.05e-85)
tmp = y / x;
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.05e-85], N[(y / x), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -3.05 \cdot 10^{-85}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 62.1%
+-commutative62.1%
+-commutative62.1%
+-commutative62.1%
*-commutative62.1%
distribute-rgt1-in35.7%
fma-define62.1%
+-commutative62.1%
+-commutative62.1%
cube-unmult62.2%
+-commutative62.2%
Simplified62.2%
*-commutative62.2%
fma-define35.7%
cube-mult35.7%
distribute-rgt1-in62.1%
*-commutative62.1%
associate-*l*62.1%
times-frac85.3%
associate-+r+85.3%
Applied egg-rr85.3%
Taylor expanded in x around inf 74.2%
Taylor expanded in x around inf 73.8%
if -1 < x < -3.04999999999999995e-85Initial program 83.9%
associate-/l*99.3%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in x around 0 92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in y around 0 52.4%
if -3.04999999999999995e-85 < x Initial program 72.2%
associate-/l*82.0%
associate-+l+82.0%
Simplified82.0%
Taylor expanded in x around 0 57.2%
Final simplification61.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.1e-50) (/ (/ y x) (+ x 1.0)) (* (/ x (+ y x)) (/ 1.0 (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.1e-50) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + x)) * (1.0 / (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.1d-50) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + x)) * (1.0d0 / (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.1e-50) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + x)) * (1.0 / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.1e-50: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + x)) * (1.0 / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.1e-50) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / 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.1e-50)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / (y + x)) * (1.0 / (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.1e-50], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y + 1}\\
\end{array}
\end{array}
if y < 3.1000000000000002e-50Initial program 71.7%
+-commutative71.7%
+-commutative71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt1-in54.1%
fma-define71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.7%
+-commutative71.7%
Simplified71.7%
fma-define54.1%
cube-mult54.1%
distribute-rgt1-in71.7%
*-commutative71.7%
associate-*l*71.7%
times-frac94.8%
associate-+r+94.8%
Applied egg-rr94.8%
associate-*r/94.8%
*-commutative94.8%
+-commutative94.8%
associate-+l+94.8%
frac-times99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*94.7%
*-commutative94.7%
clear-num94.7%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times98.3%
*-un-lft-identity98.3%
associate-+l+98.3%
+-commutative98.3%
Applied egg-rr98.3%
Taylor expanded in y around 0 58.1%
associate-/r*60.8%
+-commutative60.8%
Simplified60.8%
if 3.1000000000000002e-50 < y Initial program 66.1%
+-commutative66.1%
+-commutative66.1%
+-commutative66.1%
*-commutative66.1%
distribute-rgt1-in66.0%
fma-define66.1%
+-commutative66.1%
+-commutative66.1%
cube-unmult66.2%
+-commutative66.2%
Simplified66.2%
fma-define66.0%
cube-mult66.0%
distribute-rgt1-in66.1%
*-commutative66.1%
associate-*l*66.1%
times-frac89.6%
associate-+r+89.6%
Applied egg-rr89.6%
Taylor expanded in x around 0 74.4%
+-commutative74.4%
Simplified74.4%
Final simplification64.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.9e-50) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.9e-50) {
tmp = (y / x) / (x + 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 <= 1.9d-50) then
tmp = (y / x) / (x + 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 <= 1.9e-50) {
tmp = (y / x) / (x + 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 <= 1.9e-50: tmp = (y / x) / (x + 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 <= 1.9e-50) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.9e-50)
tmp = (y / x) / (x + 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, 1.9e-50], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 1.9e-50Initial program 71.7%
+-commutative71.7%
+-commutative71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt1-in54.1%
fma-define71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.7%
+-commutative71.7%
Simplified71.7%
fma-define54.1%
cube-mult54.1%
distribute-rgt1-in71.7%
*-commutative71.7%
associate-*l*71.7%
times-frac94.8%
associate-+r+94.8%
Applied egg-rr94.8%
associate-*r/94.8%
*-commutative94.8%
+-commutative94.8%
associate-+l+94.8%
frac-times99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*94.7%
*-commutative94.7%
clear-num94.7%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times98.3%
*-un-lft-identity98.3%
associate-+l+98.3%
+-commutative98.3%
Applied egg-rr98.3%
Taylor expanded in y around 0 58.1%
associate-/r*60.8%
+-commutative60.8%
Simplified60.8%
if 1.9e-50 < y Initial program 66.1%
+-commutative66.1%
+-commutative66.1%
+-commutative66.1%
*-commutative66.1%
distribute-rgt1-in66.0%
fma-define66.1%
+-commutative66.1%
+-commutative66.1%
cube-unmult66.2%
+-commutative66.2%
Simplified66.2%
fma-define66.0%
cube-mult66.0%
distribute-rgt1-in66.1%
*-commutative66.1%
associate-*l*66.1%
times-frac89.6%
associate-+r+89.6%
Applied egg-rr89.6%
associate-*r/89.5%
*-commutative89.5%
+-commutative89.5%
associate-+l+89.5%
frac-times99.7%
associate-+l+99.7%
+-commutative99.7%
associate-/r*89.5%
*-commutative89.5%
associate-*l/89.4%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 74.3%
+-commutative74.3%
Simplified74.3%
Final simplification64.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 4.3e-50) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 4.3e-50) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.3d-50) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 4.3e-50) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 4.3e-50: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 4.3e-50) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 4.3e-50)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 4.3e-50], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 4.29999999999999997e-50Initial program 71.7%
+-commutative71.7%
+-commutative71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt1-in54.1%
fma-define71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.7%
+-commutative71.7%
Simplified71.7%
fma-define54.1%
cube-mult54.1%
distribute-rgt1-in71.7%
*-commutative71.7%
associate-*l*71.7%
times-frac94.8%
associate-+r+94.8%
Applied egg-rr94.8%
associate-*r/94.8%
*-commutative94.8%
+-commutative94.8%
associate-+l+94.8%
frac-times99.8%
associate-+l+99.8%
+-commutative99.8%
associate-/r*94.7%
*-commutative94.7%
clear-num94.7%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times98.3%
*-un-lft-identity98.3%
associate-+l+98.3%
+-commutative98.3%
Applied egg-rr98.3%
Taylor expanded in y around 0 58.1%
associate-/r*60.8%
+-commutative60.8%
Simplified60.8%
if 4.29999999999999997e-50 < y Initial program 66.1%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in x around 0 69.6%
associate-/r*73.8%
+-commutative73.8%
Simplified73.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.2e-49) (/ y x) (* (/ x y) (/ 1.0 y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.2e-49) {
tmp = y / x;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.2d-49) then
tmp = y / x
else
tmp = (x / y) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.2e-49) {
tmp = y / x;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.2e-49: tmp = y / x else: tmp = (x / y) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.2e-49) tmp = Float64(y / x); else tmp = Float64(Float64(x / y) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.2e-49)
tmp = y / x;
else
tmp = (x / y) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.2e-49], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 2.1999999999999999e-49Initial program 71.7%
associate-/l*82.7%
associate-+l+82.7%
Simplified82.7%
Taylor expanded in x around 0 73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in y around 0 35.8%
if 2.1999999999999999e-49 < y Initial program 66.1%
+-commutative66.1%
+-commutative66.1%
+-commutative66.1%
*-commutative66.1%
distribute-rgt1-in66.0%
fma-define66.1%
+-commutative66.1%
+-commutative66.1%
cube-unmult66.2%
+-commutative66.2%
Simplified66.2%
fma-define66.0%
cube-mult66.0%
distribute-rgt1-in66.1%
*-commutative66.1%
associate-*l*66.1%
times-frac89.6%
associate-+r+89.6%
Applied egg-rr89.6%
Taylor expanded in x around 0 79.0%
Taylor expanded in y around inf 65.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.2e-49) (/ y x) (/ (/ x y) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.2e-49) {
tmp = y / x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.2d-49) then
tmp = y / x
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.2e-49) {
tmp = y / x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.2e-49: tmp = y / x else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.2e-49) tmp = Float64(y / x); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.2e-49)
tmp = y / x;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.2e-49], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 2.1999999999999999e-49Initial program 71.7%
associate-/l*82.7%
associate-+l+82.7%
Simplified82.7%
Taylor expanded in x around 0 73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in y around 0 35.8%
if 2.1999999999999999e-49 < y Initial program 66.1%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in x around 0 69.6%
Taylor expanded in y around inf 61.6%
add-sqr-sqrt32.7%
times-frac33.9%
Applied egg-rr33.9%
associate-*l/34.0%
associate-*r/34.0%
rem-square-sqrt65.8%
Simplified65.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.2e-49) (/ y x) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.2e-49) {
tmp = y / x;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.2d-49) then
tmp = y / x
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.2e-49) {
tmp = y / x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.2e-49: tmp = y / x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.2e-49) tmp = Float64(y / x); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.2e-49)
tmp = y / x;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.2e-49], N[(y / x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 2.1999999999999999e-49Initial program 71.7%
associate-/l*82.7%
associate-+l+82.7%
Simplified82.7%
Taylor expanded in x around 0 73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in y around 0 35.8%
if 2.1999999999999999e-49 < y Initial program 66.1%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in x around 0 69.6%
Taylor expanded in y around inf 61.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ y x))
assert(x < y);
double code(double x, double y) {
return y / x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y / x
end function
assert x < y;
public static double code(double x, double y) {
return y / x;
}
[x, y] = sort([x, y]) def code(x, y): return y / x
x, y = sort([x, y]) function code(x, y) return Float64(y / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = y / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(y / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{x}
\end{array}
Initial program 70.3%
associate-/l*82.9%
associate-+l+82.9%
Simplified82.9%
Taylor expanded in x around 0 74.4%
+-commutative74.4%
Simplified74.4%
Taylor expanded in y around 0 27.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 0.5 x))
assert(x < y);
double code(double x, double y) {
return 0.5 / 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 = 0.5d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 0.5 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 0.5 / x
x, y = sort([x, y]) function code(x, y) return Float64(0.5 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 0.5 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(0.5 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{0.5}{x}
\end{array}
Initial program 70.3%
Taylor expanded in x around 0 41.0%
associate-*r*41.0%
+-commutative41.0%
unpow241.0%
distribute-rgt-in41.1%
Simplified41.1%
Taylor expanded in x around inf 4.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 1.0)
assert(x < y);
double code(double x, double y) {
return 1.0;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
assert x < y;
public static double code(double x, double y) {
return 1.0;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0
x, y = sort([x, y]) function code(x, y) return 1.0 end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := 1.0
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
1
\end{array}
Initial program 70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
*-commutative70.3%
distribute-rgt1-in57.1%
fma-define70.3%
+-commutative70.3%
+-commutative70.3%
cube-unmult70.3%
+-commutative70.3%
Simplified70.3%
*-commutative70.3%
fma-define57.1%
cube-mult57.1%
distribute-rgt1-in70.3%
*-commutative70.3%
associate-*l*70.3%
times-frac93.4%
associate-+r+93.4%
Applied egg-rr93.4%
Taylor expanded in y around 0 52.6%
+-commutative52.6%
Simplified52.6%
Taylor expanded in x around 0 3.5%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2024181
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))