
(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 (+ x y)) (/ (/ 1.0 (+ x (+ y 1.0))) (/ (+ x y) y))))
double code(double x, double y) {
return (x / (x + y)) * ((1.0 / (x + (y + 1.0))) / ((x + y) / y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (x + y)) * ((1.0d0 / (x + (y + 1.0d0))) / ((x + y) / y))
end function
public static double code(double x, double y) {
return (x / (x + y)) * ((1.0 / (x + (y + 1.0))) / ((x + y) / y));
}
def code(x, y): return (x / (x + y)) * ((1.0 / (x + (y + 1.0))) / ((x + y) / y))
function code(x, y) return Float64(Float64(x / Float64(x + y)) * Float64(Float64(1.0 / Float64(x + Float64(y + 1.0))) / Float64(Float64(x + y) / y))) end
function tmp = code(x, y) tmp = (x / (x + y)) * ((1.0 / (x + (y + 1.0))) / ((x + y) / y)); end
code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{x + y} \cdot \frac{\frac{1}{x + \left(y + 1\right)}}{\frac{x + y}{y}}
\end{array}
Initial program 70.3%
associate-*l*70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-*l*70.3%
associate-*l/85.0%
*-commutative85.0%
*-commutative85.0%
distribute-rgt1-in66.3%
fma-def85.0%
+-commutative85.0%
+-commutative85.0%
cube-unmult85.0%
+-commutative85.0%
Simplified85.0%
associate-*r/70.3%
fma-udef54.9%
cube-mult54.9%
distribute-rgt1-in70.3%
associate-+r+70.3%
*-commutative70.3%
frac-times88.8%
associate-*l/81.0%
associate-/r*87.6%
associate-+r+87.6%
+-commutative87.6%
associate-+l+87.6%
Applied egg-rr87.6%
clear-num87.5%
associate-+r+87.5%
+-commutative87.5%
associate-+r+87.5%
un-div-inv87.5%
associate-+r+87.5%
+-commutative87.5%
associate-+r+87.5%
Applied egg-rr87.5%
associate-/l/81.0%
div-inv81.0%
associate-+r+81.0%
+-commutative81.0%
associate-+r+81.0%
clear-num81.0%
+-commutative81.0%
+-commutative81.0%
times-frac99.8%
clear-num99.8%
times-frac99.3%
associate-/r/99.3%
*-un-lft-identity99.3%
div-inv99.3%
div-inv99.2%
times-frac99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y)
:precision binary64
(if (<= x -6.8e+155)
(* (/ x (+ x y)) (/ (/ 1.0 x) (/ (+ x y) y)))
(if (<= x -4.5e-14)
(* (/ x (+ x (+ y 1.0))) (/ y (* (+ x y) (+ x y))))
(* (/ (/ y (+ x y)) (+ x y)) (/ x (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -6.8e+155) {
tmp = (x / (x + y)) * ((1.0 / x) / ((x + y) / y));
} else if (x <= -4.5e-14) {
tmp = (x / (x + (y + 1.0))) * (y / ((x + y) * (x + y)));
} else {
tmp = ((y / (x + y)) / (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) :: tmp
if (x <= (-6.8d+155)) then
tmp = (x / (x + y)) * ((1.0d0 / x) / ((x + y) / y))
else if (x <= (-4.5d-14)) then
tmp = (x / (x + (y + 1.0d0))) * (y / ((x + y) * (x + y)))
else
tmp = ((y / (x + y)) / (x + y)) * (x / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -6.8e+155) {
tmp = (x / (x + y)) * ((1.0 / x) / ((x + y) / y));
} else if (x <= -4.5e-14) {
tmp = (x / (x + (y + 1.0))) * (y / ((x + y) * (x + y)));
} else {
tmp = ((y / (x + y)) / (x + y)) * (x / (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.8e+155: tmp = (x / (x + y)) * ((1.0 / x) / ((x + y) / y)) elif x <= -4.5e-14: tmp = (x / (x + (y + 1.0))) * (y / ((x + y) * (x + y))) else: tmp = ((y / (x + y)) / (x + y)) * (x / (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -6.8e+155) tmp = Float64(Float64(x / Float64(x + y)) * Float64(Float64(1.0 / x) / Float64(Float64(x + y) / y))); elseif (x <= -4.5e-14) tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(Float64(y / Float64(x + y)) / Float64(x + y)) * Float64(x / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.8e+155) tmp = (x / (x + y)) * ((1.0 / x) / ((x + y) / y)); elseif (x <= -4.5e-14) tmp = (x / (x + (y + 1.0))) * (y / ((x + y) * (x + y))); else tmp = ((y / (x + y)) / (x + y)) * (x / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.8e+155], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / x), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e-14], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+155}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{1}{x}}{\frac{x + y}{y}}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x + y} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -6.8000000000000002e155Initial program 74.3%
associate-*l*74.3%
+-commutative74.3%
+-commutative74.3%
+-commutative74.3%
associate-*l*74.3%
associate-*l/83.0%
*-commutative83.0%
*-commutative83.0%
distribute-rgt1-in0.6%
fma-def83.0%
+-commutative83.0%
+-commutative83.0%
cube-unmult83.0%
+-commutative83.0%
Simplified83.0%
associate-*r/74.3%
fma-udef0.0%
cube-mult0.0%
distribute-rgt1-in74.3%
associate-+r+74.3%
*-commutative74.3%
frac-times83.0%
associate-*l/83.0%
associate-/r*99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
clear-num99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
un-div-inv99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Applied egg-rr99.9%
associate-/l/83.0%
div-inv83.0%
associate-+r+83.0%
+-commutative83.0%
associate-+r+83.0%
clear-num83.0%
+-commutative83.0%
+-commutative83.0%
times-frac99.9%
clear-num99.9%
times-frac99.8%
associate-/r/99.8%
*-un-lft-identity99.8%
div-inv99.8%
div-inv99.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 93.0%
if -6.8000000000000002e155 < x < -4.4999999999999998e-14Initial program 72.6%
associate-*l*72.6%
+-commutative72.6%
+-commutative72.6%
+-commutative72.6%
associate-*l*72.6%
*-commutative72.6%
times-frac91.9%
+-commutative91.9%
+-commutative91.9%
+-commutative91.9%
associate-+l+91.9%
Simplified91.9%
if -4.4999999999999998e-14 < x Initial program 69.3%
associate-*l*69.3%
+-commutative69.3%
+-commutative69.3%
+-commutative69.3%
associate-*l*69.3%
*-commutative69.3%
times-frac89.0%
+-commutative89.0%
+-commutative89.0%
+-commutative89.0%
associate-+l+89.0%
Simplified89.0%
Taylor expanded in x around 0 82.1%
+-commutative82.1%
Simplified82.1%
associate-/r*90.9%
div-inv90.9%
Applied egg-rr90.9%
associate-*r/90.9%
*-rgt-identity90.9%
Simplified90.9%
Final simplification91.3%
(FPCore (x y)
:precision binary64
(if (<= y 1.06e-169)
(/ (/ y x) (+ x 1.0))
(if (<= y 1.05e-7)
(* x (/ y (* (+ x y) (+ x y))))
(* (/ x (+ x (+ y 1.0))) (/ 1.0 (+ y (* x 2.0)))))))
double code(double x, double y) {
double tmp;
if (y <= 1.06e-169) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1.05e-7) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (x + (y + 1.0))) * (1.0 / (y + (x * 2.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.06d-169) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 1.05d-7) then
tmp = x * (y / ((x + y) * (x + y)))
else
tmp = (x / (x + (y + 1.0d0))) * (1.0d0 / (y + (x * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.06e-169) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1.05e-7) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (x + (y + 1.0))) * (1.0 / (y + (x * 2.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.06e-169: tmp = (y / x) / (x + 1.0) elif y <= 1.05e-7: tmp = x * (y / ((x + y) * (x + y))) else: tmp = (x / (x + (y + 1.0))) * (1.0 / (y + (x * 2.0))) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.06e-169) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 1.05e-7) tmp = Float64(x * Float64(y / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) * Float64(1.0 / Float64(y + Float64(x * 2.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.06e-169) tmp = (y / x) / (x + 1.0); elseif (y <= 1.05e-7) tmp = x * (y / ((x + y) * (x + y))); else tmp = (x / (x + (y + 1.0))) * (1.0 / (y + (x * 2.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.06e-169], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-7], N[(x * N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.06 \cdot 10^{-169}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y + x \cdot 2}\\
\end{array}
\end{array}
if y < 1.06e-169Initial program 65.0%
associate-*l*65.0%
+-commutative65.0%
+-commutative65.0%
+-commutative65.0%
associate-*l*65.0%
*-commutative65.0%
times-frac86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
associate-+l+86.3%
Simplified86.3%
add-cube-cbrt85.7%
times-frac98.8%
pow298.8%
Applied egg-rr98.8%
frac-times85.7%
unpow285.7%
add-cube-cbrt86.3%
associate-/r*99.8%
clear-num99.3%
+-commutative99.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in y around 0 56.9%
associate-/r*58.0%
+-commutative58.0%
Simplified58.0%
if 1.06e-169 < y < 1.05e-7Initial program 94.5%
associate-*l*94.5%
+-commutative94.5%
+-commutative94.5%
+-commutative94.5%
associate-*l*94.5%
*-commutative94.5%
times-frac99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in y around 0 89.3%
if 1.05e-7 < y Initial program 68.7%
associate-*l*68.7%
+-commutative68.7%
+-commutative68.7%
+-commutative68.7%
associate-*l*68.7%
*-commutative68.7%
times-frac88.7%
+-commutative88.7%
+-commutative88.7%
+-commutative88.7%
associate-+l+88.7%
Simplified88.7%
add-cube-cbrt88.3%
times-frac99.3%
pow299.3%
Applied egg-rr99.3%
frac-times88.3%
unpow288.3%
add-cube-cbrt88.7%
associate-/r*99.9%
clear-num98.7%
+-commutative98.7%
+-commutative98.7%
Applied egg-rr98.7%
Taylor expanded in y around inf 77.3%
*-commutative77.3%
Simplified77.3%
Final simplification67.4%
(FPCore (x y)
:precision binary64
(if (<= y 1.06e-169)
(/ (/ y x) (+ x 1.0))
(if (<= y 3e+151)
(* (/ y (* (+ x y) (+ x y))) (/ x (+ y 1.0)))
(* (/ x (+ x (+ y 1.0))) (/ 1.0 (+ y (* x 2.0)))))))
double code(double x, double y) {
double tmp;
if (y <= 1.06e-169) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 3e+151) {
tmp = (y / ((x + y) * (x + y))) * (x / (y + 1.0));
} else {
tmp = (x / (x + (y + 1.0))) * (1.0 / (y + (x * 2.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.06d-169) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 3d+151) then
tmp = (y / ((x + y) * (x + y))) * (x / (y + 1.0d0))
else
tmp = (x / (x + (y + 1.0d0))) * (1.0d0 / (y + (x * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.06e-169) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 3e+151) {
tmp = (y / ((x + y) * (x + y))) * (x / (y + 1.0));
} else {
tmp = (x / (x + (y + 1.0))) * (1.0 / (y + (x * 2.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.06e-169: tmp = (y / x) / (x + 1.0) elif y <= 3e+151: tmp = (y / ((x + y) * (x + y))) * (x / (y + 1.0)) else: tmp = (x / (x + (y + 1.0))) * (1.0 / (y + (x * 2.0))) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.06e-169) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 3e+151) tmp = Float64(Float64(y / Float64(Float64(x + y) * Float64(x + y))) * Float64(x / Float64(y + 1.0))); else tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) * Float64(1.0 / Float64(y + Float64(x * 2.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.06e-169) tmp = (y / x) / (x + 1.0); elseif (y <= 3e+151) tmp = (y / ((x + y) * (x + y))) * (x / (y + 1.0)); else tmp = (x / (x + (y + 1.0))) * (1.0 / (y + (x * 2.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.06e-169], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+151], N[(N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.06 \cdot 10^{-169}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+151}:\\
\;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y + x \cdot 2}\\
\end{array}
\end{array}
if y < 1.06e-169Initial program 65.0%
associate-*l*65.0%
+-commutative65.0%
+-commutative65.0%
+-commutative65.0%
associate-*l*65.0%
*-commutative65.0%
times-frac86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
associate-+l+86.3%
Simplified86.3%
add-cube-cbrt85.7%
times-frac98.8%
pow298.8%
Applied egg-rr98.8%
frac-times85.7%
unpow285.7%
add-cube-cbrt86.3%
associate-/r*99.8%
clear-num99.3%
+-commutative99.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in y around 0 56.9%
associate-/r*58.0%
+-commutative58.0%
Simplified58.0%
if 1.06e-169 < y < 2.9999999999999999e151Initial program 89.7%
associate-*l*89.7%
+-commutative89.7%
+-commutative89.7%
+-commutative89.7%
associate-*l*89.7%
*-commutative89.7%
times-frac99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in x around 0 86.2%
+-commutative86.2%
Simplified86.2%
if 2.9999999999999999e151 < y Initial program 55.2%
associate-*l*55.2%
+-commutative55.2%
+-commutative55.2%
+-commutative55.2%
associate-*l*55.2%
*-commutative55.2%
times-frac78.7%
+-commutative78.7%
+-commutative78.7%
+-commutative78.7%
associate-+l+78.7%
Simplified78.7%
add-cube-cbrt78.7%
times-frac99.6%
pow299.6%
Applied egg-rr99.6%
frac-times78.7%
unpow278.7%
add-cube-cbrt78.7%
associate-/r*100.0%
clear-num97.8%
+-commutative97.8%
+-commutative97.8%
Applied egg-rr97.8%
Taylor expanded in y around inf 84.9%
*-commutative84.9%
Simplified84.9%
Final simplification69.0%
(FPCore (x y) :precision binary64 (* (/ 1.0 (/ (+ x y) (/ y (+ x y)))) (/ x (+ x (+ y 1.0)))))
double code(double x, double y) {
return (1.0 / ((x + y) / (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 = (1.0d0 / ((x + y) / (y / (x + y)))) * (x / (x + (y + 1.0d0)))
end function
public static double code(double x, double y) {
return (1.0 / ((x + y) / (y / (x + y)))) * (x / (x + (y + 1.0)));
}
def code(x, y): return (1.0 / ((x + y) / (y / (x + y)))) * (x / (x + (y + 1.0)))
function code(x, y) return Float64(Float64(1.0 / Float64(Float64(x + y) / Float64(y / Float64(x + y)))) * Float64(x / Float64(x + Float64(y + 1.0)))) end
function tmp = code(x, y) tmp = (1.0 / ((x + y) / (y / (x + y)))) * (x / (x + (y + 1.0))); end
code[x_, y_] := N[(N[(1.0 / N[(N[(x + y), $MachinePrecision] / N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{x + y}{\frac{y}{x + y}}} \cdot \frac{x}{x + \left(y + 1\right)}
\end{array}
Initial program 70.3%
associate-*l*70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-*l*70.3%
*-commutative70.3%
times-frac88.8%
+-commutative88.8%
+-commutative88.8%
+-commutative88.8%
associate-+l+88.8%
Simplified88.8%
add-cube-cbrt88.1%
times-frac98.9%
pow298.9%
Applied egg-rr98.9%
frac-times88.1%
unpow288.1%
add-cube-cbrt88.8%
associate-/r*99.8%
clear-num99.2%
+-commutative99.2%
+-commutative99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x y) :precision binary64 (if (<= y 1.8e-305) (/ (/ y x) (+ x 1.0)) (* (/ (/ y (+ x y)) (+ x y)) (/ x (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 1.8e-305) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = ((y / (x + y)) / (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) :: tmp
if (y <= 1.8d-305) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = ((y / (x + y)) / (x + y)) * (x / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.8e-305) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = ((y / (x + y)) / (x + y)) * (x / (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.8e-305: tmp = (y / x) / (x + 1.0) else: tmp = ((y / (x + y)) / (x + y)) * (x / (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.8e-305) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(Float64(y / Float64(x + y)) / Float64(x + y)) * Float64(x / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.8e-305) tmp = (y / x) / (x + 1.0); else tmp = ((y / (x + y)) / (x + y)) * (x / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.8e-305], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{-305}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x + y} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if y < 1.80000000000000002e-305Initial program 68.3%
associate-*l*68.3%
+-commutative68.3%
+-commutative68.3%
+-commutative68.3%
associate-*l*68.3%
*-commutative68.3%
times-frac89.3%
+-commutative89.3%
+-commutative89.3%
+-commutative89.3%
associate-+l+89.3%
Simplified89.3%
add-cube-cbrt88.6%
times-frac98.9%
pow298.9%
Applied egg-rr98.9%
frac-times88.6%
unpow288.6%
add-cube-cbrt89.3%
associate-/r*99.7%
clear-num99.2%
+-commutative99.2%
+-commutative99.2%
Applied egg-rr99.2%
Taylor expanded in y around 0 49.7%
associate-/r*51.0%
+-commutative51.0%
Simplified51.0%
if 1.80000000000000002e-305 < y Initial program 72.2%
associate-*l*72.2%
+-commutative72.2%
+-commutative72.2%
+-commutative72.2%
associate-*l*72.2%
*-commutative72.2%
times-frac88.3%
+-commutative88.3%
+-commutative88.3%
+-commutative88.3%
associate-+l+88.3%
Simplified88.3%
Taylor expanded in x around 0 81.0%
+-commutative81.0%
Simplified81.0%
associate-/r*89.2%
div-inv89.1%
Applied egg-rr89.1%
associate-*r/89.2%
*-rgt-identity89.2%
Simplified89.2%
Final simplification70.6%
(FPCore (x y) :precision binary64 (/ (/ y (+ x y)) (* (+ x y) (/ (+ y (+ x 1.0)) x))))
double code(double x, double y) {
return (y / (x + y)) / ((x + y) * ((y + (x + 1.0)) / x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (x + y)) / ((x + y) * ((y + (x + 1.0d0)) / x))
end function
public static double code(double x, double y) {
return (y / (x + y)) / ((x + y) * ((y + (x + 1.0)) / x));
}
def code(x, y): return (y / (x + y)) / ((x + y) * ((y + (x + 1.0)) / x))
function code(x, y) return Float64(Float64(y / Float64(x + y)) / Float64(Float64(x + y) * Float64(Float64(y + Float64(x + 1.0)) / x))) end
function tmp = code(x, y) tmp = (y / (x + y)) / ((x + y) * ((y + (x + 1.0)) / x)); end
code[x_, y_] := N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x + y}}{\left(x + y\right) \cdot \frac{y + \left(x + 1\right)}{x}}
\end{array}
Initial program 70.3%
associate-*l*70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-*l*70.3%
associate-*l/85.0%
*-commutative85.0%
*-commutative85.0%
distribute-rgt1-in66.3%
fma-def85.0%
+-commutative85.0%
+-commutative85.0%
cube-unmult85.0%
+-commutative85.0%
Simplified85.0%
associate-*r/70.3%
fma-udef54.9%
cube-mult54.9%
distribute-rgt1-in70.3%
associate-+r+70.3%
*-commutative70.3%
frac-times88.8%
*-commutative88.8%
clear-num88.4%
associate-/r*99.4%
frac-times99.4%
*-un-lft-identity99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+l+99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y)
:precision binary64
(if (<= y 1.06e-169)
(/ (/ y x) (+ x 1.0))
(if (<= y 5.3e-8)
(* x (/ y (* (+ x y) (+ x y))))
(/ (/ x (+ y 1.0)) (+ x y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.06e-169) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 5.3e-8) {
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 (y <= 1.06d-169) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 5.3d-8) 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 (y <= 1.06e-169) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 5.3e-8) {
tmp = x * (y / ((x + y) * (x + y)));
} else {
tmp = (x / (y + 1.0)) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.06e-169: tmp = (y / x) / (x + 1.0) elif y <= 5.3e-8: 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 (y <= 1.06e-169) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 5.3e-8) 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 (y <= 1.06e-169) tmp = (y / x) / (x + 1.0); elseif (y <= 5.3e-8) 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[y, 1.06e-169], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.3e-8], 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}\;y \leq 1.06 \cdot 10^{-169}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-8}:\\
\;\;\;\;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 y < 1.06e-169Initial program 65.0%
associate-*l*65.0%
+-commutative65.0%
+-commutative65.0%
+-commutative65.0%
associate-*l*65.0%
*-commutative65.0%
times-frac86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
associate-+l+86.3%
Simplified86.3%
add-cube-cbrt85.7%
times-frac98.8%
pow298.8%
Applied egg-rr98.8%
frac-times85.7%
unpow285.7%
add-cube-cbrt86.3%
associate-/r*99.8%
clear-num99.3%
+-commutative99.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in y around 0 56.9%
associate-/r*58.0%
+-commutative58.0%
Simplified58.0%
if 1.06e-169 < y < 5.2999999999999998e-8Initial program 94.5%
associate-*l*94.5%
+-commutative94.5%
+-commutative94.5%
+-commutative94.5%
associate-*l*94.5%
*-commutative94.5%
times-frac99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in x around 0 89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in y around 0 89.3%
if 5.2999999999999998e-8 < y Initial program 68.7%
associate-*l*68.7%
+-commutative68.7%
+-commutative68.7%
+-commutative68.7%
associate-*l*68.7%
associate-*l/80.0%
*-commutative80.0%
*-commutative80.0%
distribute-rgt1-in78.2%
fma-def80.0%
+-commutative80.0%
+-commutative80.0%
cube-unmult80.0%
+-commutative80.0%
Simplified80.0%
associate-*r/68.7%
fma-udef67.1%
cube-mult67.1%
distribute-rgt1-in68.7%
associate-+r+68.7%
*-commutative68.7%
frac-times88.7%
associate-*l/88.6%
associate-/r*99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
clear-num99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
un-div-inv99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 75.3%
+-commutative75.3%
Simplified75.3%
Final simplification66.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ y x) (+ x 1.0))))
(if (<= y 1.7e-76)
t_0
(if (<= y 2700000.0)
(/ x (* y (+ y 1.0)))
(if (<= y 2.2e+32) t_0 (/ (/ x y) (+ x y)))))))
double code(double x, double y) {
double t_0 = (y / x) / (x + 1.0);
double tmp;
if (y <= 1.7e-76) {
tmp = t_0;
} else if (y <= 2700000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 2.2e+32) {
tmp = t_0;
} else {
tmp = (x / y) / (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 = (y / x) / (x + 1.0d0)
if (y <= 1.7d-76) then
tmp = t_0
else if (y <= 2700000.0d0) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 2.2d+32) then
tmp = t_0
else
tmp = (x / y) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y / x) / (x + 1.0);
double tmp;
if (y <= 1.7e-76) {
tmp = t_0;
} else if (y <= 2700000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 2.2e+32) {
tmp = t_0;
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
def code(x, y): t_0 = (y / x) / (x + 1.0) tmp = 0 if y <= 1.7e-76: tmp = t_0 elif y <= 2700000.0: tmp = x / (y * (y + 1.0)) elif y <= 2.2e+32: tmp = t_0 else: tmp = (x / y) / (x + y) return tmp
function code(x, y) t_0 = Float64(Float64(y / x) / Float64(x + 1.0)) tmp = 0.0 if (y <= 1.7e-76) tmp = t_0; elseif (y <= 2700000.0) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 2.2e+32) tmp = t_0; else tmp = Float64(Float64(x / y) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) t_0 = (y / x) / (x + 1.0); tmp = 0.0; if (y <= 1.7e-76) tmp = t_0; elseif (y <= 2700000.0) tmp = x / (y * (y + 1.0)); elseif (y <= 2.2e+32) tmp = t_0; else tmp = (x / y) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.7e-76], t$95$0, If[LessEqual[y, 2700000.0], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+32], t$95$0, N[(N[(x / y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x}}{x + 1}\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{-76}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2700000:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+32}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + y}\\
\end{array}
\end{array}
if y < 1.7e-76 or 2.7e6 < y < 2.20000000000000001e32Initial program 69.2%
associate-*l*69.2%
+-commutative69.2%
+-commutative69.2%
+-commutative69.2%
associate-*l*69.2%
*-commutative69.2%
times-frac88.3%
+-commutative88.3%
+-commutative88.3%
+-commutative88.3%
associate-+l+88.3%
Simplified88.3%
add-cube-cbrt87.5%
times-frac98.8%
pow298.8%
Applied egg-rr98.8%
frac-times87.5%
unpow287.5%
add-cube-cbrt88.3%
associate-/r*99.8%
clear-num99.4%
+-commutative99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 60.8%
associate-/r*61.8%
+-commutative61.8%
Simplified61.8%
if 1.7e-76 < y < 2.7e6Initial program 95.2%
associate-*l*95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
associate-*l*95.2%
*-commutative95.2%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 44.5%
+-commutative44.5%
Simplified44.5%
if 2.20000000000000001e32 < y Initial program 63.9%
associate-*l*63.9%
+-commutative63.9%
+-commutative63.9%
+-commutative63.9%
associate-*l*63.9%
associate-*l/77.6%
*-commutative77.6%
*-commutative77.6%
distribute-rgt1-in77.4%
fma-def77.6%
+-commutative77.6%
+-commutative77.6%
cube-unmult77.6%
+-commutative77.6%
Simplified77.6%
associate-*r/64.0%
fma-udef64.0%
cube-mult63.9%
distribute-rgt1-in63.9%
associate-+r+63.9%
*-commutative63.9%
frac-times86.3%
associate-*l/86.3%
associate-/r*99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
clear-num99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
un-div-inv99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 83.4%
Final simplification64.7%
(FPCore (x y)
:precision binary64
(if (<= y 1.35e-74)
(/ (/ y x) (+ x 1.0))
(if (<= y 1700000000.0)
(/ x (* y (+ y 1.0)))
(if (<= y 1.9e+27) (/ (/ y x) (+ x y)) (/ (/ x y) (+ x y))))))
double code(double x, double y) {
double tmp;
if (y <= 1.35e-74) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1700000000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 1.9e+27) {
tmp = (y / x) / (x + y);
} else {
tmp = (x / y) / (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 <= 1.35d-74) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 1700000000.0d0) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 1.9d+27) then
tmp = (y / x) / (x + y)
else
tmp = (x / y) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.35e-74) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1700000000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 1.9e+27) {
tmp = (y / x) / (x + y);
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.35e-74: tmp = (y / x) / (x + 1.0) elif y <= 1700000000.0: tmp = x / (y * (y + 1.0)) elif y <= 1.9e+27: tmp = (y / x) / (x + y) else: tmp = (x / y) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.35e-74) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 1700000000.0) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 1.9e+27) tmp = Float64(Float64(y / x) / Float64(x + y)); else tmp = Float64(Float64(x / y) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.35e-74) tmp = (y / x) / (x + 1.0); elseif (y <= 1700000000.0) tmp = x / (y * (y + 1.0)); elseif (y <= 1.9e+27) tmp = (y / x) / (x + y); else tmp = (x / y) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.35e-74], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1700000000.0], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+27], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.35 \cdot 10^{-74}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 1700000000:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+27}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + y}\\
\end{array}
\end{array}
if y < 1.35000000000000009e-74Initial program 68.5%
associate-*l*68.5%
+-commutative68.5%
+-commutative68.5%
+-commutative68.5%
associate-*l*68.5%
*-commutative68.5%
times-frac87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
Simplified87.8%
add-cube-cbrt87.1%
times-frac98.8%
pow298.8%
Applied egg-rr98.8%
frac-times87.1%
unpow287.1%
add-cube-cbrt87.8%
associate-/r*99.8%
clear-num99.4%
+-commutative99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 60.4%
associate-/r*61.4%
+-commutative61.4%
Simplified61.4%
if 1.35000000000000009e-74 < y < 1.7e9Initial program 95.4%
associate-*l*95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
associate-*l*95.4%
*-commutative95.4%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 42.6%
+-commutative42.6%
Simplified42.6%
if 1.7e9 < y < 1.90000000000000011e27Initial program 81.0%
associate-*l*81.0%
+-commutative81.0%
+-commutative81.0%
+-commutative81.0%
associate-*l*81.0%
associate-*l/81.0%
*-commutative81.0%
*-commutative81.0%
distribute-rgt1-in81.0%
fma-def81.0%
+-commutative81.0%
+-commutative81.0%
cube-unmult81.2%
+-commutative81.2%
Simplified81.2%
associate-*r/81.2%
fma-udef81.2%
cube-mult81.0%
distribute-rgt1-in81.0%
associate-+r+81.0%
*-commutative81.0%
frac-times99.7%
associate-*l/99.7%
associate-/r*99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
clear-num99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
un-div-inv99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 62.7%
+-commutative62.7%
Simplified62.7%
Taylor expanded in x around inf 62.4%
if 1.90000000000000011e27 < y Initial program 64.6%
associate-*l*64.6%
+-commutative64.6%
+-commutative64.6%
+-commutative64.6%
associate-*l*64.6%
associate-*l/78.0%
*-commutative78.0%
*-commutative78.0%
distribute-rgt1-in77.8%
fma-def78.0%
+-commutative78.0%
+-commutative78.0%
cube-unmult78.0%
+-commutative78.0%
Simplified78.0%
associate-*r/64.6%
fma-udef64.6%
cube-mult64.6%
distribute-rgt1-in64.6%
associate-+r+64.6%
*-commutative64.6%
frac-times86.6%
associate-*l/86.5%
associate-/r*99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
clear-num99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
un-div-inv99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 82.0%
Final simplification64.1%
(FPCore (x y) :precision binary64 (if (<= y 1.75e-88) (/ y x) (if (<= y 0.75) (- (/ x y) x) (* (/ x y) (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.75e-88) {
tmp = y / x;
} else if (y <= 0.75) {
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 <= 1.75d-88) then
tmp = y / x
else if (y <= 0.75d0) 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 <= 1.75e-88) {
tmp = y / x;
} else if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.75e-88: tmp = y / x elif y <= 0.75: tmp = (x / y) - x else: tmp = (x / y) * (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.75e-88) tmp = Float64(y / x); elseif (y <= 0.75) 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 <= 1.75e-88) tmp = y / x; elseif (y <= 0.75) tmp = (x / y) - x; else tmp = (x / y) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.75e-88], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.75], 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 1.75 \cdot 10^{-88}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 1.7500000000000001e-88Initial program 68.2%
associate-*l*68.2%
+-commutative68.2%
+-commutative68.2%
+-commutative68.2%
associate-*l*68.2%
*-commutative68.2%
times-frac87.7%
+-commutative87.7%
+-commutative87.7%
+-commutative87.7%
associate-+l+87.7%
Simplified87.7%
Taylor expanded in x around 0 78.1%
+-commutative78.1%
Simplified78.1%
Taylor expanded in y around 0 40.4%
if 1.7500000000000001e-88 < y < 0.75Initial program 95.0%
associate-*l*95.0%
+-commutative95.0%
+-commutative95.0%
+-commutative95.0%
associate-*l*95.0%
*-commutative95.0%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 42.6%
+-commutative42.6%
Simplified42.6%
Taylor expanded in y around 0 39.1%
neg-mul-139.1%
+-commutative39.1%
unsub-neg39.1%
Simplified39.1%
if 0.75 < y Initial program 67.1%
associate-*l*67.1%
+-commutative67.1%
+-commutative67.1%
+-commutative67.1%
associate-*l*67.1%
*-commutative67.1%
times-frac88.1%
+-commutative88.1%
+-commutative88.1%
+-commutative88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around inf 77.2%
Taylor expanded in y around inf 76.0%
Final simplification48.6%
(FPCore (x y) :precision binary64 (if (<= y 1.3e-86) (/ y x) (if (<= y 7.2e+59) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.3e-86) {
tmp = y / x;
} else if (y <= 7.2e+59) {
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.3d-86) then
tmp = y / x
else if (y <= 7.2d+59) 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.3e-86) {
tmp = y / x;
} else if (y <= 7.2e+59) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.3e-86: tmp = y / x elif y <= 7.2e+59: 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.3e-86) tmp = Float64(y / x); elseif (y <= 7.2e+59) 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.3e-86) tmp = y / x; elseif (y <= 7.2e+59) 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.3e-86], N[(y / x), $MachinePrecision], If[LessEqual[y, 7.2e+59], 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.3 \cdot 10^{-86}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 1.3000000000000001e-86Initial program 68.2%
associate-*l*68.2%
+-commutative68.2%
+-commutative68.2%
+-commutative68.2%
associate-*l*68.2%
*-commutative68.2%
times-frac87.7%
+-commutative87.7%
+-commutative87.7%
+-commutative87.7%
associate-+l+87.7%
Simplified87.7%
Taylor expanded in x around 0 78.1%
+-commutative78.1%
Simplified78.1%
Taylor expanded in y around 0 40.4%
if 1.3000000000000001e-86 < y < 7.1999999999999997e59Initial program 94.0%
associate-*l*94.0%
+-commutative94.0%
+-commutative94.0%
+-commutative94.0%
associate-*l*94.0%
*-commutative94.0%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 48.1%
+-commutative48.1%
Simplified48.1%
if 7.1999999999999997e59 < y Initial program 60.2%
associate-*l*60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
associate-*l*60.2%
*-commutative60.2%
times-frac85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
associate-+l+85.0%
Simplified85.0%
Taylor expanded in y around inf 82.5%
Taylor expanded in y around inf 82.3%
Final simplification49.1%
(FPCore (x y) :precision binary64 (if (<= y 1.9e-88) (/ y (* x (+ y 1.0))) (if (<= y 7.2e+59) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.9e-88) {
tmp = y / (x * (y + 1.0));
} else if (y <= 7.2e+59) {
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.9d-88) then
tmp = y / (x * (y + 1.0d0))
else if (y <= 7.2d+59) 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.9e-88) {
tmp = y / (x * (y + 1.0));
} else if (y <= 7.2e+59) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.9e-88: tmp = y / (x * (y + 1.0)) elif y <= 7.2e+59: 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.9e-88) tmp = Float64(y / Float64(x * Float64(y + 1.0))); elseif (y <= 7.2e+59) 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.9e-88) tmp = y / (x * (y + 1.0)); elseif (y <= 7.2e+59) 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.9e-88], N[(y / N[(x * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+59], 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.9 \cdot 10^{-88}:\\
\;\;\;\;\frac{y}{x \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 1.90000000000000006e-88Initial program 68.2%
associate-*l*68.2%
+-commutative68.2%
+-commutative68.2%
+-commutative68.2%
associate-*l*68.2%
*-commutative68.2%
times-frac87.7%
+-commutative87.7%
+-commutative87.7%
+-commutative87.7%
associate-+l+87.7%
Simplified87.7%
Taylor expanded in x around 0 78.1%
+-commutative78.1%
Simplified78.1%
Taylor expanded in x around inf 46.9%
if 1.90000000000000006e-88 < y < 7.1999999999999997e59Initial program 94.0%
associate-*l*94.0%
+-commutative94.0%
+-commutative94.0%
+-commutative94.0%
associate-*l*94.0%
*-commutative94.0%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 48.1%
+-commutative48.1%
Simplified48.1%
if 7.1999999999999997e59 < y Initial program 60.2%
associate-*l*60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
associate-*l*60.2%
*-commutative60.2%
times-frac85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
associate-+l+85.0%
Simplified85.0%
Taylor expanded in y around inf 82.5%
Taylor expanded in y around inf 82.3%
Final simplification53.6%
(FPCore (x y) :precision binary64 (if (<= y 9e-76) (/ y (* x (+ x 1.0))) (if (<= y 7.2e+59) (/ x (* y (+ y 1.0))) (* (/ x y) (/ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= 9e-76) {
tmp = y / (x * (x + 1.0));
} else if (y <= 7.2e+59) {
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 <= 9d-76) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 7.2d+59) 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 <= 9e-76) {
tmp = y / (x * (x + 1.0));
} else if (y <= 7.2e+59) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 9e-76: tmp = y / (x * (x + 1.0)) elif y <= 7.2e+59: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) * (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (y <= 9e-76) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 7.2e+59) 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 <= 9e-76) tmp = y / (x * (x + 1.0)); elseif (y <= 7.2e+59) tmp = x / (y * (y + 1.0)); else tmp = (x / y) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 9e-76], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+59], 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 9 \cdot 10^{-76}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 9.0000000000000001e-76Initial program 68.5%
associate-*l*68.5%
+-commutative68.5%
+-commutative68.5%
+-commutative68.5%
associate-*l*68.5%
*-commutative68.5%
times-frac87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
Simplified87.8%
Taylor expanded in y around 0 60.4%
+-commutative60.4%
Simplified60.4%
if 9.0000000000000001e-76 < y < 7.1999999999999997e59Initial program 93.9%
associate-*l*93.9%
+-commutative93.9%
+-commutative93.9%
+-commutative93.9%
associate-*l*93.9%
*-commutative93.9%
times-frac99.5%
+-commutative99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 47.9%
+-commutative47.9%
Simplified47.9%
if 7.1999999999999997e59 < y Initial program 60.2%
associate-*l*60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
associate-*l*60.2%
*-commutative60.2%
times-frac85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
associate-+l+85.0%
Simplified85.0%
Taylor expanded in y around inf 82.5%
Taylor expanded in y around inf 82.3%
Final simplification62.8%
(FPCore (x y) :precision binary64 (if (<= y 8.5e-74) (/ y (* x (+ x 1.0))) (if (<= y 5200000000.0) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ x y)))))
double code(double x, double y) {
double tmp;
if (y <= 8.5e-74) {
tmp = y / (x * (x + 1.0));
} else if (y <= 5200000000.0) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (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 <= 8.5d-74) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 5200000000.0d0) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 8.5e-74) {
tmp = y / (x * (x + 1.0));
} else if (y <= 5200000000.0) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8.5e-74: tmp = y / (x * (x + 1.0)) elif y <= 5200000000.0: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= 8.5e-74) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 5200000000.0) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 8.5e-74) tmp = y / (x * (x + 1.0)); elseif (y <= 5200000000.0) tmp = x / (y * (y + 1.0)); else tmp = (x / y) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8.5e-74], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5200000000.0], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{-74}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 5200000000:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + y}\\
\end{array}
\end{array}
if y < 8.50000000000000052e-74Initial program 68.5%
associate-*l*68.5%
+-commutative68.5%
+-commutative68.5%
+-commutative68.5%
associate-*l*68.5%
*-commutative68.5%
times-frac87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
Simplified87.8%
Taylor expanded in y around 0 60.4%
+-commutative60.4%
Simplified60.4%
if 8.50000000000000052e-74 < y < 5.2e9Initial program 95.4%
associate-*l*95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
associate-*l*95.4%
*-commutative95.4%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 42.6%
+-commutative42.6%
Simplified42.6%
if 5.2e9 < y Initial program 66.0%
associate-*l*66.0%
+-commutative66.0%
+-commutative66.0%
+-commutative66.0%
associate-*l*66.0%
associate-*l/78.3%
*-commutative78.3%
*-commutative78.3%
distribute-rgt1-in78.1%
fma-def78.3%
+-commutative78.3%
+-commutative78.3%
cube-unmult78.3%
+-commutative78.3%
Simplified78.3%
associate-*r/66.0%
fma-udef66.0%
cube-mult66.0%
distribute-rgt1-in66.0%
associate-+r+66.0%
*-commutative66.0%
frac-times87.7%
associate-*l/87.7%
associate-/r*99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
clear-num99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
un-div-inv99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 78.2%
Final simplification62.9%
(FPCore (x y) :precision binary64 (if (<= y 1.7e-76) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y (+ x 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 1.7e-76) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + (x + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.7d-76) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / y) / (y + (x + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.7e-76) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + (x + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.7e-76: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + (x + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.7e-76) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(y + Float64(x + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.7e-76) tmp = (y / x) / (x + 1.0); else tmp = (x / y) / (y + (x + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.7e-76], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{-76}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + \left(x + 1\right)}\\
\end{array}
\end{array}
if y < 1.7e-76Initial program 68.5%
associate-*l*68.5%
+-commutative68.5%
+-commutative68.5%
+-commutative68.5%
associate-*l*68.5%
*-commutative68.5%
times-frac87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
Simplified87.8%
add-cube-cbrt87.1%
times-frac98.8%
pow298.8%
Applied egg-rr98.8%
frac-times87.1%
unpow287.1%
add-cube-cbrt87.8%
associate-/r*99.8%
clear-num99.4%
+-commutative99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 60.4%
associate-/r*61.4%
+-commutative61.4%
Simplified61.4%
if 1.7e-76 < y Initial program 74.1%
associate-*l*74.1%
+-commutative74.1%
+-commutative74.1%
+-commutative74.1%
associate-*l*74.1%
*-commutative74.1%
times-frac91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
associate-+l+91.0%
Simplified91.0%
Taylor expanded in y around inf 68.5%
expm1-log1p-u68.4%
expm1-udef46.0%
clear-num46.0%
frac-times46.0%
*-un-lft-identity46.0%
/-rgt-identity46.0%
associate-+r+46.0%
+-commutative46.0%
associate-+r+46.0%
Applied egg-rr46.0%
expm1-def68.7%
expm1-log1p68.8%
associate-/r*68.5%
+-commutative68.5%
Simplified68.5%
Final simplification63.6%
(FPCore (x y) :precision binary64 (if (<= y 9e-75) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y (+ x 1.0))) y)))
double code(double x, double y) {
double tmp;
if (y <= 9e-75) {
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 (y <= 9d-75) 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 (y <= 9e-75) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + (x + 1.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 9e-75: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + (x + 1.0))) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 9e-75) 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 (y <= 9e-75) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + (x + 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 9e-75], 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}\;y \leq 9 \cdot 10^{-75}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\
\end{array}
\end{array}
if y < 9.0000000000000006e-75Initial program 68.5%
associate-*l*68.5%
+-commutative68.5%
+-commutative68.5%
+-commutative68.5%
associate-*l*68.5%
*-commutative68.5%
times-frac87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
Simplified87.8%
add-cube-cbrt87.1%
times-frac98.8%
pow298.8%
Applied egg-rr98.8%
frac-times87.1%
unpow287.1%
add-cube-cbrt87.8%
associate-/r*99.8%
clear-num99.4%
+-commutative99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 60.4%
associate-/r*61.4%
+-commutative61.4%
Simplified61.4%
if 9.0000000000000006e-75 < y Initial program 74.1%
associate-*l*74.1%
+-commutative74.1%
+-commutative74.1%
+-commutative74.1%
associate-*l*74.1%
*-commutative74.1%
times-frac91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
associate-+l+91.0%
Simplified91.0%
Taylor expanded in y around inf 68.5%
associate-*l/68.5%
*-un-lft-identity68.5%
associate-+r+68.5%
+-commutative68.5%
associate-+r+68.5%
Applied egg-rr68.5%
Final simplification63.6%
(FPCore (x y) :precision binary64 (if (<= y 2.4e-88) (/ y x) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 2.4e-88) {
tmp = y / x;
} 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 <= 2.4d-88) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.4e-88) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.4e-88: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 2.4e-88) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.4e-88) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.4e-88], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{-88}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 2.4e-88Initial program 68.2%
associate-*l*68.2%
+-commutative68.2%
+-commutative68.2%
+-commutative68.2%
associate-*l*68.2%
*-commutative68.2%
times-frac87.7%
+-commutative87.7%
+-commutative87.7%
+-commutative87.7%
associate-+l+87.7%
Simplified87.7%
Taylor expanded in x around 0 78.1%
+-commutative78.1%
Simplified78.1%
Taylor expanded in y around 0 40.4%
if 2.4e-88 < y Initial program 74.6%
associate-*l*74.6%
+-commutative74.6%
+-commutative74.6%
+-commutative74.6%
associate-*l*74.6%
*-commutative74.6%
times-frac91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l+91.2%
Simplified91.2%
Taylor expanded in x around 0 65.7%
+-commutative65.7%
Simplified65.7%
Taylor expanded in y around 0 32.7%
Final simplification37.9%
(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 70.3%
associate-*l*70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-*l*70.3%
*-commutative70.3%
times-frac88.8%
+-commutative88.8%
+-commutative88.8%
+-commutative88.8%
associate-+l+88.8%
Simplified88.8%
Taylor expanded in x around 0 46.3%
+-commutative46.3%
Simplified46.3%
Taylor expanded in y around 0 27.1%
Final simplification27.1%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2023318
(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))))