
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (/ (/ x (+ x y)) (+ x y)) (/ (+ y (+ x 1.0)) y)))
assert(x < y);
double code(double x, double y) {
return ((x / (x + y)) / (x + y)) / ((y + (x + 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 = ((x / (x + y)) / (x + y)) / ((y + (x + 1.0d0)) / y)
end function
assert x < y;
public static double code(double x, double y) {
return ((x / (x + y)) / (x + y)) / ((y + (x + 1.0)) / y);
}
[x, y] = sort([x, y]) def code(x, y): return ((x / (x + y)) / (x + y)) / ((y + (x + 1.0)) / y)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + y)) / Float64(Float64(y + Float64(x + 1.0)) / y)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((x / (x + y)) / (x + y)) / ((y + (x + 1.0)) / y);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{\frac{x}{x + y}}{x + y}}{\frac{y + \left(x + 1\right)}{y}}
\end{array}
Initial program 68.3%
associate-/l*82.0%
associate-+l+82.0%
Simplified82.0%
clear-num82.0%
associate-+r+82.0%
*-commutative82.0%
distribute-rgt1-in62.5%
cube-mult62.5%
un-div-inv62.5%
cube-mult62.5%
distribute-rgt1-in82.1%
*-commutative82.1%
associate-/l*83.9%
pow283.8%
+-commutative83.8%
Applied egg-rr83.8%
associate-/r*86.0%
+-commutative86.0%
Simplified86.0%
*-un-lft-identity86.0%
unpow286.0%
times-frac99.7%
Applied egg-rr99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Final simplification99.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ x y))))
(if (<= x -1.4e+154)
(/ t_0 (+ x (+ y 1.0)))
(if (<= x -5.2e-14)
(/ y (* (+ x y) (+ y (+ x 1.0))))
(if (<= x 2.9e-71)
(/ (* x t_0) (* (+ x y) (+ y 1.0)))
(* (/ 1.0 y) (/ x (+ y 1.0))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x + y);
double tmp;
if (x <= -1.4e+154) {
tmp = t_0 / (x + (y + 1.0));
} else if (x <= -5.2e-14) {
tmp = y / ((x + y) * (y + (x + 1.0)));
} else if (x <= 2.9e-71) {
tmp = (x * t_0) / ((x + y) * (y + 1.0));
} else {
tmp = (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = y / (x + y)
if (x <= (-1.4d+154)) then
tmp = t_0 / (x + (y + 1.0d0))
else if (x <= (-5.2d-14)) then
tmp = y / ((x + y) * (y + (x + 1.0d0)))
else if (x <= 2.9d-71) then
tmp = (x * t_0) / ((x + y) * (y + 1.0d0))
else
tmp = (1.0d0 / y) * (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 / (x + y);
double tmp;
if (x <= -1.4e+154) {
tmp = t_0 / (x + (y + 1.0));
} else if (x <= -5.2e-14) {
tmp = y / ((x + y) * (y + (x + 1.0)));
} else if (x <= 2.9e-71) {
tmp = (x * t_0) / ((x + y) * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x + y) tmp = 0 if x <= -1.4e+154: tmp = t_0 / (x + (y + 1.0)) elif x <= -5.2e-14: tmp = y / ((x + y) * (y + (x + 1.0))) elif x <= 2.9e-71: tmp = (x * t_0) / ((x + y) * (y + 1.0)) else: tmp = (1.0 / y) * (x / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x + y)) tmp = 0.0 if (x <= -1.4e+154) tmp = Float64(t_0 / Float64(x + Float64(y + 1.0))); elseif (x <= -5.2e-14) tmp = Float64(y / Float64(Float64(x + y) * Float64(y + Float64(x + 1.0)))); elseif (x <= 2.9e-71) tmp = Float64(Float64(x * t_0) / Float64(Float64(x + y) * Float64(y + 1.0))); else tmp = Float64(Float64(1.0 / y) * 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 / (x + y);
tmp = 0.0;
if (x <= -1.4e+154)
tmp = t_0 / (x + (y + 1.0));
elseif (x <= -5.2e-14)
tmp = y / ((x + y) * (y + (x + 1.0)));
elseif (x <= 2.9e-71)
tmp = (x * t_0) / ((x + y) * (y + 1.0));
else
tmp = (1.0 / 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_] := Block[{t$95$0 = N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e+154], N[(t$95$0 / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.2e-14], N[(y / N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e-71], N[(N[(x * t$95$0), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x + y}\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{t\_0}{x + \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-71}:\\
\;\;\;\;\frac{x \cdot t\_0}{\left(x + y\right) \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -1.4e154Initial program 70.4%
associate-*l*70.4%
times-frac87.8%
+-commutative87.8%
+-commutative87.8%
associate-+r+87.8%
+-commutative87.8%
associate-+l+87.8%
Applied egg-rr87.8%
Taylor expanded in x around inf 87.8%
*-un-lft-identity87.8%
associate-/r*91.0%
+-commutative91.0%
+-commutative91.0%
associate-+r+91.0%
+-commutative91.0%
associate-+l+91.0%
Applied egg-rr91.0%
if -1.4e154 < x < -5.19999999999999993e-14Initial program 71.4%
associate-*l*71.4%
times-frac90.3%
+-commutative90.3%
+-commutative90.3%
associate-+r+90.3%
+-commutative90.3%
associate-+l+90.3%
Applied egg-rr90.3%
Taylor expanded in x around inf 83.6%
if -5.19999999999999993e-14 < x < 2.8999999999999999e-71Initial program 69.4%
associate-*l*69.3%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-/r*99.8%
associate-+r+99.8%
+-commutative99.8%
frac-times99.9%
*-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
distribute-lft-in99.9%
+-commutative99.9%
distribute-lft-in99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 99.9%
if 2.8999999999999999e-71 < x Initial program 64.1%
associate-/l*78.1%
associate-+l+78.1%
Simplified78.1%
Taylor expanded in x around 0 28.6%
+-commutative28.6%
Simplified28.6%
*-un-lft-identity28.6%
times-frac33.5%
Applied egg-rr33.5%
Final simplification79.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2.2e+154)
(/ (/ y (+ x y)) (+ x (+ y 1.0)))
(if (<= x -4.2e-14)
(/ y (* (+ x y) (+ y (+ x 1.0))))
(if (<= x 3.2e-111)
(* (/ x (+ x y)) (/ y (* (+ x y) (+ y 1.0))))
(* (/ 1.0 y) (/ x (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.2e+154) {
tmp = (y / (x + y)) / (x + (y + 1.0));
} else if (x <= -4.2e-14) {
tmp = y / ((x + y) * (y + (x + 1.0)));
} else if (x <= 3.2e-111) {
tmp = (x / (x + y)) * (y / ((x + y) * (y + 1.0)));
} else {
tmp = (1.0 / 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 (x <= (-2.2d+154)) then
tmp = (y / (x + y)) / (x + (y + 1.0d0))
else if (x <= (-4.2d-14)) then
tmp = y / ((x + y) * (y + (x + 1.0d0)))
else if (x <= 3.2d-111) then
tmp = (x / (x + y)) * (y / ((x + y) * (y + 1.0d0)))
else
tmp = (1.0d0 / 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 (x <= -2.2e+154) {
tmp = (y / (x + y)) / (x + (y + 1.0));
} else if (x <= -4.2e-14) {
tmp = y / ((x + y) * (y + (x + 1.0)));
} else if (x <= 3.2e-111) {
tmp = (x / (x + y)) * (y / ((x + y) * (y + 1.0)));
} else {
tmp = (1.0 / y) * (x / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.2e+154: tmp = (y / (x + y)) / (x + (y + 1.0)) elif x <= -4.2e-14: tmp = y / ((x + y) * (y + (x + 1.0))) elif x <= 3.2e-111: tmp = (x / (x + y)) * (y / ((x + y) * (y + 1.0))) else: tmp = (1.0 / y) * (x / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.2e+154) tmp = Float64(Float64(y / Float64(x + y)) / Float64(x + Float64(y + 1.0))); elseif (x <= -4.2e-14) tmp = Float64(y / Float64(Float64(x + y) * Float64(y + Float64(x + 1.0)))); elseif (x <= 3.2e-111) tmp = Float64(Float64(x / Float64(x + y)) * Float64(y / Float64(Float64(x + y) * Float64(y + 1.0)))); else tmp = Float64(Float64(1.0 / 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 (x <= -2.2e+154)
tmp = (y / (x + y)) / (x + (y + 1.0));
elseif (x <= -4.2e-14)
tmp = y / ((x + y) * (y + (x + 1.0)));
elseif (x <= 3.2e-111)
tmp = (x / (x + y)) * (y / ((x + y) * (y + 1.0)));
else
tmp = (1.0 / 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[x, -2.2e+154], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.2e-14], N[(y / N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.2e-111], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(x + y), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / 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}\;x \leq -2.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x + \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{y}{\left(x + y\right) \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -2.2000000000000001e154Initial program 70.4%
associate-*l*70.4%
times-frac87.8%
+-commutative87.8%
+-commutative87.8%
associate-+r+87.8%
+-commutative87.8%
associate-+l+87.8%
Applied egg-rr87.8%
Taylor expanded in x around inf 87.8%
*-un-lft-identity87.8%
associate-/r*91.0%
+-commutative91.0%
+-commutative91.0%
associate-+r+91.0%
+-commutative91.0%
associate-+l+91.0%
Applied egg-rr91.0%
if -2.2000000000000001e154 < x < -4.1999999999999998e-14Initial program 71.4%
associate-*l*71.4%
times-frac90.3%
+-commutative90.3%
+-commutative90.3%
associate-+r+90.3%
+-commutative90.3%
associate-+l+90.3%
Applied egg-rr90.3%
Taylor expanded in x around inf 83.6%
if -4.1999999999999998e-14 < x < 3.1999999999999998e-111Initial program 68.7%
associate-*l*68.7%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
Simplified99.8%
if 3.1999999999999998e-111 < x Initial program 65.6%
associate-/l*79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in x around 0 31.1%
+-commutative31.1%
Simplified31.1%
*-un-lft-identity31.1%
times-frac35.4%
Applied egg-rr35.4%
Final simplification77.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= x -1.6e+58)
(/ (/ y (+ x y)) t_0)
(if (<= x -1.95e-59)
(* x (/ y (* t_0 (* (+ x y) (+ x y)))))
(/ (/ (/ x (+ x y)) (+ x y)) (/ (+ y 1.0) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.6e+58) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -1.95e-59) {
tmp = x * (y / (t_0 * ((x + y) * (x + y))));
} else {
tmp = ((x / (x + y)) / (x + y)) / ((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 = x + (y + 1.0d0)
if (x <= (-1.6d+58)) then
tmp = (y / (x + y)) / t_0
else if (x <= (-1.95d-59)) then
tmp = x * (y / (t_0 * ((x + y) * (x + y))))
else
tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0d0) / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.6e+58) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -1.95e-59) {
tmp = x * (y / (t_0 * ((x + y) * (x + y))));
} else {
tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if x <= -1.6e+58: tmp = (y / (x + y)) / t_0 elif x <= -1.95e-59: tmp = x * (y / (t_0 * ((x + y) * (x + y)))) else: tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -1.6e+58) tmp = Float64(Float64(y / Float64(x + y)) / t_0); elseif (x <= -1.95e-59) tmp = Float64(x * Float64(y / Float64(t_0 * Float64(Float64(x + y) * Float64(x + y))))); else tmp = Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + y)) / Float64(Float64(y + 1.0) / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (x <= -1.6e+58)
tmp = (y / (x + y)) / t_0;
elseif (x <= -1.95e-59)
tmp = x * (y / (t_0 * ((x + y) * (x + y))));
else
tmp = ((x / (x + y)) / (x + y)) / ((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[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+58], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, -1.95e-59], N[(x * N[(y / N[(t$95$0 * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+58}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{t\_0}\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-59}:\\
\;\;\;\;x \cdot \frac{y}{t\_0 \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{x}{x + y}}{x + y}}{\frac{y + 1}{y}}\\
\end{array}
\end{array}
if x < -1.60000000000000008e58Initial program 65.9%
associate-*l*65.9%
times-frac86.3%
+-commutative86.3%
+-commutative86.3%
associate-+r+86.3%
+-commutative86.3%
associate-+l+86.3%
Applied egg-rr86.3%
Taylor expanded in x around inf 84.5%
*-un-lft-identity84.5%
associate-/r*82.1%
+-commutative82.1%
+-commutative82.1%
associate-+r+82.1%
+-commutative82.1%
associate-+l+82.1%
Applied egg-rr82.1%
if -1.60000000000000008e58 < x < -1.95000000000000009e-59Initial program 94.6%
associate-/l*94.6%
associate-+l+94.6%
Simplified94.6%
if -1.95000000000000009e-59 < x Initial program 66.4%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
clear-num81.7%
associate-+r+81.7%
*-commutative81.7%
distribute-rgt1-in70.5%
cube-mult70.5%
un-div-inv70.6%
cube-mult70.6%
distribute-rgt1-in81.8%
*-commutative81.8%
associate-/l*83.7%
pow283.7%
+-commutative83.7%
Applied egg-rr83.7%
associate-/r*84.6%
+-commutative84.6%
Simplified84.6%
*-un-lft-identity84.6%
unpow284.7%
times-frac99.7%
Applied egg-rr99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 84.2%
Final simplification84.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 3.35e-163)
(/ (/ y (+ x 1.0)) x)
(if (<= y 6.6e-5)
(* x (/ y (* (+ x 1.0) (* (+ x y) (+ x y)))))
(if (<= y 5.7e+109)
(/ x (* (+ x y) (+ y (+ x 1.0))))
(* (/ x (+ x y)) (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.35e-163) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 6.6e-5) {
tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y))));
} else if (y <= 5.7e+109) {
tmp = x / ((x + y) * (y + (x + 1.0)));
} else {
tmp = (x / (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.35d-163) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 6.6d-5) then
tmp = x * (y / ((x + 1.0d0) * ((x + y) * (x + y))))
else if (y <= 5.7d+109) then
tmp = x / ((x + y) * (y + (x + 1.0d0)))
else
tmp = (x / (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.35e-163) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 6.6e-5) {
tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y))));
} else if (y <= 5.7e+109) {
tmp = x / ((x + y) * (y + (x + 1.0)));
} else {
tmp = (x / (x + y)) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.35e-163: tmp = (y / (x + 1.0)) / x elif y <= 6.6e-5: tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y)))) elif y <= 5.7e+109: tmp = x / ((x + y) * (y + (x + 1.0))) else: tmp = (x / (x + y)) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.35e-163) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 6.6e-5) tmp = Float64(x * Float64(y / Float64(Float64(x + 1.0) * Float64(Float64(x + y) * Float64(x + y))))); elseif (y <= 5.7e+109) tmp = Float64(x / Float64(Float64(x + y) * Float64(y + Float64(x + 1.0)))); else tmp = Float64(Float64(x / 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.35e-163)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 6.6e-5)
tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y))));
elseif (y <= 5.7e+109)
tmp = x / ((x + y) * (y + (x + 1.0)));
else
tmp = (x / (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.35e-163], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 6.6e-5], N[(x * N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.7e+109], N[(x / N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.35 \cdot 10^{-163}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{+109}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 3.3500000000000001e-163Initial program 65.0%
associate-/l*80.1%
associate-+l+80.1%
Simplified80.1%
clear-num80.1%
associate-+r+80.1%
*-commutative80.1%
distribute-rgt1-in53.7%
cube-mult53.6%
un-div-inv53.7%
cube-mult53.7%
distribute-rgt1-in80.2%
*-commutative80.2%
associate-/l*81.3%
pow281.3%
+-commutative81.3%
Applied egg-rr81.3%
associate-/r*83.5%
+-commutative83.5%
Simplified83.5%
*-un-lft-identity83.5%
unpow283.5%
times-frac99.7%
Applied egg-rr99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in y around 0 51.3%
+-commutative51.3%
Simplified51.3%
*-un-lft-identity51.3%
times-frac52.7%
Applied egg-rr52.7%
associate-*l/52.8%
*-lft-identity52.8%
+-commutative52.8%
Simplified52.8%
if 3.3500000000000001e-163 < y < 6.6000000000000005e-5Initial program 87.2%
associate-/l*93.1%
associate-+l+93.1%
Simplified93.1%
Taylor expanded in y around 0 92.0%
+-commutative92.0%
Simplified92.0%
if 6.6000000000000005e-5 < y < 5.7000000000000002e109Initial program 75.8%
associate-*l*75.8%
times-frac89.7%
+-commutative89.7%
+-commutative89.7%
associate-+r+89.7%
+-commutative89.7%
associate-+l+89.7%
Applied egg-rr89.7%
*-commutative89.7%
associate-/r*99.6%
associate-+r+99.6%
+-commutative99.6%
frac-times90.1%
*-commutative90.1%
+-commutative90.1%
associate-+r+90.1%
distribute-lft-in85.4%
+-commutative85.4%
distribute-lft-in90.1%
Applied egg-rr90.1%
Taylor expanded in y around inf 90.1%
if 5.7000000000000002e109 < y Initial program 59.2%
associate-*l*59.2%
times-frac82.2%
+-commutative82.2%
+-commutative82.2%
associate-+r+82.2%
+-commutative82.2%
associate-+l+82.2%
Applied egg-rr82.2%
Taylor expanded in y around inf 89.4%
Final simplification66.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2.1e+154)
(/ (/ y (+ x y)) (+ x (+ y 1.0)))
(if (<= x -1.6e-30)
(/ y (* (+ x y) (+ y (+ x 1.0))))
(/ (/ (/ x (+ x y)) (+ x y)) (/ (+ y 1.0) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.1e+154) {
tmp = (y / (x + y)) / (x + (y + 1.0));
} else if (x <= -1.6e-30) {
tmp = y / ((x + y) * (y + (x + 1.0)));
} else {
tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.1d+154)) then
tmp = (y / (x + y)) / (x + (y + 1.0d0))
else if (x <= (-1.6d-30)) then
tmp = y / ((x + y) * (y + (x + 1.0d0)))
else
tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0d0) / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.1e+154) {
tmp = (y / (x + y)) / (x + (y + 1.0));
} else if (x <= -1.6e-30) {
tmp = y / ((x + y) * (y + (x + 1.0)));
} else {
tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.1e+154: tmp = (y / (x + y)) / (x + (y + 1.0)) elif x <= -1.6e-30: tmp = y / ((x + y) * (y + (x + 1.0))) else: tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.1e+154) tmp = Float64(Float64(y / Float64(x + y)) / Float64(x + Float64(y + 1.0))); elseif (x <= -1.6e-30) tmp = Float64(y / Float64(Float64(x + y) * Float64(y + Float64(x + 1.0)))); else tmp = Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + y)) / Float64(Float64(y + 1.0) / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.1e+154)
tmp = (y / (x + y)) / (x + (y + 1.0));
elseif (x <= -1.6e-30)
tmp = y / ((x + y) * (y + (x + 1.0)));
else
tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.1e+154], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.6e-30], N[(y / N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x + \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-30}:\\
\;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{x}{x + y}}{x + y}}{\frac{y + 1}{y}}\\
\end{array}
\end{array}
if x < -2.09999999999999994e154Initial program 70.4%
associate-*l*70.4%
times-frac87.8%
+-commutative87.8%
+-commutative87.8%
associate-+r+87.8%
+-commutative87.8%
associate-+l+87.8%
Applied egg-rr87.8%
Taylor expanded in x around inf 87.8%
*-un-lft-identity87.8%
associate-/r*91.0%
+-commutative91.0%
+-commutative91.0%
associate-+r+91.0%
+-commutative91.0%
associate-+l+91.0%
Applied egg-rr91.0%
if -2.09999999999999994e154 < x < -1.6e-30Initial program 73.3%
associate-*l*73.3%
times-frac91.0%
+-commutative91.0%
+-commutative91.0%
associate-+r+91.0%
+-commutative91.0%
associate-+l+91.0%
Applied egg-rr91.0%
Taylor expanded in x around inf 84.7%
if -1.6e-30 < x Initial program 67.2%
associate-/l*82.1%
associate-+l+82.1%
Simplified82.1%
clear-num82.1%
associate-+r+82.1%
*-commutative82.1%
distribute-rgt1-in71.3%
cube-mult71.2%
un-div-inv71.3%
cube-mult71.3%
distribute-rgt1-in82.2%
*-commutative82.2%
associate-/l*84.1%
pow284.1%
+-commutative84.1%
Applied egg-rr84.1%
associate-/r*85.0%
+-commutative85.0%
Simplified85.0%
*-un-lft-identity85.0%
unpow285.0%
times-frac99.7%
Applied egg-rr99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 84.5%
Final simplification85.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.8e+125) (/ (* x (/ y (+ x y))) (* (+ x y) (+ y (+ x 1.0)))) (/ (/ (/ x (+ x y)) (+ x y)) (/ (+ y 1.0) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.8e+125) {
tmp = (x * (y / (x + y))) / ((x + y) * (y + (x + 1.0)));
} else {
tmp = ((x / (x + y)) / (x + y)) / ((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.8d+125) then
tmp = (x * (y / (x + y))) / ((x + y) * (y + (x + 1.0d0)))
else
tmp = ((x / (x + y)) / (x + y)) / ((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.8e+125) {
tmp = (x * (y / (x + y))) / ((x + y) * (y + (x + 1.0)));
} else {
tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.8e+125: tmp = (x * (y / (x + y))) / ((x + y) * (y + (x + 1.0))) else: tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.8e+125) tmp = Float64(Float64(x * Float64(y / Float64(x + y))) / Float64(Float64(x + y) * Float64(y + Float64(x + 1.0)))); else tmp = Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + y)) / Float64(Float64(y + 1.0) / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 3.8e+125)
tmp = (x * (y / (x + y))) / ((x + y) * (y + (x + 1.0)));
else
tmp = ((x / (x + y)) / (x + y)) / ((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.8e+125], N[(N[(x * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.8 \cdot 10^{+125}:\\
\;\;\;\;\frac{x \cdot \frac{y}{x + y}}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{x}{x + y}}{x + y}}{\frac{y + 1}{y}}\\
\end{array}
\end{array}
if y < 3.80000000000000002e125Initial program 69.2%
associate-*l*69.2%
times-frac95.0%
+-commutative95.0%
+-commutative95.0%
associate-+r+95.0%
+-commutative95.0%
associate-+l+95.0%
Applied egg-rr95.0%
*-commutative95.0%
associate-/r*99.8%
associate-+r+99.8%
+-commutative99.8%
frac-times95.0%
*-commutative95.0%
+-commutative95.0%
associate-+r+95.0%
distribute-lft-in92.6%
+-commutative92.6%
distribute-lft-in95.0%
Applied egg-rr95.0%
if 3.80000000000000002e125 < y Initial program 61.9%
associate-/l*79.5%
associate-+l+79.5%
Simplified79.5%
clear-num79.5%
associate-+r+79.5%
*-commutative79.5%
distribute-rgt1-in79.5%
cube-mult79.5%
un-div-inv79.5%
cube-mult79.5%
distribute-rgt1-in79.5%
*-commutative79.5%
associate-/l*82.4%
pow282.4%
+-commutative82.4%
Applied egg-rr82.4%
associate-/r*82.4%
+-commutative82.4%
Simplified82.4%
*-un-lft-identity82.4%
unpow282.4%
times-frac99.8%
Applied egg-rr99.8%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 94.1%
Final simplification94.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= y 3.8e+125)
(* t_0 (/ y (* (+ x y) (+ y (+ x 1.0)))))
(/ (/ t_0 (+ x y)) (/ (+ y 1.0) y)))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= 3.8e+125) {
tmp = t_0 * (y / ((x + y) * (y + (x + 1.0))));
} else {
tmp = (t_0 / (x + y)) / ((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 = x / (x + y)
if (y <= 3.8d+125) then
tmp = t_0 * (y / ((x + y) * (y + (x + 1.0d0))))
else
tmp = (t_0 / (x + y)) / ((y + 1.0d0) / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= 3.8e+125) {
tmp = t_0 * (y / ((x + y) * (y + (x + 1.0))));
} else {
tmp = (t_0 / (x + y)) / ((y + 1.0) / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if y <= 3.8e+125: tmp = t_0 * (y / ((x + y) * (y + (x + 1.0)))) else: tmp = (t_0 / (x + y)) / ((y + 1.0) / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= 3.8e+125) tmp = Float64(t_0 * Float64(y / Float64(Float64(x + y) * Float64(y + Float64(x + 1.0))))); else tmp = Float64(Float64(t_0 / Float64(x + y)) / Float64(Float64(y + 1.0) / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (y <= 3.8e+125)
tmp = t_0 * (y / ((x + y) * (y + (x + 1.0))));
else
tmp = (t_0 / (x + y)) / ((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[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.8e+125], N[(t$95$0 * N[(y / N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;y \leq 3.8 \cdot 10^{+125}:\\
\;\;\;\;t\_0 \cdot \frac{y}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_0}{x + y}}{\frac{y + 1}{y}}\\
\end{array}
\end{array}
if y < 3.80000000000000002e125Initial program 69.2%
associate-*l*69.2%
times-frac95.0%
+-commutative95.0%
+-commutative95.0%
associate-+r+95.0%
+-commutative95.0%
associate-+l+95.0%
Applied egg-rr95.0%
if 3.80000000000000002e125 < y Initial program 61.9%
associate-/l*79.5%
associate-+l+79.5%
Simplified79.5%
clear-num79.5%
associate-+r+79.5%
*-commutative79.5%
distribute-rgt1-in79.5%
cube-mult79.5%
un-div-inv79.5%
cube-mult79.5%
distribute-rgt1-in79.5%
*-commutative79.5%
associate-/l*82.4%
pow282.4%
+-commutative82.4%
Applied egg-rr82.4%
associate-/r*82.4%
+-commutative82.4%
Simplified82.4%
*-un-lft-identity82.4%
unpow282.4%
times-frac99.8%
Applied egg-rr99.8%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in x around 0 94.1%
Final simplification94.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 3.5e-160)
(/ (/ y (+ x 1.0)) x)
(if (<= y 2.85e+109)
(/ x (* (+ x y) (+ y (+ x 1.0))))
(* (/ x (+ x y)) (/ 1.0 y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.5e-160) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 2.85e+109) {
tmp = x / ((x + y) * (y + (x + 1.0)));
} else {
tmp = (x / (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-160) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 2.85d+109) then
tmp = x / ((x + y) * (y + (x + 1.0d0)))
else
tmp = (x / (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-160) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 2.85e+109) {
tmp = x / ((x + y) * (y + (x + 1.0)));
} else {
tmp = (x / (x + y)) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.5e-160: tmp = (y / (x + 1.0)) / x elif y <= 2.85e+109: tmp = x / ((x + y) * (y + (x + 1.0))) else: tmp = (x / (x + y)) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.5e-160) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 2.85e+109) tmp = Float64(x / Float64(Float64(x + y) * Float64(y + Float64(x + 1.0)))); else tmp = Float64(Float64(x / 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-160)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 2.85e+109)
tmp = x / ((x + y) * (y + (x + 1.0)));
else
tmp = (x / (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-160], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.85e+109], N[(x / N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $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^{-160}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 2.85 \cdot 10^{+109}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 3.5000000000000003e-160Initial program 65.2%
associate-/l*80.2%
associate-+l+80.2%
Simplified80.2%
clear-num80.2%
associate-+r+80.2%
*-commutative80.2%
distribute-rgt1-in53.9%
cube-mult53.9%
un-div-inv54.0%
cube-mult54.0%
distribute-rgt1-in80.3%
*-commutative80.3%
associate-/l*81.4%
pow281.4%
+-commutative81.4%
Applied egg-rr81.4%
associate-/r*83.6%
+-commutative83.6%
Simplified83.6%
*-un-lft-identity83.6%
unpow283.6%
times-frac99.7%
Applied egg-rr99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in y around 0 51.6%
+-commutative51.6%
Simplified51.6%
*-un-lft-identity51.6%
times-frac53.0%
Applied egg-rr53.0%
associate-*l/53.1%
*-lft-identity53.1%
+-commutative53.1%
Simplified53.1%
if 3.5000000000000003e-160 < y < 2.8500000000000001e109Initial program 82.8%
associate-*l*82.9%
times-frac96.2%
+-commutative96.2%
+-commutative96.2%
associate-+r+96.2%
+-commutative96.2%
associate-+l+96.2%
Applied egg-rr96.2%
*-commutative96.2%
associate-/r*99.8%
associate-+r+99.8%
+-commutative99.8%
frac-times96.2%
*-commutative96.2%
+-commutative96.2%
associate-+r+96.2%
distribute-lft-in94.5%
+-commutative94.5%
distribute-lft-in96.2%
Applied egg-rr96.2%
Taylor expanded in y around inf 75.5%
if 2.8500000000000001e109 < y Initial program 59.2%
associate-*l*59.2%
times-frac82.2%
+-commutative82.2%
+-commutative82.2%
associate-+r+82.2%
+-commutative82.2%
associate-+l+82.2%
Applied egg-rr82.2%
Taylor expanded in y around inf 89.4%
Final simplification63.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4.7e+139) (/ (/ y x) x) (if (<= x -2.8e-153) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.7e+139) {
tmp = (y / x) / x;
} else if (x <= -2.8e-153) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.7d+139)) then
tmp = (y / x) / x
else if (x <= (-2.8d-153)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.7e+139) {
tmp = (y / x) / x;
} else if (x <= -2.8e-153) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.7e+139: tmp = (y / x) / x elif x <= -2.8e-153: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.7e+139) tmp = Float64(Float64(y / x) / x); elseif (x <= -2.8e-153) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.7e+139)
tmp = (y / x) / x;
elseif (x <= -2.8e-153)
tmp = y / (x * (x + 1.0));
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.7e+139], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.8e-153], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{+139}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -4.7000000000000001e139Initial program 71.4%
associate-/l*88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around 0 88.2%
associate-/r*90.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in x around inf 90.8%
if -4.7000000000000001e139 < x < -2.8000000000000001e-153Initial program 78.1%
associate-/l*86.2%
associate-+l+86.2%
Simplified86.2%
Taylor expanded in y around 0 53.2%
if -2.8000000000000001e-153 < x Initial program 64.7%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
Taylor expanded in x around 0 61.0%
+-commutative61.0%
Simplified61.0%
Final simplification63.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.0) (/ (/ y x) x) (if (<= x -2.8e-153) (/ 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) / x;
} else if (x <= -2.8e-153) {
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) / x
else if (x <= (-2.8d-153)) 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) / x;
} else if (x <= -2.8e-153) {
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) / x elif x <= -2.8e-153: 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) / x); elseif (x <= -2.8e-153) 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) / x;
elseif (x <= -2.8e-153)
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] / x), $MachinePrecision], If[LessEqual[x, -2.8e-153], 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{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 70.4%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in y around 0 77.9%
associate-/r*79.3%
+-commutative79.3%
Simplified79.3%
Taylor expanded in x around inf 79.2%
if -1 < x < -2.8000000000000001e-153Initial program 86.1%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 42.5%
associate-/r*42.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in x around 0 42.0%
if -2.8000000000000001e-153 < x Initial program 64.7%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
Taylor expanded in x around 0 61.0%
+-commutative61.0%
Simplified61.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.8e-153) (/ (/ y (+ x 1.0)) x) (* (/ x (+ x y)) (/ 1.0 (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.8e-153) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / (x + y)) * (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 (x <= (-2.8d-153)) then
tmp = (y / (x + 1.0d0)) / x
else
tmp = (x / (x + y)) * (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 (x <= -2.8e-153) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / (x + y)) * (1.0 / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.8e-153: tmp = (y / (x + 1.0)) / x else: tmp = (x / (x + y)) * (1.0 / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.8e-153) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); else tmp = Float64(Float64(x / Float64(x + y)) * 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 (x <= -2.8e-153)
tmp = (y / (x + 1.0)) / x;
else
tmp = (x / (x + y)) * (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[x, -2.8e-153], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / N[(x + y), $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}\;x \leq -2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y + 1}\\
\end{array}
\end{array}
if x < -2.8000000000000001e-153Initial program 75.6%
associate-/l*86.9%
associate-+l+86.9%
Simplified86.9%
clear-num86.9%
associate-+r+86.9%
*-commutative86.9%
distribute-rgt1-in47.0%
cube-mult47.0%
un-div-inv47.1%
cube-mult47.1%
distribute-rgt1-in86.9%
*-commutative86.9%
associate-/l*88.0%
pow288.0%
+-commutative88.0%
Applied egg-rr88.0%
associate-/r*92.3%
+-commutative92.3%
Simplified92.3%
*-un-lft-identity92.3%
unpow292.3%
times-frac99.6%
Applied egg-rr99.6%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in y around 0 66.1%
+-commutative66.1%
Simplified66.1%
*-un-lft-identity66.1%
times-frac66.9%
Applied egg-rr66.9%
associate-*l/67.0%
*-lft-identity67.0%
+-commutative67.0%
Simplified67.0%
if -2.8000000000000001e-153 < x Initial program 64.7%
associate-*l*64.7%
times-frac94.0%
+-commutative94.0%
+-commutative94.0%
associate-+r+94.0%
+-commutative94.0%
associate-+l+94.0%
Applied egg-rr94.0%
Taylor expanded in x around 0 63.4%
+-commutative63.4%
Simplified63.4%
Final simplification64.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.8e-153) (/ (/ y (+ x 1.0)) x) (* (/ 1.0 y) (/ x (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.8e-153) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (1.0 / 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 (x <= (-2.8d-153)) then
tmp = (y / (x + 1.0d0)) / x
else
tmp = (1.0d0 / 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 (x <= -2.8e-153) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (1.0 / y) * (x / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.8e-153: tmp = (y / (x + 1.0)) / x else: tmp = (1.0 / y) * (x / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.8e-153) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); else tmp = Float64(Float64(1.0 / 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 (x <= -2.8e-153)
tmp = (y / (x + 1.0)) / x;
else
tmp = (1.0 / 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[x, -2.8e-153], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(1.0 / 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}\;x \leq -2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -2.8000000000000001e-153Initial program 75.6%
associate-/l*86.9%
associate-+l+86.9%
Simplified86.9%
clear-num86.9%
associate-+r+86.9%
*-commutative86.9%
distribute-rgt1-in47.0%
cube-mult47.0%
un-div-inv47.1%
cube-mult47.1%
distribute-rgt1-in86.9%
*-commutative86.9%
associate-/l*88.0%
pow288.0%
+-commutative88.0%
Applied egg-rr88.0%
associate-/r*92.3%
+-commutative92.3%
Simplified92.3%
*-un-lft-identity92.3%
unpow292.3%
times-frac99.6%
Applied egg-rr99.6%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in y around 0 66.1%
+-commutative66.1%
Simplified66.1%
*-un-lft-identity66.1%
times-frac66.9%
Applied egg-rr66.9%
associate-*l/67.0%
*-lft-identity67.0%
+-commutative67.0%
Simplified67.0%
if -2.8000000000000001e-153 < x Initial program 64.7%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
Taylor expanded in x around 0 61.0%
+-commutative61.0%
Simplified61.0%
*-un-lft-identity61.0%
times-frac62.9%
Applied egg-rr62.9%
Final simplification64.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.8e-153) (/ (/ y (+ x 1.0)) x) (* x (/ (/ 1.0 y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.8e-153) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = x * ((1.0 / 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.8d-153)) then
tmp = (y / (x + 1.0d0)) / x
else
tmp = x * ((1.0d0 / 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.8e-153) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = x * ((1.0 / y) / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.8e-153: tmp = (y / (x + 1.0)) / x else: tmp = x * ((1.0 / y) / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.8e-153) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); else tmp = Float64(x * Float64(Float64(1.0 / 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.8e-153)
tmp = (y / (x + 1.0)) / x;
else
tmp = x * ((1.0 / 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.8e-153], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[(1.0 / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.8000000000000001e-153Initial program 75.6%
associate-/l*86.9%
associate-+l+86.9%
Simplified86.9%
clear-num86.9%
associate-+r+86.9%
*-commutative86.9%
distribute-rgt1-in47.0%
cube-mult47.0%
un-div-inv47.1%
cube-mult47.1%
distribute-rgt1-in86.9%
*-commutative86.9%
associate-/l*88.0%
pow288.0%
+-commutative88.0%
Applied egg-rr88.0%
associate-/r*92.3%
+-commutative92.3%
Simplified92.3%
*-un-lft-identity92.3%
unpow292.3%
times-frac99.6%
Applied egg-rr99.6%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in y around 0 66.1%
+-commutative66.1%
Simplified66.1%
*-un-lft-identity66.1%
times-frac66.9%
Applied egg-rr66.9%
associate-*l/67.0%
*-lft-identity67.0%
+-commutative67.0%
Simplified67.0%
if -2.8000000000000001e-153 < x Initial program 64.7%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
Taylor expanded in x around 0 60.9%
associate-/r*61.4%
+-commutative61.4%
Simplified61.4%
Final simplification63.3%
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) x) (if (<= x -2.7e-153) (/ y x) (/ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -2.7e-153) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-2.7d-153)) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -2.7e-153) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) / x elif x <= -2.7e-153: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -2.7e-153) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = (y / x) / x;
elseif (x <= -2.7e-153)
tmp = y / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.7e-153], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1Initial program 70.4%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in y around 0 77.9%
associate-/r*79.3%
+-commutative79.3%
Simplified79.3%
Taylor expanded in x around inf 79.2%
if -1 < x < -2.70000000000000009e-153Initial program 86.1%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 42.5%
associate-/r*42.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in x around 0 42.0%
if -2.70000000000000009e-153 < x Initial program 64.7%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
Taylor expanded in x around 0 61.0%
+-commutative61.0%
Simplified61.0%
Taylor expanded in y around 0 43.4%
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 x)) (if (<= x -1.05e-153) (/ y x) (/ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -1.05e-153) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-1.05d-153)) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -1.05e-153) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -1.05e-153: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -1.05e-153) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = y / (x * x);
elseif (x <= -1.05e-153)
tmp = y / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.05e-153], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1Initial program 70.4%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
clear-num80.5%
associate-+r+80.5%
*-commutative80.5%
distribute-rgt1-in29.7%
cube-mult29.7%
un-div-inv29.7%
cube-mult29.7%
distribute-rgt1-in80.5%
*-commutative80.5%
associate-/l*82.2%
pow282.2%
+-commutative82.2%
Applied egg-rr82.2%
associate-/r*88.7%
+-commutative88.7%
Simplified88.7%
*-un-lft-identity88.7%
unpow288.7%
times-frac99.6%
Applied egg-rr99.6%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in y around 0 77.9%
+-commutative77.9%
Simplified77.9%
Taylor expanded in x around inf 77.7%
if -1 < x < -1.05000000000000002e-153Initial program 86.1%
associate-/l*99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 42.5%
associate-/r*42.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in x around 0 42.0%
if -1.05000000000000002e-153 < x Initial program 64.7%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
Taylor expanded in x around 0 61.0%
+-commutative61.0%
Simplified61.0%
Taylor expanded in y around 0 43.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.8e-153) (/ (/ y (+ x 1.0)) x) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.8e-153) {
tmp = (y / (x + 1.0)) / 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.8d-153)) then
tmp = (y / (x + 1.0d0)) / 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.8e-153) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.8e-153: tmp = (y / (x + 1.0)) / 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.8e-153) tmp = Float64(Float64(y / Float64(x + 1.0)) / 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 <= -2.8e-153)
tmp = (y / (x + 1.0)) / 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.8e-153], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / 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 -2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -2.8000000000000001e-153Initial program 75.6%
associate-/l*86.9%
associate-+l+86.9%
Simplified86.9%
clear-num86.9%
associate-+r+86.9%
*-commutative86.9%
distribute-rgt1-in47.0%
cube-mult47.0%
un-div-inv47.1%
cube-mult47.1%
distribute-rgt1-in86.9%
*-commutative86.9%
associate-/l*88.0%
pow288.0%
+-commutative88.0%
Applied egg-rr88.0%
associate-/r*92.3%
+-commutative92.3%
Simplified92.3%
*-un-lft-identity92.3%
unpow292.3%
times-frac99.6%
Applied egg-rr99.6%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in y around 0 66.1%
+-commutative66.1%
Simplified66.1%
*-un-lft-identity66.1%
times-frac66.9%
Applied egg-rr66.9%
associate-*l/67.0%
*-lft-identity67.0%
+-commutative67.0%
Simplified67.0%
if -2.8000000000000001e-153 < x Initial program 64.7%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
Taylor expanded in x around 0 61.0%
+-commutative61.0%
Simplified61.0%
Final simplification63.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.8e-153) (/ (/ y x) (+ x 1.0)) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.8e-153) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.8d-153)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.8e-153) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.8e-153: tmp = (y / x) / (x + 1.0) else: tmp = x / (y * (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.8e-153) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.8e-153)
tmp = (y / x) / (x + 1.0);
else
tmp = x / (y * (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.8e-153], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -2.8000000000000001e-153Initial program 75.6%
associate-/l*86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in y around 0 66.1%
associate-/r*67.1%
+-commutative67.1%
Simplified67.1%
if -2.8000000000000001e-153 < x Initial program 64.7%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
Taylor expanded in x around 0 61.0%
+-commutative61.0%
Simplified61.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.4e-153) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.4e-153) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.4d-153)) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.4e-153) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.4e-153: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.4e-153) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.4e-153)
tmp = y / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.4e-153], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -2.4000000000000002e-153Initial program 75.6%
associate-/l*86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in y around 0 66.1%
associate-/r*67.1%
+-commutative67.1%
Simplified67.1%
Taylor expanded in x around 0 36.2%
if -2.4000000000000002e-153 < x Initial program 64.7%
associate-/l*79.6%
associate-+l+79.6%
Simplified79.6%
Taylor expanded in x around 0 61.0%
+-commutative61.0%
Simplified61.0%
Taylor expanded in y around 0 43.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.45e-35) (/ 1.0 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.45e-35) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.45d-35)) then
tmp = 1.0d0 / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.45e-35) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.45e-35: tmp = 1.0 / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.45e-35) tmp = Float64(1.0 / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.45e-35)
tmp = 1.0 / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.45e-35], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{-35}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -2.4500000000000002e-35Initial program 71.8%
associate-/l*81.5%
associate-+l+81.5%
Simplified81.5%
Taylor expanded in x around 0 54.4%
Taylor expanded in x around inf 5.9%
if -2.4500000000000002e-35 < x Initial program 67.2%
associate-/l*82.1%
associate-+l+82.1%
Simplified82.1%
Taylor expanded in x around 0 61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in y around 0 42.5%
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 68.3%
associate-/l*82.0%
associate-+l+82.0%
Simplified82.0%
Taylor expanded in x around 0 63.3%
Taylor expanded in x around inf 3.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 2024135
(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))))