
(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 (* (/ (/ 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 66.9%
times-frac86.0%
associate-+l+86.0%
Simplified86.0%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
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
(if (<= x -3.2e+160)
(/ (/ y (+ y (+ x 1.0))) (+ x y))
(if (<= x -1.15e-16)
(* (/ y (+ x (+ y 1.0))) (/ x (* (+ x y) (+ x y))))
(* (/ (/ x (+ x y)) (+ x y)) (/ y (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.2e+160) {
tmp = (y / (y + (x + 1.0))) / (x + y);
} else if (x <= -1.15e-16) {
tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)));
} else {
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.2d+160)) then
tmp = (y / (y + (x + 1.0d0))) / (x + y)
else if (x <= (-1.15d-16)) then
tmp = (y / (x + (y + 1.0d0))) * (x / ((x + y) * (x + y)))
else
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.2e+160) {
tmp = (y / (y + (x + 1.0))) / (x + y);
} else if (x <= -1.15e-16) {
tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)));
} else {
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.2e+160: tmp = (y / (y + (x + 1.0))) / (x + y) elif x <= -1.15e-16: tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y))) else: tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.2e+160) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(x + y)); elseif (x <= -1.15e-16) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(x / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + y)) * Float64(y / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.2e+160)
tmp = (y / (y + (x + 1.0))) / (x + y);
elseif (x <= -1.15e-16)
tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)));
else
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.2e+160], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.15e-16], 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[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+160}:\\
\;\;\;\;\frac{\frac{y}{y + \left(x + 1\right)}}{x + y}\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-16}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{x + y} \cdot \frac{y}{y + 1}\\
\end{array}
\end{array}
if x < -3.1999999999999998e160Initial program 59.4%
times-frac82.1%
associate-+l+82.1%
Simplified82.1%
associate-/r*99.9%
div-inv99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in x around inf 86.1%
associate-*l/86.1%
*-un-lft-identity86.1%
associate-+r+86.1%
+-commutative86.1%
associate-+l+86.1%
Applied egg-rr86.1%
if -3.1999999999999998e160 < x < -1.15e-16Initial program 76.6%
times-frac91.6%
associate-+l+91.6%
Simplified91.6%
if -1.15e-16 < x Initial program 66.5%
times-frac85.7%
associate-+l+85.7%
Simplified85.7%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 84.1%
+-commutative84.1%
Simplified84.1%
Final simplification85.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -3.3e+160)
(/ (/ y (+ y (+ x 1.0))) (+ x y))
(if (<= x -2e-21)
(* (/ y (* (+ x y) (+ x y))) (/ x (+ x (+ y 1.0))))
(* (/ (/ x (+ x y)) (+ x y)) (/ y (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.3e+160) {
tmp = (y / (y + (x + 1.0))) / (x + y);
} else if (x <= -2e-21) {
tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0)));
} else {
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.3d+160)) then
tmp = (y / (y + (x + 1.0d0))) / (x + y)
else if (x <= (-2d-21)) then
tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0d0)))
else
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.3e+160) {
tmp = (y / (y + (x + 1.0))) / (x + y);
} else if (x <= -2e-21) {
tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0)));
} else {
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.3e+160: tmp = (y / (y + (x + 1.0))) / (x + y) elif x <= -2e-21: tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0))) else: tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.3e+160) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(x + y)); elseif (x <= -2e-21) tmp = Float64(Float64(y / Float64(Float64(x + y) * Float64(x + y))) * Float64(x / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + y)) * Float64(y / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.3e+160)
tmp = (y / (y + (x + 1.0))) / (x + y);
elseif (x <= -2e-21)
tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0)));
else
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.3e+160], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-21], N[(N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{+160}:\\
\;\;\;\;\frac{\frac{y}{y + \left(x + 1\right)}}{x + y}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-21}:\\
\;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{x + y} \cdot \frac{y}{y + 1}\\
\end{array}
\end{array}
if x < -3.2999999999999997e160Initial program 59.4%
times-frac82.1%
associate-+l+82.1%
Simplified82.1%
associate-/r*99.9%
div-inv99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in x around inf 86.1%
associate-*l/86.1%
*-un-lft-identity86.1%
associate-+r+86.1%
+-commutative86.1%
associate-+l+86.1%
Applied egg-rr86.1%
if -3.2999999999999997e160 < x < -1.99999999999999982e-21Initial program 77.2%
associate-/r*82.5%
+-commutative82.5%
+-commutative82.5%
+-commutative82.5%
associate-/l/77.2%
times-frac92.1%
*-commutative92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
associate-+l+92.1%
Simplified92.1%
if -1.99999999999999982e-21 < x Initial program 66.3%
times-frac85.7%
associate-+l+85.7%
Simplified85.7%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 84.0%
+-commutative84.0%
Simplified84.0%
Final simplification85.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 1.2e-168)
(/ (/ y x) (+ x 1.0))
(if (<= y 150000000.0)
(* (/ y (* (+ x y) (+ x y))) (/ x (+ x 1.0)))
(/ (/ x (+ x y)) (+ y (+ x (- x -1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.2e-168) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 150000000.0) {
tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0));
} else {
tmp = (x / (x + y)) / (y + (x + (x - -1.0)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.2d-168) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 150000000.0d0) then
tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0d0))
else
tmp = (x / (x + y)) / (y + (x + (x - (-1.0d0))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.2e-168) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 150000000.0) {
tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0));
} else {
tmp = (x / (x + y)) / (y + (x + (x - -1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.2e-168: tmp = (y / x) / (x + 1.0) elif y <= 150000000.0: tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0)) else: tmp = (x / (x + y)) / (y + (x + (x - -1.0))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.2e-168) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 150000000.0) tmp = Float64(Float64(y / Float64(Float64(x + y) * Float64(x + y))) * Float64(x / Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + Float64(x + Float64(x - -1.0)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.2e-168)
tmp = (y / x) / (x + 1.0);
elseif (y <= 150000000.0)
tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0));
else
tmp = (x / (x + y)) / (y + (x + (x - -1.0)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 1.2e-168], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 150000000.0], N[(N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2 \cdot 10^{-168}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 150000000:\\
\;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + \left(x + \left(x - -1\right)\right)}\\
\end{array}
\end{array}
if y < 1.2e-168Initial program 65.2%
times-frac85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in y around 0 57.6%
associate-/r*56.1%
+-commutative56.1%
Simplified56.1%
if 1.2e-168 < y < 1.5e8Initial program 88.9%
associate-/r*91.5%
+-commutative91.5%
+-commutative91.5%
+-commutative91.5%
associate-/l/88.9%
times-frac99.5%
*-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 97.7%
+-commutative97.7%
Simplified97.7%
if 1.5e8 < y Initial program 58.6%
associate-/r*63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
associate-/r*58.6%
associate-*l/71.7%
*-commutative71.7%
*-commutative71.7%
distribute-rgt1-in68.6%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.8%
+-commutative71.8%
Simplified71.8%
associate-*r/58.6%
fma-udef57.6%
cube-mult57.6%
distribute-rgt1-in58.6%
associate-+r+58.6%
*-commutative58.6%
*-commutative58.6%
frac-times80.1%
associate-/r*99.8%
clear-num99.8%
frac-times99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
Taylor expanded in y around -inf 77.8%
mul-1-neg77.8%
unsub-neg77.8%
neg-mul-177.8%
+-commutative77.8%
unsub-neg77.8%
distribute-lft-in77.8%
metadata-eval77.8%
neg-mul-177.8%
unsub-neg77.8%
Simplified77.8%
Final simplification66.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -4.4e+161)
(/ (/ y (+ y (+ x 1.0))) (+ x y))
(if (<= x -5.3e-20)
(* (/ y (* (+ x y) (+ x y))) (/ x (+ x 1.0)))
(* (/ (/ x (+ x y)) (+ x y)) (/ y (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.4e+161) {
tmp = (y / (y + (x + 1.0))) / (x + y);
} else if (x <= -5.3e-20) {
tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0));
} else {
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.4d+161)) then
tmp = (y / (y + (x + 1.0d0))) / (x + y)
else if (x <= (-5.3d-20)) then
tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0d0))
else
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.4e+161) {
tmp = (y / (y + (x + 1.0))) / (x + y);
} else if (x <= -5.3e-20) {
tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0));
} else {
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.4e+161: tmp = (y / (y + (x + 1.0))) / (x + y) elif x <= -5.3e-20: tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0)) else: tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.4e+161) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(x + y)); elseif (x <= -5.3e-20) tmp = Float64(Float64(y / Float64(Float64(x + y) * Float64(x + y))) * Float64(x / Float64(x + 1.0))); else tmp = Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + y)) * Float64(y / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.4e+161)
tmp = (y / (y + (x + 1.0))) / (x + y);
elseif (x <= -5.3e-20)
tmp = (y / ((x + y) * (x + y))) * (x / (x + 1.0));
else
tmp = ((x / (x + y)) / (x + y)) * (y / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.4e+161], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.3e-20], N[(N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+161}:\\
\;\;\;\;\frac{\frac{y}{y + \left(x + 1\right)}}{x + y}\\
\mathbf{elif}\;x \leq -5.3 \cdot 10^{-20}:\\
\;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{x + y} \cdot \frac{y}{y + 1}\\
\end{array}
\end{array}
if x < -4.4e161Initial program 61.2%
times-frac84.5%
associate-+l+84.5%
Simplified84.5%
associate-/r*99.9%
div-inv99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in x around inf 88.6%
associate-*l/88.6%
*-un-lft-identity88.6%
associate-+r+88.6%
+-commutative88.6%
associate-+l+88.6%
Applied egg-rr88.6%
if -4.4e161 < x < -5.3000000000000002e-20Initial program 75.1%
associate-/r*80.3%
+-commutative80.3%
+-commutative80.3%
+-commutative80.3%
associate-/l/75.1%
times-frac89.7%
*-commutative89.7%
+-commutative89.7%
+-commutative89.7%
+-commutative89.7%
associate-+l+89.7%
Simplified89.7%
Taylor expanded in y around 0 84.8%
+-commutative84.8%
Simplified84.8%
if -5.3000000000000002e-20 < x Initial program 66.3%
times-frac85.7%
associate-+l+85.7%
Simplified85.7%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 84.0%
+-commutative84.0%
Simplified84.0%
Final simplification84.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 4.6e-92)
(/ (/ y x) (+ x 1.0))
(if (<= y 0.55)
(* x (/ y (* (+ x y) (+ x y))))
(/ (/ x (+ x y)) (+ x (+ y (+ x 1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 4.6e-92) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 0.55) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) / (x + (y + (x + 1.0)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.6d-92) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 0.55d0) then
tmp = x * (y / ((x + y) * (x + y)))
else
tmp = (x / (x + y)) / (x + (y + (x + 1.0d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 4.6e-92) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 0.55) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) / (x + (y + (x + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 4.6e-92: tmp = (y / x) / (x + 1.0) elif y <= 0.55: tmp = x * (y / ((x + y) * (x + y))) else: tmp = (x / (x + y)) / (x + (y + (x + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 4.6e-92) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 0.55) tmp = Float64(x * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(x + Float64(y + Float64(x + 1.0)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 4.6e-92)
tmp = (y / x) / (x + 1.0);
elseif (y <= 0.55)
tmp = x * (y / ((x + y) * (x + y)));
else
tmp = (x / (x + y)) / (x + (y + (x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 4.6e-92], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.55], N[(x * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.6 \cdot 10^{-92}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 0.55:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{x + \left(y + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if y < 4.60000000000000032e-92Initial program 66.5%
times-frac86.1%
associate-+l+86.1%
Simplified86.1%
Taylor expanded in y around 0 58.7%
associate-/r*57.3%
+-commutative57.3%
Simplified57.3%
if 4.60000000000000032e-92 < y < 0.55000000000000004Initial program 88.5%
associate-/r*92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
associate-/l/88.5%
times-frac99.5%
*-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 82.0%
if 0.55000000000000004 < y Initial program 59.3%
associate-/r*63.8%
+-commutative63.8%
+-commutative63.8%
+-commutative63.8%
associate-/r*59.3%
associate-*l/72.2%
*-commutative72.2%
*-commutative72.2%
distribute-rgt1-in69.1%
fma-def72.2%
+-commutative72.2%
+-commutative72.2%
cube-unmult72.3%
+-commutative72.3%
Simplified72.3%
associate-*r/59.3%
fma-udef58.3%
cube-mult58.3%
distribute-rgt1-in59.3%
associate-+r+59.3%
*-commutative59.3%
*-commutative59.3%
frac-times80.4%
associate-/r*99.8%
clear-num99.8%
frac-times99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
Taylor expanded in y around -inf 76.6%
mul-1-neg76.6%
unsub-neg76.6%
neg-mul-176.6%
+-commutative76.6%
unsub-neg76.6%
distribute-lft-in76.6%
metadata-eval76.6%
neg-mul-176.6%
unsub-neg76.6%
Simplified76.6%
associate--r-76.6%
Applied egg-rr76.6%
Final simplification64.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 1.7e-92)
(/ (/ y x) (+ x 1.0))
(if (<= y 1700000.0)
(* x (/ y (* (+ x y) (+ x y))))
(/ (/ x (+ x y)) (+ y (+ x (- x -1.0)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.7e-92) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1700000.0) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) / (y + (x + (x - -1.0)));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.7d-92) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 1700000.0d0) then
tmp = x * (y / ((x + y) * (x + y)))
else
tmp = (x / (x + y)) / (y + (x + (x - (-1.0d0))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.7e-92) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1700000.0) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) / (y + (x + (x - -1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.7e-92: tmp = (y / x) / (x + 1.0) elif y <= 1700000.0: tmp = x * (y / ((x + y) * (x + y))) else: tmp = (x / (x + y)) / (y + (x + (x - -1.0))) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.7e-92) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 1700000.0) tmp = Float64(x * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + Float64(x + Float64(x - -1.0)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.7e-92)
tmp = (y / x) / (x + 1.0);
elseif (y <= 1700000.0)
tmp = x * (y / ((x + y) * (x + y)));
else
tmp = (x / (x + y)) / (y + (x + (x - -1.0)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 1.7e-92], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1700000.0], N[(x * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{-92}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 1700000:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + \left(x + \left(x - -1\right)\right)}\\
\end{array}
\end{array}
if y < 1.7000000000000001e-92Initial program 66.5%
times-frac86.1%
associate-+l+86.1%
Simplified86.1%
Taylor expanded in y around 0 58.7%
associate-/r*57.3%
+-commutative57.3%
Simplified57.3%
if 1.7000000000000001e-92 < y < 1.7e6Initial program 89.0%
associate-/r*92.4%
+-commutative92.4%
+-commutative92.4%
+-commutative92.4%
associate-/l/89.0%
times-frac99.5%
*-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 79.1%
if 1.7e6 < y Initial program 58.6%
associate-/r*63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
associate-/r*58.6%
associate-*l/71.7%
*-commutative71.7%
*-commutative71.7%
distribute-rgt1-in68.6%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.8%
+-commutative71.8%
Simplified71.8%
associate-*r/58.6%
fma-udef57.6%
cube-mult57.6%
distribute-rgt1-in58.6%
associate-+r+58.6%
*-commutative58.6%
*-commutative58.6%
frac-times80.1%
associate-/r*99.8%
clear-num99.8%
frac-times99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
Taylor expanded in y around -inf 77.8%
mul-1-neg77.8%
unsub-neg77.8%
neg-mul-177.8%
+-commutative77.8%
unsub-neg77.8%
distribute-lft-in77.8%
metadata-eval77.8%
neg-mul-177.8%
unsub-neg77.8%
Simplified77.8%
Final simplification64.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 1.8e-92)
(/ (/ y x) (+ x 1.0))
(if (<= y 110000000.0)
(* x (/ y (* (+ x y) (+ x y))))
(/ (/ x (+ x y)) (+ y 1.0)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.8e-92) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 110000000.0) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.8d-92) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 110000000.0d0) then
tmp = x * (y / ((x + y) * (x + y)))
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.8e-92) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 110000000.0) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.8e-92: tmp = (y / x) / (x + 1.0) elif y <= 110000000.0: tmp = x * (y / ((x + y) * (x + y))) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.8e-92) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 110000000.0) tmp = Float64(x * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.8e-92)
tmp = (y / x) / (x + 1.0);
elseif (y <= 110000000.0)
tmp = x * (y / ((x + y) * (x + y)));
else
tmp = (x / (x + y)) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 1.8e-92], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 110000000.0], N[(x * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{-92}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 110000000:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if y < 1.80000000000000008e-92Initial program 66.5%
times-frac86.1%
associate-+l+86.1%
Simplified86.1%
Taylor expanded in y around 0 58.7%
associate-/r*57.3%
+-commutative57.3%
Simplified57.3%
if 1.80000000000000008e-92 < y < 1.1e8Initial program 89.0%
associate-/r*92.4%
+-commutative92.4%
+-commutative92.4%
+-commutative92.4%
associate-/l/89.0%
times-frac99.5%
*-commutative99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 79.1%
if 1.1e8 < y Initial program 58.6%
associate-/r*63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
associate-/r*58.6%
associate-*l/71.7%
*-commutative71.7%
*-commutative71.7%
distribute-rgt1-in68.6%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.8%
+-commutative71.8%
Simplified71.8%
associate-*r/58.6%
fma-udef57.6%
cube-mult57.6%
distribute-rgt1-in58.6%
associate-+r+58.6%
*-commutative58.6%
*-commutative58.6%
frac-times80.1%
associate-/r*99.8%
clear-num99.8%
frac-times99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 76.9%
+-commutative76.9%
Simplified76.9%
Final simplification64.0%
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 -5.8e-137)
t_0
(if (<= y 3.8e-161)
(/ y x)
(if (<= y 3.3e-86)
t_0
(if (<= y 96000000.0) (- (/ x y) x) (/ x (* y y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -5.8e-137) {
tmp = t_0;
} else if (y <= 3.8e-161) {
tmp = y / x;
} else if (y <= 3.3e-86) {
tmp = t_0;
} else if (y <= 96000000.0) {
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) :: t_0
real(8) :: tmp
t_0 = y / (x * x)
if (y <= (-5.8d-137)) then
tmp = t_0
else if (y <= 3.8d-161) then
tmp = y / x
else if (y <= 3.3d-86) then
tmp = t_0
else if (y <= 96000000.0d0) 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 t_0 = y / (x * x);
double tmp;
if (y <= -5.8e-137) {
tmp = t_0;
} else if (y <= 3.8e-161) {
tmp = y / x;
} else if (y <= 3.3e-86) {
tmp = t_0;
} else if (y <= 96000000.0) {
tmp = (x / y) - x;
} 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 <= -5.8e-137: tmp = t_0 elif y <= 3.8e-161: tmp = y / x elif y <= 3.3e-86: tmp = t_0 elif y <= 96000000.0: tmp = (x / y) - x 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 <= -5.8e-137) tmp = t_0; elseif (y <= 3.8e-161) tmp = Float64(y / x); elseif (y <= 3.3e-86) tmp = t_0; elseif (y <= 96000000.0) 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)
t_0 = y / (x * x);
tmp = 0.0;
if (y <= -5.8e-137)
tmp = t_0;
elseif (y <= 3.8e-161)
tmp = y / x;
elseif (y <= 3.3e-86)
tmp = t_0;
elseif (y <= 96000000.0)
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_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e-137], t$95$0, If[LessEqual[y, 3.8e-161], N[(y / x), $MachinePrecision], If[LessEqual[y, 3.3e-86], t$95$0, If[LessEqual[y, 96000000.0], 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}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{-137}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-161}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-86}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 96000000:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -5.7999999999999997e-137 or 3.8000000000000001e-161 < y < 3.29999999999999987e-86Initial program 68.5%
associate-/r*75.2%
+-commutative75.2%
+-commutative75.2%
+-commutative75.2%
associate-/r*68.5%
associate-*l/83.4%
*-commutative83.4%
*-commutative83.4%
distribute-rgt1-in52.5%
fma-def83.4%
+-commutative83.4%
+-commutative83.4%
cube-unmult83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in x around inf 39.2%
unpow239.2%
Simplified39.2%
if -5.7999999999999997e-137 < y < 3.8000000000000001e-161Initial program 64.6%
associate-/r*64.5%
+-commutative64.5%
+-commutative64.5%
+-commutative64.5%
associate-/r*64.6%
associate-*l/75.9%
*-commutative75.9%
*-commutative75.9%
distribute-rgt1-in62.0%
fma-def75.9%
+-commutative75.9%
+-commutative75.9%
cube-unmult75.9%
+-commutative75.9%
Simplified75.9%
associate-*r/64.6%
fma-udef50.7%
cube-mult50.7%
distribute-rgt1-in64.6%
associate-+r+64.6%
*-commutative64.6%
*-commutative64.6%
frac-times75.9%
associate-/r*99.7%
clear-num99.6%
frac-times99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in x around 0 71.1%
if 3.29999999999999987e-86 < y < 9.6e7Initial program 87.6%
times-frac99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 58.1%
distribute-rgt-in58.1%
*-lft-identity58.1%
Simplified58.1%
Taylor expanded in y around 0 58.0%
neg-mul-158.0%
+-commutative58.0%
unsub-neg58.0%
Simplified58.0%
if 9.6e7 < y Initial program 58.6%
associate-/r*63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
associate-/r*58.6%
associate-*l/71.7%
*-commutative71.7%
*-commutative71.7%
distribute-rgt1-in68.6%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in y around inf 69.5%
unpow269.5%
Simplified69.5%
Final simplification56.0%
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 -7.1e-137)
t_0
(if (<= y 2.85e-161)
(/ y x)
(if (<= y 4.4e-87)
t_0
(if (<= y 96000000.0) (- (/ x y) x) (/ (/ x y) y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -7.1e-137) {
tmp = t_0;
} else if (y <= 2.85e-161) {
tmp = y / x;
} else if (y <= 4.4e-87) {
tmp = t_0;
} else if (y <= 96000000.0) {
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) :: t_0
real(8) :: tmp
t_0 = y / (x * x)
if (y <= (-7.1d-137)) then
tmp = t_0
else if (y <= 2.85d-161) then
tmp = y / x
else if (y <= 4.4d-87) then
tmp = t_0
else if (y <= 96000000.0d0) 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 t_0 = y / (x * x);
double tmp;
if (y <= -7.1e-137) {
tmp = t_0;
} else if (y <= 2.85e-161) {
tmp = y / x;
} else if (y <= 4.4e-87) {
tmp = t_0;
} else if (y <= 96000000.0) {
tmp = (x / y) - x;
} 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 <= -7.1e-137: tmp = t_0 elif y <= 2.85e-161: tmp = y / x elif y <= 4.4e-87: tmp = t_0 elif y <= 96000000.0: tmp = (x / y) - x 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 <= -7.1e-137) tmp = t_0; elseif (y <= 2.85e-161) tmp = Float64(y / x); elseif (y <= 4.4e-87) tmp = t_0; elseif (y <= 96000000.0) 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)
t_0 = y / (x * x);
tmp = 0.0;
if (y <= -7.1e-137)
tmp = t_0;
elseif (y <= 2.85e-161)
tmp = y / x;
elseif (y <= 4.4e-87)
tmp = t_0;
elseif (y <= 96000000.0)
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_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.1e-137], t$95$0, If[LessEqual[y, 2.85e-161], N[(y / x), $MachinePrecision], If[LessEqual[y, 4.4e-87], t$95$0, If[LessEqual[y, 96000000.0], 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}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -7.1 \cdot 10^{-137}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.85 \cdot 10^{-161}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-87}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 96000000:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -7.0999999999999997e-137 or 2.85000000000000011e-161 < y < 4.39999999999999976e-87Initial program 68.5%
associate-/r*75.2%
+-commutative75.2%
+-commutative75.2%
+-commutative75.2%
associate-/r*68.5%
associate-*l/83.4%
*-commutative83.4%
*-commutative83.4%
distribute-rgt1-in52.5%
fma-def83.4%
+-commutative83.4%
+-commutative83.4%
cube-unmult83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in x around inf 39.2%
unpow239.2%
Simplified39.2%
if -7.0999999999999997e-137 < y < 2.85000000000000011e-161Initial program 64.6%
associate-/r*64.5%
+-commutative64.5%
+-commutative64.5%
+-commutative64.5%
associate-/r*64.6%
associate-*l/75.9%
*-commutative75.9%
*-commutative75.9%
distribute-rgt1-in62.0%
fma-def75.9%
+-commutative75.9%
+-commutative75.9%
cube-unmult75.9%
+-commutative75.9%
Simplified75.9%
associate-*r/64.6%
fma-udef50.7%
cube-mult50.7%
distribute-rgt1-in64.6%
associate-+r+64.6%
*-commutative64.6%
*-commutative64.6%
frac-times75.9%
associate-/r*99.7%
clear-num99.6%
frac-times99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in x around 0 71.1%
if 4.39999999999999976e-87 < y < 9.6e7Initial program 87.6%
times-frac99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 58.1%
distribute-rgt-in58.1%
*-lft-identity58.1%
Simplified58.1%
Taylor expanded in y around 0 58.0%
neg-mul-158.0%
+-commutative58.0%
unsub-neg58.0%
Simplified58.0%
if 9.6e7 < y Initial program 58.6%
associate-/r*63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
associate-/r*58.6%
associate-*l/71.7%
*-commutative71.7%
*-commutative71.7%
distribute-rgt1-in68.6%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in y around inf 69.5%
unpow269.5%
Simplified69.5%
*-un-lft-identity69.5%
times-frac75.9%
Applied egg-rr75.9%
associate-*l/75.9%
*-lft-identity75.9%
Simplified75.9%
Final simplification57.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -7e-137)
(/ (/ y x) x)
(if (<= y 2.15e-161)
(/ y x)
(if (<= y 3.1e-86)
(/ y (* x x))
(if (<= y 96000000.0) (- (/ x y) x) (/ (/ x y) y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -7e-137) {
tmp = (y / x) / x;
} else if (y <= 2.15e-161) {
tmp = y / x;
} else if (y <= 3.1e-86) {
tmp = y / (x * x);
} else if (y <= 96000000.0) {
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 <= (-7d-137)) then
tmp = (y / x) / x
else if (y <= 2.15d-161) then
tmp = y / x
else if (y <= 3.1d-86) then
tmp = y / (x * x)
else if (y <= 96000000.0d0) 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 <= -7e-137) {
tmp = (y / x) / x;
} else if (y <= 2.15e-161) {
tmp = y / x;
} else if (y <= 3.1e-86) {
tmp = y / (x * x);
} else if (y <= 96000000.0) {
tmp = (x / y) - x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -7e-137: tmp = (y / x) / x elif y <= 2.15e-161: tmp = y / x elif y <= 3.1e-86: tmp = y / (x * x) elif y <= 96000000.0: 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 <= -7e-137) tmp = Float64(Float64(y / x) / x); elseif (y <= 2.15e-161) tmp = Float64(y / x); elseif (y <= 3.1e-86) tmp = Float64(y / Float64(x * x)); elseif (y <= 96000000.0) 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 <= -7e-137)
tmp = (y / x) / x;
elseif (y <= 2.15e-161)
tmp = y / x;
elseif (y <= 3.1e-86)
tmp = y / (x * x);
elseif (y <= 96000000.0)
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, -7e-137], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 2.15e-161], N[(y / x), $MachinePrecision], If[LessEqual[y, 3.1e-86], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 96000000.0], 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 -7 \cdot 10^{-137}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-161}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-86}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;y \leq 96000000:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -7.0000000000000002e-137Initial program 66.0%
associate-/r*73.5%
+-commutative73.5%
+-commutative73.5%
+-commutative73.5%
associate-/r*66.0%
associate-*l/81.6%
*-commutative81.6%
*-commutative81.6%
distribute-rgt1-in48.3%
fma-def81.6%
+-commutative81.6%
+-commutative81.6%
cube-unmult81.6%
+-commutative81.6%
Simplified81.6%
Taylor expanded in x around inf 37.3%
unpow237.3%
Simplified37.3%
un-div-inv37.3%
associate-/r*34.8%
Applied egg-rr34.8%
if -7.0000000000000002e-137 < y < 2.14999999999999983e-161Initial program 64.6%
associate-/r*64.5%
+-commutative64.5%
+-commutative64.5%
+-commutative64.5%
associate-/r*64.6%
associate-*l/75.9%
*-commutative75.9%
*-commutative75.9%
distribute-rgt1-in62.0%
fma-def75.9%
+-commutative75.9%
+-commutative75.9%
cube-unmult75.9%
+-commutative75.9%
Simplified75.9%
associate-*r/64.6%
fma-udef50.7%
cube-mult50.7%
distribute-rgt1-in64.6%
associate-+r+64.6%
*-commutative64.6%
*-commutative64.6%
frac-times75.9%
associate-/r*99.7%
clear-num99.6%
frac-times99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in x around 0 71.1%
if 2.14999999999999983e-161 < y < 3.09999999999999989e-86Initial program 90.5%
associate-/r*90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
associate-/r*90.5%
associate-*l/99.2%
*-commutative99.2%
*-commutative99.2%
distribute-rgt1-in90.0%
fma-def99.1%
+-commutative99.1%
+-commutative99.1%
cube-unmult99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 55.4%
unpow255.4%
Simplified55.4%
if 3.09999999999999989e-86 < y < 9.6e7Initial program 87.6%
times-frac99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 58.1%
distribute-rgt-in58.1%
*-lft-identity58.1%
Simplified58.1%
Taylor expanded in y around 0 58.0%
neg-mul-158.0%
+-commutative58.0%
unsub-neg58.0%
Simplified58.0%
if 9.6e7 < y Initial program 58.6%
associate-/r*63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
associate-/r*58.6%
associate-*l/71.7%
*-commutative71.7%
*-commutative71.7%
distribute-rgt1-in68.6%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.8%
+-commutative71.8%
Simplified71.8%
Taylor expanded in y around inf 69.5%
unpow269.5%
Simplified69.5%
*-un-lft-identity69.5%
times-frac75.9%
Applied egg-rr75.9%
associate-*l/75.9%
*-lft-identity75.9%
Simplified75.9%
Final simplification56.5%
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 -7.5e-95)
(- (/ y x) y)
(if (<= x 3.3e+15) (/ x (* y (+ y 1.0))) (/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -7.5e-95) {
tmp = (y / x) - y;
} else if (x <= 3.3e+15) {
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 <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-7.5d-95)) then
tmp = (y / x) - y
else if (x <= 3.3d+15) 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 <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -7.5e-95) {
tmp = (y / x) - y;
} else if (x <= 3.3e+15) {
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 <= -1.0: tmp = (y / x) / x elif x <= -7.5e-95: tmp = (y / x) - y elif x <= 3.3e+15: 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 <= -1.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -7.5e-95) tmp = Float64(Float64(y / x) - y); elseif (x <= 3.3e+15) 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 <= -1.0)
tmp = (y / x) / x;
elseif (x <= -7.5e-95)
tmp = (y / x) - y;
elseif (x <= 3.3e+15)
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, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -7.5e-95], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 3.3e+15], 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 -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1Initial program 65.0%
associate-/r*68.0%
+-commutative68.0%
+-commutative68.0%
+-commutative68.0%
associate-/r*65.0%
associate-*l/82.6%
*-commutative82.6%
*-commutative82.6%
distribute-rgt1-in36.2%
fma-def82.5%
+-commutative82.5%
+-commutative82.5%
cube-unmult82.6%
+-commutative82.6%
Simplified82.6%
Taylor expanded in x around inf 77.4%
unpow277.4%
Simplified77.4%
un-div-inv77.6%
associate-/r*77.8%
Applied egg-rr77.8%
if -1 < x < -7.5000000000000003e-95Initial program 88.3%
associate-/r*93.9%
+-commutative93.9%
+-commutative93.9%
+-commutative93.9%
associate-/r*88.3%
associate-*l/94.1%
*-commutative94.1%
*-commutative94.1%
distribute-rgt1-in81.4%
fma-def94.0%
+-commutative94.0%
+-commutative94.0%
cube-unmult94.0%
+-commutative94.0%
Simplified94.0%
associate-*r/88.2%
fma-udef75.7%
cube-mult75.7%
distribute-rgt1-in88.3%
associate-+r+88.3%
*-commutative88.3%
*-commutative88.3%
frac-times99.5%
associate-/r*99.6%
clear-num99.6%
frac-times99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 45.4%
+-commutative45.4%
Simplified45.4%
Taylor expanded in x around 0 33.1%
neg-mul-133.1%
+-commutative33.1%
unsub-neg33.1%
Simplified33.1%
if -7.5000000000000003e-95 < x < 3.3e15Initial program 76.0%
times-frac86.7%
associate-+l+86.7%
Simplified86.7%
Taylor expanded in x around 0 77.0%
+-commutative77.0%
Simplified77.0%
if 3.3e15 < x Initial program 44.6%
associate-/r*54.0%
+-commutative54.0%
+-commutative54.0%
+-commutative54.0%
associate-/r*44.6%
associate-*l/72.1%
*-commutative72.1%
*-commutative72.1%
distribute-rgt1-in68.3%
fma-def72.1%
+-commutative72.1%
+-commutative72.1%
cube-unmult72.1%
+-commutative72.1%
Simplified72.1%
Taylor expanded in y around inf 28.5%
unpow228.5%
Simplified28.5%
*-un-lft-identity28.5%
times-frac32.5%
Applied egg-rr32.5%
associate-*l/32.5%
*-lft-identity32.5%
Simplified32.5%
Final simplification64.2%
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 -7.5e-95)
(- (/ y x) y)
(if (<= x 2.05e+18) (/ x (+ y (* y y))) (/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -7.5e-95) {
tmp = (y / x) - y;
} else if (x <= 2.05e+18) {
tmp = x / (y + (y * y));
} 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 <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-7.5d-95)) then
tmp = (y / x) - y
else if (x <= 2.05d+18) then
tmp = x / (y + (y * y))
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 <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -7.5e-95) {
tmp = (y / x) - y;
} else if (x <= 2.05e+18) {
tmp = x / (y + (y * y));
} else {
tmp = (x / 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 <= -7.5e-95: tmp = (y / x) - y elif x <= 2.05e+18: tmp = x / (y + (y * y)) else: tmp = (x / 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 <= -7.5e-95) tmp = Float64(Float64(y / x) - y); elseif (x <= 2.05e+18) tmp = Float64(x / Float64(y + Float64(y * y))); 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 <= -1.0)
tmp = (y / x) / x;
elseif (x <= -7.5e-95)
tmp = (y / x) - y;
elseif (x <= 2.05e+18)
tmp = x / (y + (y * y));
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, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -7.5e-95], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 2.05e+18], N[(x / N[(y + N[(y * y), $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 -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+18}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1Initial program 65.0%
associate-/r*68.0%
+-commutative68.0%
+-commutative68.0%
+-commutative68.0%
associate-/r*65.0%
associate-*l/82.6%
*-commutative82.6%
*-commutative82.6%
distribute-rgt1-in36.2%
fma-def82.5%
+-commutative82.5%
+-commutative82.5%
cube-unmult82.6%
+-commutative82.6%
Simplified82.6%
Taylor expanded in x around inf 77.4%
unpow277.4%
Simplified77.4%
un-div-inv77.6%
associate-/r*77.8%
Applied egg-rr77.8%
if -1 < x < -7.5000000000000003e-95Initial program 88.3%
associate-/r*93.9%
+-commutative93.9%
+-commutative93.9%
+-commutative93.9%
associate-/r*88.3%
associate-*l/94.1%
*-commutative94.1%
*-commutative94.1%
distribute-rgt1-in81.4%
fma-def94.0%
+-commutative94.0%
+-commutative94.0%
cube-unmult94.0%
+-commutative94.0%
Simplified94.0%
associate-*r/88.2%
fma-udef75.7%
cube-mult75.7%
distribute-rgt1-in88.3%
associate-+r+88.3%
*-commutative88.3%
*-commutative88.3%
frac-times99.5%
associate-/r*99.6%
clear-num99.6%
frac-times99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 45.4%
+-commutative45.4%
Simplified45.4%
Taylor expanded in x around 0 33.1%
neg-mul-133.1%
+-commutative33.1%
unsub-neg33.1%
Simplified33.1%
if -7.5000000000000003e-95 < x < 2.05e18Initial program 76.0%
times-frac86.7%
associate-+l+86.7%
Simplified86.7%
Taylor expanded in x around 0 77.0%
distribute-rgt-in77.0%
*-lft-identity77.0%
Simplified77.0%
if 2.05e18 < x Initial program 44.6%
associate-/r*54.0%
+-commutative54.0%
+-commutative54.0%
+-commutative54.0%
associate-/r*44.6%
associate-*l/72.1%
*-commutative72.1%
*-commutative72.1%
distribute-rgt1-in68.3%
fma-def72.1%
+-commutative72.1%
+-commutative72.1%
cube-unmult72.1%
+-commutative72.1%
Simplified72.1%
Taylor expanded in y around inf 28.5%
unpow228.5%
Simplified28.5%
*-un-lft-identity28.5%
times-frac32.5%
Applied egg-rr32.5%
associate-*l/32.5%
*-lft-identity32.5%
Simplified32.5%
Final simplification64.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -2.8e+118)
(/ (/ y x) x)
(if (<= y 3.2e-84)
(/ y (* x (+ x 1.0)))
(if (<= y 4e+29) (/ x (+ y (* y y))) (/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.8e+118) {
tmp = (y / x) / x;
} else if (y <= 3.2e-84) {
tmp = y / (x * (x + 1.0));
} else if (y <= 4e+29) {
tmp = x / (y + (y * y));
} 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.8d+118)) then
tmp = (y / x) / x
else if (y <= 3.2d-84) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 4d+29) then
tmp = x / (y + (y * y))
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.8e+118) {
tmp = (y / x) / x;
} else if (y <= 3.2e-84) {
tmp = y / (x * (x + 1.0));
} else if (y <= 4e+29) {
tmp = x / (y + (y * y));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -2.8e+118: tmp = (y / x) / x elif y <= 3.2e-84: tmp = y / (x * (x + 1.0)) elif y <= 4e+29: tmp = x / (y + (y * y)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2.8e+118) tmp = Float64(Float64(y / x) / x); elseif (y <= 3.2e-84) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 4e+29) tmp = Float64(x / Float64(y + Float64(y * y))); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -2.8e+118)
tmp = (y / x) / x;
elseif (y <= 3.2e-84)
tmp = y / (x * (x + 1.0));
elseif (y <= 4e+29)
tmp = x / (y + (y * y));
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.8e+118], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.2e-84], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+29], N[(x / N[(y + N[(y * y), $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 -2.8 \cdot 10^{+118}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -2.79999999999999986e118Initial program 42.9%
associate-/r*53.7%
+-commutative53.7%
+-commutative53.7%
+-commutative53.7%
associate-/r*42.9%
associate-*l/70.9%
*-commutative70.9%
*-commutative70.9%
distribute-rgt1-in15.9%
fma-def70.9%
+-commutative70.9%
+-commutative70.9%
cube-unmult70.9%
+-commutative70.9%
Simplified70.9%
Taylor expanded in x around inf 27.1%
unpow227.1%
Simplified27.1%
un-div-inv27.1%
associate-/r*21.2%
Applied egg-rr21.2%
if -2.79999999999999986e118 < y < 3.1999999999999999e-84Initial program 74.9%
times-frac87.8%
associate-+l+87.8%
Simplified87.8%
Taylor expanded in y around 0 70.1%
if 3.1999999999999999e-84 < y < 3.99999999999999966e29Initial program 86.0%
times-frac99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 57.2%
distribute-rgt-in57.3%
*-lft-identity57.3%
Simplified57.3%
if 3.99999999999999966e29 < y Initial program 57.3%
associate-/r*60.6%
+-commutative60.6%
+-commutative60.6%
+-commutative60.6%
associate-/r*57.3%
associate-*l/72.0%
*-commutative72.0%
*-commutative72.0%
distribute-rgt1-in68.6%
fma-def72.0%
+-commutative72.0%
+-commutative72.0%
cube-unmult72.0%
+-commutative72.0%
Simplified72.0%
Taylor expanded in y around inf 71.5%
unpow271.5%
Simplified71.5%
*-un-lft-identity71.5%
times-frac78.3%
Applied egg-rr78.3%
associate-*l/78.4%
*-lft-identity78.4%
Simplified78.4%
Final simplification62.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y -3.1e+119)
(/ (/ y x) x)
(if (<= y 3.2e-84)
(/ y (* x (+ x 1.0)))
(if (<= y 5.8e+28) (/ x (+ y (* y y))) (/ (/ x (+ x y)) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -3.1e+119) {
tmp = (y / x) / x;
} else if (y <= 3.2e-84) {
tmp = y / (x * (x + 1.0));
} else if (y <= 5.8e+28) {
tmp = x / (y + (y * y));
} else {
tmp = (x / (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 <= (-3.1d+119)) then
tmp = (y / x) / x
else if (y <= 3.2d-84) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 5.8d+28) then
tmp = x / (y + (y * y))
else
tmp = (x / (x + y)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -3.1e+119) {
tmp = (y / x) / x;
} else if (y <= 3.2e-84) {
tmp = y / (x * (x + 1.0));
} else if (y <= 5.8e+28) {
tmp = x / (y + (y * y));
} else {
tmp = (x / (x + y)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -3.1e+119: tmp = (y / x) / x elif y <= 3.2e-84: tmp = y / (x * (x + 1.0)) elif y <= 5.8e+28: tmp = x / (y + (y * y)) else: tmp = (x / (x + y)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -3.1e+119) tmp = Float64(Float64(y / x) / x); elseif (y <= 3.2e-84) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 5.8e+28) tmp = Float64(x / Float64(y + Float64(y * y))); else tmp = Float64(Float64(x / 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 <= -3.1e+119)
tmp = (y / x) / x;
elseif (y <= 3.2e-84)
tmp = y / (x * (x + 1.0));
elseif (y <= 5.8e+28)
tmp = x / (y + (y * y));
else
tmp = (x / (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, -3.1e+119], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.2e-84], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e+28], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+119}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\
\end{array}
\end{array}
if y < -3.09999999999999995e119Initial program 42.9%
associate-/r*53.7%
+-commutative53.7%
+-commutative53.7%
+-commutative53.7%
associate-/r*42.9%
associate-*l/70.9%
*-commutative70.9%
*-commutative70.9%
distribute-rgt1-in15.9%
fma-def70.9%
+-commutative70.9%
+-commutative70.9%
cube-unmult70.9%
+-commutative70.9%
Simplified70.9%
Taylor expanded in x around inf 27.1%
unpow227.1%
Simplified27.1%
un-div-inv27.1%
associate-/r*21.2%
Applied egg-rr21.2%
if -3.09999999999999995e119 < y < 3.1999999999999999e-84Initial program 74.9%
times-frac87.8%
associate-+l+87.8%
Simplified87.8%
Taylor expanded in y around 0 70.1%
if 3.1999999999999999e-84 < y < 5.8000000000000002e28Initial program 86.0%
times-frac99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 57.2%
distribute-rgt-in57.3%
*-lft-identity57.3%
Simplified57.3%
if 5.8000000000000002e28 < y Initial program 57.3%
associate-/r*60.6%
+-commutative60.6%
+-commutative60.6%
+-commutative60.6%
associate-/r*57.3%
associate-*l/72.0%
*-commutative72.0%
*-commutative72.0%
distribute-rgt1-in68.6%
fma-def72.0%
+-commutative72.0%
+-commutative72.0%
cube-unmult72.0%
+-commutative72.0%
Simplified72.0%
associate-*r/57.3%
fma-udef56.2%
cube-mult56.2%
distribute-rgt1-in57.3%
associate-+r+57.3%
*-commutative57.3%
*-commutative57.3%
frac-times78.7%
associate-/r*99.9%
clear-num99.9%
frac-times99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
Taylor expanded in y around inf 78.7%
Final simplification62.4%
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))))
(if (<= y -2.1e+141)
t_0
(if (<= y 1.75e-153) (/ y x) (if (<= y 96000000.0) (- (/ x y) x) t_0)))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -2.1e+141) {
tmp = t_0;
} else if (y <= 1.75e-153) {
tmp = y / x;
} else if (y <= 96000000.0) {
tmp = (x / y) - x;
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y * y)
if (y <= (-2.1d+141)) then
tmp = t_0
else if (y <= 1.75d-153) then
tmp = y / x
else if (y <= 96000000.0d0) then
tmp = (x / y) - x
else
tmp = t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -2.1e+141) {
tmp = t_0;
} else if (y <= 1.75e-153) {
tmp = y / x;
} else if (y <= 96000000.0) {
tmp = (x / y) - x;
} else {
tmp = t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y * y) tmp = 0 if y <= -2.1e+141: tmp = t_0 elif y <= 1.75e-153: tmp = y / x elif y <= 96000000.0: tmp = (x / y) - x else: tmp = t_0 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (y <= -2.1e+141) tmp = t_0; elseif (y <= 1.75e-153) tmp = Float64(y / x); elseif (y <= 96000000.0) tmp = Float64(Float64(x / y) - x); else tmp = t_0; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y * y);
tmp = 0.0;
if (y <= -2.1e+141)
tmp = t_0;
elseif (y <= 1.75e-153)
tmp = y / x;
elseif (y <= 96000000.0)
tmp = (x / y) - x;
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+141], t$95$0, If[LessEqual[y, 1.75e-153], N[(y / x), $MachinePrecision], If[LessEqual[y, 96000000.0], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+141}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 96000000:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -2.0999999999999998e141 or 9.6e7 < y Initial program 51.5%
associate-/r*58.8%
+-commutative58.8%
+-commutative58.8%
+-commutative58.8%
associate-/r*51.5%
associate-*l/71.1%
*-commutative71.1%
*-commutative71.1%
distribute-rgt1-in45.8%
fma-def71.1%
+-commutative71.1%
+-commutative71.1%
cube-unmult71.1%
+-commutative71.1%
Simplified71.1%
Taylor expanded in y around inf 72.7%
unpow272.7%
Simplified72.7%
if -2.0999999999999998e141 < y < 1.7499999999999999e-153Initial program 73.7%
associate-/r*75.9%
+-commutative75.9%
+-commutative75.9%
+-commutative75.9%
associate-/r*73.7%
associate-*l/82.5%
*-commutative82.5%
*-commutative82.5%
distribute-rgt1-in67.6%
fma-def82.5%
+-commutative82.5%
+-commutative82.5%
cube-unmult82.5%
+-commutative82.5%
Simplified82.5%
associate-*r/73.7%
fma-udef59.7%
cube-mult59.7%
distribute-rgt1-in73.7%
associate-+r+73.7%
*-commutative73.7%
*-commutative73.7%
frac-times86.9%
associate-/r*99.7%
clear-num99.6%
frac-times99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 68.3%
+-commutative68.3%
Simplified68.3%
Taylor expanded in x around 0 44.3%
if 1.7499999999999999e-153 < y < 9.6e7Initial program 88.5%
times-frac99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 45.7%
distribute-rgt-in45.7%
*-lft-identity45.7%
Simplified45.7%
Taylor expanded in y around 0 45.6%
neg-mul-145.6%
+-commutative45.6%
unsub-neg45.6%
Simplified45.6%
Final simplification55.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -2.8e+118) (/ (/ y x) x) (if (<= y 3.2e-84) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -2.8e+118) {
tmp = (y / x) / x;
} else if (y <= 3.2e-84) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2.8d+118)) then
tmp = (y / x) / x
else if (y <= 3.2d-84) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -2.8e+118) {
tmp = (y / x) / x;
} else if (y <= 3.2e-84) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -2.8e+118: tmp = (y / x) / x elif y <= 3.2e-84: tmp = y / (x * (x + 1.0)) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -2.8e+118) tmp = Float64(Float64(y / x) / x); elseif (y <= 3.2e-84) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -2.8e+118)
tmp = (y / x) / x;
elseif (y <= 3.2e-84)
tmp = y / (x * (x + 1.0));
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, -2.8e+118], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.2e-84], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+118}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if y < -2.79999999999999986e118Initial program 42.9%
associate-/r*53.7%
+-commutative53.7%
+-commutative53.7%
+-commutative53.7%
associate-/r*42.9%
associate-*l/70.9%
*-commutative70.9%
*-commutative70.9%
distribute-rgt1-in15.9%
fma-def70.9%
+-commutative70.9%
+-commutative70.9%
cube-unmult70.9%
+-commutative70.9%
Simplified70.9%
Taylor expanded in x around inf 27.1%
unpow227.1%
Simplified27.1%
un-div-inv27.1%
associate-/r*21.2%
Applied egg-rr21.2%
if -2.79999999999999986e118 < y < 3.1999999999999999e-84Initial program 74.9%
times-frac87.8%
associate-+l+87.8%
Simplified87.8%
Taylor expanded in y around 0 70.1%
if 3.1999999999999999e-84 < y Initial program 66.7%
associate-/r*71.1%
+-commutative71.1%
+-commutative71.1%
+-commutative71.1%
associate-/l/66.7%
times-frac85.5%
*-commutative85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
associate-+l+85.5%
Simplified85.5%
Taylor expanded in y around inf 71.7%
associate-*l/71.7%
*-un-lft-identity71.7%
Applied egg-rr71.7%
Taylor expanded in x around 0 71.4%
+-commutative71.4%
Simplified71.4%
Final simplification62.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.1e-84) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ x y)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.1e-84) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (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 <= 3.1d-84) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (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 <= 3.1e-84) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.1e-84: tmp = (y / x) / (x + 1.0) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.1e-84) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / 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 <= 3.1e-84)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / (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, 3.1e-84], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{-84}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if y < 3.10000000000000002e-84Initial program 67.0%
times-frac86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in y around 0 59.4%
associate-/r*58.0%
+-commutative58.0%
Simplified58.0%
if 3.10000000000000002e-84 < y Initial program 66.7%
associate-/r*71.1%
+-commutative71.1%
+-commutative71.1%
+-commutative71.1%
associate-/r*66.7%
associate-*l/78.4%
*-commutative78.4%
*-commutative78.4%
distribute-rgt1-in74.9%
fma-def78.4%
+-commutative78.4%
+-commutative78.4%
cube-unmult78.4%
+-commutative78.4%
Simplified78.4%
associate-*r/66.7%
fma-udef64.8%
cube-mult64.8%
distribute-rgt1-in66.7%
associate-+r+66.7%
*-commutative66.7%
*-commutative66.7%
frac-times85.4%
associate-/r*99.8%
clear-num99.8%
frac-times99.3%
*-un-lft-identity99.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 71.8%
+-commutative71.8%
Simplified71.8%
Final simplification62.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 4.8e-86) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ x (+ y 1.0))) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 4.8e-86) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.8d-86) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (x + (y + 1.0d0))) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 4.8e-86) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 4.8e-86: tmp = (y / x) / (x + 1.0) else: tmp = (x / (x + (y + 1.0))) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 4.8e-86) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 4.8e-86)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / (x + (y + 1.0))) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 4.8e-86], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{-86}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y}\\
\end{array}
\end{array}
if y < 4.80000000000000026e-86Initial program 67.0%
times-frac86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in y around 0 59.4%
associate-/r*58.0%
+-commutative58.0%
Simplified58.0%
if 4.80000000000000026e-86 < y Initial program 66.7%
associate-/r*71.1%
+-commutative71.1%
+-commutative71.1%
+-commutative71.1%
associate-/l/66.7%
times-frac85.5%
*-commutative85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
associate-+l+85.5%
Simplified85.5%
Taylor expanded in y around inf 71.7%
associate-*l/71.7%
*-un-lft-identity71.7%
Applied egg-rr71.7%
Final simplification62.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 3.2e-84) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 3.2e-84) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.2d-84) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 3.2e-84) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 3.2e-84: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 3.2e-84) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 3.2e-84)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 3.2e-84], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if y < 3.1999999999999999e-84Initial program 67.0%
times-frac86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in y around 0 59.4%
associate-/r*58.0%
+-commutative58.0%
Simplified58.0%
if 3.1999999999999999e-84 < y Initial program 66.7%
associate-/r*71.1%
+-commutative71.1%
+-commutative71.1%
+-commutative71.1%
associate-/l/66.7%
times-frac85.5%
*-commutative85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
associate-+l+85.5%
Simplified85.5%
Taylor expanded in y around inf 71.7%
associate-*l/71.7%
*-un-lft-identity71.7%
Applied egg-rr71.7%
Taylor expanded in x around 0 71.4%
+-commutative71.4%
Simplified71.4%
Final simplification62.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.75e-153) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.75e-153) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.75d-153) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.75e-153) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.75e-153: tmp = y / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.75e-153) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.75e-153)
tmp = y / x;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 1.75e-153], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.75 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 1.7499999999999999e-153Initial program 65.4%
associate-/r*69.9%
+-commutative69.9%
+-commutative69.9%
+-commutative69.9%
associate-/r*65.4%
associate-*l/79.3%
*-commutative79.3%
*-commutative79.3%
distribute-rgt1-in53.7%
fma-def79.3%
+-commutative79.3%
+-commutative79.3%
cube-unmult79.3%
+-commutative79.3%
Simplified79.3%
associate-*r/65.4%
fma-udef45.1%
cube-mult45.1%
distribute-rgt1-in65.4%
associate-+r+65.4%
*-commutative65.4%
*-commutative65.4%
frac-times85.5%
associate-/r*99.8%
clear-num99.7%
frac-times99.4%
*-un-lft-identity99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 57.8%
+-commutative57.8%
Simplified57.8%
Taylor expanded in x around 0 33.5%
if 1.7499999999999999e-153 < y Initial program 69.5%
times-frac87.1%
associate-+l+87.1%
Simplified87.1%
Taylor expanded in x around 0 61.2%
distribute-rgt-in61.2%
*-lft-identity61.2%
Simplified61.2%
Taylor expanded in y around 0 35.7%
Final simplification34.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 0.5 x))
assert(x < y);
double code(double x, double y) {
return 0.5 / x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.5d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 0.5 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 0.5 / x
x, y = sort([x, y]) function code(x, y) return Float64(0.5 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 0.5 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(0.5 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{0.5}{x}
\end{array}
Initial program 66.9%
associate-/r*71.2%
+-commutative71.2%
+-commutative71.2%
+-commutative71.2%
associate-/r*66.9%
associate-*l/79.9%
*-commutative79.9%
*-commutative79.9%
distribute-rgt1-in62.1%
fma-def79.9%
+-commutative79.9%
+-commutative79.9%
cube-unmult79.9%
+-commutative79.9%
Simplified79.9%
associate-*r/66.9%
fma-udef53.0%
cube-mult53.0%
distribute-rgt1-in66.9%
associate-+r+66.9%
*-commutative66.9%
*-commutative66.9%
frac-times86.0%
associate-/r*99.8%
clear-num99.7%
frac-times99.4%
*-un-lft-identity99.4%
Applied egg-rr99.4%
Taylor expanded in y around -inf 54.2%
mul-1-neg54.2%
unsub-neg54.2%
neg-mul-154.2%
+-commutative54.2%
unsub-neg54.2%
distribute-lft-in54.2%
metadata-eval54.2%
neg-mul-154.2%
unsub-neg54.2%
Simplified54.2%
Taylor expanded in x around inf 4.2%
Final simplification4.2%
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 66.9%
times-frac86.0%
associate-+l+86.0%
Simplified86.0%
Taylor expanded in x around 0 50.7%
distribute-rgt-in50.7%
*-lft-identity50.7%
Simplified50.7%
Taylor expanded in y around 0 29.8%
Final simplification29.8%
(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 2023290
(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))))