
(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 (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
return ((x / (x + y)) / (x + y)) * (y / (x + (y + 1.0)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / (x + y)) / (x + y)) * (y / (x + (y + 1.0d0)))
end function
assert x < y;
public static double code(double x, double y) {
return ((x / (x + y)) / (x + y)) * (y / (x + (y + 1.0)));
}
[x, y] = sort([x, y]) def code(x, y): return ((x / (x + y)) / (x + y)) * (y / (x + (y + 1.0)))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + y)) * Float64(y / Float64(x + Float64(y + 1.0)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((x / (x + y)) / (x + y)) * (y / (x + (y + 1.0)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{x + y}}{x + y} \cdot \frac{y}{x + \left(y + 1\right)}
\end{array}
Initial program 69.4%
times-frac89.9%
/-rgt-identity89.9%
associate-/l/89.9%
*-lft-identity89.9%
associate-+l+89.9%
Simplified89.9%
associate-/r*99.8%
div-inv99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= y 2.5e-46)
(/ (* t_0 (/ y (+ x 1.0))) (+ x y))
(if (<= y 1.35e+154)
(* (/ y (+ x (+ y 1.0))) (/ x (* (+ x y) (+ x y))))
(/ t_0 (+ x y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= 2.5e-46) {
tmp = (t_0 * (y / (x + 1.0))) / (x + y);
} else if (y <= 1.35e+154) {
tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)));
} else {
tmp = t_0 / (x + y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (y <= 2.5d-46) then
tmp = (t_0 * (y / (x + 1.0d0))) / (x + y)
else if (y <= 1.35d+154) then
tmp = (y / (x + (y + 1.0d0))) * (x / ((x + y) * (x + y)))
else
tmp = t_0 / (x + 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 <= 2.5e-46) {
tmp = (t_0 * (y / (x + 1.0))) / (x + y);
} else if (y <= 1.35e+154) {
tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)));
} else {
tmp = t_0 / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if y <= 2.5e-46: tmp = (t_0 * (y / (x + 1.0))) / (x + y) elif y <= 1.35e+154: tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y))) else: tmp = t_0 / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= 2.5e-46) tmp = Float64(Float64(t_0 * Float64(y / Float64(x + 1.0))) / Float64(x + y)); elseif (y <= 1.35e+154) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(x / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(t_0 / Float64(x + 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 <= 2.5e-46)
tmp = (t_0 * (y / (x + 1.0))) / (x + y);
elseif (y <= 1.35e+154)
tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)));
else
tmp = t_0 / (x + y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.5e-46], N[(N[(t$95$0 * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(x + 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 2.5 \cdot 10^{-46}:\\
\;\;\;\;\frac{t_0 \cdot \frac{y}{x + 1}}{x + y}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{x + y}\\
\end{array}
\end{array}
if y < 2.49999999999999996e-46Initial program 70.7%
Taylor expanded in y around 0 65.7%
+-commutative65.7%
Simplified65.7%
*-un-lft-identity65.7%
associate-*l*65.7%
times-frac62.6%
Applied egg-rr62.6%
associate-*l/62.7%
*-lft-identity62.7%
times-frac83.9%
Simplified83.9%
if 2.49999999999999996e-46 < y < 1.35000000000000003e154Initial program 75.8%
times-frac94.0%
/-rgt-identity94.0%
associate-/l/94.0%
*-lft-identity94.0%
associate-+l+94.0%
Simplified94.0%
if 1.35000000000000003e154 < y Initial program 53.7%
times-frac82.4%
/-rgt-identity82.4%
associate-/l/82.4%
*-lft-identity82.4%
associate-+l+82.4%
Simplified82.4%
associate-/r*99.8%
div-inv99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around inf 84.6%
Final simplification86.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 5.2e-128)
(* (/ 1.0 (+ 1.0 (+ x y))) (/ y x))
(if (<= y 2.5e-18)
(/ (* x y) (* (* (+ x y) (+ x y)) (+ x 1.0)))
(/ (/ x y) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 5.2e-128) {
tmp = (1.0 / (1.0 + (x + y))) * (y / x);
} else if (y <= 2.5e-18) {
tmp = (x * y) / (((x + y) * (x + y)) * (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 <= 5.2d-128) then
tmp = (1.0d0 / (1.0d0 + (x + y))) * (y / x)
else if (y <= 2.5d-18) then
tmp = (x * y) / (((x + y) * (x + y)) * (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 <= 5.2e-128) {
tmp = (1.0 / (1.0 + (x + y))) * (y / x);
} else if (y <= 2.5e-18) {
tmp = (x * y) / (((x + y) * (x + y)) * (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 <= 5.2e-128: tmp = (1.0 / (1.0 + (x + y))) * (y / x) elif y <= 2.5e-18: tmp = (x * y) / (((x + y) * (x + y)) * (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 <= 5.2e-128) tmp = Float64(Float64(1.0 / Float64(1.0 + Float64(x + y))) * Float64(y / x)); elseif (y <= 2.5e-18) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * 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 <= 5.2e-128)
tmp = (1.0 / (1.0 + (x + y))) * (y / x);
elseif (y <= 2.5e-18)
tmp = (x * y) / (((x + y) * (x + y)) * (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, 5.2e-128], N[(N[(1.0 / N[(1.0 + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-18], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * 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 5.2 \cdot 10^{-128}:\\
\;\;\;\;\frac{1}{1 + \left(x + y\right)} \cdot \frac{y}{x}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 5.19999999999999961e-128Initial program 69.7%
times-frac89.5%
/-rgt-identity89.5%
associate-/l/89.5%
*-lft-identity89.5%
associate-+l+89.5%
Simplified89.5%
Taylor expanded in x around inf 59.4%
associate-*r/59.4%
clear-num59.3%
Applied egg-rr59.3%
associate-/r/59.3%
associate-+r+59.3%
+-commutative59.3%
+-commutative59.3%
associate-*l/59.4%
*-lft-identity59.4%
Simplified59.4%
if 5.19999999999999961e-128 < y < 2.50000000000000018e-18Initial program 86.7%
Taylor expanded in y around 0 86.7%
+-commutative86.7%
Simplified86.7%
if 2.50000000000000018e-18 < y Initial program 64.5%
times-frac88.3%
/-rgt-identity88.3%
associate-/l/88.3%
*-lft-identity88.3%
associate-+l+88.3%
Simplified88.3%
Taylor expanded in x around 0 74.5%
associate-/r*75.3%
+-commutative75.3%
Simplified75.3%
Final simplification66.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -6.2e+164)
(/ (/ y x) x)
(if (<= x -2.05e+39)
(/ y (* x (+ x y)))
(if (<= x -2.2e-58)
(/ x (+ y (* y y)))
(if (<= x -4.4e-103)
(/ y x)
(if (<= x 6e+62) (/ x (* y (+ y 1.0))) (/ (/ x y) y)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -6.2e+164) {
tmp = (y / x) / x;
} else if (x <= -2.05e+39) {
tmp = y / (x * (x + y));
} else if (x <= -2.2e-58) {
tmp = x / (y + (y * y));
} else if (x <= -4.4e-103) {
tmp = y / x;
} else if (x <= 6e+62) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-6.2d+164)) then
tmp = (y / x) / x
else if (x <= (-2.05d+39)) then
tmp = y / (x * (x + y))
else if (x <= (-2.2d-58)) then
tmp = x / (y + (y * y))
else if (x <= (-4.4d-103)) then
tmp = y / x
else if (x <= 6d+62) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -6.2e+164) {
tmp = (y / x) / x;
} else if (x <= -2.05e+39) {
tmp = y / (x * (x + y));
} else if (x <= -2.2e-58) {
tmp = x / (y + (y * y));
} else if (x <= -4.4e-103) {
tmp = y / x;
} else if (x <= 6e+62) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -6.2e+164: tmp = (y / x) / x elif x <= -2.05e+39: tmp = y / (x * (x + y)) elif x <= -2.2e-58: tmp = x / (y + (y * y)) elif x <= -4.4e-103: tmp = y / x elif x <= 6e+62: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -6.2e+164) tmp = Float64(Float64(y / x) / x); elseif (x <= -2.05e+39) tmp = Float64(y / Float64(x * Float64(x + y))); elseif (x <= -2.2e-58) tmp = Float64(x / Float64(y + Float64(y * y))); elseif (x <= -4.4e-103) tmp = Float64(y / x); elseif (x <= 6e+62) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -6.2e+164)
tmp = (y / x) / x;
elseif (x <= -2.05e+39)
tmp = y / (x * (x + y));
elseif (x <= -2.2e-58)
tmp = x / (y + (y * y));
elseif (x <= -4.4e-103)
tmp = y / x;
elseif (x <= 6e+62)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -6.2e+164], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.05e+39], N[(y / N[(x * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-58], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.4e-103], N[(y / x), $MachinePrecision], If[LessEqual[x, 6e+62], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+164}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.05 \cdot 10^{+39}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + y\right)}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-103}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -6.2000000000000003e164Initial program 62.6%
times-frac85.5%
/-rgt-identity85.5%
associate-/l/85.5%
*-lft-identity85.5%
associate-+l+85.5%
Simplified85.5%
Taylor expanded in x around inf 92.6%
Taylor expanded in x around inf 92.3%
associate-*l/92.3%
*-un-lft-identity92.3%
Applied egg-rr92.3%
if -6.2000000000000003e164 < x < -2.05000000000000002e39Initial program 51.6%
Taylor expanded in y around 0 50.1%
+-commutative50.1%
Simplified50.1%
*-un-lft-identity50.1%
associate-*l*50.1%
times-frac59.1%
Applied egg-rr59.1%
associate-*l/59.1%
*-lft-identity59.1%
times-frac62.3%
Simplified62.3%
Taylor expanded in x around inf 61.3%
expm1-log1p-u61.3%
expm1-udef59.3%
associate-/l/59.3%
*-commutative59.3%
Applied egg-rr59.3%
expm1-def79.1%
expm1-log1p79.1%
Simplified79.1%
if -2.05000000000000002e39 < x < -2.20000000000000006e-58Initial program 90.5%
times-frac98.4%
/-rgt-identity98.4%
associate-/l/98.4%
*-lft-identity98.4%
associate-+l+98.4%
Simplified98.4%
Taylor expanded in x around 0 71.2%
distribute-rgt-in71.2%
*-lft-identity71.2%
Simplified71.2%
if -2.20000000000000006e-58 < x < -4.3999999999999999e-103Initial program 64.1%
Taylor expanded in y around 0 22.6%
*-commutative22.6%
unpow222.6%
+-commutative22.6%
Simplified22.6%
Taylor expanded in x around 0 58.3%
if -4.3999999999999999e-103 < x < 6e62Initial program 76.4%
times-frac90.5%
/-rgt-identity90.5%
associate-/l/90.5%
*-lft-identity90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 77.1%
if 6e62 < x Initial program 58.0%
associate-*r/70.4%
*-commutative70.4%
distribute-rgt1-in70.3%
fma-def70.4%
cube-unmult70.4%
Simplified70.4%
Taylor expanded in y around inf 13.5%
unpow213.5%
Simplified13.5%
*-un-lft-identity13.5%
times-frac20.9%
Applied egg-rr20.9%
associate-*l/20.9%
*-lft-identity20.9%
Simplified20.9%
Final simplification69.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.5e-18) (/ (* (/ x (+ x y)) (/ y (+ x 1.0))) (+ x y)) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.5e-18) {
tmp = ((x / (x + y)) * (y / (x + 1.0))) / (x + y);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.5d-18) then
tmp = ((x / (x + y)) * (y / (x + 1.0d0))) / (x + y)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.5e-18) {
tmp = ((x / (x + y)) * (y / (x + 1.0))) / (x + y);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.5e-18: tmp = ((x / (x + y)) * (y / (x + 1.0))) / (x + y) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.5e-18) tmp = Float64(Float64(Float64(x / Float64(x + y)) * Float64(y / Float64(x + 1.0))) / Float64(x + y)); 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 <= 2.5e-18)
tmp = ((x / (x + y)) * (y / (x + 1.0))) / (x + y);
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.5e-18], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $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 2.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{\frac{x}{x + y} \cdot \frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 2.50000000000000018e-18Initial program 71.5%
Taylor expanded in y around 0 66.8%
+-commutative66.8%
Simplified66.8%
*-un-lft-identity66.8%
associate-*l*66.7%
times-frac63.8%
Applied egg-rr63.8%
associate-*l/63.8%
*-lft-identity63.8%
times-frac84.6%
Simplified84.6%
if 2.50000000000000018e-18 < y Initial program 64.5%
times-frac88.3%
/-rgt-identity88.3%
associate-/l/88.3%
*-lft-identity88.3%
associate-+l+88.3%
Simplified88.3%
Taylor expanded in x around 0 74.5%
associate-/r*75.3%
+-commutative75.3%
Simplified75.3%
Final simplification81.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 (+ y 1.0)))))
(if (<= x -1.25e+40)
(* (/ y x) (/ 1.0 x))
(if (<= x -2e-58)
t_0
(if (<= x -4.4e-103) (/ y x) (if (<= x 2.6e+52) t_0 (/ (/ x y) y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * (y + 1.0));
double tmp;
if (x <= -1.25e+40) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2e-58) {
tmp = t_0;
} else if (x <= -4.4e-103) {
tmp = y / x;
} else if (x <= 2.6e+52) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y * (y + 1.0d0))
if (x <= (-1.25d+40)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-2d-58)) then
tmp = t_0
else if (x <= (-4.4d-103)) then
tmp = y / x
else if (x <= 2.6d+52) then
tmp = t_0
else
tmp = (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 * (y + 1.0));
double tmp;
if (x <= -1.25e+40) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2e-58) {
tmp = t_0;
} else if (x <= -4.4e-103) {
tmp = y / x;
} else if (x <= 2.6e+52) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * (y + 1.0)) tmp = 0 if x <= -1.25e+40: tmp = (y / x) * (1.0 / x) elif x <= -2e-58: tmp = t_0 elif x <= -4.4e-103: tmp = y / x elif x <= 2.6e+52: tmp = t_0 else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * Float64(y + 1.0))) tmp = 0.0 if (x <= -1.25e+40) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -2e-58) tmp = t_0; elseif (x <= -4.4e-103) tmp = Float64(y / x); elseif (x <= 2.6e+52) tmp = t_0; else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * (y + 1.0));
tmp = 0.0;
if (x <= -1.25e+40)
tmp = (y / x) * (1.0 / x);
elseif (x <= -2e-58)
tmp = t_0;
elseif (x <= -4.4e-103)
tmp = y / x;
elseif (x <= 2.6e+52)
tmp = t_0;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+40], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-58], t$95$0, If[LessEqual[x, -4.4e-103], N[(y / x), $MachinePrecision], If[LessEqual[x, 2.6e+52], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+40}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-58}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-103}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+52}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.25000000000000001e40Initial program 57.7%
times-frac90.5%
/-rgt-identity90.5%
associate-/l/90.5%
*-lft-identity90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around inf 78.6%
Taylor expanded in x around inf 78.1%
if -1.25000000000000001e40 < x < -2.0000000000000001e-58 or -4.3999999999999999e-103 < x < 2.6e52Initial program 78.2%
times-frac91.6%
/-rgt-identity91.6%
associate-/l/91.6%
*-lft-identity91.6%
associate-+l+91.6%
Simplified91.6%
Taylor expanded in x around 0 77.0%
if -2.0000000000000001e-58 < x < -4.3999999999999999e-103Initial program 64.1%
Taylor expanded in y around 0 22.6%
*-commutative22.6%
unpow222.6%
+-commutative22.6%
Simplified22.6%
Taylor expanded in x around 0 58.3%
if 2.6e52 < x Initial program 60.7%
associate-*r/72.4%
*-commutative72.4%
distribute-rgt1-in72.2%
fma-def72.4%
cube-unmult72.4%
Simplified72.4%
Taylor expanded in y around inf 15.0%
unpow215.0%
Simplified15.0%
*-un-lft-identity15.0%
times-frac21.9%
Applied egg-rr21.9%
associate-*l/21.9%
*-lft-identity21.9%
Simplified21.9%
Final simplification67.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2e+39)
(* (/ y x) (/ 1.0 x))
(if (<= x -2e-58)
(/ x (+ y (* y y)))
(if (<= x -4.4e-103)
(/ y x)
(if (<= x 3.3e+58) (/ x (* y (+ y 1.0))) (/ (/ x y) y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2e+39) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2e-58) {
tmp = x / (y + (y * y));
} else if (x <= -4.4e-103) {
tmp = y / x;
} else if (x <= 3.3e+58) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2d+39)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-2d-58)) then
tmp = x / (y + (y * y))
else if (x <= (-4.4d-103)) then
tmp = y / x
else if (x <= 3.3d+58) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2e+39) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -2e-58) {
tmp = x / (y + (y * y));
} else if (x <= -4.4e-103) {
tmp = y / x;
} else if (x <= 3.3e+58) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2e+39: tmp = (y / x) * (1.0 / x) elif x <= -2e-58: tmp = x / (y + (y * y)) elif x <= -4.4e-103: tmp = y / x elif x <= 3.3e+58: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2e+39) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -2e-58) tmp = Float64(x / Float64(y + Float64(y * y))); elseif (x <= -4.4e-103) tmp = Float64(y / x); elseif (x <= 3.3e+58) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2e+39)
tmp = (y / x) * (1.0 / x);
elseif (x <= -2e-58)
tmp = x / (y + (y * y));
elseif (x <= -4.4e-103)
tmp = y / x;
elseif (x <= 3.3e+58)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2e+39], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-58], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.4e-103], N[(y / x), $MachinePrecision], If[LessEqual[x, 3.3e+58], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+39}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-103}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+58}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.99999999999999988e39Initial program 57.7%
times-frac90.5%
/-rgt-identity90.5%
associate-/l/90.5%
*-lft-identity90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around inf 78.6%
Taylor expanded in x around inf 78.1%
if -1.99999999999999988e39 < x < -2.0000000000000001e-58Initial program 90.5%
times-frac98.4%
/-rgt-identity98.4%
associate-/l/98.4%
*-lft-identity98.4%
associate-+l+98.4%
Simplified98.4%
Taylor expanded in x around 0 71.2%
distribute-rgt-in71.2%
*-lft-identity71.2%
Simplified71.2%
if -2.0000000000000001e-58 < x < -4.3999999999999999e-103Initial program 64.1%
Taylor expanded in y around 0 22.6%
*-commutative22.6%
unpow222.6%
+-commutative22.6%
Simplified22.6%
Taylor expanded in x around 0 58.3%
if -4.3999999999999999e-103 < x < 3.29999999999999983e58Initial program 76.3%
times-frac90.4%
/-rgt-identity90.4%
associate-/l/90.4%
*-lft-identity90.4%
associate-+l+90.4%
Simplified90.4%
Taylor expanded in x around 0 77.7%
if 3.29999999999999983e58 < x Initial program 58.9%
associate-*r/71.1%
*-commutative71.1%
distribute-rgt1-in70.9%
fma-def71.1%
cube-unmult71.1%
Simplified71.1%
Taylor expanded in y around inf 13.2%
unpow213.2%
Simplified13.2%
*-un-lft-identity13.2%
times-frac20.5%
Applied egg-rr20.5%
associate-*l/20.5%
*-lft-identity20.5%
Simplified20.5%
Final simplification67.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.95e-21) (* (/ 1.0 (+ 1.0 (+ x y))) (/ y x)) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.95e-21) {
tmp = (1.0 / (1.0 + (x + y))) * (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 (y <= 1.95d-21) then
tmp = (1.0d0 / (1.0d0 + (x + y))) * (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 (y <= 1.95e-21) {
tmp = (1.0 / (1.0 + (x + y))) * (y / x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.95e-21: tmp = (1.0 / (1.0 + (x + y))) * (y / x) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.95e-21) tmp = Float64(Float64(1.0 / Float64(1.0 + Float64(x + y))) * Float64(y / x)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.95e-21)
tmp = (1.0 / (1.0 + (x + y))) * (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[y, 1.95e-21], N[(N[(1.0 / N[(1.0 + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.95 \cdot 10^{-21}:\\
\;\;\;\;\frac{1}{1 + \left(x + y\right)} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 1.95e-21Initial program 71.5%
times-frac90.6%
/-rgt-identity90.6%
associate-/l/90.6%
*-lft-identity90.6%
associate-+l+90.6%
Simplified90.6%
Taylor expanded in x around inf 60.1%
associate-*r/60.0%
clear-num60.0%
Applied egg-rr60.0%
associate-/r/60.0%
associate-+r+60.0%
+-commutative60.0%
+-commutative60.0%
associate-*l/60.0%
*-lft-identity60.0%
Simplified60.0%
if 1.95e-21 < y Initial program 64.5%
times-frac88.3%
/-rgt-identity88.3%
associate-/l/88.3%
*-lft-identity88.3%
associate-+l+88.3%
Simplified88.3%
Taylor expanded in x around 0 74.5%
associate-/r*75.3%
+-commutative75.3%
Simplified75.3%
Final simplification64.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -5.2e-153) (/ y (* x x)) (if (<= y 3.1e-127) (/ y x) (if (<= y 0.75) (- (/ x y) x) (/ x (* y y))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -5.2e-153) {
tmp = y / (x * x);
} else if (y <= 3.1e-127) {
tmp = y / x;
} else if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-5.2d-153)) then
tmp = y / (x * x)
else if (y <= 3.1d-127) then
tmp = y / x
else if (y <= 0.75d0) then
tmp = (x / y) - x
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -5.2e-153) {
tmp = y / (x * x);
} else if (y <= 3.1e-127) {
tmp = y / x;
} else if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -5.2e-153: tmp = y / (x * x) elif y <= 3.1e-127: tmp = y / x elif y <= 0.75: tmp = (x / y) - x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -5.2e-153) tmp = Float64(y / Float64(x * x)); elseif (y <= 3.1e-127) tmp = Float64(y / x); elseif (y <= 0.75) tmp = Float64(Float64(x / y) - x); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -5.2e-153)
tmp = y / (x * x);
elseif (y <= 3.1e-127)
tmp = y / x;
elseif (y <= 0.75)
tmp = (x / y) - x;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -5.2e-153], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e-127], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.75], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-127}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -5.2000000000000003e-153Initial program 69.4%
associate-*r/83.3%
*-commutative83.3%
distribute-rgt1-in44.2%
fma-def83.2%
cube-unmult83.3%
Simplified83.3%
Taylor expanded in x around inf 34.4%
unpow234.4%
Simplified34.4%
if -5.2000000000000003e-153 < y < 3.1e-127Initial program 70.1%
Taylor expanded in y around 0 70.1%
*-commutative70.1%
unpow270.1%
+-commutative70.1%
Simplified70.1%
Taylor expanded in x around 0 71.8%
if 3.1e-127 < y < 0.75Initial program 86.3%
times-frac99.7%
/-rgt-identity99.7%
associate-/l/99.7%
*-lft-identity99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 37.9%
distribute-rgt-in37.9%
*-lft-identity37.9%
Simplified37.9%
Taylor expanded in y around 0 30.5%
mul-1-neg30.5%
unsub-neg30.5%
Simplified30.5%
if 0.75 < y Initial program 62.8%
associate-*r/78.1%
*-commutative78.1%
distribute-rgt1-in72.3%
fma-def78.1%
cube-unmult78.2%
Simplified78.2%
Taylor expanded in y around inf 76.3%
unpow276.3%
Simplified76.3%
Final simplification55.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -1.25e-152) (/ y (* x x)) (if (<= y 1.65e-125) (/ y x) (if (<= y 0.75) (- (/ x y) x) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1.25e-152) {
tmp = y / (x * x);
} else if (y <= 1.65e-125) {
tmp = y / x;
} else if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.25d-152)) then
tmp = y / (x * x)
else if (y <= 1.65d-125) then
tmp = y / x
else if (y <= 0.75d0) then
tmp = (x / y) - x
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -1.25e-152) {
tmp = y / (x * x);
} else if (y <= 1.65e-125) {
tmp = y / x;
} else if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1.25e-152: tmp = y / (x * x) elif y <= 1.65e-125: tmp = y / x elif y <= 0.75: tmp = (x / y) - x else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1.25e-152) tmp = Float64(y / Float64(x * x)); elseif (y <= 1.65e-125) tmp = Float64(y / x); elseif (y <= 0.75) tmp = Float64(Float64(x / y) - x); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -1.25e-152)
tmp = y / (x * x);
elseif (y <= 1.65e-125)
tmp = y / x;
elseif (y <= 0.75)
tmp = (x / y) - x;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -1.25e-152], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-125], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.75], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-152}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-125}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -1.2499999999999999e-152Initial program 69.4%
associate-*r/83.3%
*-commutative83.3%
distribute-rgt1-in44.2%
fma-def83.2%
cube-unmult83.3%
Simplified83.3%
Taylor expanded in x around inf 34.4%
unpow234.4%
Simplified34.4%
if -1.2499999999999999e-152 < y < 1.65e-125Initial program 70.1%
Taylor expanded in y around 0 70.1%
*-commutative70.1%
unpow270.1%
+-commutative70.1%
Simplified70.1%
Taylor expanded in x around 0 71.8%
if 1.65e-125 < y < 0.75Initial program 86.3%
times-frac99.7%
/-rgt-identity99.7%
associate-/l/99.7%
*-lft-identity99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 37.9%
distribute-rgt-in37.9%
*-lft-identity37.9%
Simplified37.9%
Taylor expanded in y around 0 30.5%
mul-1-neg30.5%
unsub-neg30.5%
Simplified30.5%
if 0.75 < y Initial program 62.8%
associate-*r/78.1%
*-commutative78.1%
distribute-rgt1-in72.3%
fma-def78.1%
cube-unmult78.2%
Simplified78.2%
Taylor expanded in y around inf 76.3%
unpow276.3%
Simplified76.3%
*-un-lft-identity76.3%
times-frac77.1%
Applied egg-rr77.1%
associate-*l/77.1%
*-lft-identity77.1%
Simplified77.1%
Final simplification55.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -8.2e-151) (/ (/ y x) x) (if (<= y 1.7e-125) (/ y x) (if (<= y 0.76) (- (/ x y) x) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -8.2e-151) {
tmp = (y / x) / x;
} else if (y <= 1.7e-125) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-8.2d-151)) then
tmp = (y / x) / x
else if (y <= 1.7d-125) then
tmp = y / x
else if (y <= 0.76d0) then
tmp = (x / y) - x
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -8.2e-151) {
tmp = (y / x) / x;
} else if (y <= 1.7e-125) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -8.2e-151: tmp = (y / x) / x elif y <= 1.7e-125: tmp = y / x elif y <= 0.76: tmp = (x / y) - x else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -8.2e-151) tmp = Float64(Float64(y / x) / x); elseif (y <= 1.7e-125) tmp = Float64(y / x); elseif (y <= 0.76) tmp = Float64(Float64(x / y) - x); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -8.2e-151)
tmp = (y / x) / x;
elseif (y <= 1.7e-125)
tmp = y / x;
elseif (y <= 0.76)
tmp = (x / y) - x;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -8.2e-151], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.7e-125], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.76], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-151}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-125}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 0.76:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -8.2000000000000002e-151Initial program 69.4%
times-frac94.2%
/-rgt-identity94.2%
associate-/l/94.2%
*-lft-identity94.2%
associate-+l+94.2%
Simplified94.2%
Taylor expanded in x around inf 40.8%
Taylor expanded in x around inf 37.0%
associate-*l/37.0%
*-un-lft-identity37.0%
Applied egg-rr37.0%
if -8.2000000000000002e-151 < y < 1.69999999999999988e-125Initial program 70.1%
Taylor expanded in y around 0 70.1%
*-commutative70.1%
unpow270.1%
+-commutative70.1%
Simplified70.1%
Taylor expanded in x around 0 71.8%
if 1.69999999999999988e-125 < y < 0.76000000000000001Initial program 86.3%
times-frac99.7%
/-rgt-identity99.7%
associate-/l/99.7%
*-lft-identity99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 37.9%
distribute-rgt-in37.9%
*-lft-identity37.9%
Simplified37.9%
Taylor expanded in y around 0 30.5%
mul-1-neg30.5%
unsub-neg30.5%
Simplified30.5%
if 0.76000000000000001 < y Initial program 62.8%
associate-*r/78.1%
*-commutative78.1%
distribute-rgt1-in72.3%
fma-def78.1%
cube-unmult78.2%
Simplified78.2%
Taylor expanded in y around inf 76.3%
unpow276.3%
Simplified76.3%
*-un-lft-identity76.3%
times-frac77.1%
Applied egg-rr77.1%
associate-*l/77.1%
*-lft-identity77.1%
Simplified77.1%
Final simplification56.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -6.8e-152) (* (/ y x) (/ 1.0 x)) (if (<= y 1.7e-125) (/ y x) (if (<= y 0.76) (- (/ x y) x) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -6.8e-152) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 1.7e-125) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-6.8d-152)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 1.7d-125) then
tmp = y / x
else if (y <= 0.76d0) then
tmp = (x / y) - x
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -6.8e-152) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 1.7e-125) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -6.8e-152: tmp = (y / x) * (1.0 / x) elif y <= 1.7e-125: tmp = y / x elif y <= 0.76: tmp = (x / y) - x else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -6.8e-152) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 1.7e-125) tmp = Float64(y / x); elseif (y <= 0.76) tmp = Float64(Float64(x / y) - x); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -6.8e-152)
tmp = (y / x) * (1.0 / x);
elseif (y <= 1.7e-125)
tmp = y / x;
elseif (y <= 0.76)
tmp = (x / y) - x;
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -6.8e-152], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-125], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.76], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-152}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-125}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 0.76:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -6.79999999999999968e-152Initial program 69.4%
times-frac94.2%
/-rgt-identity94.2%
associate-/l/94.2%
*-lft-identity94.2%
associate-+l+94.2%
Simplified94.2%
Taylor expanded in x around inf 40.8%
Taylor expanded in x around inf 37.0%
if -6.79999999999999968e-152 < y < 1.69999999999999988e-125Initial program 70.1%
Taylor expanded in y around 0 70.1%
*-commutative70.1%
unpow270.1%
+-commutative70.1%
Simplified70.1%
Taylor expanded in x around 0 71.8%
if 1.69999999999999988e-125 < y < 0.76000000000000001Initial program 86.3%
times-frac99.7%
/-rgt-identity99.7%
associate-/l/99.7%
*-lft-identity99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 37.9%
distribute-rgt-in37.9%
*-lft-identity37.9%
Simplified37.9%
Taylor expanded in y around 0 30.5%
mul-1-neg30.5%
unsub-neg30.5%
Simplified30.5%
if 0.76000000000000001 < y Initial program 62.8%
associate-*r/78.1%
*-commutative78.1%
distribute-rgt1-in72.3%
fma-def78.1%
cube-unmult78.2%
Simplified78.2%
Taylor expanded in y around inf 76.3%
unpow276.3%
Simplified76.3%
*-un-lft-identity76.3%
times-frac77.1%
Applied egg-rr77.1%
associate-*l/77.1%
*-lft-identity77.1%
Simplified77.1%
Final simplification56.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 6.6e-24) (/ y (* x (+ x 1.0))) (if (<= y 5e+151) (/ x (* y (+ y 1.0))) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 6.6e-24) {
tmp = y / (x * (x + 1.0));
} else if (y <= 5e+151) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6.6d-24) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 5d+151) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 6.6e-24) {
tmp = y / (x * (x + 1.0));
} else if (y <= 5e+151) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 6.6e-24: tmp = y / (x * (x + 1.0)) elif y <= 5e+151: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 6.6e-24) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 5e+151) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 6.6e-24)
tmp = y / (x * (x + 1.0));
elseif (y <= 5e+151)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 6.6e-24], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+151], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.6 \cdot 10^{-24}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+151}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 6.59999999999999968e-24Initial program 71.5%
times-frac90.6%
/-rgt-identity90.6%
associate-/l/90.6%
*-lft-identity90.6%
associate-+l+90.6%
Simplified90.6%
Taylor expanded in y around 0 58.4%
if 6.59999999999999968e-24 < y < 5.0000000000000002e151Initial program 75.0%
times-frac95.2%
/-rgt-identity95.2%
associate-/l/95.2%
*-lft-identity95.2%
associate-+l+95.2%
Simplified95.2%
Taylor expanded in x around 0 69.6%
if 5.0000000000000002e151 < y Initial program 52.2%
associate-*r/80.3%
*-commutative80.3%
distribute-rgt1-in74.4%
fma-def80.3%
cube-unmult80.3%
Simplified80.3%
Taylor expanded in y around inf 80.2%
unpow280.2%
Simplified80.2%
*-un-lft-identity80.2%
times-frac81.9%
Applied egg-rr81.9%
associate-*l/81.9%
*-lft-identity81.9%
Simplified81.9%
Final simplification63.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 7.6e-24) (/ y (+ x (* x x))) (if (<= y 1e+152) (/ x (* y (+ y 1.0))) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 7.6e-24) {
tmp = y / (x + (x * x));
} else if (y <= 1e+152) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 7.6d-24) then
tmp = y / (x + (x * x))
else if (y <= 1d+152) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 7.6e-24) {
tmp = y / (x + (x * x));
} else if (y <= 1e+152) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 7.6e-24: tmp = y / (x + (x * x)) elif y <= 1e+152: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 7.6e-24) tmp = Float64(y / Float64(x + Float64(x * x))); elseif (y <= 1e+152) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 7.6e-24)
tmp = y / (x + (x * x));
elseif (y <= 1e+152)
tmp = x / (y * (y + 1.0));
else
tmp = (x / y) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 7.6e-24], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+152], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.6 \cdot 10^{-24}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{elif}\;y \leq 10^{+152}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 7.60000000000000052e-24Initial program 71.5%
times-frac90.6%
/-rgt-identity90.6%
associate-/l/90.6%
*-lft-identity90.6%
associate-+l+90.6%
Simplified90.6%
Taylor expanded in x around inf 60.1%
Taylor expanded in y around 0 58.4%
*-commutative58.4%
distribute-lft-in58.4%
*-rgt-identity58.4%
Simplified58.4%
if 7.60000000000000052e-24 < y < 1e152Initial program 75.0%
times-frac95.2%
/-rgt-identity95.2%
associate-/l/95.2%
*-lft-identity95.2%
associate-+l+95.2%
Simplified95.2%
Taylor expanded in x around 0 69.6%
if 1e152 < y Initial program 52.2%
associate-*r/80.3%
*-commutative80.3%
distribute-rgt1-in74.4%
fma-def80.3%
cube-unmult80.3%
Simplified80.3%
Taylor expanded in y around inf 80.2%
unpow280.2%
Simplified80.2%
*-un-lft-identity80.2%
times-frac81.9%
Applied egg-rr81.9%
associate-*l/81.9%
*-lft-identity81.9%
Simplified81.9%
Final simplification63.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 7.4e-19) (/ (/ y (+ x 1.0)) (+ x y)) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 7.4e-19) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 7.4d-19) then
tmp = (y / (x + 1.0d0)) / (x + y)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 7.4e-19) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 7.4e-19: tmp = (y / (x + 1.0)) / (x + y) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 7.4e-19) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); 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 <= 7.4e-19)
tmp = (y / (x + 1.0)) / (x + y);
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 7.4e-19], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $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 7.4 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 7.40000000000000011e-19Initial program 71.5%
Taylor expanded in y around 0 66.8%
+-commutative66.8%
Simplified66.8%
*-un-lft-identity66.8%
associate-*l*66.7%
times-frac63.8%
Applied egg-rr63.8%
associate-*l/63.8%
*-lft-identity63.8%
times-frac84.6%
Simplified84.6%
Taylor expanded in y around 0 60.1%
if 7.40000000000000011e-19 < y Initial program 64.5%
times-frac88.3%
/-rgt-identity88.3%
associate-/l/88.3%
*-lft-identity88.3%
associate-+l+88.3%
Simplified88.3%
Taylor expanded in x around 0 74.5%
associate-/r*75.3%
+-commutative75.3%
Simplified75.3%
Final simplification64.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.5e-22) (/ (/ y (+ x (+ y 1.0))) x) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.5e-22) {
tmp = (y / (x + (y + 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 (y <= 2.5d-22) then
tmp = (y / (x + (y + 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 (y <= 2.5e-22) {
tmp = (y / (x + (y + 1.0))) / x;
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.5e-22: tmp = (y / (x + (y + 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 (y <= 2.5e-22) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / x); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.5e-22)
tmp = (y / (x + (y + 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[y, 2.5e-22], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $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 2.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 2.49999999999999977e-22Initial program 71.5%
times-frac90.6%
/-rgt-identity90.6%
associate-/l/90.6%
*-lft-identity90.6%
associate-+l+90.6%
Simplified90.6%
Taylor expanded in x around inf 60.1%
associate-*l/60.1%
*-un-lft-identity60.1%
Applied egg-rr60.1%
if 2.49999999999999977e-22 < y Initial program 64.5%
times-frac88.3%
/-rgt-identity88.3%
associate-/l/88.3%
*-lft-identity88.3%
associate-+l+88.3%
Simplified88.3%
Taylor expanded in x around 0 74.5%
associate-/r*75.3%
+-commutative75.3%
Simplified75.3%
Final simplification64.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.4e-126) (/ y x) (if (<= y 0.76) (- (/ x y) x) (/ x (* y y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.4e-126) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.4d-126) then
tmp = y / x
else if (y <= 0.76d0) then
tmp = (x / y) - x
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.4e-126) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.4e-126: tmp = y / x elif y <= 0.76: tmp = (x / y) - x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.4e-126) tmp = Float64(y / x); elseif (y <= 0.76) tmp = Float64(Float64(x / y) - x); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.4e-126)
tmp = y / x;
elseif (y <= 0.76)
tmp = (x / y) - x;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.4e-126], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.76], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{-126}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 0.76:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 2.40000000000000007e-126Initial program 69.7%
Taylor expanded in y around 0 44.4%
*-commutative44.4%
unpow244.4%
+-commutative44.4%
Simplified44.4%
Taylor expanded in x around 0 34.7%
if 2.40000000000000007e-126 < y < 0.76000000000000001Initial program 86.3%
times-frac99.7%
/-rgt-identity99.7%
associate-/l/99.7%
*-lft-identity99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 37.9%
distribute-rgt-in37.9%
*-lft-identity37.9%
Simplified37.9%
Taylor expanded in y around 0 30.5%
mul-1-neg30.5%
unsub-neg30.5%
Simplified30.5%
if 0.76000000000000001 < y Initial program 62.8%
associate-*r/78.1%
*-commutative78.1%
distribute-rgt1-in72.3%
fma-def78.1%
cube-unmult78.2%
Simplified78.2%
Taylor expanded in y around inf 76.3%
unpow276.3%
Simplified76.3%
Final simplification46.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.2e-18) (/ y (+ x (* x x))) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.2e-18) {
tmp = y / (x + (x * x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.2d-18) then
tmp = y / (x + (x * x))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.2e-18) {
tmp = y / (x + (x * x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.2e-18: tmp = y / (x + (x * x)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.2e-18) tmp = Float64(y / Float64(x + Float64(x * x))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.2e-18)
tmp = y / (x + (x * x));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.2e-18], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-18}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 2.1999999999999998e-18Initial program 71.5%
times-frac90.6%
/-rgt-identity90.6%
associate-/l/90.6%
*-lft-identity90.6%
associate-+l+90.6%
Simplified90.6%
Taylor expanded in x around inf 60.1%
Taylor expanded in y around 0 58.4%
*-commutative58.4%
distribute-lft-in58.4%
*-rgt-identity58.4%
Simplified58.4%
if 2.1999999999999998e-18 < y Initial program 64.5%
times-frac88.3%
/-rgt-identity88.3%
associate-/l/88.3%
*-lft-identity88.3%
associate-+l+88.3%
Simplified88.3%
Taylor expanded in x around 0 74.5%
associate-/r*75.3%
+-commutative75.3%
Simplified75.3%
Final simplification63.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 8.2e-128) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 8.2e-128) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 8.2d-128) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 8.2e-128) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 8.2e-128: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 8.2e-128) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 8.2e-128)
tmp = y / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 8.2e-128], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.2 \cdot 10^{-128}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 8.1999999999999999e-128Initial program 69.7%
Taylor expanded in y around 0 44.4%
*-commutative44.4%
unpow244.4%
+-commutative44.4%
Simplified44.4%
Taylor expanded in x around 0 34.7%
if 8.1999999999999999e-128 < y Initial program 68.8%
times-frac90.5%
/-rgt-identity90.5%
associate-/l/90.5%
*-lft-identity90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 66.6%
distribute-rgt-in66.6%
*-lft-identity66.6%
Simplified66.6%
Taylor expanded in y around 0 27.3%
Final simplification31.9%
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 69.4%
times-frac89.9%
/-rgt-identity89.9%
associate-/l/89.9%
*-lft-identity89.9%
associate-+l+89.9%
Simplified89.9%
Taylor expanded in x around inf 49.5%
Taylor expanded in y around inf 4.1%
Final simplification4.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ x y))
assert(x < y);
double code(double x, double y) {
return x / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
assert x < y;
public static double code(double x, double y) {
return x / y;
}
[x, y] = sort([x, y]) def code(x, y): return x / y
x, y = sort([x, y]) function code(x, y) return Float64(x / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = x / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y}
\end{array}
Initial program 69.4%
times-frac89.9%
/-rgt-identity89.9%
associate-/l/89.9%
*-lft-identity89.9%
associate-+l+89.9%
Simplified89.9%
Taylor expanded in x around 0 51.5%
distribute-rgt-in51.5%
*-lft-identity51.5%
Simplified51.5%
Taylor expanded in y around 0 26.2%
Final simplification26.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 2023192
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))