
(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 18 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)) (/ x (+ x (+ y 1.0)))) (+ y x)))
double code(double x, double y) {
return ((y / (y + x)) * (x / (x + (y + 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 / (x + (y + 1.0d0)))) / (y + x)
end function
public static double code(double x, double y) {
return ((y / (y + x)) * (x / (x + (y + 1.0)))) / (y + x);
}
def code(x, y): return ((y / (y + x)) * (x / (x + (y + 1.0)))) / (y + x)
function code(x, y) return Float64(Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(x + Float64(y + 1.0)))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y / (y + x)) * (x / (x + (y + 1.0)))) / (y + x); end
code[x_, y_] := N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{y + x} \cdot \frac{x}{x + \left(y + 1\right)}}{y + x}
\end{array}
Initial program 66.9%
times-frac85.4%
+-commutative85.4%
associate-+l+85.4%
Simplified85.4%
frac-times66.9%
*-commutative66.9%
frac-times85.4%
associate-/r*99.8%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(if (<= y 1.4e-14)
(/ (* (/ y (+ y x)) (/ x (+ x 1.0))) (+ y x))
(if (<= y 1.25e+154)
(* (/ y (+ y (+ x 1.0))) (/ x (* (+ y x) (+ y x))))
(/ (/ x (+ y (+ x (+ x 1.0)))) (+ y x)))))
double code(double x, double y) {
double tmp;
if (y <= 1.4e-14) {
tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x);
} else if (y <= 1.25e+154) {
tmp = (y / (y + (x + 1.0))) * (x / ((y + x) * (y + x)));
} else {
tmp = (x / (y + (x + (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) :: tmp
if (y <= 1.4d-14) then
tmp = ((y / (y + x)) * (x / (x + 1.0d0))) / (y + x)
else if (y <= 1.25d+154) then
tmp = (y / (y + (x + 1.0d0))) * (x / ((y + x) * (y + x)))
else
tmp = (x / (y + (x + (x + 1.0d0)))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.4e-14) {
tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x);
} else if (y <= 1.25e+154) {
tmp = (y / (y + (x + 1.0))) * (x / ((y + x) * (y + x)));
} else {
tmp = (x / (y + (x + (x + 1.0)))) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.4e-14: tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x) elif y <= 1.25e+154: tmp = (y / (y + (x + 1.0))) * (x / ((y + x) * (y + x))) else: tmp = (x / (y + (x + (x + 1.0)))) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.4e-14) tmp = Float64(Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(x + 1.0))) / Float64(y + x)); elseif (y <= 1.25e+154) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(y + Float64(x + Float64(x + 1.0)))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.4e-14) tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x); elseif (y <= 1.25e+154) tmp = (y / (y + (x + 1.0))) * (x / ((y + x) * (y + x))); else tmp = (x / (y + (x + (x + 1.0)))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.4e-14], 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.25e+154], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.4 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{y}{y + x} \cdot \frac{x}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+154}:\\
\;\;\;\;\frac{y}{y + \left(x + 1\right)} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + \left(x + 1\right)\right)}}{y + x}\\
\end{array}
\end{array}
if y < 1.4e-14Initial program 67.9%
times-frac83.2%
+-commutative83.2%
associate-+l+83.2%
Simplified83.2%
frac-times67.9%
*-commutative67.9%
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 y around 0 82.9%
+-commutative82.9%
Simplified82.9%
if 1.4e-14 < y < 1.25000000000000001e154Initial program 63.3%
times-frac95.8%
+-commutative95.8%
associate-+l+95.8%
Simplified95.8%
if 1.25000000000000001e154 < y Initial program 64.2%
times-frac88.8%
+-commutative88.8%
associate-+l+88.8%
Simplified88.8%
frac-times64.2%
*-commutative64.2%
frac-times88.8%
associate-/r*100.0%
associate-*l/100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
clear-num100.0%
frac-times100.0%
*-un-lft-identity100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
Applied egg-rr100.0%
Taylor expanded in y around -inf 94.9%
mul-1-neg94.9%
unsub-neg94.9%
neg-mul-194.9%
distribute-lft-in94.9%
metadata-eval94.9%
neg-mul-194.9%
+-commutative94.9%
unsub-neg94.9%
unsub-neg94.9%
Simplified94.9%
Final simplification86.1%
(FPCore (x y)
:precision binary64
(if (<= x -340.0)
(* (/ (/ x (+ y x)) (+ y x)) (/ y x))
(if (<= x -6.5e-178)
(* (/ y (* (+ y x) (+ y x))) (/ x (+ y 1.0)))
(if (<= x -2.8e-205)
(/ (/ y (+ x 1.0)) (+ y x))
(/ (/ x (+ y (+ x (+ x 1.0)))) (+ y x))))))
double code(double x, double y) {
double tmp;
if (x <= -340.0) {
tmp = ((x / (y + x)) / (y + x)) * (y / x);
} else if (x <= -6.5e-178) {
tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0));
} else if (x <= -2.8e-205) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + (x + (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) :: tmp
if (x <= (-340.0d0)) then
tmp = ((x / (y + x)) / (y + x)) * (y / x)
else if (x <= (-6.5d-178)) then
tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0d0))
else if (x <= (-2.8d-205)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = (x / (y + (x + (x + 1.0d0)))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -340.0) {
tmp = ((x / (y + x)) / (y + x)) * (y / x);
} else if (x <= -6.5e-178) {
tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0));
} else if (x <= -2.8e-205) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + (x + (x + 1.0)))) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -340.0: tmp = ((x / (y + x)) / (y + x)) * (y / x) elif x <= -6.5e-178: tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0)) elif x <= -2.8e-205: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (x / (y + (x + (x + 1.0)))) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -340.0) tmp = Float64(Float64(Float64(x / Float64(y + x)) / Float64(y + x)) * Float64(y / x)); elseif (x <= -6.5e-178) tmp = Float64(Float64(y / Float64(Float64(y + x) * Float64(y + x))) * Float64(x / Float64(y + 1.0))); elseif (x <= -2.8e-205) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + Float64(x + Float64(x + 1.0)))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -340.0) tmp = ((x / (y + x)) / (y + x)) * (y / x); elseif (x <= -6.5e-178) tmp = (y / ((y + x) * (y + x))) * (x / (y + 1.0)); elseif (x <= -2.8e-205) tmp = (y / (x + 1.0)) / (y + x); else tmp = (x / (y + (x + (x + 1.0)))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -340.0], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.5e-178], 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, -2.8e-205], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -340:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-178}:\\
\;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{y + 1}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-205}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + \left(x + 1\right)\right)}}{y + x}\\
\end{array}
\end{array}
if x < -340Initial program 64.0%
times-frac82.1%
+-commutative82.1%
associate-+l+82.1%
Simplified82.1%
Taylor expanded in x around inf 74.1%
associate-/r*81.8%
div-inv81.8%
Applied egg-rr81.8%
associate-*r/81.8%
*-rgt-identity81.8%
Simplified81.8%
if -340 < x < -6.5000000000000002e-178Initial program 85.4%
associate-*l*85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
*-commutative85.4%
associate-*l*85.4%
times-frac99.5%
+-commutative99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 96.1%
+-commutative96.1%
Simplified96.1%
if -6.5000000000000002e-178 < x < -2.79999999999999991e-205Initial program 50.0%
times-frac51.2%
+-commutative51.2%
associate-+l+51.2%
Simplified51.2%
frac-times50.0%
*-commutative50.0%
frac-times51.2%
associate-/r*99.6%
associate-*l/100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 51.4%
+-commutative51.4%
Simplified51.4%
if -2.79999999999999991e-205 < x Initial program 64.1%
times-frac84.2%
+-commutative84.2%
associate-+l+84.2%
Simplified84.2%
frac-times64.1%
*-commutative64.1%
frac-times84.2%
associate-/r*99.9%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
clear-num99.9%
frac-times99.3%
*-un-lft-identity99.3%
+-commutative99.3%
associate-+r+99.3%
+-commutative99.3%
associate-+r+99.3%
Applied egg-rr99.3%
Taylor expanded in y around -inf 56.9%
mul-1-neg56.9%
unsub-neg56.9%
neg-mul-156.9%
distribute-lft-in56.9%
metadata-eval56.9%
neg-mul-156.9%
+-commutative56.9%
unsub-neg56.9%
unsub-neg56.9%
Simplified56.9%
Final simplification67.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (/ (/ x (+ y x)) (+ y x)))) (if (<= x -1500000.0) (* t_0 (/ y x)) (* t_0 (/ y (+ y 1.0))))))
double code(double x, double y) {
double t_0 = (x / (y + x)) / (y + x);
double tmp;
if (x <= -1500000.0) {
tmp = t_0 * (y / x);
} else {
tmp = t_0 * (y / (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (x / (y + x)) / (y + x)
if (x <= (-1500000.0d0)) then
tmp = t_0 * (y / x)
else
tmp = t_0 * (y / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x / (y + x)) / (y + x);
double tmp;
if (x <= -1500000.0) {
tmp = t_0 * (y / x);
} else {
tmp = t_0 * (y / (y + 1.0));
}
return tmp;
}
def code(x, y): t_0 = (x / (y + x)) / (y + x) tmp = 0 if x <= -1500000.0: tmp = t_0 * (y / x) else: tmp = t_0 * (y / (y + 1.0)) return tmp
function code(x, y) t_0 = Float64(Float64(x / Float64(y + x)) / Float64(y + x)) tmp = 0.0 if (x <= -1500000.0) tmp = Float64(t_0 * Float64(y / x)); else tmp = Float64(t_0 * Float64(y / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) t_0 = (x / (y + x)) / (y + x); tmp = 0.0; if (x <= -1500000.0) tmp = t_0 * (y / x); else tmp = t_0 * (y / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1500000.0], N[(t$95$0 * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{x}{y + x}}{y + x}\\
\mathbf{if}\;x \leq -1500000:\\
\;\;\;\;t_0 \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{y}{y + 1}\\
\end{array}
\end{array}
if x < -1.5e6Initial program 64.0%
times-frac82.1%
+-commutative82.1%
associate-+l+82.1%
Simplified82.1%
Taylor expanded in x around inf 74.1%
associate-/r*81.8%
div-inv81.8%
Applied egg-rr81.8%
associate-*r/81.8%
*-rgt-identity81.8%
Simplified81.8%
if -1.5e6 < x Initial program 67.7%
times-frac86.3%
+-commutative86.3%
associate-+l+86.3%
Simplified86.3%
associate-/r*37.3%
div-inv37.3%
Applied egg-rr99.7%
associate-*r/37.3%
*-rgt-identity37.3%
Simplified99.7%
Taylor expanded in x around 0 82.9%
+-commutative82.9%
Simplified82.9%
Final simplification82.6%
(FPCore (x y) :precision binary64 (if (<= y 7.5e-12) (/ (* (/ y (+ y x)) (/ x (+ x 1.0))) (+ y x)) (/ (/ x (+ y (+ x (+ x 1.0)))) (+ y x))))
double code(double x, double y) {
double tmp;
if (y <= 7.5e-12) {
tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x);
} else {
tmp = (x / (y + (x + (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) :: tmp
if (y <= 7.5d-12) then
tmp = ((y / (y + x)) * (x / (x + 1.0d0))) / (y + x)
else
tmp = (x / (y + (x + (x + 1.0d0)))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 7.5e-12) {
tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x);
} else {
tmp = (x / (y + (x + (x + 1.0)))) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7.5e-12: tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x) else: tmp = (x / (y + (x + (x + 1.0)))) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 7.5e-12) tmp = Float64(Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(x + 1.0))) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + Float64(x + Float64(x + 1.0)))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 7.5e-12) tmp = ((y / (y + x)) * (x / (x + 1.0))) / (y + x); else tmp = (x / (y + (x + (x + 1.0)))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7.5e-12], N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{y}{y + x} \cdot \frac{x}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + \left(x + 1\right)\right)}}{y + x}\\
\end{array}
\end{array}
if y < 7.5e-12Initial program 67.9%
times-frac83.2%
+-commutative83.2%
associate-+l+83.2%
Simplified83.2%
frac-times67.9%
*-commutative67.9%
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 y around 0 82.9%
+-commutative82.9%
Simplified82.9%
if 7.5e-12 < y Initial program 63.9%
times-frac91.3%
+-commutative91.3%
associate-+l+91.3%
Simplified91.3%
frac-times63.9%
*-commutative63.9%
frac-times91.2%
associate-/r*99.9%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
clear-num99.9%
frac-times99.9%
*-un-lft-identity99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around -inf 82.8%
mul-1-neg82.8%
unsub-neg82.8%
neg-mul-182.8%
distribute-lft-in82.8%
metadata-eval82.8%
neg-mul-182.8%
+-commutative82.8%
unsub-neg82.8%
unsub-neg82.8%
Simplified82.8%
Final simplification82.9%
(FPCore (x y) :precision binary64 (* (/ (/ x (+ y x)) (+ y x)) (/ y (+ y (+ x 1.0)))))
double code(double x, double y) {
return ((x / (y + x)) / (y + x)) * (y / (y + (x + 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 / (y + (x + 1.0d0)))
end function
public static double code(double x, double y) {
return ((x / (y + x)) / (y + x)) * (y / (y + (x + 1.0)));
}
def code(x, y): return ((x / (y + x)) / (y + x)) * (y / (y + (x + 1.0)))
function code(x, y) return Float64(Float64(Float64(x / Float64(y + x)) / Float64(y + x)) * Float64(y / Float64(y + Float64(x + 1.0)))) end
function tmp = code(x, y) tmp = ((x / (y + x)) / (y + x)) * (y / (y + (x + 1.0))); end
code[x_, y_] := N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{y + \left(x + 1\right)}
\end{array}
Initial program 66.9%
times-frac85.4%
+-commutative85.4%
associate-+l+85.4%
Simplified85.4%
associate-/r*47.3%
div-inv47.3%
Applied egg-rr99.7%
associate-*r/47.3%
*-rgt-identity47.3%
Simplified99.8%
Final simplification99.8%
(FPCore (x y) :precision binary64 (if (<= y 5.4e-116) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y (+ x (+ x 1.0)))) (+ y x))))
double code(double x, double y) {
double tmp;
if (y <= 5.4e-116) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + (x + (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) :: tmp
if (y <= 5.4d-116) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = (x / (y + (x + (x + 1.0d0)))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 5.4e-116) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + (x + (x + 1.0)))) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.4e-116: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (x / (y + (x + (x + 1.0)))) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 5.4e-116) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + Float64(x + Float64(x + 1.0)))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5.4e-116) tmp = (y / (x + 1.0)) / (y + x); else tmp = (x / (y + (x + (x + 1.0)))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.4e-116], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.4 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + \left(x + 1\right)\right)}}{y + x}\\
\end{array}
\end{array}
if y < 5.4e-116Initial program 65.6%
times-frac81.8%
+-commutative81.8%
associate-+l+81.8%
Simplified81.8%
frac-times65.6%
*-commutative65.6%
frac-times81.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 y around 0 61.0%
+-commutative61.0%
Simplified61.0%
if 5.4e-116 < y Initial program 69.5%
times-frac92.7%
+-commutative92.7%
associate-+l+92.7%
Simplified92.7%
frac-times69.5%
*-commutative69.5%
frac-times92.8%
associate-/r*99.9%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
clear-num99.9%
frac-times99.9%
*-un-lft-identity99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around -inf 77.6%
mul-1-neg77.6%
unsub-neg77.6%
neg-mul-177.6%
distribute-lft-in77.6%
metadata-eval77.6%
neg-mul-177.6%
+-commutative77.6%
unsub-neg77.6%
unsub-neg77.6%
Simplified77.6%
Final simplification66.4%
(FPCore (x y)
:precision binary64
(if (<= y -1.75e+43)
(* (/ y x) (/ 1.0 x))
(if (<= y 2.8e-116)
(/ y (* x (+ x 1.0)))
(if (<= y 4.6e+42) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ y x))))))
double code(double x, double y) {
double tmp;
if (y <= -1.75e+43) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 2.8e-116) {
tmp = y / (x * (x + 1.0));
} else if (y <= 4.6e+42) {
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 (y <= (-1.75d+43)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 2.8d-116) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 4.6d+42) 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 (y <= -1.75e+43) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 2.8e-116) {
tmp = y / (x * (x + 1.0));
} else if (y <= 4.6e+42) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.75e+43: tmp = (y / x) * (1.0 / x) elif y <= 2.8e-116: tmp = y / (x * (x + 1.0)) elif y <= 4.6e+42: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.75e+43) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 2.8e-116) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 4.6e+42) 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 (y <= -1.75e+43) tmp = (y / x) * (1.0 / x); elseif (y <= 2.8e-116) tmp = y / (x * (x + 1.0)); elseif (y <= 4.6e+42) tmp = x / (y * (y + 1.0)); else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.75e+43], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-116], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+42], 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}\;y \leq -1.75 \cdot 10^{+43}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-116}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+42}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < -1.7500000000000001e43Initial program 57.2%
times-frac80.7%
+-commutative80.7%
associate-+l+80.7%
Simplified80.7%
Taylor expanded in x around inf 26.1%
Taylor expanded in x around inf 25.2%
if -1.7500000000000001e43 < y < 2.7999999999999999e-116Initial program 69.5%
times-frac82.4%
+-commutative82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in y around 0 76.5%
if 2.7999999999999999e-116 < y < 4.6e42Initial program 96.6%
times-frac99.4%
+-commutative99.4%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in x around 0 54.2%
+-commutative54.2%
Simplified54.2%
if 4.6e42 < y Initial program 59.8%
times-frac90.4%
+-commutative90.4%
associate-+l+90.4%
Simplified90.4%
frac-times59.8%
*-commutative59.8%
frac-times90.3%
associate-/r*99.9%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 85.1%
Final simplification65.6%
(FPCore (x y) :precision binary64 (if (<= y -1.22e+49) (* (/ y x) (/ 1.0 x)) (if (<= y 5.9e-119) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (y <= -1.22e+49) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 5.9e-119) {
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 (y <= (-1.22d+49)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 5.9d-119) 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 (y <= -1.22e+49) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 5.9e-119) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.22e+49: tmp = (y / x) * (1.0 / x) elif y <= 5.9e-119: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.22e+49) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 5.9e-119) 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 (y <= -1.22e+49) tmp = (y / x) * (1.0 / x); elseif (y <= 5.9e-119) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.22e+49], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.9e-119], 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}\;y \leq -1.22 \cdot 10^{+49}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 5.9 \cdot 10^{-119}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < -1.21999999999999988e49Initial program 57.2%
times-frac80.7%
+-commutative80.7%
associate-+l+80.7%
Simplified80.7%
Taylor expanded in x around inf 26.1%
Taylor expanded in x around inf 25.2%
if -1.21999999999999988e49 < y < 5.9000000000000002e-119Initial program 69.5%
times-frac82.4%
+-commutative82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in y around 0 76.5%
if 5.9000000000000002e-119 < y Initial program 69.5%
times-frac92.7%
+-commutative92.7%
associate-+l+92.7%
Simplified92.7%
Taylor expanded in x around 0 73.8%
+-commutative73.8%
Simplified73.8%
Final simplification64.6%
(FPCore (x y) :precision binary64 (if (<= y 7e-116) (/ (/ y x) (+ x 1.0)) (if (<= y 4.6e+42) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ y x)))))
double code(double x, double y) {
double tmp;
if (y <= 7e-116) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 4.6e+42) {
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 (y <= 7d-116) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 4.6d+42) 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 (y <= 7e-116) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 4.6e+42) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7e-116: tmp = (y / x) / (x + 1.0) elif y <= 4.6e+42: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 7e-116) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 4.6e+42) 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 (y <= 7e-116) tmp = (y / x) / (x + 1.0); elseif (y <= 4.6e+42) tmp = x / (y * (y + 1.0)); else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7e-116], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+42], 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}\;y \leq 7 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+42}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < 6.99999999999999968e-116Initial program 65.6%
times-frac81.8%
+-commutative81.8%
associate-+l+81.8%
Simplified81.8%
Taylor expanded in y around 0 58.5%
associate-/r*60.6%
+-commutative60.6%
Simplified60.6%
if 6.99999999999999968e-116 < y < 4.6e42Initial program 96.6%
times-frac99.4%
+-commutative99.4%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in x around 0 54.2%
+-commutative54.2%
Simplified54.2%
if 4.6e42 < y Initial program 59.8%
times-frac90.4%
+-commutative90.4%
associate-+l+90.4%
Simplified90.4%
frac-times59.8%
*-commutative59.8%
frac-times90.3%
associate-/r*99.9%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 85.1%
Final simplification65.9%
(FPCore (x y) :precision binary64 (if (<= y 6.5e-116) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (y <= 6.5e-116) {
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 (y <= 6.5d-116) 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 (y <= 6.5e-116) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.5e-116: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 6.5e-116) 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 (y <= 6.5e-116) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.5e-116], 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}\;y \leq 6.5 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 6.5000000000000001e-116Initial program 65.6%
times-frac81.8%
+-commutative81.8%
associate-+l+81.8%
Simplified81.8%
Taylor expanded in y around 0 58.5%
associate-/r*60.6%
+-commutative60.6%
Simplified60.6%
if 6.5000000000000001e-116 < y Initial program 69.5%
times-frac92.7%
+-commutative92.7%
associate-+l+92.7%
Simplified92.7%
frac-times69.5%
*-commutative69.5%
frac-times92.8%
associate-/r*99.9%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 77.1%
+-commutative77.1%
Simplified77.1%
Final simplification66.0%
(FPCore (x y) :precision binary64 (if (<= y 7e-116) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (y <= 7e-116) {
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 (y <= 7d-116) 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 (y <= 7e-116) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7e-116: 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 (y <= 7e-116) 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 (y <= 7e-116) 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[y, 7e-116], 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}\;y \leq 7 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 6.99999999999999968e-116Initial program 65.6%
times-frac81.8%
+-commutative81.8%
associate-+l+81.8%
Simplified81.8%
frac-times65.6%
*-commutative65.6%
frac-times81.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 y around 0 61.0%
+-commutative61.0%
Simplified61.0%
if 6.99999999999999968e-116 < y Initial program 69.5%
times-frac92.7%
+-commutative92.7%
associate-+l+92.7%
Simplified92.7%
frac-times69.5%
*-commutative69.5%
frac-times92.8%
associate-/r*99.9%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 77.1%
+-commutative77.1%
Simplified77.1%
Final simplification66.2%
(FPCore (x y) :precision binary64 (if (<= x -1.2e-33) (* (/ y x) (/ 1.0 x)) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -1.2e-33) {
tmp = (y / x) * (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 <= (-1.2d-33)) then
tmp = (y / x) * (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 <= -1.2e-33) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.2e-33: tmp = (y / x) * (1.0 / x) else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.2e-33) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.2e-33) tmp = (y / x) * (1.0 / x); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.2e-33], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-33}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1.2e-33Initial program 65.9%
times-frac84.0%
+-commutative84.0%
associate-+l+84.0%
Simplified84.0%
Taylor expanded in x around inf 63.3%
Taylor expanded in x around inf 56.3%
if -1.2e-33 < x Initial program 67.2%
times-frac85.8%
+-commutative85.8%
associate-+l+85.8%
Simplified85.8%
Taylor expanded in x around 0 57.5%
+-commutative57.5%
Simplified57.5%
Taylor expanded in y around 0 37.6%
Final simplification42.3%
(FPCore (x y) :precision binary64 (if (<= x -880000000.0) (* (/ y x) (/ 1.0 x)) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -880000000.0) {
tmp = (y / x) * (1.0 / x);
} 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 <= (-880000000.0d0)) then
tmp = (y / x) * (1.0d0 / x)
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 <= -880000000.0) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -880000000.0: tmp = (y / x) * (1.0 / x) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -880000000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); 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 <= -880000000.0) tmp = (y / x) * (1.0 / x); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -880000000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -880000000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -8.8e8Initial program 64.0%
times-frac82.1%
+-commutative82.1%
associate-+l+82.1%
Simplified82.1%
Taylor expanded in x around inf 65.6%
Taylor expanded in x around inf 62.7%
if -8.8e8 < x Initial program 67.7%
times-frac86.3%
+-commutative86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in x around 0 57.6%
+-commutative57.6%
Simplified57.6%
Final simplification58.7%
(FPCore (x y) :precision binary64 (/ x (+ y x)))
double code(double x, double y) {
return x / (y + x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / (y + x)
end function
public static double code(double x, double y) {
return x / (y + x);
}
def code(x, y): return x / (y + x)
function code(x, y) return Float64(x / Float64(y + x)) end
function tmp = code(x, y) tmp = x / (y + x); end
code[x_, y_] := N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y + x}
\end{array}
Initial program 66.9%
times-frac85.4%
+-commutative85.4%
associate-+l+85.4%
Simplified85.4%
frac-times66.9%
*-commutative66.9%
frac-times85.4%
associate-/r*99.8%
associate-*l/99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 76.0%
+-commutative76.0%
Simplified76.0%
Taylor expanded in x around 0 29.4%
Final simplification29.4%
(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.9%
times-frac85.4%
+-commutative85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in x around inf 49.1%
Taylor expanded in y around inf 4.0%
Final simplification4.0%
(FPCore (x y) :precision binary64 (/ 1.0 y))
double code(double x, double y) {
return 1.0 / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / y
end function
public static double code(double x, double y) {
return 1.0 / y;
}
def code(x, y): return 1.0 / y
function code(x, y) return Float64(1.0 / y) end
function tmp = code(x, y) tmp = 1.0 / y; end
code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{y}
\end{array}
Initial program 66.9%
times-frac85.4%
+-commutative85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in x around inf 44.6%
Taylor expanded in x around 0 4.3%
Final simplification4.3%
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
return x / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
public static double code(double x, double y) {
return x / y;
}
def code(x, y): return x / y
function code(x, y) return Float64(x / y) end
function tmp = code(x, y) tmp = x / y; end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y}
\end{array}
Initial program 66.9%
times-frac85.4%
+-commutative85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in x around 0 50.7%
+-commutative50.7%
Simplified50.7%
Taylor expanded in y around 0 29.0%
Final simplification29.0%
(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 2023310
(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))))