
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (* (/ y (+ y (+ 1.0 x))) (/ x (+ y x))) (+ y x)))
assert(x < y);
double code(double x, double y) {
return ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (y + (1.0d0 + x))) * (x / (y + x))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
return ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x);
}
[x, y] = sort([x, y]) def code(x, y): return ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(y / Float64(y + Float64(1.0 + x))) * Float64(x / Float64(y + x))) / Float64(y + x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((y / (y + (1.0 + x))) * (x / (y + x))) / (y + x);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(y / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{y + \left(1 + x\right)} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Initial program 70.0%
associate-*r/84.4%
*-commutative84.4%
distribute-rgt1-in67.7%
fma-def84.5%
cube-unmult84.5%
Simplified84.5%
associate-*r/70.0%
fma-udef55.5%
cube-mult55.5%
distribute-rgt1-in70.0%
associate-+r+70.0%
*-commutative70.0%
frac-times88.9%
*-commutative88.9%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* (+ y x) (+ y x)))))
(if (<= x -3.6e+122)
(/ (/ y (+ y (+ 1.0 x))) (+ y x))
(if (<= x -2600000.0)
(* (/ y x) t_0)
(if (<= x -2.6e-158) (* t_0 (/ y (+ y 1.0))) (/ (/ x y) (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / ((y + x) * (y + x));
double tmp;
if (x <= -3.6e+122) {
tmp = (y / (y + (1.0 + x))) / (y + x);
} else if (x <= -2600000.0) {
tmp = (y / x) * t_0;
} else if (x <= -2.6e-158) {
tmp = t_0 * (y / (y + 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) :: t_0
real(8) :: tmp
t_0 = x / ((y + x) * (y + x))
if (x <= (-3.6d+122)) then
tmp = (y / (y + (1.0d0 + x))) / (y + x)
else if (x <= (-2600000.0d0)) then
tmp = (y / x) * t_0
else if (x <= (-2.6d-158)) then
tmp = t_0 * (y / (y + 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 t_0 = x / ((y + x) * (y + x));
double tmp;
if (x <= -3.6e+122) {
tmp = (y / (y + (1.0 + x))) / (y + x);
} else if (x <= -2600000.0) {
tmp = (y / x) * t_0;
} else if (x <= -2.6e-158) {
tmp = t_0 * (y / (y + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / ((y + x) * (y + x)) tmp = 0 if x <= -3.6e+122: tmp = (y / (y + (1.0 + x))) / (y + x) elif x <= -2600000.0: tmp = (y / x) * t_0 elif x <= -2.6e-158: tmp = t_0 * (y / (y + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(Float64(y + x) * Float64(y + x))) tmp = 0.0 if (x <= -3.6e+122) tmp = Float64(Float64(y / Float64(y + Float64(1.0 + x))) / Float64(y + x)); elseif (x <= -2600000.0) tmp = Float64(Float64(y / x) * t_0); elseif (x <= -2.6e-158) tmp = Float64(t_0 * Float64(y / Float64(y + 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)
t_0 = x / ((y + x) * (y + x));
tmp = 0.0;
if (x <= -3.6e+122)
tmp = (y / (y + (1.0 + x))) / (y + x);
elseif (x <= -2600000.0)
tmp = (y / x) * t_0;
elseif (x <= -2.6e-158)
tmp = t_0 * (y / (y + 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_] := Block[{t$95$0 = N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e+122], N[(N[(y / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2600000.0], N[(N[(y / x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, -2.6e-158], N[(t$95$0 * N[(y / N[(y + 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}
t_0 := \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+122}:\\
\;\;\;\;\frac{\frac{y}{y + \left(1 + x\right)}}{y + x}\\
\mathbf{elif}\;x \leq -2600000:\\
\;\;\;\;\frac{y}{x} \cdot t_0\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-158}:\\
\;\;\;\;t_0 \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -3.6000000000000003e122Initial program 66.0%
associate-*r/76.5%
*-commutative76.5%
distribute-rgt1-in13.8%
fma-def76.5%
cube-unmult76.5%
Simplified76.5%
associate-*r/66.0%
fma-udef10.8%
cube-mult10.8%
distribute-rgt1-in66.0%
associate-+r+66.0%
*-commutative66.0%
frac-times77.8%
*-commutative77.8%
associate-/r*99.8%
frac-times77.8%
+-commutative77.8%
+-commutative77.8%
associate-+l+77.8%
+-commutative77.8%
Applied egg-rr77.8%
associate-/r*99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
*-commutative99.8%
associate-*r/73.1%
+-commutative73.1%
Simplified73.1%
Taylor expanded in y around 0 82.5%
if -3.6000000000000003e122 < x < -2.6e6Initial program 72.2%
times-frac96.3%
/-rgt-identity96.3%
associate-/l/96.3%
*-lft-identity96.3%
associate-+l+96.3%
Simplified96.3%
Taylor expanded in x around inf 77.2%
if -2.6e6 < x < -2.6e-158Initial program 88.9%
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 97.5%
+-commutative97.5%
Simplified97.5%
if -2.6e-158 < x Initial program 66.2%
associate-*r/82.8%
*-commutative82.8%
distribute-rgt1-in72.0%
fma-def82.8%
cube-unmult82.8%
Simplified82.8%
associate-*r/66.2%
fma-udef56.8%
cube-mult56.8%
distribute-rgt1-in66.2%
associate-+r+66.2%
*-commutative66.2%
frac-times87.5%
*-commutative87.5%
associate-/r*99.8%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
Taylor expanded in x around 0 59.2%
associate-/r*59.3%
Simplified59.3%
Final simplification69.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ 1.0 x))))
(if (<= x -1.9e+170)
(/ (/ y t_0) (+ y x))
(if (<= x -3.45e-9)
(* y (/ (/ 1.0 t_0) (+ y x)))
(if (<= x -2.6e-158)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ y 1.0)))
(/ (/ x y) (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (1.0 + x);
double tmp;
if (x <= -1.9e+170) {
tmp = (y / t_0) / (y + x);
} else if (x <= -3.45e-9) {
tmp = y * ((1.0 / t_0) / (y + x));
} else if (x <= -2.6e-158) {
tmp = (x / ((y + x) * (y + x))) * (y / (y + 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) :: t_0
real(8) :: tmp
t_0 = y + (1.0d0 + x)
if (x <= (-1.9d+170)) then
tmp = (y / t_0) / (y + x)
else if (x <= (-3.45d-9)) then
tmp = y * ((1.0d0 / t_0) / (y + x))
else if (x <= (-2.6d-158)) then
tmp = (x / ((y + x) * (y + x))) * (y / (y + 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 t_0 = y + (1.0 + x);
double tmp;
if (x <= -1.9e+170) {
tmp = (y / t_0) / (y + x);
} else if (x <= -3.45e-9) {
tmp = y * ((1.0 / t_0) / (y + x));
} else if (x <= -2.6e-158) {
tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (1.0 + x) tmp = 0 if x <= -1.9e+170: tmp = (y / t_0) / (y + x) elif x <= -3.45e-9: tmp = y * ((1.0 / t_0) / (y + x)) elif x <= -2.6e-158: tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(1.0 + x)) tmp = 0.0 if (x <= -1.9e+170) tmp = Float64(Float64(y / t_0) / Float64(y + x)); elseif (x <= -3.45e-9) tmp = Float64(y * Float64(Float64(1.0 / t_0) / Float64(y + x))); elseif (x <= -2.6e-158) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(y + 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)
t_0 = y + (1.0 + x);
tmp = 0.0;
if (x <= -1.9e+170)
tmp = (y / t_0) / (y + x);
elseif (x <= -3.45e-9)
tmp = y * ((1.0 / t_0) / (y + x));
elseif (x <= -2.6e-158)
tmp = (x / ((y + x) * (y + x))) * (y / (y + 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_] := Block[{t$95$0 = N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.9e+170], N[(N[(y / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.45e-9], N[(y * N[(N[(1.0 / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6e-158], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 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}
t_0 := y + \left(1 + x\right)\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+170}:\\
\;\;\;\;\frac{\frac{y}{t_0}}{y + x}\\
\mathbf{elif}\;x \leq -3.45 \cdot 10^{-9}:\\
\;\;\;\;y \cdot \frac{\frac{1}{t_0}}{y + x}\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-158}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.8999999999999999e170Initial program 70.1%
associate-*r/80.2%
*-commutative80.2%
distribute-rgt1-in4.3%
fma-def80.2%
cube-unmult80.2%
Simplified80.2%
associate-*r/70.1%
fma-udef0.0%
cube-mult0.0%
distribute-rgt1-in70.1%
associate-+r+70.1%
*-commutative70.1%
frac-times80.2%
*-commutative80.2%
associate-/r*99.8%
frac-times80.2%
+-commutative80.2%
+-commutative80.2%
associate-+l+80.2%
+-commutative80.2%
Applied egg-rr80.2%
associate-/r*99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
*-commutative99.8%
associate-*r/74.4%
+-commutative74.4%
Simplified74.4%
Taylor expanded in y around 0 87.0%
if -1.8999999999999999e170 < x < -3.44999999999999987e-9Initial program 68.9%
associate-*r/80.1%
*-commutative80.1%
distribute-rgt1-in66.7%
fma-def80.1%
cube-unmult80.1%
Simplified80.1%
associate-*r/68.8%
fma-udef60.9%
cube-mult61.0%
distribute-rgt1-in68.9%
associate-+r+68.9%
*-commutative68.9%
frac-times90.2%
*-commutative90.2%
associate-/r*99.7%
frac-times90.4%
+-commutative90.4%
+-commutative90.4%
associate-+l+90.4%
+-commutative90.4%
Applied egg-rr90.4%
associate-/r*99.7%
associate-*l/99.7%
*-commutative99.7%
associate-*r/99.7%
*-commutative99.7%
associate-*r/82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in y around 0 59.7%
+-commutative59.7%
div-inv59.8%
*-un-lft-identity59.8%
times-frac77.8%
Applied egg-rr77.8%
if -3.44999999999999987e-9 < x < -2.6e-158Initial program 88.6%
times-frac99.6%
/-rgt-identity99.6%
associate-/l/99.6%
*-lft-identity99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 99.4%
+-commutative99.4%
Simplified99.4%
if -2.6e-158 < x Initial program 66.2%
associate-*r/82.8%
*-commutative82.8%
distribute-rgt1-in72.0%
fma-def82.8%
cube-unmult82.8%
Simplified82.8%
associate-*r/66.2%
fma-udef56.8%
cube-mult56.8%
distribute-rgt1-in66.2%
associate-+r+66.2%
*-commutative66.2%
frac-times87.5%
*-commutative87.5%
associate-/r*99.8%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
Taylor expanded in x around 0 59.2%
associate-/r*59.3%
Simplified59.3%
Final simplification70.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -3.6e+122)
(/ (/ y (+ y (+ 1.0 x))) (+ y x))
(if (<= x -7.6e-17)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x (+ y 1.0))))
(/ (* (/ x (+ y x)) (/ y (+ y 1.0))) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.6e+122) {
tmp = (y / (y + (1.0 + x))) / (y + x);
} else if (x <= -7.6e-17) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.6d+122)) then
tmp = (y / (y + (1.0d0 + x))) / (y + x)
else if (x <= (-7.6d-17)) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0d0)))
else
tmp = ((x / (y + x)) * (y / (y + 1.0d0))) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.6e+122) {
tmp = (y / (y + (1.0 + x))) / (y + x);
} else if (x <= -7.6e-17) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.6e+122: tmp = (y / (y + (1.0 + x))) / (y + x) elif x <= -7.6e-17: tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0))) else: tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.6e+122) tmp = Float64(Float64(y / Float64(y + Float64(1.0 + x))) / Float64(y + x)); elseif (x <= -7.6e-17) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(y + 1.0))) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.6e+122)
tmp = (y / (y + (1.0 + x))) / (y + x);
elseif (x <= -7.6e-17)
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
else
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.6e+122], N[(N[(y / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.6e-17], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+122}:\\
\;\;\;\;\frac{\frac{y}{y + \left(1 + x\right)}}{y + x}\\
\mathbf{elif}\;x \leq -7.6 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -3.6000000000000003e122Initial program 66.0%
associate-*r/76.5%
*-commutative76.5%
distribute-rgt1-in13.8%
fma-def76.5%
cube-unmult76.5%
Simplified76.5%
associate-*r/66.0%
fma-udef10.8%
cube-mult10.8%
distribute-rgt1-in66.0%
associate-+r+66.0%
*-commutative66.0%
frac-times77.8%
*-commutative77.8%
associate-/r*99.8%
frac-times77.8%
+-commutative77.8%
+-commutative77.8%
associate-+l+77.8%
+-commutative77.8%
Applied egg-rr77.8%
associate-/r*99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
*-commutative99.8%
associate-*r/73.1%
+-commutative73.1%
Simplified73.1%
Taylor expanded in y around 0 82.5%
if -3.6000000000000003e122 < x < -7.6000000000000002e-17Initial program 74.8%
times-frac96.6%
/-rgt-identity96.6%
associate-/l/96.6%
*-lft-identity96.6%
associate-+l+96.6%
Simplified96.6%
if -7.6000000000000002e-17 < x Initial program 70.0%
associate-*r/85.7%
*-commutative85.7%
distribute-rgt1-in75.2%
fma-def85.7%
cube-unmult85.7%
Simplified85.7%
associate-*r/70.0%
fma-udef60.6%
cube-mult60.6%
distribute-rgt1-in70.0%
associate-+r+70.0%
*-commutative70.0%
frac-times89.6%
*-commutative89.6%
associate-/r*99.8%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 84.3%
+-commutative84.3%
Simplified84.3%
Final simplification85.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -4.2e+169)
(/ (* (/ y (+ y (+ 1.0 x))) (- 1.0 (/ y x))) (+ y x))
(if (<= x -7.8e-17)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x (+ y 1.0))))
(/ (* (/ x (+ y x)) (/ y (+ y 1.0))) (+ y x)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.2e+169) {
tmp = ((y / (y + (1.0 + x))) * (1.0 - (y / x))) / (y + x);
} else if (x <= -7.8e-17) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.2d+169)) then
tmp = ((y / (y + (1.0d0 + x))) * (1.0d0 - (y / x))) / (y + x)
else if (x <= (-7.8d-17)) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0d0)))
else
tmp = ((x / (y + x)) * (y / (y + 1.0d0))) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.2e+169) {
tmp = ((y / (y + (1.0 + x))) * (1.0 - (y / x))) / (y + x);
} else if (x <= -7.8e-17) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.2e+169: tmp = ((y / (y + (1.0 + x))) * (1.0 - (y / x))) / (y + x) elif x <= -7.8e-17: tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0))) else: tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.2e+169) tmp = Float64(Float64(Float64(y / Float64(y + Float64(1.0 + x))) * Float64(1.0 - Float64(y / x))) / Float64(y + x)); elseif (x <= -7.8e-17) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(y + 1.0))) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.2e+169)
tmp = ((y / (y + (1.0 + x))) * (1.0 - (y / x))) / (y + x);
elseif (x <= -7.8e-17)
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
else
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.2e+169], N[(N[(N[(y / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.8e-17], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+169}:\\
\;\;\;\;\frac{\frac{y}{y + \left(1 + x\right)} \cdot \left(1 - \frac{y}{x}\right)}{y + x}\\
\mathbf{elif}\;x \leq -7.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -4.2000000000000002e169Initial program 70.1%
associate-*r/80.2%
*-commutative80.2%
distribute-rgt1-in4.3%
fma-def80.2%
cube-unmult80.2%
Simplified80.2%
associate-*r/70.1%
fma-udef0.0%
cube-mult0.0%
distribute-rgt1-in70.1%
associate-+r+70.1%
*-commutative70.1%
frac-times80.2%
*-commutative80.2%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 87.7%
mul-1-neg87.7%
unsub-neg87.7%
Simplified87.7%
if -4.2000000000000002e169 < x < -7.79999999999999979e-17Initial program 70.4%
times-frac90.7%
/-rgt-identity90.7%
associate-/l/90.7%
*-lft-identity90.7%
associate-+l+90.7%
Simplified90.7%
if -7.79999999999999979e-17 < x Initial program 70.0%
associate-*r/85.7%
*-commutative85.7%
distribute-rgt1-in75.2%
fma-def85.7%
cube-unmult85.7%
Simplified85.7%
associate-*r/70.0%
fma-udef60.6%
cube-mult60.6%
distribute-rgt1-in70.0%
associate-+r+70.0%
*-commutative70.0%
frac-times89.6%
*-commutative89.6%
associate-/r*99.8%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 84.3%
+-commutative84.3%
Simplified84.3%
Final simplification85.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ 1.0 x))))
(if (<= x -2.9e+168)
(/ (/ y t_0) (+ y x))
(if (<= x -3.3e-9)
(* y (/ (/ 1.0 t_0) (+ y x)))
(/ (* (/ x (+ y x)) (/ y (+ y 1.0))) (+ y x))))))assert(x < y);
double code(double x, double y) {
double t_0 = y + (1.0 + x);
double tmp;
if (x <= -2.9e+168) {
tmp = (y / t_0) / (y + x);
} else if (x <= -3.3e-9) {
tmp = y * ((1.0 / t_0) / (y + x));
} else {
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y + (1.0d0 + x)
if (x <= (-2.9d+168)) then
tmp = (y / t_0) / (y + x)
else if (x <= (-3.3d-9)) then
tmp = y * ((1.0d0 / t_0) / (y + x))
else
tmp = ((x / (y + x)) * (y / (y + 1.0d0))) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y + (1.0 + x);
double tmp;
if (x <= -2.9e+168) {
tmp = (y / t_0) / (y + x);
} else if (x <= -3.3e-9) {
tmp = y * ((1.0 / t_0) / (y + x));
} else {
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y + (1.0 + x) tmp = 0 if x <= -2.9e+168: tmp = (y / t_0) / (y + x) elif x <= -3.3e-9: tmp = y * ((1.0 / t_0) / (y + x)) else: tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y + Float64(1.0 + x)) tmp = 0.0 if (x <= -2.9e+168) tmp = Float64(Float64(y / t_0) / Float64(y + x)); elseif (x <= -3.3e-9) tmp = Float64(y * Float64(Float64(1.0 / t_0) / Float64(y + x))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(y + 1.0))) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y + (1.0 + x);
tmp = 0.0;
if (x <= -2.9e+168)
tmp = (y / t_0) / (y + x);
elseif (x <= -3.3e-9)
tmp = y * ((1.0 / t_0) / (y + x));
else
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e+168], N[(N[(y / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.3e-9], N[(y * N[(N[(1.0 / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(1 + x\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+168}:\\
\;\;\;\;\frac{\frac{y}{t_0}}{y + x}\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-9}:\\
\;\;\;\;y \cdot \frac{\frac{1}{t_0}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -2.9e168Initial program 70.1%
associate-*r/80.2%
*-commutative80.2%
distribute-rgt1-in4.3%
fma-def80.2%
cube-unmult80.2%
Simplified80.2%
associate-*r/70.1%
fma-udef0.0%
cube-mult0.0%
distribute-rgt1-in70.1%
associate-+r+70.1%
*-commutative70.1%
frac-times80.2%
*-commutative80.2%
associate-/r*99.8%
frac-times80.2%
+-commutative80.2%
+-commutative80.2%
associate-+l+80.2%
+-commutative80.2%
Applied egg-rr80.2%
associate-/r*99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
*-commutative99.8%
associate-*r/74.4%
+-commutative74.4%
Simplified74.4%
Taylor expanded in y around 0 87.0%
if -2.9e168 < x < -3.30000000000000018e-9Initial program 68.9%
associate-*r/80.1%
*-commutative80.1%
distribute-rgt1-in66.7%
fma-def80.1%
cube-unmult80.1%
Simplified80.1%
associate-*r/68.8%
fma-udef60.9%
cube-mult61.0%
distribute-rgt1-in68.9%
associate-+r+68.9%
*-commutative68.9%
frac-times90.2%
*-commutative90.2%
associate-/r*99.7%
frac-times90.4%
+-commutative90.4%
+-commutative90.4%
associate-+l+90.4%
+-commutative90.4%
Applied egg-rr90.4%
associate-/r*99.7%
associate-*l/99.7%
*-commutative99.7%
associate-*r/99.7%
*-commutative99.7%
associate-*r/82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in y around 0 59.7%
+-commutative59.7%
div-inv59.8%
*-un-lft-identity59.8%
times-frac77.8%
Applied egg-rr77.8%
if -3.30000000000000018e-9 < x Initial program 70.3%
associate-*r/85.8%
*-commutative85.8%
distribute-rgt1-in75.4%
fma-def85.8%
cube-unmult85.9%
Simplified85.9%
associate-*r/70.3%
fma-udef61.0%
cube-mult61.0%
distribute-rgt1-in70.3%
associate-+r+70.3%
*-commutative70.3%
frac-times89.7%
*-commutative89.7%
associate-/r*99.8%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 84.5%
+-commutative84.5%
Simplified84.5%
Final simplification83.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -6.5e+30)
(/ (/ y x) x)
(if (<= y 2.3e-168)
(/ y (* x (+ 1.0 x)))
(if (<= y 8e+93) (/ x (+ y (* y y))) (/ 1.0 (/ y (/ x y)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -6.5e+30) {
tmp = (y / x) / x;
} else if (y <= 2.3e-168) {
tmp = y / (x * (1.0 + x));
} else if (y <= 8e+93) {
tmp = x / (y + (y * y));
} else {
tmp = 1.0 / (y / (x / y));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-6.5d+30)) then
tmp = (y / x) / x
else if (y <= 2.3d-168) then
tmp = y / (x * (1.0d0 + x))
else if (y <= 8d+93) then
tmp = x / (y + (y * y))
else
tmp = 1.0d0 / (y / (x / y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -6.5e+30) {
tmp = (y / x) / x;
} else if (y <= 2.3e-168) {
tmp = y / (x * (1.0 + x));
} else if (y <= 8e+93) {
tmp = x / (y + (y * y));
} else {
tmp = 1.0 / (y / (x / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -6.5e+30: tmp = (y / x) / x elif y <= 2.3e-168: tmp = y / (x * (1.0 + x)) elif y <= 8e+93: tmp = x / (y + (y * y)) else: tmp = 1.0 / (y / (x / y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -6.5e+30) tmp = Float64(Float64(y / x) / x); elseif (y <= 2.3e-168) tmp = Float64(y / Float64(x * Float64(1.0 + x))); elseif (y <= 8e+93) tmp = Float64(x / Float64(y + Float64(y * y))); else tmp = Float64(1.0 / Float64(y / Float64(x / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -6.5e+30)
tmp = (y / x) / x;
elseif (y <= 2.3e-168)
tmp = y / (x * (1.0 + x));
elseif (y <= 8e+93)
tmp = x / (y + (y * y));
else
tmp = 1.0 / (y / (x / y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -6.5e+30], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.3e-168], N[(y / N[(x * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+93], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-168}:\\
\;\;\;\;\frac{y}{x \cdot \left(1 + x\right)}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+93}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{\frac{x}{y}}}\\
\end{array}
\end{array}
if y < -6.5e30Initial program 57.5%
times-frac81.5%
/-rgt-identity81.5%
associate-/l/81.5%
*-lft-identity81.5%
associate-+l+81.5%
Simplified81.5%
Taylor expanded in x around inf 17.2%
Taylor expanded in x around inf 16.0%
associate-*l/16.0%
*-un-lft-identity16.0%
Applied egg-rr16.0%
if -6.5e30 < y < 2.29999999999999986e-168Initial program 73.4%
times-frac89.8%
/-rgt-identity89.8%
associate-/l/89.8%
*-lft-identity89.8%
associate-+l+89.8%
Simplified89.8%
Taylor expanded in y around 0 78.4%
if 2.29999999999999986e-168 < y < 8.00000000000000035e93Initial program 84.2%
times-frac96.8%
/-rgt-identity96.8%
associate-/l/96.8%
*-lft-identity96.8%
associate-+l+96.8%
Simplified96.8%
Taylor expanded in x around 0 47.0%
distribute-rgt-in47.0%
*-lft-identity47.0%
Simplified47.0%
if 8.00000000000000035e93 < y Initial program 63.9%
associate-*r/84.3%
*-commutative84.3%
distribute-rgt1-in84.0%
fma-def84.3%
cube-unmult84.3%
Simplified84.3%
Taylor expanded in y around inf 82.3%
unpow282.3%
Simplified82.3%
clear-num82.3%
inv-pow82.3%
Applied egg-rr82.3%
unpow-182.3%
associate-/l*84.2%
Simplified84.2%
Final simplification60.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.3e-168) (/ (/ y (+ y (+ 1.0 x))) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.3e-168) {
tmp = (y / (y + (1.0 + x))) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.3d-168) then
tmp = (y / (y + (1.0d0 + x))) / (y + x)
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.3e-168) {
tmp = (y / (y + (1.0 + x))) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.3e-168: tmp = (y / (y + (1.0 + x))) / (y + x) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.3e-168) tmp = Float64(Float64(y / Float64(y + Float64(1.0 + x))) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.3e-168)
tmp = (y / (y + (1.0 + x))) / (y + x);
else
tmp = (x / (y + 1.0)) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.3e-168], N[(N[(y / N[(y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-168}:\\
\;\;\;\;\frac{\frac{y}{y + \left(1 + x\right)}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 2.29999999999999986e-168Initial program 67.8%
associate-*r/81.7%
*-commutative81.7%
distribute-rgt1-in56.4%
fma-def81.7%
cube-unmult81.7%
Simplified81.7%
associate-*r/67.8%
fma-udef45.4%
cube-mult45.4%
distribute-rgt1-in67.8%
associate-+r+67.8%
*-commutative67.8%
frac-times86.9%
*-commutative86.9%
associate-/r*99.7%
frac-times93.5%
+-commutative93.5%
+-commutative93.5%
associate-+l+93.5%
+-commutative93.5%
Applied egg-rr93.5%
associate-/r*99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
*-commutative99.8%
associate-*r/73.5%
+-commutative73.5%
Simplified73.5%
Taylor expanded in y around 0 57.5%
if 2.29999999999999986e-168 < y Initial program 73.6%
associate-*r/88.9%
*-commutative88.9%
distribute-rgt1-in85.7%
fma-def88.9%
cube-unmult88.9%
Simplified88.9%
associate-*r/73.6%
fma-udef71.5%
cube-mult71.5%
distribute-rgt1-in73.6%
associate-+r+73.6%
*-commutative73.6%
frac-times92.1%
*-commutative92.1%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 66.9%
+-commutative66.9%
Simplified66.9%
Final simplification61.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -1.5e-92)
t_0
(if (<= y 1.66e-96)
(/ y x)
(if (<= y 16000000000.0) t_0 (/ x (* y y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1.5e-92) {
tmp = t_0;
} else if (y <= 1.66e-96) {
tmp = y / x;
} else if (y <= 16000000000.0) {
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 = y / (x * x)
if (y <= (-1.5d-92)) then
tmp = t_0
else if (y <= 1.66d-96) then
tmp = y / x
else if (y <= 16000000000.0d0) 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 = y / (x * x);
double tmp;
if (y <= -1.5e-92) {
tmp = t_0;
} else if (y <= 1.66e-96) {
tmp = y / x;
} else if (y <= 16000000000.0) {
tmp = t_0;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -1.5e-92: tmp = t_0 elif y <= 1.66e-96: tmp = y / x elif y <= 16000000000.0: tmp = t_0 else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -1.5e-92) tmp = t_0; elseif (y <= 1.66e-96) tmp = Float64(y / x); elseif (y <= 16000000000.0) tmp = t_0; else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (x * x);
tmp = 0.0;
if (y <= -1.5e-92)
tmp = t_0;
elseif (y <= 1.66e-96)
tmp = y / x;
elseif (y <= 16000000000.0)
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[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.5e-92], t$95$0, If[LessEqual[y, 1.66e-96], N[(y / x), $MachinePrecision], If[LessEqual[y, 16000000000.0], t$95$0, N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{-92}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{-96}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 16000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -1.50000000000000007e-92 or 1.65999999999999993e-96 < y < 1.6e10Initial program 70.1%
associate-*r/80.7%
*-commutative80.7%
distribute-rgt1-in51.2%
fma-def80.7%
cube-unmult80.8%
Simplified80.8%
Taylor expanded in x around inf 27.4%
unpow227.4%
Simplified27.4%
if -1.50000000000000007e-92 < y < 1.65999999999999993e-96Initial program 70.3%
times-frac88.0%
/-rgt-identity88.0%
associate-/l/88.0%
*-lft-identity88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in y around 0 81.4%
Taylor expanded in x around 0 66.0%
if 1.6e10 < y Initial program 69.5%
associate-*r/87.3%
*-commutative87.3%
distribute-rgt1-in84.0%
fma-def87.3%
cube-unmult87.3%
Simplified87.3%
Taylor expanded in y around inf 79.7%
unpow279.7%
Simplified79.7%
Final simplification55.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -1e-84)
t_0
(if (<= y 6.5e-101) (/ y x) (if (<= y 6500000000.0) t_0 (/ (/ x y) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1e-84) {
tmp = t_0;
} else if (y <= 6.5e-101) {
tmp = y / x;
} else if (y <= 6500000000.0) {
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 = y / (x * x)
if (y <= (-1d-84)) then
tmp = t_0
else if (y <= 6.5d-101) then
tmp = y / x
else if (y <= 6500000000.0d0) 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 = y / (x * x);
double tmp;
if (y <= -1e-84) {
tmp = t_0;
} else if (y <= 6.5e-101) {
tmp = y / x;
} else if (y <= 6500000000.0) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -1e-84: tmp = t_0 elif y <= 6.5e-101: tmp = y / x elif y <= 6500000000.0: tmp = t_0 else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -1e-84) tmp = t_0; elseif (y <= 6.5e-101) tmp = Float64(y / x); elseif (y <= 6500000000.0) 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 = y / (x * x);
tmp = 0.0;
if (y <= -1e-84)
tmp = t_0;
elseif (y <= 6.5e-101)
tmp = y / x;
elseif (y <= 6500000000.0)
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[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-84], t$95$0, If[LessEqual[y, 6.5e-101], N[(y / x), $MachinePrecision], If[LessEqual[y, 6500000000.0], 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{y}{x \cdot x}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-84}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-101}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 6500000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -1e-84 or 6.4999999999999996e-101 < y < 6.5e9Initial program 69.5%
associate-*r/80.3%
*-commutative80.3%
distribute-rgt1-in50.2%
fma-def80.3%
cube-unmult80.3%
Simplified80.3%
Taylor expanded in x around inf 26.9%
unpow226.9%
Simplified26.9%
if -1e-84 < y < 6.4999999999999996e-101Initial program 70.9%
times-frac88.2%
/-rgt-identity88.2%
associate-/l/88.2%
*-lft-identity88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in y around 0 80.9%
Taylor expanded in x around 0 64.8%
if 6.5e9 < y Initial program 69.5%
associate-*r/87.3%
*-commutative87.3%
distribute-rgt1-in84.0%
fma-def87.3%
cube-unmult87.3%
Simplified87.3%
Taylor expanded in y around inf 79.7%
unpow279.7%
Simplified79.7%
associate-/r*81.2%
div-inv81.1%
Applied egg-rr81.1%
associate-*r/81.2%
*-rgt-identity81.2%
Simplified81.2%
Final simplification55.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ y x) x)))
(if (<= y -1.2e-93)
t_0
(if (<= y 1.72e-102)
(/ y x)
(if (<= y 1500000000.0) t_0 (/ (/ x y) y))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / x) / x;
double tmp;
if (y <= -1.2e-93) {
tmp = t_0;
} else if (y <= 1.72e-102) {
tmp = y / x;
} else if (y <= 1500000000.0) {
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 = (y / x) / x
if (y <= (-1.2d-93)) then
tmp = t_0
else if (y <= 1.72d-102) then
tmp = y / x
else if (y <= 1500000000.0d0) 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 = (y / x) / x;
double tmp;
if (y <= -1.2e-93) {
tmp = t_0;
} else if (y <= 1.72e-102) {
tmp = y / x;
} else if (y <= 1500000000.0) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / x) / x tmp = 0 if y <= -1.2e-93: tmp = t_0 elif y <= 1.72e-102: tmp = y / x elif y <= 1500000000.0: tmp = t_0 else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / x) / x) tmp = 0.0 if (y <= -1.2e-93) tmp = t_0; elseif (y <= 1.72e-102) tmp = Float64(y / x); elseif (y <= 1500000000.0) 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 = (y / x) / x;
tmp = 0.0;
if (y <= -1.2e-93)
tmp = t_0;
elseif (y <= 1.72e-102)
tmp = y / x;
elseif (y <= 1500000000.0)
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[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[y, -1.2e-93], t$95$0, If[LessEqual[y, 1.72e-102], N[(y / x), $MachinePrecision], If[LessEqual[y, 1500000000.0], 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{\frac{y}{x}}{x}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{-93}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.72 \cdot 10^{-102}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1500000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -1.2000000000000001e-93 or 1.72000000000000009e-102 < y < 1.5e9Initial program 70.1%
times-frac89.0%
/-rgt-identity89.0%
associate-/l/89.0%
*-lft-identity89.0%
associate-+l+89.0%
Simplified89.0%
Taylor expanded in x around inf 34.1%
Taylor expanded in x around inf 30.8%
associate-*l/30.8%
*-un-lft-identity30.8%
Applied egg-rr30.8%
if -1.2000000000000001e-93 < y < 1.72000000000000009e-102Initial program 70.3%
times-frac88.0%
/-rgt-identity88.0%
associate-/l/88.0%
*-lft-identity88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in y around 0 81.4%
Taylor expanded in x around 0 66.0%
if 1.5e9 < y Initial program 69.5%
associate-*r/87.3%
*-commutative87.3%
distribute-rgt1-in84.0%
fma-def87.3%
cube-unmult87.3%
Simplified87.3%
Taylor expanded in y around inf 79.7%
unpow279.7%
Simplified79.7%
associate-/r*81.2%
div-inv81.1%
Applied egg-rr81.1%
associate-*r/81.2%
*-rgt-identity81.2%
Simplified81.2%
Final simplification56.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.0) (/ (/ y x) x) (if (<= x -1.75e-101) (- (/ y x) y) (/ x (+ y (* y y))))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -1.75e-101) {
tmp = (y / x) - y;
} else {
tmp = x / (y + (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 <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-1.75d-101)) then
tmp = (y / x) - y
else
tmp = x / (y + (y * y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -1.75e-101) {
tmp = (y / x) - y;
} else {
tmp = x / (y + (y * y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) / x elif x <= -1.75e-101: tmp = (y / x) - y else: tmp = x / (y + (y * y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.75e-101) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / Float64(y + Float64(y * y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = (y / x) / x;
elseif (x <= -1.75e-101)
tmp = (y / x) - y;
else
tmp = x / (y + (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, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.75e-101], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-101}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\end{array}
\end{array}
if x < -1Initial program 68.8%
times-frac86.3%
/-rgt-identity86.3%
associate-/l/86.3%
*-lft-identity86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in x around inf 68.8%
Taylor expanded in x around inf 68.3%
associate-*l/68.3%
*-un-lft-identity68.3%
Applied egg-rr68.3%
if -1 < x < -1.74999999999999997e-101Initial program 88.0%
times-frac99.6%
/-rgt-identity99.6%
associate-/l/99.6%
*-lft-identity99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 53.3%
Taylor expanded in x around 0 50.9%
neg-mul-150.9%
unsub-neg50.9%
Simplified50.9%
if -1.74999999999999997e-101 < x Initial program 67.8%
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 61.3%
distribute-rgt-in61.3%
*-lft-identity61.3%
Simplified61.3%
Final simplification61.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -6.1e+30) (/ (/ y x) x) (if (<= y 2.3e-168) (/ y (* x (+ 1.0 x))) (/ (/ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -6.1e+30) {
tmp = (y / x) / x;
} else if (y <= 2.3e-168) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-6.1d+30)) then
tmp = (y / x) / x
else if (y <= 2.3d-168) then
tmp = y / (x * (1.0d0 + x))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -6.1e+30) {
tmp = (y / x) / x;
} else if (y <= 2.3e-168) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -6.1e+30: tmp = (y / x) / x elif y <= 2.3e-168: tmp = y / (x * (1.0 + x)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -6.1e+30) tmp = Float64(Float64(y / x) / x); elseif (y <= 2.3e-168) tmp = Float64(y / Float64(x * Float64(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 <= -6.1e+30)
tmp = (y / x) / x;
elseif (y <= 2.3e-168)
tmp = y / (x * (1.0 + x));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -6.1e+30], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.3e-168], N[(y / N[(x * N[(1.0 + 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 -6.1 \cdot 10^{+30}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-168}:\\
\;\;\;\;\frac{y}{x \cdot \left(1 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < -6.1000000000000001e30Initial program 57.5%
times-frac81.5%
/-rgt-identity81.5%
associate-/l/81.5%
*-lft-identity81.5%
associate-+l+81.5%
Simplified81.5%
Taylor expanded in x around inf 17.2%
Taylor expanded in x around inf 16.0%
associate-*l/16.0%
*-un-lft-identity16.0%
Applied egg-rr16.0%
if -6.1000000000000001e30 < y < 2.29999999999999986e-168Initial program 73.4%
times-frac89.8%
/-rgt-identity89.8%
associate-/l/89.8%
*-lft-identity89.8%
associate-+l+89.8%
Simplified89.8%
Taylor expanded in y around 0 78.4%
if 2.29999999999999986e-168 < y Initial program 73.6%
associate-*r/88.9%
*-commutative88.9%
distribute-rgt1-in85.7%
fma-def88.9%
cube-unmult88.9%
Simplified88.9%
associate-*r/73.6%
fma-udef71.5%
cube-mult71.5%
distribute-rgt1-in73.6%
associate-+r+73.6%
*-commutative73.6%
frac-times92.1%
*-commutative92.1%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
Taylor expanded in x around 0 65.5%
associate-/r*66.5%
Simplified66.5%
Final simplification60.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -6e+30) (/ (/ y x) (+ y x)) (if (<= y 2.3e-168) (/ y (* x (+ 1.0 x))) (/ (/ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -6e+30) {
tmp = (y / x) / (y + x);
} else if (y <= 2.3e-168) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-6d+30)) then
tmp = (y / x) / (y + x)
else if (y <= 2.3d-168) then
tmp = y / (x * (1.0d0 + x))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -6e+30) {
tmp = (y / x) / (y + x);
} else if (y <= 2.3e-168) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -6e+30: tmp = (y / x) / (y + x) elif y <= 2.3e-168: tmp = y / (x * (1.0 + x)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -6e+30) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (y <= 2.3e-168) tmp = Float64(y / Float64(x * Float64(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 <= -6e+30)
tmp = (y / x) / (y + x);
elseif (y <= 2.3e-168)
tmp = y / (x * (1.0 + x));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -6e+30], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e-168], N[(y / N[(x * N[(1.0 + 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 -6 \cdot 10^{+30}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-168}:\\
\;\;\;\;\frac{y}{x \cdot \left(1 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < -5.99999999999999956e30Initial program 57.5%
associate-*r/71.4%
*-commutative71.4%
distribute-rgt1-in28.3%
fma-def71.4%
cube-unmult71.5%
Simplified71.5%
associate-*r/57.5%
fma-udef22.6%
cube-mult22.5%
distribute-rgt1-in57.5%
associate-+r+57.5%
*-commutative57.5%
frac-times81.5%
*-commutative81.5%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 17.1%
if -5.99999999999999956e30 < y < 2.29999999999999986e-168Initial program 73.4%
times-frac89.8%
/-rgt-identity89.8%
associate-/l/89.8%
*-lft-identity89.8%
associate-+l+89.8%
Simplified89.8%
Taylor expanded in y around 0 78.4%
if 2.29999999999999986e-168 < y Initial program 73.6%
associate-*r/88.9%
*-commutative88.9%
distribute-rgt1-in85.7%
fma-def88.9%
cube-unmult88.9%
Simplified88.9%
associate-*r/73.6%
fma-udef71.5%
cube-mult71.5%
distribute-rgt1-in73.6%
associate-+r+73.6%
*-commutative73.6%
frac-times92.1%
*-commutative92.1%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
Taylor expanded in x around 0 65.5%
associate-/r*66.5%
Simplified66.5%
Final simplification60.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.3e-168) (/ (/ y (+ 1.0 x)) x) (/ (/ x (+ y 1.0)) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.3e-168) {
tmp = (y / (1.0 + x)) / x;
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.3d-168) then
tmp = (y / (1.0d0 + x)) / x
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.3e-168) {
tmp = (y / (1.0 + x)) / x;
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.3e-168: tmp = (y / (1.0 + x)) / x else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.3e-168) tmp = Float64(Float64(y / Float64(1.0 + x)) / x); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.3e-168)
tmp = (y / (1.0 + x)) / x;
else
tmp = (x / (y + 1.0)) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.3e-168], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-168}:\\
\;\;\;\;\frac{\frac{y}{1 + x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 2.29999999999999986e-168Initial program 67.8%
associate-*r/81.7%
*-commutative81.7%
distribute-rgt1-in56.4%
fma-def81.7%
cube-unmult81.7%
Simplified81.7%
associate-*r/67.8%
fma-udef45.4%
cube-mult45.4%
distribute-rgt1-in67.8%
associate-+r+67.8%
*-commutative67.8%
frac-times86.9%
*-commutative86.9%
associate-/r*99.7%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 54.5%
associate-/r*56.5%
Simplified56.5%
if 2.29999999999999986e-168 < y Initial program 73.6%
associate-*r/88.9%
*-commutative88.9%
distribute-rgt1-in85.7%
fma-def88.9%
cube-unmult88.9%
Simplified88.9%
associate-*r/73.6%
fma-udef71.5%
cube-mult71.5%
distribute-rgt1-in73.6%
associate-+r+73.6%
*-commutative73.6%
frac-times92.1%
*-commutative92.1%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 66.9%
+-commutative66.9%
Simplified66.9%
Final simplification60.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.3e-168) (/ (/ y (+ 1.0 x)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.3e-168) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.3d-168) then
tmp = (y / (1.0d0 + x)) / (y + x)
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 2.3e-168) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.3e-168: tmp = (y / (1.0 + x)) / (y + x) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.3e-168) tmp = Float64(Float64(y / Float64(1.0 + x)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.3e-168)
tmp = (y / (1.0 + x)) / (y + x);
else
tmp = (x / (y + 1.0)) / (y + x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 2.3e-168], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-168}:\\
\;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 2.29999999999999986e-168Initial program 67.8%
associate-*r/81.7%
*-commutative81.7%
distribute-rgt1-in56.4%
fma-def81.7%
cube-unmult81.7%
Simplified81.7%
associate-*r/67.8%
fma-udef45.4%
cube-mult45.4%
distribute-rgt1-in67.8%
associate-+r+67.8%
*-commutative67.8%
frac-times86.9%
*-commutative86.9%
associate-/r*99.7%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 57.1%
if 2.29999999999999986e-168 < y Initial program 73.6%
associate-*r/88.9%
*-commutative88.9%
distribute-rgt1-in85.7%
fma-def88.9%
cube-unmult88.9%
Simplified88.9%
associate-*r/73.6%
fma-udef71.5%
cube-mult71.5%
distribute-rgt1-in73.6%
associate-+r+73.6%
*-commutative73.6%
frac-times92.1%
*-commutative92.1%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 66.9%
+-commutative66.9%
Simplified66.9%
Final simplification60.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 2.3e-168) (/ (/ y (+ 1.0 x)) x) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.3e-168) {
tmp = (y / (1.0 + 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.3d-168) then
tmp = (y / (1.0d0 + 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.3e-168) {
tmp = (y / (1.0 + 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.3e-168: tmp = (y / (1.0 + 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.3e-168) tmp = Float64(Float64(y / Float64(1.0 + 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.3e-168)
tmp = (y / (1.0 + 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.3e-168], N[(N[(y / N[(1.0 + x), $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.3 \cdot 10^{-168}:\\
\;\;\;\;\frac{\frac{y}{1 + x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 2.29999999999999986e-168Initial program 67.8%
associate-*r/81.7%
*-commutative81.7%
distribute-rgt1-in56.4%
fma-def81.7%
cube-unmult81.7%
Simplified81.7%
associate-*r/67.8%
fma-udef45.4%
cube-mult45.4%
distribute-rgt1-in67.8%
associate-+r+67.8%
*-commutative67.8%
frac-times86.9%
*-commutative86.9%
associate-/r*99.7%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 54.5%
associate-/r*56.5%
Simplified56.5%
if 2.29999999999999986e-168 < y Initial program 73.6%
associate-*r/88.9%
*-commutative88.9%
distribute-rgt1-in85.7%
fma-def88.9%
cube-unmult88.9%
Simplified88.9%
associate-*r/73.6%
fma-udef71.5%
cube-mult71.5%
distribute-rgt1-in73.6%
associate-+r+73.6%
*-commutative73.6%
frac-times92.1%
*-commutative92.1%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
Taylor expanded in x around 0 65.5%
associate-/r*66.5%
Simplified66.5%
Final simplification60.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 8e-47) (/ y x) (/ 1.0 (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 8e-47) {
tmp = y / x;
} else {
tmp = 1.0 / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 8d-47) then
tmp = y / x
else
tmp = 1.0d0 / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 8e-47) {
tmp = y / x;
} else {
tmp = 1.0 / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 8e-47: tmp = y / x else: tmp = 1.0 / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 8e-47) tmp = Float64(y / x); else tmp = Float64(1.0 / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 8e-47)
tmp = y / x;
else
tmp = 1.0 / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 8e-47], N[(y / x), $MachinePrecision], N[(1.0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{-47}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y + 1}\\
\end{array}
\end{array}
if y < 7.9999999999999998e-47Initial program 69.2%
times-frac88.0%
/-rgt-identity88.0%
associate-/l/88.0%
*-lft-identity88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in y around 0 56.3%
Taylor expanded in x around 0 37.8%
if 7.9999999999999998e-47 < y Initial program 72.2%
associate-*r/88.0%
*-commutative88.0%
distribute-rgt1-in85.1%
fma-def88.0%
cube-unmult88.0%
Simplified88.0%
associate-*r/72.2%
fma-udef70.8%
cube-mult70.8%
distribute-rgt1-in72.2%
associate-+r+72.2%
*-commutative72.2%
frac-times91.2%
*-commutative91.2%
associate-/r*99.8%
frac-times91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l+91.2%
+-commutative91.2%
Applied egg-rr91.2%
associate-/r*99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.9%
*-commutative99.9%
associate-*r/78.3%
+-commutative78.3%
Simplified78.3%
Taylor expanded in y around 0 25.5%
Taylor expanded in x around 0 5.7%
+-commutative5.7%
Simplified5.7%
Final simplification28.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.15e-17) (/ y x) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.15e-17) {
tmp = y / x;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.15d-17) then
tmp = y / x
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.15e-17) {
tmp = y / x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.15e-17: tmp = y / x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.15e-17) tmp = Float64(y / x); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.15e-17)
tmp = y / x;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 1.15e-17], N[(y / x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{-17}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1.15000000000000004e-17Initial program 69.5%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 56.8%
Taylor expanded in x around 0 37.4%
if 1.15000000000000004e-17 < y Initial program 71.4%
associate-*r/87.7%
*-commutative87.7%
distribute-rgt1-in84.7%
fma-def87.7%
cube-unmult87.7%
Simplified87.7%
Taylor expanded in y around inf 73.8%
unpow273.8%
Simplified73.8%
Final simplification47.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 8e-47) (/ y x) (/ 1.0 y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 8e-47) {
tmp = y / x;
} else {
tmp = 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 <= 8d-47) then
tmp = y / x
else
tmp = 1.0d0 / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 8e-47) {
tmp = y / x;
} else {
tmp = 1.0 / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 8e-47: tmp = y / x else: tmp = 1.0 / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 8e-47) tmp = Float64(y / x); else tmp = 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 <= 8e-47)
tmp = y / x;
else
tmp = 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, 8e-47], N[(y / x), $MachinePrecision], N[(1.0 / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{-47}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y}\\
\end{array}
\end{array}
if y < 7.9999999999999998e-47Initial program 69.2%
times-frac88.0%
/-rgt-identity88.0%
associate-/l/88.0%
*-lft-identity88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in y around 0 56.3%
Taylor expanded in x around 0 37.8%
if 7.9999999999999998e-47 < y Initial program 72.2%
associate-*r/88.0%
*-commutative88.0%
distribute-rgt1-in85.1%
fma-def88.0%
cube-unmult88.0%
Simplified88.0%
associate-*r/72.2%
fma-udef70.8%
cube-mult70.8%
distribute-rgt1-in72.2%
associate-+r+72.2%
*-commutative72.2%
frac-times91.2%
*-commutative91.2%
associate-/r*99.8%
frac-times91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l+91.2%
+-commutative91.2%
Applied egg-rr91.2%
associate-/r*99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.9%
*-commutative99.9%
associate-*r/78.3%
+-commutative78.3%
Simplified78.3%
Taylor expanded in y around 0 25.5%
Taylor expanded in y around inf 5.6%
Final simplification28.6%
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 70.0%
associate-*r/84.4%
*-commutative84.4%
distribute-rgt1-in67.7%
fma-def84.5%
cube-unmult84.5%
Simplified84.5%
associate-*r/70.0%
fma-udef55.5%
cube-mult55.5%
distribute-rgt1-in70.0%
associate-+r+70.0%
*-commutative70.0%
frac-times88.9%
*-commutative88.9%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 47.9%
mul-1-neg47.9%
unsub-neg47.9%
Simplified47.9%
Taylor expanded in y around inf 3.7%
Final simplification3.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 x))
assert(x < y);
double code(double x, double y) {
return 1.0 / x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / x
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{x}
\end{array}
Initial program 70.0%
times-frac88.9%
/-rgt-identity88.9%
associate-/l/88.9%
*-lft-identity88.9%
associate-+l+88.9%
Simplified88.9%
Taylor expanded in x around inf 48.4%
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 (/ 1.0 y))
assert(x < y);
double code(double x, double y) {
return 1.0 / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / y
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / y;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / y
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{y}
\end{array}
Initial program 70.0%
associate-*r/84.4%
*-commutative84.4%
distribute-rgt1-in67.7%
fma-def84.5%
cube-unmult84.5%
Simplified84.5%
associate-*r/70.0%
fma-udef55.5%
cube-mult55.5%
distribute-rgt1-in70.0%
associate-+r+70.0%
*-commutative70.0%
frac-times88.9%
*-commutative88.9%
associate-/r*99.8%
frac-times93.5%
+-commutative93.5%
+-commutative93.5%
associate-+l+93.5%
+-commutative93.5%
Applied egg-rr93.5%
associate-/r*99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
*-commutative99.8%
associate-*r/75.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in y around 0 49.4%
Taylor expanded in y around inf 4.1%
Final simplification4.1%
(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 2023257
(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))))