
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (/ (* x (/ (/ y (+ x y)) (+ y (+ x 1.0)))) (+ x y)))
double code(double x, double y) {
return (x * ((y / (x + y)) / (y + (x + 1.0)))) / (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * ((y / (x + y)) / (y + (x + 1.0d0)))) / (x + y)
end function
public static double code(double x, double y) {
return (x * ((y / (x + y)) / (y + (x + 1.0)))) / (x + y);
}
def code(x, y): return (x * ((y / (x + y)) / (y + (x + 1.0)))) / (x + y)
function code(x, y) return Float64(Float64(x * Float64(Float64(y / Float64(x + y)) / Float64(y + Float64(x + 1.0)))) / Float64(x + y)) end
function tmp = code(x, y) tmp = (x * ((y / (x + y)) / (y + (x + 1.0)))) / (x + y); end
code[x_, y_] := N[(N[(x * N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \frac{\frac{y}{x + y}}{y + \left(x + 1\right)}}{x + y}
\end{array}
Initial program 71.0%
*-commutative71.0%
associate-*l*71.0%
times-frac94.4%
+-commutative94.4%
+-commutative94.4%
associate-+r+94.4%
+-commutative94.4%
associate-+l+94.4%
Applied egg-rr94.4%
div-inv94.3%
+-commutative94.3%
+-commutative94.3%
Applied egg-rr94.3%
associate-*r/94.4%
*-rgt-identity94.4%
associate-/r*99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
clear-num99.8%
+-commutative99.8%
times-frac99.0%
associate-/l*99.0%
associate-*l/99.0%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(if (<= y 2.8e-164)
(/ (/ y (+ x 1.0)) (+ x y))
(if (<= y 1e+92)
(* x (/ y (* (+ x (+ y 1.0)) (* (+ x y) (+ x y)))))
(/ (/ x (+ x y)) (+ (+ y 1.0) (* x 2.0))))))
double code(double x, double y) {
double tmp;
if (y <= 2.8e-164) {
tmp = (y / (x + 1.0)) / (x + y);
} else if (y <= 1e+92) {
tmp = x * (y / ((x + (y + 1.0)) * ((x + y) * (x + y))));
} else {
tmp = (x / (x + y)) / ((y + 1.0) + (x * 2.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.8d-164) then
tmp = (y / (x + 1.0d0)) / (x + y)
else if (y <= 1d+92) then
tmp = x * (y / ((x + (y + 1.0d0)) * ((x + y) * (x + y))))
else
tmp = (x / (x + y)) / ((y + 1.0d0) + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.8e-164) {
tmp = (y / (x + 1.0)) / (x + y);
} else if (y <= 1e+92) {
tmp = x * (y / ((x + (y + 1.0)) * ((x + y) * (x + y))));
} else {
tmp = (x / (x + y)) / ((y + 1.0) + (x * 2.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.8e-164: tmp = (y / (x + 1.0)) / (x + y) elif y <= 1e+92: tmp = x * (y / ((x + (y + 1.0)) * ((x + y) * (x + y)))) else: tmp = (x / (x + y)) / ((y + 1.0) + (x * 2.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.8e-164) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); elseif (y <= 1e+92) tmp = Float64(x * Float64(y / Float64(Float64(x + Float64(y + 1.0)) * Float64(Float64(x + y) * Float64(x + y))))); else tmp = Float64(Float64(x / Float64(x + y)) / Float64(Float64(y + 1.0) + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.8e-164) tmp = (y / (x + 1.0)) / (x + y); elseif (y <= 1e+92) tmp = x * (y / ((x + (y + 1.0)) * ((x + y) * (x + y)))); else tmp = (x / (x + y)) / ((y + 1.0) + (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.8e-164], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+92], N[(x * N[(y / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + 1.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.8 \cdot 10^{-164}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{elif}\;y \leq 10^{+92}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + \left(y + 1\right)\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{\left(y + 1\right) + x \cdot 2}\\
\end{array}
\end{array}
if y < 2.8000000000000001e-164Initial program 71.8%
*-commutative71.8%
associate-*l*71.8%
times-frac94.3%
+-commutative94.3%
+-commutative94.3%
associate-+r+94.3%
+-commutative94.3%
associate-+l+94.3%
Applied egg-rr94.3%
div-inv94.2%
+-commutative94.2%
+-commutative94.2%
Applied egg-rr94.2%
associate-*r/94.3%
*-rgt-identity94.3%
associate-/r*99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Simplified99.9%
*-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
clear-num99.8%
+-commutative99.8%
times-frac98.9%
associate-/l*98.9%
associate-*l/99.0%
Applied egg-rr99.9%
Taylor expanded in y around 0 51.5%
+-commutative51.5%
Simplified51.5%
if 2.8000000000000001e-164 < y < 1e92Initial program 84.2%
associate-/l*87.6%
associate-+l+87.6%
Simplified87.6%
if 1e92 < y Initial program 55.9%
*-commutative55.9%
associate-*l*55.9%
times-frac93.1%
+-commutative93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+l+93.1%
Applied egg-rr93.1%
*-commutative93.1%
associate-/r*99.8%
clear-num99.8%
frac-times98.5%
+-commutative98.5%
+-commutative98.5%
+-commutative98.5%
Applied egg-rr98.5%
Taylor expanded in y around inf 78.3%
associate-+r+78.3%
+-commutative78.3%
*-commutative78.3%
Simplified78.3%
Final simplification63.8%
(FPCore (x y) :precision binary64 (if (<= x -1.22e+162) (* (/ (/ x (+ x y)) (+ x (+ y 1.0))) (/ y x)) (* (/ y (+ x y)) (/ x (* (+ x y) (+ y (+ x 1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= -1.22e+162) {
tmp = ((x / (x + y)) / (x + (y + 1.0))) * (y / x);
} else {
tmp = (y / (x + y)) * (x / ((x + y) * (y + (x + 1.0))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.22d+162)) then
tmp = ((x / (x + y)) / (x + (y + 1.0d0))) * (y / x)
else
tmp = (y / (x + y)) * (x / ((x + y) * (y + (x + 1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.22e+162) {
tmp = ((x / (x + y)) / (x + (y + 1.0))) * (y / x);
} else {
tmp = (y / (x + y)) * (x / ((x + y) * (y + (x + 1.0))));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.22e+162: tmp = ((x / (x + y)) / (x + (y + 1.0))) * (y / x) else: tmp = (y / (x + y)) * (x / ((x + y) * (y + (x + 1.0)))) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.22e+162) tmp = Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + Float64(y + 1.0))) * Float64(y / x)); else tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x + y) * Float64(y + Float64(x + 1.0))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.22e+162) tmp = ((x / (x + y)) / (x + (y + 1.0))) * (y / x); else tmp = (y / (x + y)) * (x / ((x + y) * (y + (x + 1.0)))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.22e+162], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.22 \cdot 10^{+162}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{x + \left(y + 1\right)} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if x < -1.22e162Initial program 60.3%
*-commutative60.3%
associate-*l*60.3%
times-frac85.1%
+-commutative85.1%
+-commutative85.1%
associate-+r+85.1%
+-commutative85.1%
associate-+l+85.1%
Applied egg-rr85.1%
div-inv85.1%
+-commutative85.1%
+-commutative85.1%
Applied egg-rr85.1%
associate-*r/85.1%
*-rgt-identity85.1%
associate-/r*99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Simplified99.9%
Taylor expanded in y around 0 97.4%
if -1.22e162 < x Initial program 72.8%
*-commutative72.8%
associate-*l*72.8%
times-frac96.0%
+-commutative96.0%
+-commutative96.0%
associate-+r+96.0%
+-commutative96.0%
associate-+l+96.0%
Applied egg-rr96.0%
Final simplification96.2%
(FPCore (x y) :precision binary64 (if (<= y 1.12e-142) (/ (/ y (+ x 1.0)) (+ x y)) (if (<= y 6.8e+165) (/ x (* (+ x y) (+ y (+ x 1.0)))) (/ (/ x y) (+ x y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.12e-142) {
tmp = (y / (x + 1.0)) / (x + y);
} else if (y <= 6.8e+165) {
tmp = x / ((x + y) * (y + (x + 1.0)));
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.12d-142) then
tmp = (y / (x + 1.0d0)) / (x + y)
else if (y <= 6.8d+165) then
tmp = x / ((x + y) * (y + (x + 1.0d0)))
else
tmp = (x / y) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.12e-142) {
tmp = (y / (x + 1.0)) / (x + y);
} else if (y <= 6.8e+165) {
tmp = x / ((x + y) * (y + (x + 1.0)));
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.12e-142: tmp = (y / (x + 1.0)) / (x + y) elif y <= 6.8e+165: tmp = x / ((x + y) * (y + (x + 1.0))) else: tmp = (x / y) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.12e-142) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); elseif (y <= 6.8e+165) tmp = Float64(x / Float64(Float64(x + y) * Float64(y + Float64(x + 1.0)))); else tmp = Float64(Float64(x / y) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.12e-142) tmp = (y / (x + 1.0)) / (x + y); elseif (y <= 6.8e+165) tmp = x / ((x + y) * (y + (x + 1.0))); else tmp = (x / y) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.12e-142], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+165], N[(x / N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.12 \cdot 10^{-142}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+165}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + y}\\
\end{array}
\end{array}
if y < 1.1199999999999999e-142Initial program 72.1%
*-commutative72.1%
associate-*l*72.1%
times-frac94.3%
+-commutative94.3%
+-commutative94.3%
associate-+r+94.3%
+-commutative94.3%
associate-+l+94.3%
Applied egg-rr94.3%
div-inv94.3%
+-commutative94.3%
+-commutative94.3%
Applied egg-rr94.3%
associate-*r/94.3%
*-rgt-identity94.3%
associate-/r*99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Simplified99.9%
*-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
clear-num99.8%
+-commutative99.8%
times-frac99.0%
associate-/l*98.9%
associate-*l/99.0%
Applied egg-rr99.9%
Taylor expanded in y around 0 52.1%
+-commutative52.1%
Simplified52.1%
if 1.1199999999999999e-142 < y < 6.80000000000000022e165Initial program 65.7%
*-commutative65.7%
associate-*l*65.7%
times-frac96.1%
+-commutative96.1%
+-commutative96.1%
associate-+r+96.1%
+-commutative96.1%
associate-+l+96.1%
Applied egg-rr96.1%
Taylor expanded in y around inf 72.9%
if 6.80000000000000022e165 < y Initial program 76.9%
*-commutative76.9%
associate-*l*76.9%
times-frac90.7%
+-commutative90.7%
+-commutative90.7%
associate-+r+90.7%
+-commutative90.7%
associate-+l+90.7%
Applied egg-rr90.7%
div-inv90.7%
+-commutative90.7%
+-commutative90.7%
Applied egg-rr90.7%
associate-*r/90.7%
*-rgt-identity90.7%
associate-/r*99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Simplified99.9%
*-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
clear-num99.9%
+-commutative99.9%
times-frac99.9%
associate-/l*99.9%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 99.9%
Final simplification63.3%
(FPCore (x y) :precision binary64 (if (<= x -1e-147) (* (/ (/ x (+ x y)) (+ x (+ y 1.0))) (/ y x)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -1e-147) {
tmp = ((x / (x + y)) / (x + (y + 1.0))) * (y / 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 <= (-1d-147)) then
tmp = ((x / (x + y)) / (x + (y + 1.0d0))) * (y / 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 <= -1e-147) {
tmp = ((x / (x + y)) / (x + (y + 1.0))) * (y / x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1e-147: tmp = ((x / (x + y)) / (x + (y + 1.0))) * (y / x) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1e-147) tmp = Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + Float64(y + 1.0))) * Float64(y / x)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1e-147) tmp = ((x / (x + y)) / (x + (y + 1.0))) * (y / x); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1e-147], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-147}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{x + \left(y + 1\right)} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -9.9999999999999997e-148Initial program 67.8%
*-commutative67.8%
associate-*l*67.8%
times-frac92.4%
+-commutative92.4%
+-commutative92.4%
associate-+r+92.4%
+-commutative92.4%
associate-+l+92.4%
Applied egg-rr92.4%
div-inv92.3%
+-commutative92.3%
+-commutative92.3%
Applied egg-rr92.3%
associate-*r/92.4%
*-rgt-identity92.4%
associate-/r*99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
Taylor expanded in y around 0 82.9%
if -9.9999999999999997e-148 < x Initial program 73.0%
associate-/l*81.9%
associate-+l+81.9%
Simplified81.9%
Taylor expanded in x around 0 62.6%
associate-/r*63.8%
+-commutative63.8%
Simplified63.8%
Final simplification71.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= x -4.2e-148)
(* (/ t_0 (+ x (+ y 1.0))) (/ y x))
(/ t_0 (+ (+ y 1.0) (* x 2.0))))))
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -4.2e-148) {
tmp = (t_0 / (x + (y + 1.0))) * (y / x);
} else {
tmp = t_0 / ((y + 1.0) + (x * 2.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 / (x + y)
if (x <= (-4.2d-148)) then
tmp = (t_0 / (x + (y + 1.0d0))) * (y / x)
else
tmp = t_0 / ((y + 1.0d0) + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -4.2e-148) {
tmp = (t_0 / (x + (y + 1.0))) * (y / x);
} else {
tmp = t_0 / ((y + 1.0) + (x * 2.0));
}
return tmp;
}
def code(x, y): t_0 = x / (x + y) tmp = 0 if x <= -4.2e-148: tmp = (t_0 / (x + (y + 1.0))) * (y / x) else: tmp = t_0 / ((y + 1.0) + (x * 2.0)) return tmp
function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -4.2e-148) tmp = Float64(Float64(t_0 / Float64(x + Float64(y + 1.0))) * Float64(y / x)); else tmp = Float64(t_0 / Float64(Float64(y + 1.0) + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (x + y); tmp = 0.0; if (x <= -4.2e-148) tmp = (t_0 / (x + (y + 1.0))) * (y / x); else tmp = t_0 / ((y + 1.0) + (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.2e-148], N[(N[(t$95$0 / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(y + 1.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{-148}:\\
\;\;\;\;\frac{t\_0}{x + \left(y + 1\right)} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\left(y + 1\right) + x \cdot 2}\\
\end{array}
\end{array}
if x < -4.2e-148Initial program 67.8%
*-commutative67.8%
associate-*l*67.8%
times-frac92.4%
+-commutative92.4%
+-commutative92.4%
associate-+r+92.4%
+-commutative92.4%
associate-+l+92.4%
Applied egg-rr92.4%
div-inv92.3%
+-commutative92.3%
+-commutative92.3%
Applied egg-rr92.3%
associate-*r/92.4%
*-rgt-identity92.4%
associate-/r*99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
Taylor expanded in y around 0 82.9%
if -4.2e-148 < x Initial program 73.0%
*-commutative73.0%
associate-*l*73.0%
times-frac95.7%
+-commutative95.7%
+-commutative95.7%
associate-+r+95.7%
+-commutative95.7%
associate-+l+95.7%
Applied egg-rr95.7%
*-commutative95.7%
associate-/r*99.8%
clear-num99.8%
frac-times99.7%
+-commutative99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 65.1%
associate-+r+65.1%
+-commutative65.1%
*-commutative65.1%
Simplified65.1%
Final simplification72.1%
(FPCore (x y) :precision binary64 (if (<= x -550.0) (/ (/ y x) x) (if (<= x -3.4e-150) (* y (/ 1.0 (+ x y))) (/ x y))))
double code(double x, double y) {
double tmp;
if (x <= -550.0) {
tmp = (y / x) / x;
} else if (x <= -3.4e-150) {
tmp = y * (1.0 / (x + y));
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-550.0d0)) then
tmp = (y / x) / x
else if (x <= (-3.4d-150)) then
tmp = y * (1.0d0 / (x + y))
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -550.0) {
tmp = (y / x) / x;
} else if (x <= -3.4e-150) {
tmp = y * (1.0 / (x + y));
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -550.0: tmp = (y / x) / x elif x <= -3.4e-150: tmp = y * (1.0 / (x + y)) else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -550.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -3.4e-150) tmp = Float64(y * Float64(1.0 / Float64(x + y))); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -550.0) tmp = (y / x) / x; elseif (x <= -3.4e-150) tmp = y * (1.0 / (x + y)); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -550.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -3.4e-150], N[(y * N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -550:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-150}:\\
\;\;\;\;y \cdot \frac{1}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -550Initial program 61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac89.3%
+-commutative89.3%
+-commutative89.3%
associate-+r+89.3%
+-commutative89.3%
associate-+l+89.3%
Applied egg-rr89.3%
Taylor expanded in x around inf 74.3%
un-div-inv74.4%
Applied egg-rr74.4%
Taylor expanded in y around 0 73.9%
if -550 < x < -3.39999999999999999e-150Initial program 83.5%
*-un-lft-identity83.5%
associate-*l*83.5%
times-frac89.8%
+-commutative89.8%
*-commutative89.8%
+-commutative89.8%
associate-+r+89.8%
+-commutative89.8%
associate-+l+89.8%
Applied egg-rr89.8%
Taylor expanded in y around 0 37.3%
+-commutative37.3%
Simplified37.3%
Taylor expanded in x around 0 35.5%
if -3.39999999999999999e-150 < x Initial program 73.0%
associate-/l*81.9%
associate-+l+81.9%
Simplified81.9%
Taylor expanded in x around 0 62.6%
Taylor expanded in y around 0 38.9%
Final simplification48.2%
(FPCore (x y) :precision binary64 (if (<= x -550.0) (/ (/ y x) x) (if (<= x -2.1e-125) (* y (/ 1.0 (+ x y))) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -550.0) {
tmp = (y / x) / x;
} else if (x <= -2.1e-125) {
tmp = y * (1.0 / (x + y));
} 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 <= (-550.0d0)) then
tmp = (y / x) / x
else if (x <= (-2.1d-125)) then
tmp = y * (1.0d0 / (x + y))
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 <= -550.0) {
tmp = (y / x) / x;
} else if (x <= -2.1e-125) {
tmp = y * (1.0 / (x + y));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -550.0: tmp = (y / x) / x elif x <= -2.1e-125: tmp = y * (1.0 / (x + y)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -550.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -2.1e-125) tmp = Float64(y * Float64(1.0 / Float64(x + y))); 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 <= -550.0) tmp = (y / x) / x; elseif (x <= -2.1e-125) tmp = y * (1.0 / (x + y)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -550.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.1e-125], N[(y * N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -550:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-125}:\\
\;\;\;\;y \cdot \frac{1}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -550Initial program 61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac89.3%
+-commutative89.3%
+-commutative89.3%
associate-+r+89.3%
+-commutative89.3%
associate-+l+89.3%
Applied egg-rr89.3%
Taylor expanded in x around inf 74.3%
un-div-inv74.4%
Applied egg-rr74.4%
Taylor expanded in y around 0 73.9%
if -550 < x < -2.1e-125Initial program 84.1%
*-un-lft-identity84.1%
associate-*l*84.2%
times-frac91.7%
+-commutative91.7%
*-commutative91.7%
+-commutative91.7%
associate-+r+91.7%
+-commutative91.7%
associate-+l+91.7%
Applied egg-rr91.7%
Taylor expanded in y around 0 40.3%
+-commutative40.3%
Simplified40.3%
Taylor expanded in x around 0 38.1%
if -2.1e-125 < x Initial program 73.3%
associate-/l*82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in x around 0 63.1%
Final simplification63.8%
(FPCore (x y) :precision binary64 (if (<= x -2.5e+162) (/ (/ y x) x) (if (<= x -2.1e-125) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -2.5e+162) {
tmp = (y / x) / x;
} else if (x <= -2.1e-125) {
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 <= (-2.5d+162)) then
tmp = (y / x) / x
else if (x <= (-2.1d-125)) 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 <= -2.5e+162) {
tmp = (y / x) / x;
} else if (x <= -2.1e-125) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.5e+162: tmp = (y / x) / x elif x <= -2.1e-125: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.5e+162) tmp = Float64(Float64(y / x) / x); elseif (x <= -2.1e-125) 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 <= -2.5e+162) tmp = (y / x) / x; elseif (x <= -2.1e-125) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.5e+162], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.1e-125], 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 -2.5 \cdot 10^{+162}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-125}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -2.4999999999999998e162Initial program 60.3%
*-commutative60.3%
associate-*l*60.3%
times-frac85.1%
+-commutative85.1%
+-commutative85.1%
associate-+r+85.1%
+-commutative85.1%
associate-+l+85.1%
Applied egg-rr85.1%
Taylor expanded in x around inf 92.5%
un-div-inv92.5%
Applied egg-rr92.5%
Taylor expanded in y around 0 92.4%
if -2.4999999999999998e162 < x < -2.1e-125Initial program 71.7%
associate-/l*79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in y around 0 47.3%
+-commutative47.3%
Simplified47.3%
if -2.1e-125 < x Initial program 73.3%
associate-/l*82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in x around 0 63.1%
Final simplification63.9%
(FPCore (x y) :precision binary64 (if (<= x -4.7e+163) (/ (/ y x) x) (if (<= x -1.6e-125) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -4.7e+163) {
tmp = (y / x) / x;
} else if (x <= -1.6e-125) {
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 <= (-4.7d+163)) then
tmp = (y / x) / x
else if (x <= (-1.6d-125)) 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 <= -4.7e+163) {
tmp = (y / x) / x;
} else if (x <= -1.6e-125) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.7e+163: tmp = (y / x) / x elif x <= -1.6e-125: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.7e+163) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.6e-125) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.7e+163) tmp = (y / x) / x; elseif (x <= -1.6e-125) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.7e+163], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.6e-125], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{+163}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-125}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -4.70000000000000019e163Initial program 61.9%
*-commutative61.9%
associate-*l*61.9%
times-frac84.7%
+-commutative84.7%
+-commutative84.7%
associate-+r+84.7%
+-commutative84.7%
associate-+l+84.7%
Applied egg-rr84.7%
Taylor expanded in x around inf 94.9%
un-div-inv94.9%
Applied egg-rr94.9%
Taylor expanded in y around 0 94.8%
if -4.70000000000000019e163 < x < -1.5999999999999999e-125Initial program 70.4%
associate-/l*79.5%
associate-+l+79.5%
Simplified79.5%
Taylor expanded in y around 0 48.2%
+-commutative48.2%
Simplified48.2%
if -1.5999999999999999e-125 < x Initial program 73.3%
associate-/l*82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in x around 0 63.1%
associate-/r*64.3%
+-commutative64.3%
Simplified64.3%
Final simplification65.1%
(FPCore (x y) :precision binary64 (* (/ y (+ x y)) (/ (/ x (+ x y)) (+ x (+ y 1.0)))))
double code(double x, double y) {
return (y / (x + y)) * ((x / (x + y)) / (x + (y + 1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (x + y)) * ((x / (x + y)) / (x + (y + 1.0d0)))
end function
public static double code(double x, double y) {
return (y / (x + y)) * ((x / (x + y)) / (x + (y + 1.0)));
}
def code(x, y): return (y / (x + y)) * ((x / (x + y)) / (x + (y + 1.0)))
function code(x, y) return Float64(Float64(y / Float64(x + y)) * Float64(Float64(x / Float64(x + y)) / Float64(x + Float64(y + 1.0)))) end
function tmp = code(x, y) tmp = (y / (x + y)) * ((x / (x + y)) / (x + (y + 1.0))); end
code[x_, y_] := N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x + y} \cdot \frac{\frac{x}{x + y}}{x + \left(y + 1\right)}
\end{array}
Initial program 71.0%
*-commutative71.0%
associate-*l*71.0%
times-frac94.4%
+-commutative94.4%
+-commutative94.4%
associate-+r+94.4%
+-commutative94.4%
associate-+l+94.4%
Applied egg-rr94.4%
div-inv94.3%
+-commutative94.3%
+-commutative94.3%
Applied egg-rr94.3%
associate-*r/94.4%
*-rgt-identity94.4%
associate-/r*99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y) :precision binary64 (if (<= x -2e-125) (/ (/ y (+ x 1.0)) (+ x y)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -2e-125) {
tmp = (y / (x + 1.0)) / (x + y);
} 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 <= (-2d-125)) then
tmp = (y / (x + 1.0d0)) / (x + y)
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 <= -2e-125) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2e-125: tmp = (y / (x + 1.0)) / (x + y) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -2e-125) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2e-125) tmp = (y / (x + 1.0)) / (x + y); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2e-125], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-125}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.00000000000000002e-125Initial program 67.1%
*-commutative67.1%
associate-*l*67.1%
times-frac92.0%
+-commutative92.0%
+-commutative92.0%
associate-+r+92.0%
+-commutative92.0%
associate-+l+92.0%
Applied egg-rr92.0%
div-inv92.0%
+-commutative92.0%
+-commutative92.0%
Applied egg-rr92.0%
associate-*r/92.0%
*-rgt-identity92.0%
associate-/r*99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
clear-num99.8%
+-commutative99.8%
times-frac97.8%
associate-/l*97.8%
associate-*l/97.8%
Applied egg-rr99.9%
Taylor expanded in y around 0 65.8%
+-commutative65.8%
Simplified65.8%
if -2.00000000000000002e-125 < x Initial program 73.3%
associate-/l*82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in x around 0 63.1%
associate-/r*64.3%
+-commutative64.3%
Simplified64.3%
Final simplification64.9%
(FPCore (x y) :precision binary64 (if (<= x -2.1e-125) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -2.1e-125) {
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 <= (-2.1d-125)) 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 <= -2.1e-125) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.1e-125: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.1e-125) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.1e-125) tmp = (y / x) / (x + 1.0); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.1e-125], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-125}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.1e-125Initial program 67.1%
*-commutative67.1%
associate-*l*67.1%
times-frac92.0%
+-commutative92.0%
+-commutative92.0%
associate-+r+92.0%
+-commutative92.0%
associate-+l+92.0%
Applied egg-rr92.0%
div-inv92.0%
+-commutative92.0%
+-commutative92.0%
Applied egg-rr92.0%
associate-*r/92.0%
*-rgt-identity92.0%
associate-/r*99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
*-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
clear-num99.8%
+-commutative99.8%
times-frac97.8%
associate-/l*97.8%
associate-*l/97.8%
Applied egg-rr99.9%
Taylor expanded in y around 0 62.4%
associate-/r*65.3%
+-commutative65.3%
Simplified65.3%
if -2.1e-125 < x Initial program 73.3%
associate-/l*82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in x around 0 63.1%
associate-/r*64.3%
+-commutative64.3%
Simplified64.3%
Final simplification64.7%
(FPCore (x y) :precision binary64 (if (<= x -550.0) (/ (/ y x) x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -550.0) {
tmp = (y / x) / 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 <= (-550.0d0)) then
tmp = (y / x) / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -550.0) {
tmp = (y / x) / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -550.0: tmp = (y / x) / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -550.0) tmp = Float64(Float64(y / x) / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -550.0) tmp = (y / x) / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -550.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -550:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -550Initial program 61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac89.3%
+-commutative89.3%
+-commutative89.3%
associate-+r+89.3%
+-commutative89.3%
associate-+l+89.3%
Applied egg-rr89.3%
Taylor expanded in x around inf 74.3%
un-div-inv74.4%
Applied egg-rr74.4%
Taylor expanded in y around 0 73.9%
if -550 < x Initial program 74.7%
associate-/l*83.7%
associate-+l+83.7%
Simplified83.7%
Taylor expanded in x around 0 62.8%
Taylor expanded in y around 0 35.3%
Final simplification46.0%
(FPCore (x y) :precision binary64 (if (<= x -780.0) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -780.0) {
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 <= (-780.0d0)) 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 <= -780.0) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -780.0: tmp = 1.0 / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -780.0) 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 <= -780.0) tmp = 1.0 / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -780.0], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -780:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -780Initial program 61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac89.3%
+-commutative89.3%
+-commutative89.3%
associate-+r+89.3%
+-commutative89.3%
associate-+l+89.3%
Applied egg-rr89.3%
Taylor expanded in x around inf 74.3%
un-div-inv74.4%
Applied egg-rr74.4%
Taylor expanded in y around inf 5.8%
if -780 < x Initial program 74.7%
associate-/l*83.7%
associate-+l+83.7%
Simplified83.7%
Taylor expanded in x around 0 62.8%
Taylor expanded in y around 0 35.3%
Final simplification27.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 71.0%
*-commutative71.0%
associate-*l*71.0%
times-frac94.4%
+-commutative94.4%
+-commutative94.4%
associate-+r+94.4%
+-commutative94.4%
associate-+l+94.4%
Applied egg-rr94.4%
Taylor expanded in x around inf 38.2%
un-div-inv38.2%
Applied egg-rr38.2%
Taylor expanded in y around inf 4.3%
Final simplification4.3%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 71.0%
*-un-lft-identity71.0%
associate-*l*71.0%
times-frac77.3%
+-commutative77.3%
*-commutative77.3%
+-commutative77.3%
associate-+r+77.3%
+-commutative77.3%
associate-+l+77.3%
Applied egg-rr77.3%
Taylor expanded in y around 0 47.8%
+-commutative47.8%
Simplified47.8%
Taylor expanded in x around 0 3.6%
Final simplification3.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 2024044
(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))))