
(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 16 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
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y 1e-159)
(/ (/ y (+ x 1.0)) x)
(if (<= y 2.4e+71)
(* x (/ y (* (* (+ y x) (+ y x)) t_0)))
(/ (/ 1.0 (fma x 2.0 y)) (/ t_0 x))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 1e-159) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 2.4e+71) {
tmp = x * (y / (((y + x) * (y + x)) * t_0));
} else {
tmp = (1.0 / fma(x, 2.0, y)) / (t_0 / x);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 1e-159) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 2.4e+71) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * Float64(y + x)) * t_0))); else tmp = Float64(Float64(1.0 / fma(x, 2.0, y)) / Float64(t_0 / x)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1e-159], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.4e+71], N[(x * N[(y / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x * 2.0 + y), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 / x), $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 10^{-159}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+71}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\mathsf{fma}\left(x, 2, y\right)}}{\frac{t\_0}{x}}\\
\end{array}
\end{array}
if y < 9.99999999999999989e-160Initial program 72.3%
Taylor expanded in y around 0 72.3%
Taylor expanded in y around 0 59.9%
+-commutative59.9%
Simplified59.9%
*-un-lft-identity59.9%
times-frac59.7%
Applied egg-rr59.7%
associate-*l/59.8%
*-lft-identity59.8%
Simplified59.8%
if 9.99999999999999989e-160 < y < 2.39999999999999981e71Initial program 88.4%
associate-/l*91.4%
associate-+l+91.4%
Simplified91.4%
if 2.39999999999999981e71 < y Initial program 49.3%
associate-/l*76.9%
associate-+l+76.9%
Simplified76.9%
Taylor expanded in x around 0 62.9%
associate-*r*62.9%
+-commutative62.9%
unpow262.9%
distribute-rgt-in76.9%
*-commutative76.9%
Simplified76.9%
associate-*r/49.3%
associate-+r+49.3%
*-commutative49.3%
associate-+r+49.3%
+-commutative49.3%
fma-define49.3%
Applied egg-rr49.3%
times-frac85.4%
associate-/r*90.1%
*-inverses90.1%
Simplified90.1%
*-commutative90.1%
clear-num90.0%
un-div-inv90.1%
Applied egg-rr90.1%
Final simplification72.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 (<= y 1.5e-158)
(/ (/ y (+ x 1.0)) x)
(if (<= y 2.4e+71)
(* x (/ y (* (* (+ y x) (+ y x)) t_0)))
(/ (/ x (fma x 2.0 y)) t_0)))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 1.5e-158) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 2.4e+71) {
tmp = x * (y / (((y + x) * (y + x)) * t_0));
} else {
tmp = (x / fma(x, 2.0, y)) / 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.5e-158) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 2.4e+71) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * Float64(y + x)) * t_0))); else tmp = Float64(Float64(x / fma(x, 2.0, y)) / t_0); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.5e-158], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.4e+71], N[(x * N[(y / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x * 2.0 + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $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.5 \cdot 10^{-158}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+71}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{fma}\left(x, 2, y\right)}}{t\_0}\\
\end{array}
\end{array}
if y < 1.5e-158Initial program 72.3%
Taylor expanded in y around 0 72.3%
Taylor expanded in y around 0 59.9%
+-commutative59.9%
Simplified59.9%
*-un-lft-identity59.9%
times-frac59.7%
Applied egg-rr59.7%
associate-*l/59.8%
*-lft-identity59.8%
Simplified59.8%
if 1.5e-158 < y < 2.39999999999999981e71Initial program 88.4%
associate-/l*91.4%
associate-+l+91.4%
Simplified91.4%
if 2.39999999999999981e71 < y Initial program 49.3%
associate-/l*76.9%
associate-+l+76.9%
Simplified76.9%
Taylor expanded in x around 0 62.9%
associate-*r*62.9%
+-commutative62.9%
unpow262.9%
distribute-rgt-in76.9%
*-commutative76.9%
Simplified76.9%
associate-*r/49.3%
associate-+r+49.3%
*-commutative49.3%
associate-+r+49.3%
+-commutative49.3%
fma-define49.3%
Applied egg-rr49.3%
times-frac85.4%
associate-/r*90.1%
*-inverses90.1%
Simplified90.1%
associate-*l/90.1%
un-div-inv90.1%
Applied egg-rr90.1%
Final simplification72.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= y 6.8e-112)
t_0
(if (<= y 4.6e-24)
(/ x y)
(if (<= y 880000.0)
t_0
(if (<= y 6e+147) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= 6.8e-112) {
tmp = t_0;
} else if (y <= 4.6e-24) {
tmp = x / y;
} else if (y <= 880000.0) {
tmp = t_0;
} else if (y <= 6e+147) {
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) :: t_0
real(8) :: tmp
t_0 = y / (x * (x + 1.0d0))
if (y <= 6.8d-112) then
tmp = t_0
else if (y <= 4.6d-24) then
tmp = x / y
else if (y <= 880000.0d0) then
tmp = t_0
else if (y <= 6d+147) 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 t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= 6.8e-112) {
tmp = t_0;
} else if (y <= 4.6e-24) {
tmp = x / y;
} else if (y <= 880000.0) {
tmp = t_0;
} else if (y <= 6e+147) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if y <= 6.8e-112: tmp = t_0 elif y <= 4.6e-24: tmp = x / y elif y <= 880000.0: tmp = t_0 elif y <= 6e+147: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (y <= 6.8e-112) tmp = t_0; elseif (y <= 4.6e-24) tmp = Float64(x / y); elseif (y <= 880000.0) tmp = t_0; elseif (y <= 6e+147) 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)
t_0 = y / (x * (x + 1.0));
tmp = 0.0;
if (y <= 6.8e-112)
tmp = t_0;
elseif (y <= 4.6e-24)
tmp = x / y;
elseif (y <= 880000.0)
tmp = t_0;
elseif (y <= 6e+147)
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_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.8e-112], t$95$0, If[LessEqual[y, 4.6e-24], N[(x / y), $MachinePrecision], If[LessEqual[y, 880000.0], t$95$0, If[LessEqual[y, 6e+147], 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}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;y \leq 6.8 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 880000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+147}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 6.7999999999999996e-112 or 4.6000000000000002e-24 < y < 8.8e5Initial program 73.4%
associate-/l*85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in y around 0 60.7%
if 6.7999999999999996e-112 < y < 4.6000000000000002e-24Initial program 99.5%
associate-/l*96.7%
associate-+l+96.7%
Simplified96.7%
Taylor expanded in x around 0 32.3%
+-commutative32.3%
Simplified32.3%
Taylor expanded in y around 0 32.3%
if 8.8e5 < y < 5.99999999999999987e147Initial program 63.3%
associate-/l*72.3%
associate-+l+72.3%
Simplified72.3%
Taylor expanded in x around 0 64.2%
+-commutative64.2%
Simplified64.2%
if 5.99999999999999987e147 < y Initial program 49.1%
associate-/l*81.6%
associate-+l+81.6%
Simplified81.6%
Taylor expanded in x around 0 81.6%
+-commutative81.6%
Simplified81.6%
*-un-lft-identity81.6%
*-commutative81.6%
times-frac92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 92.3%
Final simplification65.5%
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 2e-159)
(/ (/ y (+ x 1.0)) x)
(if (<= y 6.8e+76)
(* x (/ y (* (* (+ y x) (+ y x)) t_0)))
(* (/ x t_0) (/ (+ 1.0 (* -2.0 (/ x y))) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2e-159) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 6.8e+76) {
tmp = x * (y / (((y + x) * (y + x)) * t_0));
} else {
tmp = (x / t_0) * ((1.0 + (-2.0 * (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) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= 2d-159) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 6.8d+76) then
tmp = x * (y / (((y + x) * (y + x)) * t_0))
else
tmp = (x / t_0) * ((1.0d0 + ((-2.0d0) * (x / y))) / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2e-159) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 6.8e+76) {
tmp = x * (y / (((y + x) * (y + x)) * t_0));
} else {
tmp = (x / t_0) * ((1.0 + (-2.0 * (x / y))) / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 2e-159: tmp = (y / (x + 1.0)) / x elif y <= 6.8e+76: tmp = x * (y / (((y + x) * (y + x)) * t_0)) else: tmp = (x / t_0) * ((1.0 + (-2.0 * (x / y))) / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 2e-159) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 6.8e+76) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * Float64(y + x)) * t_0))); else tmp = Float64(Float64(x / t_0) * Float64(Float64(1.0 + Float64(-2.0 * Float64(x / y))) / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (y <= 2e-159)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 6.8e+76)
tmp = x * (y / (((y + x) * (y + x)) * t_0));
else
tmp = (x / t_0) * ((1.0 + (-2.0 * (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_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2e-159], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 6.8e+76], N[(x * N[(y / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] * N[(N[(1.0 + N[(-2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $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}\;y \leq 2 \cdot 10^{-159}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+76}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t\_0} \cdot \frac{1 + -2 \cdot \frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 1.99999999999999998e-159Initial program 72.3%
Taylor expanded in y around 0 72.3%
Taylor expanded in y around 0 59.9%
+-commutative59.9%
Simplified59.9%
*-un-lft-identity59.9%
times-frac59.7%
Applied egg-rr59.7%
associate-*l/59.8%
*-lft-identity59.8%
Simplified59.8%
if 1.99999999999999998e-159 < y < 6.7999999999999994e76Initial program 88.4%
associate-/l*91.4%
associate-+l+91.4%
Simplified91.4%
if 6.7999999999999994e76 < y Initial program 49.3%
associate-/l*76.9%
associate-+l+76.9%
Simplified76.9%
Taylor expanded in x around 0 62.9%
associate-*r*62.9%
+-commutative62.9%
unpow262.9%
distribute-rgt-in76.9%
*-commutative76.9%
Simplified76.9%
associate-*r/49.3%
associate-+r+49.3%
*-commutative49.3%
associate-+r+49.3%
+-commutative49.3%
fma-define49.3%
Applied egg-rr49.3%
times-frac85.4%
associate-/r*90.1%
*-inverses90.1%
Simplified90.1%
Taylor expanded in y around inf 89.6%
Final simplification72.5%
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.8e-159)
(/ (/ y (+ x 1.0)) x)
(if (<= y 2.5e+99)
(* x (/ y (* (* (+ y x) (+ y x)) t_0)))
(/ (/ 1.0 y) (/ t_0 x))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 1.8e-159) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 2.5e+99) {
tmp = x * (y / (((y + x) * (y + x)) * t_0));
} else {
tmp = (1.0 / y) / (t_0 / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= 1.8d-159) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 2.5d+99) then
tmp = x * (y / (((y + x) * (y + x)) * t_0))
else
tmp = (1.0d0 / y) / (t_0 / x)
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.8e-159) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 2.5e+99) {
tmp = x * (y / (((y + x) * (y + x)) * t_0));
} else {
tmp = (1.0 / y) / (t_0 / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 1.8e-159: tmp = (y / (x + 1.0)) / x elif y <= 2.5e+99: tmp = x * (y / (((y + x) * (y + x)) * t_0)) else: tmp = (1.0 / y) / (t_0 / x) 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.8e-159) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 2.5e+99) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * Float64(y + x)) * t_0))); else tmp = Float64(Float64(1.0 / y) / Float64(t_0 / x)); 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.8e-159)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 2.5e+99)
tmp = x * (y / (((y + x) * (y + x)) * t_0));
else
tmp = (1.0 / y) / (t_0 / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.8e-159], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.5e+99], N[(x * N[(y / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] / N[(t$95$0 / x), $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.8 \cdot 10^{-159}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y}}{\frac{t\_0}{x}}\\
\end{array}
\end{array}
if y < 1.80000000000000011e-159Initial program 72.3%
Taylor expanded in y around 0 72.3%
Taylor expanded in y around 0 59.9%
+-commutative59.9%
Simplified59.9%
*-un-lft-identity59.9%
times-frac59.7%
Applied egg-rr59.7%
associate-*l/59.8%
*-lft-identity59.8%
Simplified59.8%
if 1.80000000000000011e-159 < y < 2.50000000000000004e99Initial program 86.5%
associate-/l*89.5%
associate-+l+89.5%
Simplified89.5%
if 2.50000000000000004e99 < y Initial program 49.9%
associate-/l*78.0%
associate-+l+78.0%
Simplified78.0%
Taylor expanded in x around 0 63.8%
associate-*r*63.8%
+-commutative63.8%
unpow263.8%
distribute-rgt-in78.0%
*-commutative78.0%
Simplified78.0%
associate-*r/49.9%
associate-+r+49.9%
*-commutative49.9%
associate-+r+49.9%
+-commutative49.9%
fma-define49.9%
Applied egg-rr49.9%
times-frac86.6%
associate-/r*91.4%
*-inverses91.4%
Simplified91.4%
*-commutative91.4%
clear-num91.3%
un-div-inv91.4%
Applied egg-rr91.4%
Taylor expanded in x around 0 90.1%
Final simplification72.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y 2.2e-157)
(/ (/ y (+ x 1.0)) x)
(if (<= y 2.5e+99)
(* x (/ y (* t_0 (* y (+ y (* x 2.0))))))
(/ (/ 1.0 y) (/ t_0 x))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2.2e-157) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 2.5e+99) {
tmp = x * (y / (t_0 * (y * (y + (x * 2.0)))));
} else {
tmp = (1.0 / y) / (t_0 / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= 2.2d-157) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 2.5d+99) then
tmp = x * (y / (t_0 * (y * (y + (x * 2.0d0)))))
else
tmp = (1.0d0 / y) / (t_0 / x)
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.2e-157) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 2.5e+99) {
tmp = x * (y / (t_0 * (y * (y + (x * 2.0)))));
} else {
tmp = (1.0 / y) / (t_0 / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 2.2e-157: tmp = (y / (x + 1.0)) / x elif y <= 2.5e+99: tmp = x * (y / (t_0 * (y * (y + (x * 2.0))))) else: tmp = (1.0 / y) / (t_0 / x) 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.2e-157) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 2.5e+99) tmp = Float64(x * Float64(y / Float64(t_0 * Float64(y * Float64(y + Float64(x * 2.0)))))); else tmp = Float64(Float64(1.0 / y) / Float64(t_0 / x)); 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.2e-157)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 2.5e+99)
tmp = x * (y / (t_0 * (y * (y + (x * 2.0)))));
else
tmp = (1.0 / y) / (t_0 / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.2e-157], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.5e+99], N[(x * N[(y / N[(t$95$0 * N[(y * N[(y + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] / N[(t$95$0 / x), $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.2 \cdot 10^{-157}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \frac{y}{t\_0 \cdot \left(y \cdot \left(y + x \cdot 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y}}{\frac{t\_0}{x}}\\
\end{array}
\end{array}
if y < 2.2000000000000001e-157Initial program 72.3%
Taylor expanded in y around 0 72.3%
Taylor expanded in y around 0 59.9%
+-commutative59.9%
Simplified59.9%
*-un-lft-identity59.9%
times-frac59.7%
Applied egg-rr59.7%
associate-*l/59.8%
*-lft-identity59.8%
Simplified59.8%
if 2.2000000000000001e-157 < y < 2.50000000000000004e99Initial program 86.5%
associate-/l*89.5%
associate-+l+89.5%
Simplified89.5%
Taylor expanded in x around 0 67.6%
associate-*r*67.6%
+-commutative67.6%
unpow267.6%
distribute-rgt-in67.6%
*-commutative67.6%
Simplified67.6%
if 2.50000000000000004e99 < y Initial program 49.9%
associate-/l*78.0%
associate-+l+78.0%
Simplified78.0%
Taylor expanded in x around 0 63.8%
associate-*r*63.8%
+-commutative63.8%
unpow263.8%
distribute-rgt-in78.0%
*-commutative78.0%
Simplified78.0%
associate-*r/49.9%
associate-+r+49.9%
*-commutative49.9%
associate-+r+49.9%
+-commutative49.9%
fma-define49.9%
Applied egg-rr49.9%
times-frac86.6%
associate-/r*91.4%
*-inverses91.4%
Simplified91.4%
*-commutative91.4%
clear-num91.3%
un-div-inv91.4%
Applied egg-rr91.4%
Taylor expanded in x around 0 90.1%
Final simplification68.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 (<= y 6.8e-112)
(/ (/ y (+ x 1.0)) x)
(if (<= y 4.5e-24)
(/ (/ x y) t_0)
(if (<= y 3800000.0) (/ (/ y x) (+ x 1.0)) (/ (/ 1.0 y) (/ t_0 x)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 6.8e-112) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 4.5e-24) {
tmp = (x / y) / t_0;
} else if (y <= 3800000.0) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (1.0 / y) / (t_0 / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= 6.8d-112) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 4.5d-24) then
tmp = (x / y) / t_0
else if (y <= 3800000.0d0) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (1.0d0 / y) / (t_0 / x)
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-112) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 4.5e-24) {
tmp = (x / y) / t_0;
} else if (y <= 3800000.0) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (1.0 / y) / (t_0 / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 6.8e-112: tmp = (y / (x + 1.0)) / x elif y <= 4.5e-24: tmp = (x / y) / t_0 elif y <= 3800000.0: tmp = (y / x) / (x + 1.0) else: tmp = (1.0 / y) / (t_0 / x) 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-112) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 4.5e-24) tmp = Float64(Float64(x / y) / t_0); elseif (y <= 3800000.0) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(1.0 / y) / Float64(t_0 / x)); 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-112)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 4.5e-24)
tmp = (x / y) / t_0;
elseif (y <= 3800000.0)
tmp = (y / x) / (x + 1.0);
else
tmp = (1.0 / y) / (t_0 / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.8e-112], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 4.5e-24], N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y, 3800000.0], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] / N[(t$95$0 / x), $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^{-112}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-24}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\
\mathbf{elif}\;y \leq 3800000:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y}}{\frac{t\_0}{x}}\\
\end{array}
\end{array}
if y < 6.7999999999999996e-112Initial program 72.4%
Taylor expanded in y around 0 72.4%
Taylor expanded in y around 0 60.2%
+-commutative60.2%
Simplified60.2%
*-un-lft-identity60.2%
times-frac60.0%
Applied egg-rr60.0%
associate-*l/60.1%
*-lft-identity60.1%
Simplified60.1%
if 6.7999999999999996e-112 < y < 4.4999999999999997e-24Initial program 99.5%
associate-/l*96.7%
associate-+l+96.7%
Simplified96.7%
Taylor expanded in x around 0 69.9%
associate-*r*69.9%
+-commutative69.9%
unpow269.9%
distribute-rgt-in69.9%
*-commutative69.9%
Simplified69.9%
associate-*r/70.0%
associate-+r+70.0%
*-commutative70.0%
associate-+r+70.0%
+-commutative70.0%
fma-define70.0%
Applied egg-rr70.0%
times-frac33.9%
associate-/r*34.1%
*-inverses34.1%
Simplified34.1%
associate-*l/34.1%
un-div-inv34.2%
Applied egg-rr34.2%
Taylor expanded in x around 0 32.9%
if 4.4999999999999997e-24 < y < 3.8e6Initial program 97.4%
associate-/l*97.4%
associate-+l+97.4%
Simplified97.4%
Taylor expanded in y around 0 72.2%
associate-/r*72.2%
+-commutative72.2%
Simplified72.2%
if 3.8e6 < y Initial program 55.1%
associate-/l*77.7%
associate-+l+77.7%
Simplified77.7%
Taylor expanded in x around 0 63.8%
associate-*r*63.8%
+-commutative63.8%
unpow263.8%
distribute-rgt-in75.2%
*-commutative75.2%
Simplified75.2%
associate-*r/52.6%
associate-+r+52.6%
*-commutative52.6%
associate-+r+52.6%
+-commutative52.6%
fma-define52.6%
Applied egg-rr52.6%
times-frac78.6%
associate-/r*82.4%
*-inverses82.4%
Simplified82.4%
*-commutative82.4%
clear-num82.4%
un-div-inv82.5%
Applied egg-rr82.5%
Taylor expanded in x around 0 80.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 6.8e-112)
(/ (/ y (+ x 1.0)) x)
(if (or (<= y 5.2e-24) (not (<= y 4200000.0)))
(/ (/ x y) (+ x (+ y 1.0)))
(/ (/ y x) (+ x 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 6.8e-112) {
tmp = (y / (x + 1.0)) / x;
} else if ((y <= 5.2e-24) || !(y <= 4200000.0)) {
tmp = (x / y) / (x + (y + 1.0));
} else {
tmp = (y / x) / (x + 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 <= 6.8d-112) then
tmp = (y / (x + 1.0d0)) / x
else if ((y <= 5.2d-24) .or. (.not. (y <= 4200000.0d0))) then
tmp = (x / y) / (x + (y + 1.0d0))
else
tmp = (y / x) / (x + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 6.8e-112) {
tmp = (y / (x + 1.0)) / x;
} else if ((y <= 5.2e-24) || !(y <= 4200000.0)) {
tmp = (x / y) / (x + (y + 1.0));
} else {
tmp = (y / x) / (x + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 6.8e-112: tmp = (y / (x + 1.0)) / x elif (y <= 5.2e-24) or not (y <= 4200000.0): tmp = (x / y) / (x + (y + 1.0)) else: tmp = (y / x) / (x + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 6.8e-112) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif ((y <= 5.2e-24) || !(y <= 4200000.0)) tmp = Float64(Float64(x / y) / Float64(x + Float64(y + 1.0))); else tmp = Float64(Float64(y / x) / Float64(x + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 6.8e-112)
tmp = (y / (x + 1.0)) / x;
elseif ((y <= 5.2e-24) || ~((y <= 4200000.0)))
tmp = (x / y) / (x + (y + 1.0));
else
tmp = (y / x) / (x + 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, 6.8e-112], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[Or[LessEqual[y, 5.2e-24], N[Not[LessEqual[y, 4200000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.8 \cdot 10^{-112}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-24} \lor \neg \left(y \leq 4200000\right):\\
\;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\end{array}
\end{array}
if y < 6.7999999999999996e-112Initial program 72.4%
Taylor expanded in y around 0 72.4%
Taylor expanded in y around 0 60.2%
+-commutative60.2%
Simplified60.2%
*-un-lft-identity60.2%
times-frac60.0%
Applied egg-rr60.0%
associate-*l/60.1%
*-lft-identity60.1%
Simplified60.1%
if 6.7999999999999996e-112 < y < 5.2e-24 or 4.2e6 < y Initial program 61.2%
associate-/l*80.3%
associate-+l+80.3%
Simplified80.3%
Taylor expanded in x around 0 64.6%
associate-*r*64.6%
+-commutative64.6%
unpow264.6%
distribute-rgt-in74.5%
*-commutative74.5%
Simplified74.5%
associate-*r/55.0%
associate-+r+55.0%
*-commutative55.0%
associate-+r+55.0%
+-commutative55.0%
fma-define55.0%
Applied egg-rr55.0%
times-frac72.4%
associate-/r*75.7%
*-inverses75.7%
Simplified75.7%
associate-*l/75.7%
un-div-inv75.7%
Applied egg-rr75.7%
Taylor expanded in x around 0 74.2%
if 5.2e-24 < y < 4.2e6Initial program 97.4%
associate-/l*97.4%
associate-+l+97.4%
Simplified97.4%
Taylor expanded in y around 0 72.2%
associate-/r*72.2%
+-commutative72.2%
Simplified72.2%
Final simplification65.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 6.8e-112)
(/ (/ y (+ x 1.0)) x)
(if (<= y 4.4e-24)
(/ x y)
(if (<= y 3200000.0) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 6.8e-112) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 4.4e-24) {
tmp = x / y;
} else if (y <= 3200000.0) {
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 <= 6.8d-112) then
tmp = (y / (x + 1.0d0)) / x
else if (y <= 4.4d-24) then
tmp = x / y
else if (y <= 3200000.0d0) 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 <= 6.8e-112) {
tmp = (y / (x + 1.0)) / x;
} else if (y <= 4.4e-24) {
tmp = x / y;
} else if (y <= 3200000.0) {
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 <= 6.8e-112: tmp = (y / (x + 1.0)) / x elif y <= 4.4e-24: tmp = x / y elif y <= 3200000.0: 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 <= 6.8e-112) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); elseif (y <= 4.4e-24) tmp = Float64(x / y); elseif (y <= 3200000.0) 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 <= 6.8e-112)
tmp = (y / (x + 1.0)) / x;
elseif (y <= 4.4e-24)
tmp = x / y;
elseif (y <= 3200000.0)
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, 6.8e-112], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 4.4e-24], N[(x / y), $MachinePrecision], If[LessEqual[y, 3200000.0], 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 6.8 \cdot 10^{-112}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 3200000:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 6.7999999999999996e-112Initial program 72.4%
Taylor expanded in y around 0 72.4%
Taylor expanded in y around 0 60.2%
+-commutative60.2%
Simplified60.2%
*-un-lft-identity60.2%
times-frac60.0%
Applied egg-rr60.0%
associate-*l/60.1%
*-lft-identity60.1%
Simplified60.1%
if 6.7999999999999996e-112 < y < 4.40000000000000003e-24Initial program 99.5%
associate-/l*96.7%
associate-+l+96.7%
Simplified96.7%
Taylor expanded in x around 0 32.3%
+-commutative32.3%
Simplified32.3%
Taylor expanded in y around 0 32.3%
if 4.40000000000000003e-24 < y < 3.2e6Initial program 97.4%
associate-/l*97.4%
associate-+l+97.4%
Simplified97.4%
Taylor expanded in y around 0 72.2%
associate-/r*72.2%
+-commutative72.2%
Simplified72.2%
if 3.2e6 < y Initial program 55.1%
associate-/l*77.7%
associate-+l+77.7%
Simplified77.7%
Taylor expanded in x around 0 74.3%
+-commutative74.3%
Simplified74.3%
*-un-lft-identity74.3%
*-commutative74.3%
times-frac80.4%
Applied egg-rr80.4%
associate-*l/80.5%
*-un-lft-identity80.5%
Applied egg-rr80.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ y x) (+ x 1.0))))
(if (<= y 6.5e-112)
t_0
(if (<= y 5e-24) (/ x y) (if (<= y 45000.0) t_0 (/ (/ x y) (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / x) / (x + 1.0);
double tmp;
if (y <= 6.5e-112) {
tmp = t_0;
} else if (y <= 5e-24) {
tmp = x / y;
} else if (y <= 45000.0) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (y / x) / (x + 1.0d0)
if (y <= 6.5d-112) then
tmp = t_0
else if (y <= 5d-24) then
tmp = x / y
else if (y <= 45000.0d0) then
tmp = t_0
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 t_0 = (y / x) / (x + 1.0);
double tmp;
if (y <= 6.5e-112) {
tmp = t_0;
} else if (y <= 5e-24) {
tmp = x / y;
} else if (y <= 45000.0) {
tmp = t_0;
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / x) / (x + 1.0) tmp = 0 if y <= 6.5e-112: tmp = t_0 elif y <= 5e-24: tmp = x / y elif y <= 45000.0: tmp = t_0 else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / x) / Float64(x + 1.0)) tmp = 0.0 if (y <= 6.5e-112) tmp = t_0; elseif (y <= 5e-24) tmp = Float64(x / y); elseif (y <= 45000.0) tmp = t_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)
t_0 = (y / x) / (x + 1.0);
tmp = 0.0;
if (y <= 6.5e-112)
tmp = t_0;
elseif (y <= 5e-24)
tmp = x / y;
elseif (y <= 45000.0)
tmp = t_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_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.5e-112], t$95$0, If[LessEqual[y, 5e-24], N[(x / y), $MachinePrecision], If[LessEqual[y, 45000.0], t$95$0, N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x}}{x + 1}\\
\mathbf{if}\;y \leq 6.5 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 45000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 6.49999999999999956e-112 or 4.9999999999999998e-24 < y < 45000Initial program 73.4%
associate-/l*85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in y around 0 60.7%
associate-/r*60.6%
+-commutative60.6%
Simplified60.6%
if 6.49999999999999956e-112 < y < 4.9999999999999998e-24Initial program 99.5%
associate-/l*96.7%
associate-+l+96.7%
Simplified96.7%
Taylor expanded in x around 0 32.3%
+-commutative32.3%
Simplified32.3%
Taylor expanded in y around 0 32.3%
if 45000 < y Initial program 55.1%
associate-/l*77.7%
associate-+l+77.7%
Simplified77.7%
Taylor expanded in x around 0 74.3%
+-commutative74.3%
Simplified74.3%
*-un-lft-identity74.3%
*-commutative74.3%
times-frac80.4%
Applied egg-rr80.4%
associate-*l/80.5%
*-un-lft-identity80.5%
Applied egg-rr80.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.8e-201) (/ y x) (if (<= y 6e+147) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.8e-201) {
tmp = y / x;
} else if (y <= 6e+147) {
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.8d-201) then
tmp = y / x
else if (y <= 6d+147) 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.8e-201) {
tmp = y / x;
} else if (y <= 6e+147) {
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.8e-201: tmp = y / x elif y <= 6e+147: 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.8e-201) tmp = Float64(y / x); elseif (y <= 6e+147) 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.8e-201)
tmp = y / x;
elseif (y <= 6e+147)
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.8e-201], N[(y / x), $MachinePrecision], If[LessEqual[y, 6e+147], 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.8 \cdot 10^{-201}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+147}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 3.8e-201Initial program 72.3%
associate-/l*84.8%
associate-+l+84.8%
Simplified84.8%
Taylor expanded in y around 0 59.4%
associate-/r*59.3%
+-commutative59.3%
Simplified59.3%
Taylor expanded in x around 0 34.5%
if 3.8e-201 < y < 5.99999999999999987e147Initial program 76.1%
associate-/l*82.8%
associate-+l+82.8%
Simplified82.8%
Taylor expanded in x around 0 48.9%
+-commutative48.9%
Simplified48.9%
if 5.99999999999999987e147 < y Initial program 49.1%
associate-/l*81.6%
associate-+l+81.6%
Simplified81.6%
Taylor expanded in x around 0 81.6%
+-commutative81.6%
Simplified81.6%
*-un-lft-identity81.6%
*-commutative81.6%
times-frac92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 92.3%
Final simplification48.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.8e-201) (/ y x) (if (<= y 1.0) (/ x y) (* (/ x y) (/ 1.0 y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.8e-201) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} 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.8d-201) then
tmp = y / x
else if (y <= 1.0d0) then
tmp = x / y
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.8e-201) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.8e-201: tmp = y / x elif y <= 1.0: tmp = x / y else: tmp = (x / y) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.8e-201) tmp = Float64(y / x); elseif (y <= 1.0) tmp = Float64(x / y); 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.8e-201)
tmp = y / x;
elseif (y <= 1.0)
tmp = x / y;
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.8e-201], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $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.8 \cdot 10^{-201}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 3.8e-201Initial program 72.3%
associate-/l*84.8%
associate-+l+84.8%
Simplified84.8%
Taylor expanded in y around 0 59.4%
associate-/r*59.3%
+-commutative59.3%
Simplified59.3%
Taylor expanded in x around 0 34.5%
if 3.8e-201 < y < 1Initial program 90.2%
associate-/l*94.5%
associate-+l+94.5%
Simplified94.5%
Taylor expanded in x around 0 32.6%
+-commutative32.6%
Simplified32.6%
Taylor expanded in y around 0 29.5%
if 1 < y Initial program 55.6%
associate-/l*77.9%
associate-+l+77.9%
Simplified77.9%
Taylor expanded in x around 0 73.4%
+-commutative73.4%
Simplified73.4%
*-un-lft-identity73.4%
*-commutative73.4%
times-frac79.5%
Applied egg-rr79.5%
Taylor expanded in y around inf 78.8%
Final simplification48.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 6.8e-112) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 6.8e-112) {
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 <= 6.8d-112) 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 <= 6.8e-112) {
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 <= 6.8e-112: 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 <= 6.8e-112) 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 <= 6.8e-112)
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, 6.8e-112], 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 6.8 \cdot 10^{-112}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 6.7999999999999996e-112Initial program 72.4%
associate-/l*85.1%
associate-+l+85.1%
Simplified85.1%
Taylor expanded in y around 0 60.2%
if 6.7999999999999996e-112 < y Initial program 63.7%
associate-/l*81.5%
associate-+l+81.5%
Simplified81.5%
Taylor expanded in x around 0 65.8%
+-commutative65.8%
Simplified65.8%
*-un-lft-identity65.8%
*-commutative65.8%
times-frac70.7%
Applied egg-rr70.7%
associate-*l/70.8%
*-un-lft-identity70.8%
Applied egg-rr70.8%
Final simplification64.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.2e-189) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.2e-189) {
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 <= (-3.2d-189)) 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 <= -3.2e-189) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.2e-189: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.2e-189) 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 <= -3.2e-189)
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, -3.2e-189], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-189}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -3.2000000000000001e-189Initial program 65.1%
associate-/l*80.5%
associate-+l+80.5%
Simplified80.5%
Taylor expanded in y around 0 59.2%
associate-/r*56.0%
+-commutative56.0%
Simplified56.0%
Taylor expanded in x around 0 27.1%
if -3.2000000000000001e-189 < x Initial program 71.5%
associate-/l*85.8%
associate-+l+85.8%
Simplified85.8%
Taylor expanded in x around 0 55.2%
+-commutative55.2%
Simplified55.2%
Taylor expanded in y around 0 38.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.5e+16) (/ 0.5 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.5e+16) {
tmp = 0.5 / 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.5d+16)) then
tmp = 0.5d0 / 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.5e+16) {
tmp = 0.5 / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.5e+16: tmp = 0.5 / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.5e+16) tmp = Float64(0.5 / 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.5e+16)
tmp = 0.5 / 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.5e+16], N[(0.5 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+16}:\\
\;\;\;\;\frac{0.5}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -2.5e16Initial program 55.2%
associate-/l*75.9%
associate-+l+75.9%
Simplified75.9%
Taylor expanded in x around 0 44.3%
associate-*r*44.3%
+-commutative44.3%
unpow244.3%
distribute-rgt-in57.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in x around inf 6.0%
if -2.5e16 < x Initial program 74.4%
associate-/l*86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 35.2%
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 69.0%
associate-/l*83.7%
associate-+l+83.7%
Simplified83.7%
Taylor expanded in x around 0 59.6%
associate-*r*59.6%
+-commutative59.6%
unpow259.6%
distribute-rgt-in63.2%
*-commutative63.2%
Simplified63.2%
Taylor expanded in x around inf 4.2%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2024087
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))