
(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 22 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 (/ (/ (/ y (+ (/ y x) 1.0)) (+ y (+ x 1.0))) (+ y x)))
double code(double x, double y) {
return ((y / ((y / x) + 1.0)) / (y + (x + 1.0))) / (y + x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / ((y / x) + 1.0d0)) / (y + (x + 1.0d0))) / (y + x)
end function
public static double code(double x, double y) {
return ((y / ((y / x) + 1.0)) / (y + (x + 1.0))) / (y + x);
}
def code(x, y): return ((y / ((y / x) + 1.0)) / (y + (x + 1.0))) / (y + x)
function code(x, y) return Float64(Float64(Float64(y / Float64(Float64(y / x) + 1.0)) / Float64(y + Float64(x + 1.0))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y / ((y / x) + 1.0)) / (y + (x + 1.0))) / (y + x); end
code[x_, y_] := N[(N[(N[(y / N[(N[(y / x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{y}{\frac{y}{x} + 1}}{y + \left(x + 1\right)}}{y + x}
\end{array}
Initial program 66.0%
times-frac83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
times-frac66.0%
associate-*l/77.7%
*-commutative77.7%
*-commutative77.7%
distribute-rgt1-in59.5%
fma-def77.8%
+-commutative77.8%
+-commutative77.8%
cube-unmult77.8%
+-commutative77.8%
Simplified77.8%
associate-*r/66.0%
fma-udef52.3%
cube-mult52.2%
distribute-rgt1-in66.0%
associate-+r+66.0%
*-commutative66.0%
frac-times83.8%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*l/73.4%
+-commutative73.4%
associate-/l*99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))))
(if (<= x -2.55e-11)
(/ t_0 (+ x (+ y (+ y 1.0))))
(if (<= x -1.52e-167)
(* (/ y (* (+ y x) (+ y x))) (/ x (+ y 1.0)))
(if (<= x 3.7e-241)
(* x (/ t_0 (+ y x)))
(/ (/ x (+ y (+ x 1.0))) (+ y x)))))))
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -2.55e-11) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else if (x <= -1.52e-167) {
tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0));
} else if (x <= 3.7e-241) {
tmp = x * (t_0 / (y + x));
} else {
tmp = (x / (y + (x + 1.0))) / (y + x);
}
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 / (y + x)
if (x <= (-2.55d-11)) then
tmp = t_0 / (x + (y + (y + 1.0d0)))
else if (x <= (-1.52d-167)) then
tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0d0))
else if (x <= 3.7d-241) then
tmp = x * (t_0 / (y + x))
else
tmp = (x / (y + (x + 1.0d0))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -2.55e-11) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else if (x <= -1.52e-167) {
tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0));
} else if (x <= 3.7e-241) {
tmp = x * (t_0 / (y + x));
} else {
tmp = (x / (y + (x + 1.0))) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y / (y + x) tmp = 0 if x <= -2.55e-11: tmp = t_0 / (x + (y + (y + 1.0))) elif x <= -1.52e-167: tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0)) elif x <= 3.7e-241: tmp = x * (t_0 / (y + x)) else: tmp = (x / (y + (x + 1.0))) / (y + x) return tmp
function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (x <= -2.55e-11) tmp = Float64(t_0 / Float64(x + Float64(y + Float64(y + 1.0)))); elseif (x <= -1.52e-167) tmp = Float64(Float64(y / Float64(Float64(y + x) * Float64(y + x))) * Float64(x / Float64(y + 1.0))); elseif (x <= 3.7e-241) tmp = Float64(x * Float64(t_0 / Float64(y + x))); else tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y + x); tmp = 0.0; if (x <= -2.55e-11) tmp = t_0 / (x + (y + (y + 1.0))); elseif (x <= -1.52e-167) tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0)); elseif (x <= 3.7e-241) tmp = x * (t_0 / (y + x)); else tmp = (x / (y + (x + 1.0))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.55e-11], N[(t$95$0 / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.52e-167], N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e-241], N[(x * N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;x \leq -2.55 \cdot 10^{-11}:\\
\;\;\;\;\frac{t\_0}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{elif}\;x \leq -1.52 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{y + 1}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-241}:\\
\;\;\;\;x \cdot \frac{t\_0}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y + x}\\
\end{array}
\end{array}
if x < -2.54999999999999992e-11Initial program 54.4%
times-frac88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
times-frac54.4%
associate-*l/71.6%
*-commutative71.6%
*-commutative71.6%
distribute-rgt1-in26.9%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.6%
+-commutative71.6%
Simplified71.6%
associate-*r/54.4%
fma-udef26.9%
cube-mult26.9%
distribute-rgt1-in54.4%
associate-+r+54.4%
*-commutative54.4%
frac-times88.0%
*-commutative88.0%
clear-num87.9%
associate-/r*99.7%
frac-times99.1%
*-un-lft-identity99.1%
associate-+r+99.1%
+-commutative99.1%
associate-+l+99.1%
Applied egg-rr99.1%
Taylor expanded in x around -inf 80.5%
mul-1-neg80.5%
unsub-neg80.5%
neg-mul-180.5%
+-commutative80.5%
unsub-neg80.5%
distribute-lft-in80.5%
metadata-eval80.5%
neg-mul-180.5%
unsub-neg80.5%
Simplified80.5%
if -2.54999999999999992e-11 < x < -1.52e-167Initial program 86.9%
associate-/r*87.3%
*-commutative87.3%
+-commutative87.3%
+-commutative87.3%
associate-*l/99.5%
+-commutative99.5%
associate-*r/99.4%
remove-double-neg99.4%
+-commutative99.4%
+-commutative99.4%
remove-double-neg99.4%
+-commutative99.4%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
+-commutative99.4%
Simplified99.4%
if -1.52e-167 < x < 3.6999999999999999e-241Initial program 53.7%
associate-/r*53.7%
*-commutative53.7%
+-commutative53.7%
+-commutative53.7%
associate-*l/69.6%
+-commutative69.6%
associate-*r/69.6%
remove-double-neg69.6%
+-commutative69.6%
+-commutative69.6%
remove-double-neg69.6%
+-commutative69.6%
associate-+l+69.6%
Simplified69.6%
Taylor expanded in x around 0 69.6%
+-commutative69.6%
Simplified69.6%
Taylor expanded in y around 0 60.6%
associate-/r*90.5%
div-inv90.5%
Applied egg-rr90.5%
associate-*r/90.5%
*-rgt-identity90.5%
Simplified90.5%
if 3.6999999999999999e-241 < x Initial program 72.5%
times-frac83.4%
+-commutative83.4%
+-commutative83.4%
+-commutative83.4%
times-frac72.5%
associate-*l/80.9%
*-commutative80.9%
*-commutative80.9%
distribute-rgt1-in73.3%
fma-def80.8%
+-commutative80.8%
+-commutative80.8%
cube-unmult80.9%
+-commutative80.9%
Simplified80.9%
associate-*r/72.5%
fma-udef65.2%
cube-mult65.2%
distribute-rgt1-in72.5%
associate-+r+72.5%
*-commutative72.5%
frac-times83.3%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 46.7%
Final simplification70.2%
(FPCore (x y)
:precision binary64
(if (<= y 2.3e-5)
(/ (* (/ y (+ y x)) (/ x (+ x 1.0))) (+ y x))
(if (<= y 1.4e+154)
(* (/ y (* (+ y x) (+ y x))) (/ x (+ y 1.0)))
(* (/ 1.0 y) (/ x (+ x (+ y 1.0)))))))
double code(double x, double y) {
double tmp;
if (y <= 2.3e-5) {
tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x);
} else if (y <= 1.4e+154) {
tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0));
} else {
tmp = (1.0 / y) * (x / (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 <= 2.3d-5) then
tmp = ((y / (y + x)) * (x / (x + 1.0d0))) / (y + x)
else if (y <= 1.4d+154) then
tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0d0))
else
tmp = (1.0d0 / y) * (x / (x + (y + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.3e-5) {
tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x);
} else if (y <= 1.4e+154) {
tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0));
} else {
tmp = (1.0 / y) * (x / (x + (y + 1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.3e-5: tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x) elif y <= 1.4e+154: tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0)) else: tmp = (1.0 / y) * (x / (x + (y + 1.0))) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.3e-5) tmp = Float64(Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(x + 1.0))) / Float64(y + x)); elseif (y <= 1.4e+154) tmp = Float64(Float64(y / Float64(Float64(y + x) * Float64(y + x))) * Float64(x / Float64(y + 1.0))); else tmp = Float64(Float64(1.0 / y) * Float64(x / Float64(x + Float64(y + 1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.3e-5) tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x); elseif (y <= 1.4e+154) tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0)); else tmp = (1.0 / y) * (x / (x + (y + 1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.3e-5], N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{y}{y + x} \cdot \frac{x}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{x + \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 2.3e-5Initial program 64.8%
times-frac82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
times-frac64.8%
associate-*l/76.5%
*-commutative76.5%
*-commutative76.5%
distribute-rgt1-in57.1%
fma-def76.5%
+-commutative76.5%
+-commutative76.5%
cube-unmult76.5%
+-commutative76.5%
Simplified76.5%
associate-*r/64.9%
fma-udef48.8%
cube-mult48.7%
distribute-rgt1-in64.8%
associate-+r+64.8%
*-commutative64.8%
frac-times82.7%
associate-/r*99.6%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 81.6%
+-commutative81.6%
Simplified81.6%
if 2.3e-5 < y < 1.4e154Initial program 70.5%
associate-/r*77.1%
*-commutative77.1%
+-commutative77.1%
+-commutative77.1%
associate-*l/90.5%
+-commutative90.5%
associate-*r/90.5%
remove-double-neg90.5%
+-commutative90.5%
+-commutative90.5%
remove-double-neg90.5%
+-commutative90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in x around 0 83.7%
+-commutative83.7%
Simplified83.7%
if 1.4e154 < y Initial program 69.3%
associate-/r*69.3%
*-commutative69.3%
+-commutative69.3%
+-commutative69.3%
associate-*l/84.5%
+-commutative84.5%
associate-*r/84.5%
remove-double-neg84.5%
+-commutative84.5%
+-commutative84.5%
remove-double-neg84.5%
+-commutative84.5%
associate-+l+84.5%
Simplified84.5%
Taylor expanded in y around inf 82.5%
Final simplification82.0%
(FPCore (x y)
:precision binary64
(if (<= x -1.5e-15)
(/ (/ y (+ y x)) (+ x 1.0))
(if (<= x -3.6e-150)
(* x (/ y (* (+ y x) (+ y x))))
(/ (/ x (+ y 1.0)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -1.5e-15) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (x <= -3.6e-150) {
tmp = x * (y / ((y + x) * (y + x)));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.5d-15)) then
tmp = (y / (y + x)) / (x + 1.0d0)
else if (x <= (-3.6d-150)) then
tmp = x * (y / ((y + x) * (y + x)))
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.5e-15) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (x <= -3.6e-150) {
tmp = x * (y / ((y + x) * (y + x)));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.5e-15: tmp = (y / (y + x)) / (x + 1.0) elif x <= -3.6e-150: tmp = x * (y / ((y + x) * (y + x))) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.5e-15) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); elseif (x <= -3.6e-150) tmp = Float64(x * Float64(y / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.5e-15) tmp = (y / (y + x)) / (x + 1.0); elseif (x <= -3.6e-150) tmp = x * (y / ((y + x) * (y + x))); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.5e-15], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.6e-150], N[(x * N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{-150}:\\
\;\;\;\;x \cdot \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -1.5e-15Initial program 54.4%
times-frac88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
times-frac54.4%
associate-*l/71.6%
*-commutative71.6%
*-commutative71.6%
distribute-rgt1-in26.9%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.6%
+-commutative71.6%
Simplified71.6%
associate-*r/54.4%
fma-udef26.9%
cube-mult26.9%
distribute-rgt1-in54.4%
associate-+r+54.4%
*-commutative54.4%
frac-times88.0%
*-commutative88.0%
clear-num87.9%
associate-/r*99.7%
frac-times99.1%
*-un-lft-identity99.1%
associate-+r+99.1%
+-commutative99.1%
associate-+l+99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 79.5%
+-commutative79.5%
Simplified79.5%
if -1.5e-15 < x < -3.6000000000000002e-150Initial program 84.5%
associate-/r*84.9%
*-commutative84.9%
+-commutative84.9%
+-commutative84.9%
associate-*l/99.5%
+-commutative99.5%
associate-*r/99.4%
remove-double-neg99.4%
+-commutative99.4%
+-commutative99.4%
remove-double-neg99.4%
+-commutative99.4%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around 0 74.5%
if -3.6000000000000002e-150 < x Initial program 67.7%
times-frac79.8%
+-commutative79.8%
+-commutative79.8%
+-commutative79.8%
times-frac67.7%
associate-*l/78.0%
*-commutative78.0%
*-commutative78.0%
distribute-rgt1-in68.6%
fma-def78.0%
+-commutative78.0%
+-commutative78.0%
cube-unmult78.0%
+-commutative78.0%
Simplified78.0%
associate-*r/67.7%
fma-udef58.6%
cube-mult58.6%
distribute-rgt1-in67.7%
associate-+r+67.7%
*-commutative67.7%
frac-times79.7%
associate-/r*99.6%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 58.0%
+-commutative58.0%
Simplified58.0%
Final simplification65.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))))
(if (<= x -1.45e-15)
(/ t_0 (+ x 1.0))
(if (<= x 3.2e-241) (* x (/ t_0 (+ y x))) (/ (/ x (+ y 1.0)) (+ y x))))))
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -1.45e-15) {
tmp = t_0 / (x + 1.0);
} else if (x <= 3.2e-241) {
tmp = x * (t_0 / (y + x));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
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 / (y + x)
if (x <= (-1.45d-15)) then
tmp = t_0 / (x + 1.0d0)
else if (x <= 3.2d-241) then
tmp = x * (t_0 / (y + x))
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -1.45e-15) {
tmp = t_0 / (x + 1.0);
} else if (x <= 3.2e-241) {
tmp = x * (t_0 / (y + x));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y / (y + x) tmp = 0 if x <= -1.45e-15: tmp = t_0 / (x + 1.0) elif x <= 3.2e-241: tmp = x * (t_0 / (y + x)) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (x <= -1.45e-15) tmp = Float64(t_0 / Float64(x + 1.0)); elseif (x <= 3.2e-241) tmp = Float64(x * Float64(t_0 / Float64(y + x))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y + x); tmp = 0.0; if (x <= -1.45e-15) tmp = t_0 / (x + 1.0); elseif (x <= 3.2e-241) tmp = x * (t_0 / (y + x)); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e-15], N[(t$95$0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.2e-241], N[(x * N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-15}:\\
\;\;\;\;\frac{t\_0}{x + 1}\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-241}:\\
\;\;\;\;x \cdot \frac{t\_0}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -1.45000000000000009e-15Initial program 54.4%
times-frac88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
times-frac54.4%
associate-*l/71.6%
*-commutative71.6%
*-commutative71.6%
distribute-rgt1-in26.9%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.6%
+-commutative71.6%
Simplified71.6%
associate-*r/54.4%
fma-udef26.9%
cube-mult26.9%
distribute-rgt1-in54.4%
associate-+r+54.4%
*-commutative54.4%
frac-times88.0%
*-commutative88.0%
clear-num87.9%
associate-/r*99.7%
frac-times99.1%
*-un-lft-identity99.1%
associate-+r+99.1%
+-commutative99.1%
associate-+l+99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 79.5%
+-commutative79.5%
Simplified79.5%
if -1.45000000000000009e-15 < x < 3.2e-241Initial program 66.6%
associate-/r*66.7%
*-commutative66.7%
+-commutative66.7%
+-commutative66.7%
associate-*l/81.2%
+-commutative81.2%
associate-*r/81.1%
remove-double-neg81.1%
+-commutative81.1%
+-commutative81.1%
remove-double-neg81.1%
+-commutative81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around 0 81.1%
+-commutative81.1%
Simplified81.1%
Taylor expanded in y around 0 65.3%
associate-/r*79.4%
div-inv79.4%
Applied egg-rr79.4%
associate-*r/79.4%
*-rgt-identity79.4%
Simplified79.4%
if 3.2e-241 < x Initial program 72.5%
times-frac83.4%
+-commutative83.4%
+-commutative83.4%
+-commutative83.4%
times-frac72.5%
associate-*l/80.9%
*-commutative80.9%
*-commutative80.9%
distribute-rgt1-in73.3%
fma-def80.8%
+-commutative80.8%
+-commutative80.8%
cube-unmult80.9%
+-commutative80.9%
Simplified80.9%
associate-*r/72.5%
fma-udef65.2%
cube-mult65.2%
distribute-rgt1-in72.5%
associate-+r+72.5%
*-commutative72.5%
frac-times83.3%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 45.5%
+-commutative45.5%
Simplified45.5%
Final simplification64.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))))
(if (<= x -1.5e-15)
(/ t_0 (+ x 1.0))
(if (<= x 4.8e-241)
(* x (/ t_0 (+ y x)))
(/ (/ x (+ y (+ x 1.0))) (+ y x))))))
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -1.5e-15) {
tmp = t_0 / (x + 1.0);
} else if (x <= 4.8e-241) {
tmp = x * (t_0 / (y + x));
} else {
tmp = (x / (y + (x + 1.0))) / (y + x);
}
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 / (y + x)
if (x <= (-1.5d-15)) then
tmp = t_0 / (x + 1.0d0)
else if (x <= 4.8d-241) then
tmp = x * (t_0 / (y + x))
else
tmp = (x / (y + (x + 1.0d0))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -1.5e-15) {
tmp = t_0 / (x + 1.0);
} else if (x <= 4.8e-241) {
tmp = x * (t_0 / (y + x));
} else {
tmp = (x / (y + (x + 1.0))) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y / (y + x) tmp = 0 if x <= -1.5e-15: tmp = t_0 / (x + 1.0) elif x <= 4.8e-241: tmp = x * (t_0 / (y + x)) else: tmp = (x / (y + (x + 1.0))) / (y + x) return tmp
function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (x <= -1.5e-15) tmp = Float64(t_0 / Float64(x + 1.0)); elseif (x <= 4.8e-241) tmp = Float64(x * Float64(t_0 / Float64(y + x))); else tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y + x); tmp = 0.0; if (x <= -1.5e-15) tmp = t_0 / (x + 1.0); elseif (x <= 4.8e-241) tmp = x * (t_0 / (y + x)); else tmp = (x / (y + (x + 1.0))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5e-15], N[(t$95$0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.8e-241], N[(x * N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{-15}:\\
\;\;\;\;\frac{t\_0}{x + 1}\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-241}:\\
\;\;\;\;x \cdot \frac{t\_0}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y + x}\\
\end{array}
\end{array}
if x < -1.5e-15Initial program 54.4%
times-frac88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
times-frac54.4%
associate-*l/71.6%
*-commutative71.6%
*-commutative71.6%
distribute-rgt1-in26.9%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.6%
+-commutative71.6%
Simplified71.6%
associate-*r/54.4%
fma-udef26.9%
cube-mult26.9%
distribute-rgt1-in54.4%
associate-+r+54.4%
*-commutative54.4%
frac-times88.0%
*-commutative88.0%
clear-num87.9%
associate-/r*99.7%
frac-times99.1%
*-un-lft-identity99.1%
associate-+r+99.1%
+-commutative99.1%
associate-+l+99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 79.5%
+-commutative79.5%
Simplified79.5%
if -1.5e-15 < x < 4.8e-241Initial program 66.6%
associate-/r*66.7%
*-commutative66.7%
+-commutative66.7%
+-commutative66.7%
associate-*l/81.2%
+-commutative81.2%
associate-*r/81.1%
remove-double-neg81.1%
+-commutative81.1%
+-commutative81.1%
remove-double-neg81.1%
+-commutative81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around 0 81.1%
+-commutative81.1%
Simplified81.1%
Taylor expanded in y around 0 65.3%
associate-/r*79.4%
div-inv79.4%
Applied egg-rr79.4%
associate-*r/79.4%
*-rgt-identity79.4%
Simplified79.4%
if 4.8e-241 < x Initial program 72.5%
times-frac83.4%
+-commutative83.4%
+-commutative83.4%
+-commutative83.4%
times-frac72.5%
associate-*l/80.9%
*-commutative80.9%
*-commutative80.9%
distribute-rgt1-in73.3%
fma-def80.8%
+-commutative80.8%
+-commutative80.8%
cube-unmult80.9%
+-commutative80.9%
Simplified80.9%
associate-*r/72.5%
fma-udef65.2%
cube-mult65.2%
distribute-rgt1-in72.5%
associate-+r+72.5%
*-commutative72.5%
frac-times83.3%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 46.7%
Final simplification65.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= x -7.2e-16)
(/ (/ y t_0) (+ y x))
(if (<= x 3.3e-241)
(* x (/ (/ y (+ y x)) (+ y x)))
(/ (/ x t_0) (+ y x))))))
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (x <= -7.2e-16) {
tmp = (y / t_0) / (y + x);
} else if (x <= 3.3e-241) {
tmp = x * ((y / (y + x)) / (y + x));
} else {
tmp = (x / t_0) / (y + x);
}
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 + 1.0d0)
if (x <= (-7.2d-16)) then
tmp = (y / t_0) / (y + x)
else if (x <= 3.3d-241) then
tmp = x * ((y / (y + x)) / (y + x))
else
tmp = (x / t_0) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (x <= -7.2e-16) {
tmp = (y / t_0) / (y + x);
} else if (x <= 3.3e-241) {
tmp = x * ((y / (y + x)) / (y + x));
} else {
tmp = (x / t_0) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if x <= -7.2e-16: tmp = (y / t_0) / (y + x) elif x <= 3.3e-241: tmp = x * ((y / (y + x)) / (y + x)) else: tmp = (x / t_0) / (y + x) return tmp
function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (x <= -7.2e-16) tmp = Float64(Float64(y / t_0) / Float64(y + x)); elseif (x <= 3.3e-241) tmp = Float64(x * Float64(Float64(y / Float64(y + x)) / Float64(y + x))); else tmp = Float64(Float64(x / t_0) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (x + 1.0); tmp = 0.0; if (x <= -7.2e-16) tmp = (y / t_0) / (y + x); elseif (x <= 3.3e-241) tmp = x * ((y / (y + x)) / (y + x)); else tmp = (x / t_0) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.2e-16], N[(N[(y / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e-241], N[(x * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{y}{t\_0}}{y + x}\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-241}:\\
\;\;\;\;x \cdot \frac{\frac{y}{y + x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t\_0}}{y + x}\\
\end{array}
\end{array}
if x < -7.19999999999999965e-16Initial program 54.4%
times-frac88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
times-frac54.4%
associate-*l/71.6%
*-commutative71.6%
*-commutative71.6%
distribute-rgt1-in26.9%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.6%
+-commutative71.6%
Simplified71.6%
associate-*r/54.4%
fma-udef26.9%
cube-mult26.9%
distribute-rgt1-in54.4%
associate-+r+54.4%
*-commutative54.4%
frac-times88.0%
associate-/r*99.7%
associate-*l/99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
associate-*r/99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 79.9%
if -7.19999999999999965e-16 < x < 3.2999999999999999e-241Initial program 66.6%
associate-/r*66.7%
*-commutative66.7%
+-commutative66.7%
+-commutative66.7%
associate-*l/81.2%
+-commutative81.2%
associate-*r/81.1%
remove-double-neg81.1%
+-commutative81.1%
+-commutative81.1%
remove-double-neg81.1%
+-commutative81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around 0 81.1%
+-commutative81.1%
Simplified81.1%
Taylor expanded in y around 0 65.3%
associate-/r*79.4%
div-inv79.4%
Applied egg-rr79.4%
associate-*r/79.4%
*-rgt-identity79.4%
Simplified79.4%
if 3.2999999999999999e-241 < x Initial program 72.5%
times-frac83.4%
+-commutative83.4%
+-commutative83.4%
+-commutative83.4%
times-frac72.5%
associate-*l/80.9%
*-commutative80.9%
*-commutative80.9%
distribute-rgt1-in73.3%
fma-def80.8%
+-commutative80.8%
+-commutative80.8%
cube-unmult80.9%
+-commutative80.9%
Simplified80.9%
associate-*r/72.5%
fma-udef65.2%
cube-mult65.2%
distribute-rgt1-in72.5%
associate-+r+72.5%
*-commutative72.5%
frac-times83.3%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 46.7%
Final simplification65.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))))
(if (<= x -1.6e-17)
(/ t_0 (+ x (+ y (+ y 1.0))))
(if (<= x 2.5e-241)
(* x (/ t_0 (+ y x)))
(/ (/ x (+ y (+ x 1.0))) (+ y x))))))
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -1.6e-17) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else if (x <= 2.5e-241) {
tmp = x * (t_0 / (y + x));
} else {
tmp = (x / (y + (x + 1.0))) / (y + x);
}
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 / (y + x)
if (x <= (-1.6d-17)) then
tmp = t_0 / (x + (y + (y + 1.0d0)))
else if (x <= 2.5d-241) then
tmp = x * (t_0 / (y + x))
else
tmp = (x / (y + (x + 1.0d0))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -1.6e-17) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else if (x <= 2.5e-241) {
tmp = x * (t_0 / (y + x));
} else {
tmp = (x / (y + (x + 1.0))) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y / (y + x) tmp = 0 if x <= -1.6e-17: tmp = t_0 / (x + (y + (y + 1.0))) elif x <= 2.5e-241: tmp = x * (t_0 / (y + x)) else: tmp = (x / (y + (x + 1.0))) / (y + x) return tmp
function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (x <= -1.6e-17) tmp = Float64(t_0 / Float64(x + Float64(y + Float64(y + 1.0)))); elseif (x <= 2.5e-241) tmp = Float64(x * Float64(t_0 / Float64(y + x))); else tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y + x); tmp = 0.0; if (x <= -1.6e-17) tmp = t_0 / (x + (y + (y + 1.0))); elseif (x <= 2.5e-241) tmp = x * (t_0 / (y + x)); else tmp = (x / (y + (x + 1.0))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e-17], N[(t$95$0 / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-241], N[(x * N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{-17}:\\
\;\;\;\;\frac{t\_0}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-241}:\\
\;\;\;\;x \cdot \frac{t\_0}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y + x}\\
\end{array}
\end{array}
if x < -1.6000000000000001e-17Initial program 55.1%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
+-commutative88.2%
times-frac55.1%
associate-*l/72.1%
*-commutative72.1%
*-commutative72.1%
distribute-rgt1-in28.0%
fma-def72.1%
+-commutative72.1%
+-commutative72.1%
cube-unmult72.1%
+-commutative72.1%
Simplified72.1%
associate-*r/55.1%
fma-udef28.0%
cube-mult28.0%
distribute-rgt1-in55.1%
associate-+r+55.1%
*-commutative55.1%
frac-times88.1%
*-commutative88.1%
clear-num88.1%
associate-/r*99.7%
frac-times99.2%
*-un-lft-identity99.2%
associate-+r+99.2%
+-commutative99.2%
associate-+l+99.2%
Applied egg-rr99.2%
Taylor expanded in x around -inf 79.4%
mul-1-neg79.4%
unsub-neg79.4%
neg-mul-179.4%
+-commutative79.4%
unsub-neg79.4%
distribute-lft-in79.4%
metadata-eval79.4%
neg-mul-179.4%
unsub-neg79.4%
Simplified79.4%
if -1.6000000000000001e-17 < x < 2.4999999999999999e-241Initial program 66.2%
associate-/r*66.3%
*-commutative66.3%
+-commutative66.3%
+-commutative66.3%
associate-*l/81.0%
+-commutative81.0%
associate-*r/80.9%
remove-double-neg80.9%
+-commutative80.9%
+-commutative80.9%
remove-double-neg80.9%
+-commutative80.9%
associate-+l+80.9%
Simplified80.9%
Taylor expanded in x around 0 80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in y around 0 66.1%
associate-/r*80.4%
div-inv80.3%
Applied egg-rr80.3%
associate-*r/80.4%
*-rgt-identity80.4%
Simplified80.4%
if 2.4999999999999999e-241 < x Initial program 72.5%
times-frac83.4%
+-commutative83.4%
+-commutative83.4%
+-commutative83.4%
times-frac72.5%
associate-*l/80.9%
*-commutative80.9%
*-commutative80.9%
distribute-rgt1-in73.3%
fma-def80.8%
+-commutative80.8%
+-commutative80.8%
cube-unmult80.9%
+-commutative80.9%
Simplified80.9%
associate-*r/72.5%
fma-udef65.2%
cube-mult65.2%
distribute-rgt1-in72.5%
associate-+r+72.5%
*-commutative72.5%
frac-times83.3%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 46.7%
Final simplification65.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))))
(if (<= x -2.55e-11)
(/ t_0 (+ x (+ y (+ y 1.0))))
(/ t_0 (* (+ y x) (/ (+ y 1.0) x))))))
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -2.55e-11) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else {
tmp = t_0 / ((y + x) * ((y + 1.0) / x));
}
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 / (y + x)
if (x <= (-2.55d-11)) then
tmp = t_0 / (x + (y + (y + 1.0d0)))
else
tmp = t_0 / ((y + x) * ((y + 1.0d0) / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -2.55e-11) {
tmp = t_0 / (x + (y + (y + 1.0)));
} else {
tmp = t_0 / ((y + x) * ((y + 1.0) / x));
}
return tmp;
}
def code(x, y): t_0 = y / (y + x) tmp = 0 if x <= -2.55e-11: tmp = t_0 / (x + (y + (y + 1.0))) else: tmp = t_0 / ((y + x) * ((y + 1.0) / x)) return tmp
function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (x <= -2.55e-11) tmp = Float64(t_0 / Float64(x + Float64(y + Float64(y + 1.0)))); else tmp = Float64(t_0 / Float64(Float64(y + x) * Float64(Float64(y + 1.0) / x))); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y + x); tmp = 0.0; if (x <= -2.55e-11) tmp = t_0 / (x + (y + (y + 1.0))); else tmp = t_0 / ((y + x) * ((y + 1.0) / x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.55e-11], N[(t$95$0 / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(y + x), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;x \leq -2.55 \cdot 10^{-11}:\\
\;\;\;\;\frac{t\_0}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\left(y + x\right) \cdot \frac{y + 1}{x}}\\
\end{array}
\end{array}
if x < -2.54999999999999992e-11Initial program 54.4%
times-frac88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
times-frac54.4%
associate-*l/71.6%
*-commutative71.6%
*-commutative71.6%
distribute-rgt1-in26.9%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.6%
+-commutative71.6%
Simplified71.6%
associate-*r/54.4%
fma-udef26.9%
cube-mult26.9%
distribute-rgt1-in54.4%
associate-+r+54.4%
*-commutative54.4%
frac-times88.0%
*-commutative88.0%
clear-num87.9%
associate-/r*99.7%
frac-times99.1%
*-un-lft-identity99.1%
associate-+r+99.1%
+-commutative99.1%
associate-+l+99.1%
Applied egg-rr99.1%
Taylor expanded in x around -inf 80.5%
mul-1-neg80.5%
unsub-neg80.5%
neg-mul-180.5%
+-commutative80.5%
unsub-neg80.5%
distribute-lft-in80.5%
metadata-eval80.5%
neg-mul-180.5%
unsub-neg80.5%
Simplified80.5%
if -2.54999999999999992e-11 < x Initial program 70.0%
associate-/r*71.0%
*-commutative71.0%
+-commutative71.0%
+-commutative71.0%
associate-*l/82.4%
+-commutative82.4%
associate-*r/82.4%
remove-double-neg82.4%
+-commutative82.4%
+-commutative82.4%
remove-double-neg82.4%
+-commutative82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in x around 0 79.2%
+-commutative79.2%
Simplified79.2%
*-commutative79.2%
clear-num79.2%
associate-/r*92.2%
frac-times86.1%
*-un-lft-identity86.1%
+-commutative86.1%
+-commutative86.1%
Applied egg-rr86.1%
Final simplification84.7%
(FPCore (x y) :precision binary64 (if (<= x -2.65e-129) (/ y (* x (+ x 1.0))) (if (<= x 3.8e-58) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -2.65e-129) {
tmp = y / (x * (x + 1.0));
} else if (x <= 3.8e-58) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.65d-129)) then
tmp = y / (x * (x + 1.0d0))
else if (x <= 3.8d-58) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.65e-129) {
tmp = y / (x * (x + 1.0));
} else if (x <= 3.8e-58) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.65e-129: tmp = y / (x * (x + 1.0)) elif x <= 3.8e-58: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.65e-129) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (x <= 3.8e-58) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.65e-129) tmp = y / (x * (x + 1.0)); elseif (x <= 3.8e-58) tmp = x / (y * (y + 1.0)); else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.65e-129], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e-58], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.65 \cdot 10^{-129}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if x < -2.64999999999999987e-129Initial program 61.2%
associate-/r*73.5%
*-commutative73.5%
+-commutative73.5%
+-commutative73.5%
associate-*l/90.8%
+-commutative90.8%
associate-*r/90.8%
remove-double-neg90.8%
+-commutative90.8%
+-commutative90.8%
remove-double-neg90.8%
+-commutative90.8%
associate-+l+90.8%
Simplified90.8%
Taylor expanded in y around 0 66.7%
if -2.64999999999999987e-129 < x < 3.7999999999999997e-58Initial program 64.7%
associate-/r*64.6%
*-commutative64.6%
+-commutative64.6%
+-commutative64.6%
associate-*l/78.1%
+-commutative78.1%
associate-*r/78.1%
remove-double-neg78.1%
+-commutative78.1%
+-commutative78.1%
remove-double-neg78.1%
+-commutative78.1%
associate-+l+78.1%
Simplified78.1%
Taylor expanded in x around 0 75.6%
+-commutative75.6%
Simplified75.6%
if 3.7999999999999997e-58 < x Initial program 74.0%
times-frac83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
times-frac74.0%
associate-*l/80.6%
*-commutative80.6%
*-commutative80.6%
distribute-rgt1-in77.2%
fma-def80.5%
+-commutative80.5%
+-commutative80.5%
cube-unmult80.6%
+-commutative80.6%
Simplified80.6%
associate-*r/74.1%
fma-udef71.1%
cube-mult71.1%
distribute-rgt1-in74.0%
associate-+r+74.0%
*-commutative74.0%
frac-times83.2%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 34.2%
Final simplification61.5%
(FPCore (x y) :precision binary64 (if (<= x -1.11e-128) (/ (/ y x) (+ x 1.0)) (if (<= x 3.8e-58) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -1.11e-128) {
tmp = (y / x) / (x + 1.0);
} else if (x <= 3.8e-58) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.11d-128)) then
tmp = (y / x) / (x + 1.0d0)
else if (x <= 3.8d-58) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.11e-128) {
tmp = (y / x) / (x + 1.0);
} else if (x <= 3.8e-58) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.11e-128: tmp = (y / x) / (x + 1.0) elif x <= 3.8e-58: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.11e-128) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (x <= 3.8e-58) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.11e-128) tmp = (y / x) / (x + 1.0); elseif (x <= 3.8e-58) tmp = x / (y * (y + 1.0)); else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.11e-128], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e-58], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.11 \cdot 10^{-128}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if x < -1.1099999999999999e-128Initial program 61.2%
associate-/r*73.5%
*-commutative73.5%
+-commutative73.5%
+-commutative73.5%
associate-*l/90.8%
+-commutative90.8%
associate-*r/90.8%
remove-double-neg90.8%
+-commutative90.8%
+-commutative90.8%
remove-double-neg90.8%
+-commutative90.8%
associate-+l+90.8%
Simplified90.8%
Taylor expanded in y around 0 66.7%
associate-/r*70.6%
+-commutative70.6%
Simplified70.6%
if -1.1099999999999999e-128 < x < 3.7999999999999997e-58Initial program 64.7%
associate-/r*64.6%
*-commutative64.6%
+-commutative64.6%
+-commutative64.6%
associate-*l/78.1%
+-commutative78.1%
associate-*r/78.1%
remove-double-neg78.1%
+-commutative78.1%
+-commutative78.1%
remove-double-neg78.1%
+-commutative78.1%
associate-+l+78.1%
Simplified78.1%
Taylor expanded in x around 0 75.6%
+-commutative75.6%
Simplified75.6%
if 3.7999999999999997e-58 < x Initial program 74.0%
times-frac83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
times-frac74.0%
associate-*l/80.6%
*-commutative80.6%
*-commutative80.6%
distribute-rgt1-in77.2%
fma-def80.5%
+-commutative80.5%
+-commutative80.5%
cube-unmult80.6%
+-commutative80.6%
Simplified80.6%
associate-*r/74.1%
fma-udef71.1%
cube-mult71.1%
distribute-rgt1-in74.0%
associate-+r+74.0%
*-commutative74.0%
frac-times83.2%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 34.2%
Final simplification62.9%
(FPCore (x y) :precision binary64 (/ (* (/ y (+ y x)) (/ x (+ y (+ x 1.0)))) (+ y x)))
double code(double x, double y) {
return ((y / (y + x)) * (x / (y + (x + 1.0)))) / (y + x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (y + x)) * (x / (y + (x + 1.0d0)))) / (y + x)
end function
public static double code(double x, double y) {
return ((y / (y + x)) * (x / (y + (x + 1.0)))) / (y + x);
}
def code(x, y): return ((y / (y + x)) * (x / (y + (x + 1.0)))) / (y + x)
function code(x, y) return Float64(Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(y + Float64(x + 1.0)))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y / (y + x)) * (x / (y + (x + 1.0)))) / (y + x); end
code[x_, y_] := N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{y + x} \cdot \frac{x}{y + \left(x + 1\right)}}{y + x}
\end{array}
Initial program 66.0%
times-frac83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
times-frac66.0%
associate-*l/77.7%
*-commutative77.7%
*-commutative77.7%
distribute-rgt1-in59.5%
fma-def77.8%
+-commutative77.8%
+-commutative77.8%
cube-unmult77.8%
+-commutative77.8%
Simplified77.8%
associate-*r/66.0%
fma-udef52.3%
cube-mult52.2%
distribute-rgt1-in66.0%
associate-+r+66.0%
*-commutative66.0%
frac-times83.8%
associate-/r*99.7%
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 (/ (/ (* x (/ y (+ y x))) (+ y (+ x 1.0))) (+ y x)))
double code(double x, double y) {
return ((x * (y / (y + x))) / (y + (x + 1.0))) / (y + x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x * (y / (y + x))) / (y + (x + 1.0d0))) / (y + x)
end function
public static double code(double x, double y) {
return ((x * (y / (y + x))) / (y + (x + 1.0))) / (y + x);
}
def code(x, y): return ((x * (y / (y + x))) / (y + (x + 1.0))) / (y + x)
function code(x, y) return Float64(Float64(Float64(x * Float64(y / Float64(y + x))) / Float64(y + Float64(x + 1.0))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((x * (y / (y + x))) / (y + (x + 1.0))) / (y + x); end
code[x_, y_] := N[(N[(N[(x * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x \cdot \frac{y}{y + x}}{y + \left(x + 1\right)}}{y + x}
\end{array}
Initial program 66.0%
times-frac83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
times-frac66.0%
associate-*l/77.7%
*-commutative77.7%
*-commutative77.7%
distribute-rgt1-in59.5%
fma-def77.8%
+-commutative77.8%
+-commutative77.8%
cube-unmult77.8%
+-commutative77.8%
Simplified77.8%
associate-*r/66.0%
fma-udef52.3%
cube-mult52.2%
distribute-rgt1-in66.0%
associate-+r+66.0%
*-commutative66.0%
frac-times83.8%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
associate-*r/99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y) :precision binary64 (if (<= x -1.11e-128) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -1.11e-128) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.11d-128)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.11e-128) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.11e-128: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.11e-128) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.11e-128) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.11e-128], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.11 \cdot 10^{-128}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -1.1099999999999999e-128Initial program 61.2%
associate-/r*73.5%
*-commutative73.5%
+-commutative73.5%
+-commutative73.5%
associate-*l/90.8%
+-commutative90.8%
associate-*r/90.8%
remove-double-neg90.8%
+-commutative90.8%
+-commutative90.8%
remove-double-neg90.8%
+-commutative90.8%
associate-+l+90.8%
Simplified90.8%
Taylor expanded in y around 0 66.7%
associate-/r*70.6%
+-commutative70.6%
Simplified70.6%
if -1.1099999999999999e-128 < x Initial program 68.5%
times-frac80.2%
+-commutative80.2%
+-commutative80.2%
+-commutative80.2%
times-frac68.5%
associate-*l/78.5%
*-commutative78.5%
*-commutative78.5%
distribute-rgt1-in69.4%
fma-def78.5%
+-commutative78.5%
+-commutative78.5%
cube-unmult78.5%
+-commutative78.5%
Simplified78.5%
associate-*r/68.5%
fma-udef59.6%
cube-mult59.5%
distribute-rgt1-in68.5%
associate-+r+68.5%
*-commutative68.5%
frac-times80.1%
associate-/r*99.6%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 59.0%
+-commutative59.0%
Simplified59.0%
Final simplification63.0%
(FPCore (x y) :precision binary64 (if (<= x -1.11e-128) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -1.11e-128) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.11d-128)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.11e-128) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.11e-128: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.11e-128) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.11e-128) tmp = (y / (x + 1.0)) / (y + x); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.11e-128], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.11 \cdot 10^{-128}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -1.1099999999999999e-128Initial program 61.2%
times-frac90.9%
+-commutative90.9%
+-commutative90.9%
+-commutative90.9%
times-frac61.2%
associate-*l/76.4%
*-commutative76.4%
*-commutative76.4%
distribute-rgt1-in40.5%
fma-def76.4%
+-commutative76.4%
+-commutative76.4%
cube-unmult76.4%
+-commutative76.4%
Simplified76.4%
associate-*r/61.2%
fma-udef38.3%
cube-mult38.3%
distribute-rgt1-in61.2%
associate-+r+61.2%
*-commutative61.2%
frac-times90.8%
associate-/r*99.7%
associate-*l/99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 70.8%
+-commutative70.8%
Simplified70.8%
if -1.1099999999999999e-128 < x Initial program 68.5%
times-frac80.2%
+-commutative80.2%
+-commutative80.2%
+-commutative80.2%
times-frac68.5%
associate-*l/78.5%
*-commutative78.5%
*-commutative78.5%
distribute-rgt1-in69.4%
fma-def78.5%
+-commutative78.5%
+-commutative78.5%
cube-unmult78.5%
+-commutative78.5%
Simplified78.5%
associate-*r/68.5%
fma-udef59.6%
cube-mult59.5%
distribute-rgt1-in68.5%
associate-+r+68.5%
*-commutative68.5%
frac-times80.1%
associate-/r*99.6%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 59.0%
+-commutative59.0%
Simplified59.0%
Final simplification63.0%
(FPCore (x y) :precision binary64 (if (<= x -2.25e-129) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -2.25e-129) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.25d-129)) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.25e-129) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.25e-129: tmp = (y / (y + x)) / (x + 1.0) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.25e-129) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.25e-129) tmp = (y / (y + x)) / (x + 1.0); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.25e-129], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-129}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -2.25000000000000015e-129Initial program 61.2%
times-frac90.9%
+-commutative90.9%
+-commutative90.9%
+-commutative90.9%
times-frac61.2%
associate-*l/76.4%
*-commutative76.4%
*-commutative76.4%
distribute-rgt1-in40.5%
fma-def76.4%
+-commutative76.4%
+-commutative76.4%
cube-unmult76.4%
+-commutative76.4%
Simplified76.4%
associate-*r/61.2%
fma-udef38.3%
cube-mult38.3%
distribute-rgt1-in61.2%
associate-+r+61.2%
*-commutative61.2%
frac-times90.8%
*-commutative90.8%
clear-num90.8%
associate-/r*99.7%
frac-times99.1%
*-un-lft-identity99.1%
associate-+r+99.1%
+-commutative99.1%
associate-+l+99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 70.8%
+-commutative70.8%
Simplified70.8%
if -2.25000000000000015e-129 < x Initial program 68.5%
times-frac80.2%
+-commutative80.2%
+-commutative80.2%
+-commutative80.2%
times-frac68.5%
associate-*l/78.5%
*-commutative78.5%
*-commutative78.5%
distribute-rgt1-in69.4%
fma-def78.5%
+-commutative78.5%
+-commutative78.5%
cube-unmult78.5%
+-commutative78.5%
Simplified78.5%
associate-*r/68.5%
fma-udef59.6%
cube-mult59.5%
distribute-rgt1-in68.5%
associate-+r+68.5%
*-commutative68.5%
frac-times80.1%
associate-/r*99.6%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 59.0%
+-commutative59.0%
Simplified59.0%
Final simplification63.0%
(FPCore (x y) :precision binary64 (if (<= x -1.11e-128) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.11e-128) {
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.11d-128)) 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.11e-128) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.11e-128: 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.11e-128) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.11e-128) 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.11e-128], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.11 \cdot 10^{-128}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1.1099999999999999e-128Initial program 61.2%
associate-/r*73.5%
*-commutative73.5%
+-commutative73.5%
+-commutative73.5%
associate-*l/90.8%
+-commutative90.8%
associate-*r/90.8%
remove-double-neg90.8%
+-commutative90.8%
+-commutative90.8%
remove-double-neg90.8%
+-commutative90.8%
associate-+l+90.8%
Simplified90.8%
Taylor expanded in y around 0 66.7%
if -1.1099999999999999e-128 < x Initial program 68.5%
associate-/r*69.5%
*-commutative69.5%
+-commutative69.5%
+-commutative69.5%
associate-*l/80.2%
+-commutative80.2%
associate-*r/80.1%
remove-double-neg80.1%
+-commutative80.1%
+-commutative80.1%
remove-double-neg80.1%
+-commutative80.1%
associate-+l+80.1%
Simplified80.1%
Taylor expanded in x around 0 56.7%
+-commutative56.7%
Simplified56.7%
Final simplification60.1%
(FPCore (x y) :precision binary64 (if (<= x -2.55e-11) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -2.55e-11) {
tmp = 1.0 / 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 (x <= (-2.55d-11)) then
tmp = 1.0d0 / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.55e-11) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.55e-11: tmp = 1.0 / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -2.55e-11) tmp = Float64(1.0 / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.55e-11) tmp = 1.0 / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.55e-11], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -2.54999999999999992e-11Initial program 54.4%
times-frac88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
times-frac54.4%
associate-*l/71.6%
*-commutative71.6%
*-commutative71.6%
distribute-rgt1-in26.9%
fma-def71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.6%
+-commutative71.6%
Simplified71.6%
associate-*r/54.4%
fma-udef26.9%
cube-mult26.9%
distribute-rgt1-in54.4%
associate-+r+54.4%
*-commutative54.4%
frac-times88.0%
associate-/r*99.7%
associate-*l/99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 76.3%
Taylor expanded in y around inf 6.7%
if -2.54999999999999992e-11 < x Initial program 70.0%
associate-/r*71.0%
*-commutative71.0%
+-commutative71.0%
+-commutative71.0%
associate-*l/82.4%
+-commutative82.4%
associate-*r/82.4%
remove-double-neg82.4%
+-commutative82.4%
+-commutative82.4%
remove-double-neg82.4%
+-commutative82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in x around 0 56.6%
+-commutative56.6%
Simplified56.6%
Taylor expanded in y around 0 35.9%
Final simplification28.4%
(FPCore (x y) :precision binary64 (/ x (* y (+ y 1.0))))
double code(double x, double y) {
return x / (y * (y + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / (y * (y + 1.0d0))
end function
public static double code(double x, double y) {
return x / (y * (y + 1.0));
}
def code(x, y): return x / (y * (y + 1.0))
function code(x, y) return Float64(x / Float64(y * Float64(y + 1.0))) end
function tmp = code(x, y) tmp = x / (y * (y + 1.0)); end
code[x_, y_] := N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot \left(y + 1\right)}
\end{array}
Initial program 66.0%
associate-/r*70.9%
*-commutative70.9%
+-commutative70.9%
+-commutative70.9%
associate-*l/83.8%
+-commutative83.8%
associate-*r/83.8%
remove-double-neg83.8%
+-commutative83.8%
+-commutative83.8%
remove-double-neg83.8%
+-commutative83.8%
associate-+l+83.8%
Simplified83.8%
Taylor expanded in x around 0 47.4%
+-commutative47.4%
Simplified47.4%
Final simplification47.4%
(FPCore (x y) :precision binary64 (/ -0.25 y))
double code(double x, double y) {
return -0.25 / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (-0.25d0) / y
end function
public static double code(double x, double y) {
return -0.25 / y;
}
def code(x, y): return -0.25 / y
function code(x, y) return Float64(-0.25 / y) end
function tmp = code(x, y) tmp = -0.25 / y; end
code[x_, y_] := N[(-0.25 / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{-0.25}{y}
\end{array}
Initial program 66.0%
associate-/r*70.9%
*-commutative70.9%
+-commutative70.9%
+-commutative70.9%
associate-*l/83.8%
+-commutative83.8%
associate-*r/83.8%
remove-double-neg83.8%
+-commutative83.8%
+-commutative83.8%
remove-double-neg83.8%
+-commutative83.8%
associate-+l+83.8%
Simplified83.8%
Taylor expanded in x around inf 52.9%
Taylor expanded in y around inf 14.6%
associate-*r/14.6%
metadata-eval14.6%
associate-*r/14.6%
metadata-eval14.6%
Simplified14.6%
Taylor expanded in x around inf 3.8%
Final simplification3.8%
(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.0%
associate-/r*70.9%
*-commutative70.9%
+-commutative70.9%
+-commutative70.9%
associate-*l/83.8%
+-commutative83.8%
associate-*r/83.8%
remove-double-neg83.8%
+-commutative83.8%
+-commutative83.8%
remove-double-neg83.8%
+-commutative83.8%
associate-+l+83.8%
Simplified83.8%
Taylor expanded in x around inf 52.9%
Taylor expanded in y around inf 4.1%
Final simplification4.1%
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
return 1.0 / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
public static double code(double x, double y) {
return 1.0 / x;
}
def code(x, y): return 1.0 / x
function code(x, y) return Float64(1.0 / x) end
function tmp = code(x, y) tmp = 1.0 / x; end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x}
\end{array}
Initial program 66.0%
times-frac83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
times-frac66.0%
associate-*l/77.7%
*-commutative77.7%
*-commutative77.7%
distribute-rgt1-in59.5%
fma-def77.8%
+-commutative77.8%
+-commutative77.8%
cube-unmult77.8%
+-commutative77.8%
Simplified77.8%
associate-*r/66.0%
fma-udef52.3%
cube-mult52.2%
distribute-rgt1-in66.0%
associate-+r+66.0%
*-commutative66.0%
frac-times83.8%
associate-/r*99.7%
associate-*l/99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 37.9%
Taylor expanded in y around inf 4.6%
Final simplification4.6%
(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 2024036
(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))))