
(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 19 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}
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ y (+ x 1.0))) (/ (+ x y) y)) (+ x y)))
double code(double x, double y) {
return ((x / (y + (x + 1.0))) / ((x + y) / y)) / (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / (y + (x + 1.0d0))) / ((x + y) / y)) / (x + y)
end function
public static double code(double x, double y) {
return ((x / (y + (x + 1.0))) / ((x + y) / y)) / (x + y);
}
def code(x, y): return ((x / (y + (x + 1.0))) / ((x + y) / y)) / (x + y)
function code(x, y) return Float64(Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(Float64(x + y) / y)) / Float64(x + y)) end
function tmp = code(x, y) tmp = ((x / (y + (x + 1.0))) / ((x + y) / y)) / (x + y); end
code[x_, y_] := N[(N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{y + \left(x + 1\right)}}{\frac{x + y}{y}}}{x + y}
\end{array}
Initial program 66.1%
times-frac84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
times-frac66.1%
associate-*l/79.6%
*-commutative79.6%
*-commutative79.6%
distribute-rgt1-in56.7%
fma-def79.6%
+-commutative79.6%
+-commutative79.6%
cube-unmult79.6%
+-commutative79.6%
Simplified79.6%
associate-*r/66.1%
fma-udef48.7%
cube-mult48.7%
distribute-rgt1-in66.1%
associate-+r+66.1%
*-commutative66.1%
frac-times84.4%
associate-/r*99.8%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y 1.0))))
(if (<= x -650000.0)
(/ (/ y (+ x y)) (+ x (+ y (+ y 1.0))))
(if (<= x -2.2e-157) (* t_0 (/ y (* (+ x y) (+ x y)))) (/ t_0 (+ x y))))))
double code(double x, double y) {
double t_0 = x / (y + 1.0);
double tmp;
if (x <= -650000.0) {
tmp = (y / (x + y)) / (x + (y + (y + 1.0)));
} else if (x <= -2.2e-157) {
tmp = t_0 * (y / ((x + y) * (x + y)));
} else {
tmp = t_0 / (x + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y + 1.0d0)
if (x <= (-650000.0d0)) then
tmp = (y / (x + y)) / (x + (y + (y + 1.0d0)))
else if (x <= (-2.2d-157)) then
tmp = t_0 * (y / ((x + y) * (x + y)))
else
tmp = t_0 / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + 1.0);
double tmp;
if (x <= -650000.0) {
tmp = (y / (x + y)) / (x + (y + (y + 1.0)));
} else if (x <= -2.2e-157) {
tmp = t_0 * (y / ((x + y) * (x + y)));
} else {
tmp = t_0 / (x + y);
}
return tmp;
}
def code(x, y): t_0 = x / (y + 1.0) tmp = 0 if x <= -650000.0: tmp = (y / (x + y)) / (x + (y + (y + 1.0))) elif x <= -2.2e-157: tmp = t_0 * (y / ((x + y) * (x + y))) else: tmp = t_0 / (x + y) return tmp
function code(x, y) t_0 = Float64(x / Float64(y + 1.0)) tmp = 0.0 if (x <= -650000.0) tmp = Float64(Float64(y / Float64(x + y)) / Float64(x + Float64(y + Float64(y + 1.0)))); elseif (x <= -2.2e-157) tmp = Float64(t_0 * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(t_0 / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + 1.0); tmp = 0.0; if (x <= -650000.0) tmp = (y / (x + y)) / (x + (y + (y + 1.0))); elseif (x <= -2.2e-157) tmp = t_0 * (y / ((x + y) * (x + y))); else tmp = t_0 / (x + y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -650000.0], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-157], N[(t$95$0 * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + 1}\\
\mathbf{if}\;x \leq -650000:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-157}:\\
\;\;\;\;t_0 \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{x + y}\\
\end{array}
\end{array}
if x < -6.5e5Initial program 54.5%
times-frac79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
times-frac54.5%
associate-*l/69.8%
*-commutative69.8%
*-commutative69.8%
distribute-rgt1-in23.8%
fma-def69.8%
+-commutative69.8%
+-commutative69.8%
cube-unmult69.8%
+-commutative69.8%
Simplified69.8%
associate-*r/54.5%
fma-udef20.4%
cube-mult20.4%
distribute-rgt1-in54.5%
associate-+r+54.5%
*-commutative54.5%
frac-times79.6%
*-commutative79.6%
clear-num79.6%
associate-/r*99.8%
frac-times98.7%
*-un-lft-identity98.7%
associate-+r+98.7%
+-commutative98.7%
associate-+l+98.7%
Applied egg-rr98.7%
Taylor expanded in x around -inf 77.2%
mul-1-neg77.2%
unsub-neg77.2%
neg-mul-177.2%
+-commutative77.2%
+-commutative77.2%
neg-mul-177.2%
unsub-neg77.2%
neg-mul-177.2%
+-commutative77.2%
distribute-lft-in77.2%
metadata-eval77.2%
neg-mul-177.2%
unsub-neg77.2%
Simplified77.2%
if -6.5e5 < x < -2.2000000000000001e-157Initial program 80.8%
associate-/r*80.7%
*-commutative80.7%
+-commutative80.7%
+-commutative80.7%
associate-*l/99.6%
+-commutative99.6%
associate-*r/99.6%
remove-double-neg99.6%
+-commutative99.6%
+-commutative99.6%
remove-double-neg99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 98.5%
+-commutative98.5%
Simplified98.5%
if -2.2000000000000001e-157 < x Initial program 67.5%
times-frac82.7%
+-commutative82.7%
+-commutative82.7%
+-commutative82.7%
times-frac67.5%
associate-*l/79.4%
*-commutative79.4%
*-commutative79.4%
distribute-rgt1-in63.5%
fma-def79.4%
+-commutative79.4%
+-commutative79.4%
cube-unmult79.4%
+-commutative79.4%
Simplified79.4%
associate-*r/67.5%
fma-udef55.7%
cube-mult55.6%
distribute-rgt1-in67.5%
associate-+r+67.5%
*-commutative67.5%
frac-times82.6%
associate-/r*99.8%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 55.8%
+-commutative55.8%
Simplified55.8%
Final simplification67.7%
(FPCore (x y)
:precision binary64
(if (<= x -2.52e+154)
(/ (/ y (+ x y)) (- x (* y -2.0)))
(if (<= x -2.4e-155)
(/ (- y) (* (+ x y) (- (* y -2.0) (+ x 1.0))))
(/ (/ x (+ y 1.0)) (+ x y)))))
double code(double x, double y) {
double tmp;
if (x <= -2.52e+154) {
tmp = (y / (x + y)) / (x - (y * -2.0));
} else if (x <= -2.4e-155) {
tmp = -y / ((x + y) * ((y * -2.0) - (x + 1.0)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.52d+154)) then
tmp = (y / (x + y)) / (x - (y * (-2.0d0)))
else if (x <= (-2.4d-155)) then
tmp = -y / ((x + y) * ((y * (-2.0d0)) - (x + 1.0d0)))
else
tmp = (x / (y + 1.0d0)) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.52e+154) {
tmp = (y / (x + y)) / (x - (y * -2.0));
} else if (x <= -2.4e-155) {
tmp = -y / ((x + y) * ((y * -2.0) - (x + 1.0)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.52e+154: tmp = (y / (x + y)) / (x - (y * -2.0)) elif x <= -2.4e-155: tmp = -y / ((x + y) * ((y * -2.0) - (x + 1.0))) else: tmp = (x / (y + 1.0)) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.52e+154) tmp = Float64(Float64(y / Float64(x + y)) / Float64(x - Float64(y * -2.0))); elseif (x <= -2.4e-155) tmp = Float64(Float64(-y) / Float64(Float64(x + y) * Float64(Float64(y * -2.0) - Float64(x + 1.0)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.52e+154) tmp = (y / (x + y)) / (x - (y * -2.0)); elseif (x <= -2.4e-155) tmp = -y / ((x + y) * ((y * -2.0) - (x + 1.0))); else tmp = (x / (y + 1.0)) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.52e+154], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x - N[(y * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.4e-155], N[((-y) / N[(N[(x + y), $MachinePrecision] * N[(N[(y * -2.0), $MachinePrecision] - N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.52 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x - y \cdot -2}\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-155}:\\
\;\;\;\;\frac{-y}{\left(x + y\right) \cdot \left(y \cdot -2 - \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -2.5200000000000001e154Initial program 52.5%
times-frac75.3%
+-commutative75.3%
+-commutative75.3%
+-commutative75.3%
times-frac52.5%
associate-*l/75.3%
*-commutative75.3%
*-commutative75.3%
distribute-rgt1-in5.6%
fma-def75.3%
+-commutative75.3%
+-commutative75.3%
cube-unmult75.3%
+-commutative75.3%
Simplified75.3%
associate-*r/52.5%
fma-udef0.0%
cube-mult0.0%
distribute-rgt1-in52.5%
associate-+r+52.5%
*-commutative52.5%
frac-times75.3%
*-commutative75.3%
clear-num75.3%
associate-/r*99.9%
frac-times99.8%
*-un-lft-identity99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around -inf 83.7%
mul-1-neg83.7%
unsub-neg83.7%
neg-mul-183.7%
+-commutative83.7%
+-commutative83.7%
neg-mul-183.7%
unsub-neg83.7%
neg-mul-183.7%
+-commutative83.7%
distribute-lft-in83.7%
metadata-eval83.7%
neg-mul-183.7%
unsub-neg83.7%
Simplified83.7%
Taylor expanded in y around inf 83.7%
*-commutative83.7%
Simplified83.7%
if -2.5200000000000001e154 < x < -2.4e-155Initial program 71.3%
times-frac94.1%
+-commutative94.1%
+-commutative94.1%
+-commutative94.1%
times-frac71.3%
associate-*l/82.6%
*-commutative82.6%
*-commutative82.6%
distribute-rgt1-in72.4%
fma-def82.5%
+-commutative82.5%
+-commutative82.5%
cube-unmult82.5%
+-commutative82.5%
Simplified82.5%
associate-*r/71.3%
fma-udef62.8%
cube-mult62.7%
distribute-rgt1-in71.3%
associate-+r+71.3%
*-commutative71.3%
frac-times94.2%
*-commutative94.2%
clear-num94.1%
associate-/r*99.6%
frac-times98.5%
*-un-lft-identity98.5%
associate-+r+98.5%
+-commutative98.5%
associate-+l+98.5%
Applied egg-rr98.5%
Taylor expanded in x around -inf 54.6%
mul-1-neg54.6%
unsub-neg54.6%
neg-mul-154.6%
+-commutative54.6%
+-commutative54.6%
neg-mul-154.6%
unsub-neg54.6%
neg-mul-154.6%
+-commutative54.6%
distribute-lft-in54.6%
metadata-eval54.6%
neg-mul-154.6%
unsub-neg54.6%
Simplified54.6%
frac-2neg54.6%
div-inv54.6%
distribute-neg-frac54.6%
associate--l-54.6%
associate--r-54.6%
*-un-lft-identity54.6%
*-un-lft-identity54.6%
distribute-rgt-out54.6%
metadata-eval54.6%
Applied egg-rr54.6%
associate-*r/54.6%
*-rgt-identity54.6%
distribute-frac-neg54.6%
distribute-neg-frac54.6%
associate-/l/72.7%
distribute-neg-frac72.7%
sub-neg72.7%
metadata-eval72.7%
distribute-neg-in72.7%
+-commutative72.7%
distribute-neg-in72.7%
metadata-eval72.7%
unsub-neg72.7%
distribute-rgt-neg-in72.7%
metadata-eval72.7%
Simplified72.7%
if -2.4e-155 < x Initial program 67.5%
times-frac82.7%
+-commutative82.7%
+-commutative82.7%
+-commutative82.7%
times-frac67.5%
associate-*l/79.4%
*-commutative79.4%
*-commutative79.4%
distribute-rgt1-in63.5%
fma-def79.4%
+-commutative79.4%
+-commutative79.4%
cube-unmult79.4%
+-commutative79.4%
Simplified79.4%
associate-*r/67.5%
fma-udef55.7%
cube-mult55.6%
distribute-rgt1-in67.5%
associate-+r+67.5%
*-commutative67.5%
frac-times82.6%
associate-/r*99.8%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 55.8%
+-commutative55.8%
Simplified55.8%
Final simplification64.4%
(FPCore (x y)
:precision binary64
(if (<= x -0.07)
(/ (/ y (+ x y)) (+ x 1.0))
(if (<= x -8e-155)
(* x (/ y (* (+ x y) (+ x y))))
(/ (/ x (+ y 1.0)) (+ x y)))))
double code(double x, double y) {
double tmp;
if (x <= -0.07) {
tmp = (y / (x + y)) / (x + 1.0);
} else if (x <= -8e-155) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-0.07d0)) then
tmp = (y / (x + y)) / (x + 1.0d0)
else if (x <= (-8d-155)) then
tmp = x * (y / ((x + y) * (x + y)))
else
tmp = (x / (y + 1.0d0)) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.07) {
tmp = (y / (x + y)) / (x + 1.0);
} else if (x <= -8e-155) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.07: tmp = (y / (x + y)) / (x + 1.0) elif x <= -8e-155: tmp = x * (y / ((x + y) * (x + y))) else: tmp = (x / (y + 1.0)) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -0.07) tmp = Float64(Float64(y / Float64(x + y)) / Float64(x + 1.0)); elseif (x <= -8e-155) tmp = Float64(x * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.07) tmp = (y / (x + y)) / (x + 1.0); elseif (x <= -8e-155) tmp = x * (y / ((x + y) * (x + y))); else tmp = (x / (y + 1.0)) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.07], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-155], N[(x * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.07:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x + 1}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-155}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -0.070000000000000007Initial program 54.5%
times-frac79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
times-frac54.5%
associate-*l/69.8%
*-commutative69.8%
*-commutative69.8%
distribute-rgt1-in23.8%
fma-def69.8%
+-commutative69.8%
+-commutative69.8%
cube-unmult69.8%
+-commutative69.8%
Simplified69.8%
associate-*r/54.5%
fma-udef20.4%
cube-mult20.4%
distribute-rgt1-in54.5%
associate-+r+54.5%
*-commutative54.5%
frac-times79.6%
*-commutative79.6%
clear-num79.6%
associate-/r*99.8%
frac-times98.7%
*-un-lft-identity98.7%
associate-+r+98.7%
+-commutative98.7%
associate-+l+98.7%
Applied egg-rr98.7%
Taylor expanded in y around 0 75.7%
+-commutative75.7%
Simplified75.7%
if -0.070000000000000007 < x < -8.00000000000000011e-155Initial program 80.8%
associate-/r*80.7%
*-commutative80.7%
+-commutative80.7%
+-commutative80.7%
associate-*l/99.6%
+-commutative99.6%
associate-*r/99.6%
remove-double-neg99.6%
+-commutative99.6%
+-commutative99.6%
remove-double-neg99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in y around 0 80.4%
if -8.00000000000000011e-155 < x Initial program 67.5%
times-frac82.7%
+-commutative82.7%
+-commutative82.7%
+-commutative82.7%
times-frac67.5%
associate-*l/79.4%
*-commutative79.4%
*-commutative79.4%
distribute-rgt1-in63.5%
fma-def79.4%
+-commutative79.4%
+-commutative79.4%
cube-unmult79.4%
+-commutative79.4%
Simplified79.4%
associate-*r/67.5%
fma-udef55.7%
cube-mult55.6%
distribute-rgt1-in67.5%
associate-+r+67.5%
*-commutative67.5%
frac-times82.6%
associate-/r*99.8%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 55.8%
+-commutative55.8%
Simplified55.8%
Final simplification64.6%
(FPCore (x y)
:precision binary64
(if (<= x -2600.0)
(/ (/ y (+ x y)) (- x (* y -2.0)))
(if (<= x -2.35e-153)
(* x (/ y (* (+ x y) (+ x y))))
(/ (/ x (+ y 1.0)) (+ x y)))))
double code(double x, double y) {
double tmp;
if (x <= -2600.0) {
tmp = (y / (x + y)) / (x - (y * -2.0));
} else if (x <= -2.35e-153) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2600.0d0)) then
tmp = (y / (x + y)) / (x - (y * (-2.0d0)))
else if (x <= (-2.35d-153)) then
tmp = x * (y / ((x + y) * (x + y)))
else
tmp = (x / (y + 1.0d0)) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2600.0) {
tmp = (y / (x + y)) / (x - (y * -2.0));
} else if (x <= -2.35e-153) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2600.0: tmp = (y / (x + y)) / (x - (y * -2.0)) elif x <= -2.35e-153: tmp = x * (y / ((x + y) * (x + y))) else: tmp = (x / (y + 1.0)) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -2600.0) tmp = Float64(Float64(y / Float64(x + y)) / Float64(x - Float64(y * -2.0))); elseif (x <= -2.35e-153) tmp = Float64(x * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2600.0) tmp = (y / (x + y)) / (x - (y * -2.0)); elseif (x <= -2.35e-153) tmp = x * (y / ((x + y) * (x + y))); else tmp = (x / (y + 1.0)) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2600.0], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x - N[(y * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.35e-153], N[(x * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2600:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x - y \cdot -2}\\
\mathbf{elif}\;x \leq -2.35 \cdot 10^{-153}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -2600Initial program 54.5%
times-frac79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
times-frac54.5%
associate-*l/69.8%
*-commutative69.8%
*-commutative69.8%
distribute-rgt1-in23.8%
fma-def69.8%
+-commutative69.8%
+-commutative69.8%
cube-unmult69.8%
+-commutative69.8%
Simplified69.8%
associate-*r/54.5%
fma-udef20.4%
cube-mult20.4%
distribute-rgt1-in54.5%
associate-+r+54.5%
*-commutative54.5%
frac-times79.6%
*-commutative79.6%
clear-num79.6%
associate-/r*99.8%
frac-times98.7%
*-un-lft-identity98.7%
associate-+r+98.7%
+-commutative98.7%
associate-+l+98.7%
Applied egg-rr98.7%
Taylor expanded in x around -inf 77.2%
mul-1-neg77.2%
unsub-neg77.2%
neg-mul-177.2%
+-commutative77.2%
+-commutative77.2%
neg-mul-177.2%
unsub-neg77.2%
neg-mul-177.2%
+-commutative77.2%
distribute-lft-in77.2%
metadata-eval77.2%
neg-mul-177.2%
unsub-neg77.2%
Simplified77.2%
Taylor expanded in y around inf 76.8%
*-commutative76.8%
Simplified76.8%
if -2600 < x < -2.35e-153Initial program 80.8%
associate-/r*80.7%
*-commutative80.7%
+-commutative80.7%
+-commutative80.7%
associate-*l/99.6%
+-commutative99.6%
associate-*r/99.6%
remove-double-neg99.6%
+-commutative99.6%
+-commutative99.6%
remove-double-neg99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in y around 0 80.4%
if -2.35e-153 < x Initial program 67.5%
times-frac82.7%
+-commutative82.7%
+-commutative82.7%
+-commutative82.7%
times-frac67.5%
associate-*l/79.4%
*-commutative79.4%
*-commutative79.4%
distribute-rgt1-in63.5%
fma-def79.4%
+-commutative79.4%
+-commutative79.4%
cube-unmult79.4%
+-commutative79.4%
Simplified79.4%
associate-*r/67.5%
fma-udef55.7%
cube-mult55.6%
distribute-rgt1-in67.5%
associate-+r+67.5%
*-commutative67.5%
frac-times82.6%
associate-/r*99.8%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 55.8%
+-commutative55.8%
Simplified55.8%
Final simplification64.9%
(FPCore (x y)
:precision binary64
(if (<= x -70.0)
(/ (/ y (+ x y)) (+ x (+ y (+ y 1.0))))
(if (<= x -3.5e-155)
(* x (/ y (* (+ x y) (+ x y))))
(/ (/ x (+ y 1.0)) (+ x y)))))
double code(double x, double y) {
double tmp;
if (x <= -70.0) {
tmp = (y / (x + y)) / (x + (y + (y + 1.0)));
} else if (x <= -3.5e-155) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-70.0d0)) then
tmp = (y / (x + y)) / (x + (y + (y + 1.0d0)))
else if (x <= (-3.5d-155)) then
tmp = x * (y / ((x + y) * (x + y)))
else
tmp = (x / (y + 1.0d0)) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -70.0) {
tmp = (y / (x + y)) / (x + (y + (y + 1.0)));
} else if (x <= -3.5e-155) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -70.0: tmp = (y / (x + y)) / (x + (y + (y + 1.0))) elif x <= -3.5e-155: tmp = x * (y / ((x + y) * (x + y))) else: tmp = (x / (y + 1.0)) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -70.0) tmp = Float64(Float64(y / Float64(x + y)) / Float64(x + Float64(y + Float64(y + 1.0)))); elseif (x <= -3.5e-155) tmp = Float64(x * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -70.0) tmp = (y / (x + y)) / (x + (y + (y + 1.0))); elseif (x <= -3.5e-155) tmp = x * (y / ((x + y) * (x + y))); else tmp = (x / (y + 1.0)) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -70.0], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.5e-155], N[(x * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -70:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-155}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -70Initial program 54.5%
times-frac79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
times-frac54.5%
associate-*l/69.8%
*-commutative69.8%
*-commutative69.8%
distribute-rgt1-in23.8%
fma-def69.8%
+-commutative69.8%
+-commutative69.8%
cube-unmult69.8%
+-commutative69.8%
Simplified69.8%
associate-*r/54.5%
fma-udef20.4%
cube-mult20.4%
distribute-rgt1-in54.5%
associate-+r+54.5%
*-commutative54.5%
frac-times79.6%
*-commutative79.6%
clear-num79.6%
associate-/r*99.8%
frac-times98.7%
*-un-lft-identity98.7%
associate-+r+98.7%
+-commutative98.7%
associate-+l+98.7%
Applied egg-rr98.7%
Taylor expanded in x around -inf 77.2%
mul-1-neg77.2%
unsub-neg77.2%
neg-mul-177.2%
+-commutative77.2%
+-commutative77.2%
neg-mul-177.2%
unsub-neg77.2%
neg-mul-177.2%
+-commutative77.2%
distribute-lft-in77.2%
metadata-eval77.2%
neg-mul-177.2%
unsub-neg77.2%
Simplified77.2%
if -70 < x < -3.50000000000000015e-155Initial program 80.8%
associate-/r*80.7%
*-commutative80.7%
+-commutative80.7%
+-commutative80.7%
associate-*l/99.6%
+-commutative99.6%
associate-*r/99.6%
remove-double-neg99.6%
+-commutative99.6%
+-commutative99.6%
remove-double-neg99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in y around 0 80.4%
if -3.50000000000000015e-155 < x Initial program 67.5%
times-frac82.7%
+-commutative82.7%
+-commutative82.7%
+-commutative82.7%
times-frac67.5%
associate-*l/79.4%
*-commutative79.4%
*-commutative79.4%
distribute-rgt1-in63.5%
fma-def79.4%
+-commutative79.4%
+-commutative79.4%
cube-unmult79.4%
+-commutative79.4%
Simplified79.4%
associate-*r/67.5%
fma-udef55.7%
cube-mult55.6%
distribute-rgt1-in67.5%
associate-+r+67.5%
*-commutative67.5%
frac-times82.6%
associate-/r*99.8%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 55.8%
+-commutative55.8%
Simplified55.8%
Final simplification65.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ x y))))
(if (<= x -0.245)
(/ t_0 (+ x (+ y (+ y 1.0))))
(* (/ t_0 (+ x y)) (/ x (+ y 1.0))))))
double code(double x, double y) {
double t_0 = y / (x + y);
double tmp;
if (x <= -0.245) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else {
tmp = (t_0 / (x + y)) * (x / (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y / (x + y)
if (x <= (-0.245d0)) then
tmp = t_0 / (x + (y + (y + 1.0d0)))
else
tmp = (t_0 / (x + y)) * (x / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x + y);
double tmp;
if (x <= -0.245) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else {
tmp = (t_0 / (x + y)) * (x / (y + 1.0));
}
return tmp;
}
def code(x, y): t_0 = y / (x + y) tmp = 0 if x <= -0.245: tmp = t_0 / (x + (y + (y + 1.0))) else: tmp = (t_0 / (x + y)) * (x / (y + 1.0)) return tmp
function code(x, y) t_0 = Float64(y / Float64(x + y)) tmp = 0.0 if (x <= -0.245) tmp = Float64(t_0 / Float64(x + Float64(y + Float64(y + 1.0)))); else tmp = Float64(Float64(t_0 / Float64(x + y)) * Float64(x / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x + y); tmp = 0.0; if (x <= -0.245) tmp = t_0 / (x + (y + (y + 1.0))); else tmp = (t_0 / (x + y)) * (x / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.245], N[(t$95$0 / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x + y}\\
\mathbf{if}\;x \leq -0.245:\\
\;\;\;\;\frac{t_0}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{x + y} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -0.245Initial program 54.5%
times-frac79.5%
+-commutative79.5%
+-commutative79.5%
+-commutative79.5%
times-frac54.5%
associate-*l/69.8%
*-commutative69.8%
*-commutative69.8%
distribute-rgt1-in23.8%
fma-def69.8%
+-commutative69.8%
+-commutative69.8%
cube-unmult69.8%
+-commutative69.8%
Simplified69.8%
associate-*r/54.5%
fma-udef20.4%
cube-mult20.4%
distribute-rgt1-in54.5%
associate-+r+54.5%
*-commutative54.5%
frac-times79.6%
*-commutative79.6%
clear-num79.6%
associate-/r*99.8%
frac-times98.7%
*-un-lft-identity98.7%
associate-+r+98.7%
+-commutative98.7%
associate-+l+98.7%
Applied egg-rr98.7%
Taylor expanded in x around -inf 77.2%
mul-1-neg77.2%
unsub-neg77.2%
neg-mul-177.2%
+-commutative77.2%
+-commutative77.2%
neg-mul-177.2%
unsub-neg77.2%
neg-mul-177.2%
+-commutative77.2%
distribute-lft-in77.2%
metadata-eval77.2%
neg-mul-177.2%
unsub-neg77.2%
Simplified77.2%
if -0.245 < x Initial program 70.2%
associate-/r*71.2%
*-commutative71.2%
+-commutative71.2%
+-commutative71.2%
associate-*l/86.1%
+-commutative86.1%
associate-*r/86.0%
remove-double-neg86.0%
+-commutative86.0%
+-commutative86.0%
remove-double-neg86.0%
+-commutative86.0%
associate-+l+86.0%
Simplified86.0%
Taylor expanded in x around 0 80.0%
+-commutative80.0%
Simplified80.0%
associate-/r*91.3%
div-inv91.2%
Applied egg-rr91.2%
associate-*r/91.3%
*-rgt-identity91.3%
Simplified91.3%
Final simplification87.6%
(FPCore (x y) :precision binary64 (if (<= y 6.8e-203) (- (/ y x) y) (if (<= y 19500000.0) (- (/ x y) x) (* (/ x y) (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= 6.8e-203) {
tmp = (y / x) - y;
} else if (y <= 19500000.0) {
tmp = (x / y) - x;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6.8d-203) then
tmp = (y / x) - y
else if (y <= 19500000.0d0) then
tmp = (x / y) - x
else
tmp = (x / y) * (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6.8e-203) {
tmp = (y / x) - y;
} else if (y <= 19500000.0) {
tmp = (x / y) - x;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.8e-203: tmp = (y / x) - y elif y <= 19500000.0: tmp = (x / y) - x else: tmp = (x / y) * (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (y <= 6.8e-203) tmp = Float64(Float64(y / x) - y); elseif (y <= 19500000.0) tmp = Float64(Float64(x / y) - x); else tmp = Float64(Float64(x / y) * Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6.8e-203) tmp = (y / x) - y; elseif (y <= 19500000.0) tmp = (x / y) - x; else tmp = (x / y) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.8e-203], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[y, 19500000.0], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.8 \cdot 10^{-203}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;y \leq 19500000:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 6.7999999999999998e-203Initial program 65.3%
associate-/r*67.1%
*-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l/84.2%
+-commutative84.2%
associate-*r/84.2%
remove-double-neg84.2%
+-commutative84.2%
+-commutative84.2%
remove-double-neg84.2%
+-commutative84.2%
associate-+l+84.2%
Simplified84.2%
Taylor expanded in y around 0 55.9%
associate-/r*55.4%
+-commutative55.4%
Simplified55.4%
Taylor expanded in x around 0 22.1%
neg-mul-122.1%
+-commutative22.1%
unsub-neg22.1%
Simplified22.1%
if 6.7999999999999998e-203 < y < 1.95e7Initial program 74.7%
associate-/r*81.3%
*-commutative81.3%
+-commutative81.3%
+-commutative81.3%
associate-*l/93.2%
+-commutative93.2%
associate-*r/93.2%
remove-double-neg93.2%
+-commutative93.2%
+-commutative93.2%
remove-double-neg93.2%
+-commutative93.2%
associate-+l+93.2%
Simplified93.2%
Taylor expanded in x around 0 23.4%
+-commutative23.4%
Simplified23.4%
Taylor expanded in y around 0 23.5%
neg-mul-123.5%
+-commutative23.5%
unsub-neg23.5%
Simplified23.5%
if 1.95e7 < y Initial program 62.5%
associate-/r*66.9%
*-commutative66.9%
+-commutative66.9%
+-commutative66.9%
associate-*l/79.1%
+-commutative79.1%
associate-*r/79.1%
remove-double-neg79.1%
+-commutative79.1%
+-commutative79.1%
remove-double-neg79.1%
+-commutative79.1%
associate-+l+79.1%
Simplified79.1%
Taylor expanded in y around inf 71.0%
Taylor expanded in y around inf 70.0%
Final simplification34.3%
(FPCore (x y) :precision binary64 (if (<= y 1.15e-202) (- (/ y x) y) (if (<= y 2.75e+166) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.15e-202) {
tmp = (y / x) - y;
} else if (y <= 2.75e+166) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.15d-202) then
tmp = (y / x) - y
else if (y <= 2.75d+166) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) * (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.15e-202) {
tmp = (y / x) - y;
} else if (y <= 2.75e+166) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.15e-202: tmp = (y / x) - y elif y <= 2.75e+166: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) * (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.15e-202) tmp = Float64(Float64(y / x) - y); elseif (y <= 2.75e+166) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) * Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.15e-202) tmp = (y / x) - y; elseif (y <= 2.75e+166) tmp = x / (y * (y + 1.0)); else tmp = (x / y) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.15e-202], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[y, 2.75e+166], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{-202}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{+166}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 1.1499999999999999e-202Initial program 65.3%
associate-/r*67.1%
*-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l/84.2%
+-commutative84.2%
associate-*r/84.2%
remove-double-neg84.2%
+-commutative84.2%
+-commutative84.2%
remove-double-neg84.2%
+-commutative84.2%
associate-+l+84.2%
Simplified84.2%
Taylor expanded in y around 0 55.9%
associate-/r*55.4%
+-commutative55.4%
Simplified55.4%
Taylor expanded in x around 0 22.1%
neg-mul-122.1%
+-commutative22.1%
unsub-neg22.1%
Simplified22.1%
if 1.1499999999999999e-202 < y < 2.75000000000000004e166Initial program 68.0%
associate-/r*76.3%
*-commutative76.3%
+-commutative76.3%
+-commutative76.3%
associate-*l/84.9%
+-commutative84.9%
associate-*r/84.8%
remove-double-neg84.8%
+-commutative84.8%
+-commutative84.8%
remove-double-neg84.8%
+-commutative84.8%
associate-+l+84.8%
Simplified84.8%
Taylor expanded in x around 0 32.4%
+-commutative32.4%
Simplified32.4%
if 2.75000000000000004e166 < y Initial program 66.2%
associate-/r*66.2%
*-commutative66.2%
+-commutative66.2%
+-commutative66.2%
associate-*l/84.4%
+-commutative84.4%
associate-*r/84.4%
remove-double-neg84.4%
+-commutative84.4%
+-commutative84.4%
remove-double-neg84.4%
+-commutative84.4%
associate-+l+84.4%
Simplified84.4%
Taylor expanded in y around inf 85.4%
Taylor expanded in y around inf 85.3%
Final simplification34.4%
(FPCore (x y) :precision binary64 (if (<= x -5.5e-110) (/ y (* x (+ x 1.0))) (if (<= x 7.2e-45) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (x <= -5.5e-110) {
tmp = y / (x * (x + 1.0));
} else if (x <= 7.2e-45) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5.5d-110)) then
tmp = y / (x * (x + 1.0d0))
else if (x <= 7.2d-45) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) * (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5.5e-110) {
tmp = y / (x * (x + 1.0));
} else if (x <= 7.2e-45) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.5e-110: tmp = y / (x * (x + 1.0)) elif x <= 7.2e-45: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) * (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (x <= -5.5e-110) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (x <= 7.2e-45) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) * Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5.5e-110) tmp = y / (x * (x + 1.0)); elseif (x <= 7.2e-45) tmp = x / (y * (y + 1.0)); else tmp = (x / y) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.5e-110], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.2e-45], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-110}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -5.4999999999999998e-110Initial program 62.8%
associate-/r*69.5%
*-commutative69.5%
+-commutative69.5%
+-commutative69.5%
associate-*l/85.7%
+-commutative85.7%
associate-*r/85.7%
remove-double-neg85.7%
+-commutative85.7%
+-commutative85.7%
remove-double-neg85.7%
+-commutative85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in y around 0 63.9%
if -5.4999999999999998e-110 < x < 7.20000000000000001e-45Initial program 64.0%
associate-/r*64.1%
*-commutative64.1%
+-commutative64.1%
+-commutative64.1%
associate-*l/79.9%
+-commutative79.9%
associate-*r/79.9%
remove-double-neg79.9%
+-commutative79.9%
+-commutative79.9%
remove-double-neg79.9%
+-commutative79.9%
associate-+l+79.9%
Simplified79.9%
Taylor expanded in x around 0 74.9%
+-commutative74.9%
Simplified74.9%
if 7.20000000000000001e-45 < x Initial program 72.9%
associate-/r*75.4%
*-commutative75.4%
+-commutative75.4%
+-commutative75.4%
associate-*l/87.9%
+-commutative87.9%
associate-*r/87.9%
remove-double-neg87.9%
+-commutative87.9%
+-commutative87.9%
remove-double-neg87.9%
+-commutative87.9%
associate-+l+87.9%
Simplified87.9%
Taylor expanded in y around inf 35.1%
Taylor expanded in y around inf 34.5%
Final simplification59.1%
(FPCore (x y) :precision binary64 (* (/ (/ y (+ x y)) (+ x y)) (/ x (+ x (+ y 1.0)))))
double code(double x, double y) {
return ((y / (x + y)) / (x + y)) * (x / (x + (y + 1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (x + y)) / (x + y)) * (x / (x + (y + 1.0d0)))
end function
public static double code(double x, double y) {
return ((y / (x + y)) / (x + y)) * (x / (x + (y + 1.0)));
}
def code(x, y): return ((y / (x + y)) / (x + y)) * (x / (x + (y + 1.0)))
function code(x, y) return Float64(Float64(Float64(y / Float64(x + y)) / Float64(x + y)) * Float64(x / Float64(x + Float64(y + 1.0)))) end
function tmp = code(x, y) tmp = ((y / (x + y)) / (x + y)) * (x / (x + (y + 1.0))); end
code[x_, y_] := N[(N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x + y}}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}
\end{array}
Initial program 66.1%
associate-/r*69.4%
*-commutative69.4%
+-commutative69.4%
+-commutative69.4%
associate-*l/84.4%
+-commutative84.4%
associate-*r/84.4%
remove-double-neg84.4%
+-commutative84.4%
+-commutative84.4%
remove-double-neg84.4%
+-commutative84.4%
associate-+l+84.4%
Simplified84.4%
associate-/r*84.3%
div-inv84.3%
Applied egg-rr99.7%
associate-*r/84.3%
*-rgt-identity84.3%
Simplified99.8%
Final simplification99.8%
(FPCore (x y) :precision binary64 (/ (* (/ x (+ y (+ x 1.0))) (/ y (+ x y))) (+ x y)))
double code(double x, double y) {
return ((x / (y + (x + 1.0))) * (y / (x + y))) / (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / (y + (x + 1.0d0))) * (y / (x + y))) / (x + y)
end function
public static double code(double x, double y) {
return ((x / (y + (x + 1.0))) * (y / (x + y))) / (x + y);
}
def code(x, y): return ((x / (y + (x + 1.0))) * (y / (x + y))) / (x + y)
function code(x, y) return Float64(Float64(Float64(x / Float64(y + Float64(x + 1.0))) * Float64(y / Float64(x + y))) / Float64(x + y)) end
function tmp = code(x, y) tmp = ((x / (y + (x + 1.0))) * (y / (x + y))) / (x + y); end
code[x_, y_] := N[(N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{y + \left(x + 1\right)} \cdot \frac{y}{x + y}}{x + y}
\end{array}
Initial program 66.1%
times-frac84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
times-frac66.1%
associate-*l/79.6%
*-commutative79.6%
*-commutative79.6%
distribute-rgt1-in56.7%
fma-def79.6%
+-commutative79.6%
+-commutative79.6%
cube-unmult79.6%
+-commutative79.6%
Simplified79.6%
associate-*r/66.1%
fma-udef48.7%
cube-mult48.7%
distribute-rgt1-in66.1%
associate-+r+66.1%
*-commutative66.1%
frac-times84.4%
associate-/r*99.8%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y) :precision binary64 (if (<= x -1.7e-109) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y (+ x 1.0))) y)))
double code(double x, double y) {
double tmp;
if (x <= -1.7e-109) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + (x + 1.0))) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.7d-109)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + (x + 1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.7e-109) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + (x + 1.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.7e-109: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + (x + 1.0))) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.7e-109) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.7e-109) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + (x + 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.7e-109], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-109}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\
\end{array}
\end{array}
if x < -1.70000000000000006e-109Initial program 62.8%
associate-/r*69.5%
*-commutative69.5%
+-commutative69.5%
+-commutative69.5%
associate-*l/85.7%
+-commutative85.7%
associate-*r/85.7%
remove-double-neg85.7%
+-commutative85.7%
+-commutative85.7%
remove-double-neg85.7%
+-commutative85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in y around 0 63.9%
associate-/r*66.8%
+-commutative66.8%
Simplified66.8%
if -1.70000000000000006e-109 < x Initial program 68.1%
associate-/r*69.3%
*-commutative69.3%
+-commutative69.3%
+-commutative69.3%
associate-*l/83.6%
+-commutative83.6%
associate-*r/83.6%
remove-double-neg83.6%
+-commutative83.6%
+-commutative83.6%
remove-double-neg83.6%
+-commutative83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in y around inf 56.6%
associate-*l/56.6%
*-un-lft-identity56.6%
associate-+r+56.6%
+-commutative56.6%
associate-+r+56.6%
Applied egg-rr56.6%
Final simplification60.4%
(FPCore (x y) :precision binary64 (if (<= x -1.7e-109) (/ (/ y (+ x y)) (+ x 1.0)) (/ (/ x (+ y (+ x 1.0))) y)))
double code(double x, double y) {
double tmp;
if (x <= -1.7e-109) {
tmp = (y / (x + y)) / (x + 1.0);
} else {
tmp = (x / (y + (x + 1.0))) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.7d-109)) then
tmp = (y / (x + y)) / (x + 1.0d0)
else
tmp = (x / (y + (x + 1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.7e-109) {
tmp = (y / (x + y)) / (x + 1.0);
} else {
tmp = (x / (y + (x + 1.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.7e-109: tmp = (y / (x + y)) / (x + 1.0) else: tmp = (x / (y + (x + 1.0))) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.7e-109) tmp = Float64(Float64(y / Float64(x + y)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.7e-109) tmp = (y / (x + y)) / (x + 1.0); else tmp = (x / (y + (x + 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.7e-109], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-109}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\
\end{array}
\end{array}
if x < -1.70000000000000006e-109Initial program 62.8%
times-frac85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
times-frac62.8%
associate-*l/78.9%
*-commutative78.9%
*-commutative78.9%
distribute-rgt1-in43.8%
fma-def78.9%
+-commutative78.9%
+-commutative78.9%
cube-unmult78.9%
+-commutative78.9%
Simplified78.9%
associate-*r/62.7%
fma-udef35.9%
cube-mult35.9%
distribute-rgt1-in62.8%
associate-+r+62.8%
*-commutative62.8%
frac-times85.7%
*-commutative85.7%
clear-num85.7%
associate-/r*99.8%
frac-times99.0%
*-un-lft-identity99.0%
associate-+r+99.0%
+-commutative99.0%
associate-+l+99.0%
Applied egg-rr99.0%
Taylor expanded in y around 0 67.1%
+-commutative67.1%
Simplified67.1%
if -1.70000000000000006e-109 < x Initial program 68.1%
associate-/r*69.3%
*-commutative69.3%
+-commutative69.3%
+-commutative69.3%
associate-*l/83.6%
+-commutative83.6%
associate-*r/83.6%
remove-double-neg83.6%
+-commutative83.6%
+-commutative83.6%
remove-double-neg83.6%
+-commutative83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in y around inf 56.6%
associate-*l/56.6%
*-un-lft-identity56.6%
associate-+r+56.6%
+-commutative56.6%
associate-+r+56.6%
Applied egg-rr56.6%
Final simplification60.5%
(FPCore (x y) :precision binary64 (if (<= x -1.7e-109) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -1.7e-109) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.7d-109)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.7e-109) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.7e-109: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.7e-109) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.7e-109) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.7e-109], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-109}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.70000000000000006e-109Initial program 62.8%
associate-/r*69.5%
*-commutative69.5%
+-commutative69.5%
+-commutative69.5%
associate-*l/85.7%
+-commutative85.7%
associate-*r/85.7%
remove-double-neg85.7%
+-commutative85.7%
+-commutative85.7%
remove-double-neg85.7%
+-commutative85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in y around 0 63.9%
if -1.70000000000000006e-109 < x Initial program 68.1%
times-frac83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
times-frac68.1%
associate-*l/80.0%
*-commutative80.0%
*-commutative80.0%
distribute-rgt1-in64.3%
fma-def80.0%
+-commutative80.0%
+-commutative80.0%
cube-unmult80.0%
+-commutative80.0%
Simplified80.0%
associate-*r/68.1%
fma-udef56.3%
cube-mult56.3%
distribute-rgt1-in68.1%
associate-+r+68.1%
*-commutative68.1%
frac-times83.6%
associate-/r*99.8%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 54.4%
associate-/r*56.5%
Simplified56.5%
Final simplification59.2%
(FPCore (x y) :precision binary64 (if (<= x -1.7e-109) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -1.7e-109) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.7d-109)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.7e-109) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.7e-109: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.7e-109) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.7e-109) tmp = (y / x) / (x + 1.0); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.7e-109], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-109}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.70000000000000006e-109Initial program 62.8%
associate-/r*69.5%
*-commutative69.5%
+-commutative69.5%
+-commutative69.5%
associate-*l/85.7%
+-commutative85.7%
associate-*r/85.7%
remove-double-neg85.7%
+-commutative85.7%
+-commutative85.7%
remove-double-neg85.7%
+-commutative85.7%
associate-+l+85.7%
Simplified85.7%
Taylor expanded in y around 0 63.9%
associate-/r*66.8%
+-commutative66.8%
Simplified66.8%
if -1.70000000000000006e-109 < x Initial program 68.1%
times-frac83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
times-frac68.1%
associate-*l/80.0%
*-commutative80.0%
*-commutative80.0%
distribute-rgt1-in64.3%
fma-def80.0%
+-commutative80.0%
+-commutative80.0%
cube-unmult80.0%
+-commutative80.0%
Simplified80.0%
associate-*r/68.1%
fma-udef56.3%
cube-mult56.3%
distribute-rgt1-in68.1%
associate-+r+68.1%
*-commutative68.1%
frac-times83.6%
associate-/r*99.8%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 54.4%
associate-/r*56.5%
Simplified56.5%
Final simplification60.3%
(FPCore (x y) :precision binary64 (if (<= y 6.8e-203) (- (/ y x) y) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 6.8e-203) {
tmp = (y / x) - y;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6.8d-203) then
tmp = (y / x) - y
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6.8e-203) {
tmp = (y / x) - y;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.8e-203: tmp = (y / x) - y else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 6.8e-203) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6.8e-203) tmp = (y / x) - y; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.8e-203], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.8 \cdot 10^{-203}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 6.7999999999999998e-203Initial program 65.3%
associate-/r*67.1%
*-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l/84.2%
+-commutative84.2%
associate-*r/84.2%
remove-double-neg84.2%
+-commutative84.2%
+-commutative84.2%
remove-double-neg84.2%
+-commutative84.2%
associate-+l+84.2%
Simplified84.2%
Taylor expanded in y around 0 55.9%
associate-/r*55.4%
+-commutative55.4%
Simplified55.4%
Taylor expanded in x around 0 22.1%
neg-mul-122.1%
+-commutative22.1%
unsub-neg22.1%
Simplified22.1%
if 6.7999999999999998e-203 < y Initial program 67.3%
associate-/r*72.6%
*-commutative72.6%
+-commutative72.6%
+-commutative72.6%
associate-*l/84.7%
+-commutative84.7%
associate-*r/84.6%
remove-double-neg84.6%
+-commutative84.6%
+-commutative84.6%
remove-double-neg84.6%
+-commutative84.6%
associate-+l+84.6%
Simplified84.6%
Taylor expanded in x around 0 51.5%
+-commutative51.5%
Simplified51.5%
Taylor expanded in y around 0 27.3%
Final simplification24.2%
(FPCore (x y) :precision binary64 (/ 0.5 y))
double code(double x, double y) {
return 0.5 / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.5d0 / y
end function
public static double code(double x, double y) {
return 0.5 / y;
}
def code(x, y): return 0.5 / y
function code(x, y) return Float64(0.5 / y) end
function tmp = code(x, y) tmp = 0.5 / y; end
code[x_, y_] := N[(0.5 / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5}{y}
\end{array}
Initial program 66.1%
times-frac84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
times-frac66.1%
associate-*l/79.6%
*-commutative79.6%
*-commutative79.6%
distribute-rgt1-in56.7%
fma-def79.6%
+-commutative79.6%
+-commutative79.6%
cube-unmult79.6%
+-commutative79.6%
Simplified79.6%
associate-*r/66.1%
fma-udef48.7%
cube-mult48.7%
distribute-rgt1-in66.1%
associate-+r+66.1%
*-commutative66.1%
frac-times84.4%
*-commutative84.4%
clear-num84.4%
associate-/r*99.8%
frac-times99.3%
*-un-lft-identity99.3%
associate-+r+99.3%
+-commutative99.3%
associate-+l+99.3%
Applied egg-rr99.3%
Taylor expanded in x around -inf 54.8%
mul-1-neg54.8%
unsub-neg54.8%
neg-mul-154.8%
+-commutative54.8%
+-commutative54.8%
neg-mul-154.8%
unsub-neg54.8%
neg-mul-154.8%
+-commutative54.8%
distribute-lft-in54.8%
metadata-eval54.8%
neg-mul-154.8%
unsub-neg54.8%
Simplified54.8%
Taylor expanded in y around inf 4.3%
Final simplification4.3%
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
return x / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
public static double code(double x, double y) {
return x / y;
}
def code(x, y): return x / y
function code(x, y) return Float64(x / y) end
function tmp = code(x, y) tmp = x / y; end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y}
\end{array}
Initial program 66.1%
associate-/r*69.4%
*-commutative69.4%
+-commutative69.4%
+-commutative69.4%
associate-*l/84.4%
+-commutative84.4%
associate-*r/84.4%
remove-double-neg84.4%
+-commutative84.4%
+-commutative84.4%
remove-double-neg84.4%
+-commutative84.4%
associate-+l+84.4%
Simplified84.4%
Taylor expanded in x around 0 46.2%
+-commutative46.2%
Simplified46.2%
Taylor expanded in y around 0 24.2%
Final simplification24.2%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2024024
(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))))