
(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 16 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 (+ y x)) (+ y (+ x 1.0)))))
double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0d0)))
end function
public static double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)));
}
def code(x, y): return (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)))
function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(y + Float64(x + 1.0)))) end
function tmp = code(x, y) tmp = (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0))); end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{y + \left(x + 1\right)}
\end{array}
Initial program 72.6%
*-commutative72.6%
associate-*l*72.6%
times-frac94.5%
+-commutative94.5%
+-commutative94.5%
associate-+r+94.5%
+-commutative94.5%
associate-+l+94.5%
Applied egg-rr94.5%
clear-num94.4%
associate-/r*99.8%
+-commutative99.8%
frac-times99.5%
metadata-eval99.5%
times-frac99.5%
*-un-lft-identity99.5%
*-un-lft-identity99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
*-un-lft-identity99.5%
times-frac99.8%
clear-num99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0)))
(t_1 (/ x (* (+ y x) t_0)))
(t_2 (* (/ y (+ y x)) (/ 1.0 (+ x 1.0)))))
(if (<= y 1.35e-111)
t_2
(if (<= y 3.2e-82)
t_1
(if (<= y 1.95e-42)
t_2
(if (<= y 1.25e+165) t_1 (/ (/ x (+ y x)) t_0)))))))
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = x / ((y + x) * t_0);
double t_2 = (y / (y + x)) * (1.0 / (x + 1.0));
double tmp;
if (y <= 1.35e-111) {
tmp = t_2;
} else if (y <= 3.2e-82) {
tmp = t_1;
} else if (y <= 1.95e-42) {
tmp = t_2;
} else if (y <= 1.25e+165) {
tmp = t_1;
} else {
tmp = (x / (y + x)) / t_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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y + (x + 1.0d0)
t_1 = x / ((y + x) * t_0)
t_2 = (y / (y + x)) * (1.0d0 / (x + 1.0d0))
if (y <= 1.35d-111) then
tmp = t_2
else if (y <= 3.2d-82) then
tmp = t_1
else if (y <= 1.95d-42) then
tmp = t_2
else if (y <= 1.25d+165) then
tmp = t_1
else
tmp = (x / (y + x)) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = x / ((y + x) * t_0);
double t_2 = (y / (y + x)) * (1.0 / (x + 1.0));
double tmp;
if (y <= 1.35e-111) {
tmp = t_2;
} else if (y <= 3.2e-82) {
tmp = t_1;
} else if (y <= 1.95e-42) {
tmp = t_2;
} else if (y <= 1.25e+165) {
tmp = t_1;
} else {
tmp = (x / (y + x)) / t_0;
}
return tmp;
}
def code(x, y): t_0 = y + (x + 1.0) t_1 = x / ((y + x) * t_0) t_2 = (y / (y + x)) * (1.0 / (x + 1.0)) tmp = 0 if y <= 1.35e-111: tmp = t_2 elif y <= 3.2e-82: tmp = t_1 elif y <= 1.95e-42: tmp = t_2 elif y <= 1.25e+165: tmp = t_1 else: tmp = (x / (y + x)) / t_0 return tmp
function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) t_1 = Float64(x / Float64(Float64(y + x) * t_0)) t_2 = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(x + 1.0))) tmp = 0.0 if (y <= 1.35e-111) tmp = t_2; elseif (y <= 3.2e-82) tmp = t_1; elseif (y <= 1.95e-42) tmp = t_2; elseif (y <= 1.25e+165) tmp = t_1; else tmp = Float64(Float64(x / Float64(y + x)) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (x + 1.0); t_1 = x / ((y + x) * t_0); t_2 = (y / (y + x)) * (1.0 / (x + 1.0)); tmp = 0.0; if (y <= 1.35e-111) tmp = t_2; elseif (y <= 3.2e-82) tmp = t_1; elseif (y <= 1.95e-42) tmp = t_2; elseif (y <= 1.25e+165) tmp = t_1; else tmp = (x / (y + x)) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.35e-111], t$95$2, If[LessEqual[y, 3.2e-82], t$95$1, If[LessEqual[y, 1.95e-42], t$95$2, If[LessEqual[y, 1.25e+165], t$95$1, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
t_1 := \frac{x}{\left(y + x\right) \cdot t\_0}\\
t_2 := \frac{y}{y + x} \cdot \frac{1}{x + 1}\\
\mathbf{if}\;y \leq 1.35 \cdot 10^{-111}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0}\\
\end{array}
\end{array}
if y < 1.34999999999999994e-111 or 3.2000000000000001e-82 < y < 1.9500000000000001e-42Initial program 75.0%
*-commutative75.0%
associate-*l*75.1%
times-frac96.5%
+-commutative96.5%
+-commutative96.5%
associate-+r+96.5%
+-commutative96.5%
associate-+l+96.5%
Applied egg-rr96.5%
Taylor expanded in y around 0 61.3%
if 1.34999999999999994e-111 < y < 3.2000000000000001e-82 or 1.9500000000000001e-42 < y < 1.24999999999999993e165Initial program 74.3%
*-commutative74.3%
associate-*l*74.3%
times-frac94.7%
+-commutative94.7%
+-commutative94.7%
associate-+r+94.7%
+-commutative94.7%
associate-+l+94.7%
Applied egg-rr94.7%
Taylor expanded in y around inf 81.4%
if 1.24999999999999993e165 < y Initial program 54.1%
*-commutative54.1%
associate-*l*54.1%
times-frac81.5%
+-commutative81.5%
+-commutative81.5%
associate-+r+81.5%
+-commutative81.5%
associate-+l+81.5%
Applied egg-rr81.5%
clear-num81.5%
associate-/r*99.9%
+-commutative99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
*-un-lft-identity99.9%
times-frac99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 90.4%
Final simplification68.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* (+ y x) (+ y (+ x 1.0)))))
(t_1 (* (/ y (+ y x)) (/ 1.0 (+ x 1.0)))))
(if (<= y 1.2e-112)
t_1
(if (<= y 5.6e-82)
t_0
(if (<= y 2.8e-42)
t_1
(if (<= y 1.26e+165) t_0 (/ (/ x (+ y x)) y)))))))
double code(double x, double y) {
double t_0 = x / ((y + x) * (y + (x + 1.0)));
double t_1 = (y / (y + x)) * (1.0 / (x + 1.0));
double tmp;
if (y <= 1.2e-112) {
tmp = t_1;
} else if (y <= 5.6e-82) {
tmp = t_0;
} else if (y <= 2.8e-42) {
tmp = t_1;
} else if (y <= 1.26e+165) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / ((y + x) * (y + (x + 1.0d0)))
t_1 = (y / (y + x)) * (1.0d0 / (x + 1.0d0))
if (y <= 1.2d-112) then
tmp = t_1
else if (y <= 5.6d-82) then
tmp = t_0
else if (y <= 2.8d-42) then
tmp = t_1
else if (y <= 1.26d+165) then
tmp = t_0
else
tmp = (x / (y + x)) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / ((y + x) * (y + (x + 1.0)));
double t_1 = (y / (y + x)) * (1.0 / (x + 1.0));
double tmp;
if (y <= 1.2e-112) {
tmp = t_1;
} else if (y <= 5.6e-82) {
tmp = t_0;
} else if (y <= 2.8e-42) {
tmp = t_1;
} else if (y <= 1.26e+165) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
def code(x, y): t_0 = x / ((y + x) * (y + (x + 1.0))) t_1 = (y / (y + x)) * (1.0 / (x + 1.0)) tmp = 0 if y <= 1.2e-112: tmp = t_1 elif y <= 5.6e-82: tmp = t_0 elif y <= 2.8e-42: tmp = t_1 elif y <= 1.26e+165: tmp = t_0 else: tmp = (x / (y + x)) / y return tmp
function code(x, y) t_0 = Float64(x / Float64(Float64(y + x) * Float64(y + Float64(x + 1.0)))) t_1 = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(x + 1.0))) tmp = 0.0 if (y <= 1.2e-112) tmp = t_1; elseif (y <= 5.6e-82) tmp = t_0; elseif (y <= 2.8e-42) tmp = t_1; elseif (y <= 1.26e+165) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + x)) / y); end return tmp end
function tmp_2 = code(x, y) t_0 = x / ((y + x) * (y + (x + 1.0))); t_1 = (y / (y + x)) * (1.0 / (x + 1.0)); tmp = 0.0; if (y <= 1.2e-112) tmp = t_1; elseif (y <= 5.6e-82) tmp = t_0; elseif (y <= 2.8e-42) tmp = t_1; elseif (y <= 1.26e+165) tmp = t_0; else tmp = (x / (y + x)) / y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.2e-112], t$95$1, If[LessEqual[y, 5.6e-82], t$95$0, If[LessEqual[y, 2.8e-42], t$95$1, If[LessEqual[y, 1.26e+165], t$95$0, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\
t_1 := \frac{y}{y + x} \cdot \frac{1}{x + 1}\\
\mathbf{if}\;y \leq 1.2 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-82}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{+165}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y}\\
\end{array}
\end{array}
if y < 1.2e-112 or 5.60000000000000049e-82 < y < 2.79999999999999998e-42Initial program 75.0%
*-commutative75.0%
associate-*l*75.1%
times-frac96.5%
+-commutative96.5%
+-commutative96.5%
associate-+r+96.5%
+-commutative96.5%
associate-+l+96.5%
Applied egg-rr96.5%
Taylor expanded in y around 0 61.3%
if 1.2e-112 < y < 5.60000000000000049e-82 or 2.79999999999999998e-42 < y < 1.25999999999999999e165Initial program 74.3%
*-commutative74.3%
associate-*l*74.3%
times-frac94.7%
+-commutative94.7%
+-commutative94.7%
associate-+r+94.7%
+-commutative94.7%
associate-+l+94.7%
Applied egg-rr94.7%
Taylor expanded in y around inf 81.4%
if 1.25999999999999999e165 < y Initial program 54.1%
*-commutative54.1%
associate-*l*54.1%
times-frac81.5%
+-commutative81.5%
+-commutative81.5%
associate-+r+81.5%
+-commutative81.5%
associate-+l+81.5%
Applied egg-rr81.5%
clear-num81.5%
associate-/r*99.9%
+-commutative99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 90.1%
Final simplification68.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= y 2.6e+149)
(* (/ x (+ y x)) (/ y (* (+ y x) t_0)))
(/ (/ x y) (* t_0 (/ (+ y x) y))))))
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (y <= 2.6e+149) {
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
} else {
tmp = (x / y) / (t_0 * ((y + x) / y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y + (x + 1.0d0)
if (y <= 2.6d+149) then
tmp = (x / (y + x)) * (y / ((y + x) * t_0))
else
tmp = (x / y) / (t_0 * ((y + x) / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (y <= 2.6e+149) {
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
} else {
tmp = (x / y) / (t_0 * ((y + x) / y));
}
return tmp;
}
def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if y <= 2.6e+149: tmp = (x / (y + x)) * (y / ((y + x) * t_0)) else: tmp = (x / y) / (t_0 * ((y + x) / y)) return tmp
function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (y <= 2.6e+149) tmp = Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + x) * t_0))); else tmp = Float64(Float64(x / y) / Float64(t_0 * Float64(Float64(y + x) / y))); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (x + 1.0); tmp = 0.0; if (y <= 2.6e+149) tmp = (x / (y + x)) * (y / ((y + x) * t_0)); else tmp = (x / y) / (t_0 * ((y + x) / y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.6e+149], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(t$95$0 * N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;y \leq 2.6 \cdot 10^{+149}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0 \cdot \frac{y + x}{y}}\\
\end{array}
\end{array}
if y < 2.59999999999999979e149Initial program 74.7%
associate-*l*74.8%
times-frac96.1%
+-commutative96.1%
+-commutative96.1%
associate-+r+96.1%
+-commutative96.1%
associate-+l+96.1%
Applied egg-rr96.1%
if 2.59999999999999979e149 < y Initial program 55.7%
*-commutative55.7%
associate-*l*55.7%
times-frac82.2%
+-commutative82.2%
+-commutative82.2%
associate-+r+82.2%
+-commutative82.2%
associate-+l+82.2%
Applied egg-rr82.2%
clear-num82.2%
associate-/r*99.9%
+-commutative99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 93.8%
Final simplification95.8%
(FPCore (x y) :precision binary64 (if (<= y 1.5e-6) (* (/ x (+ y x)) (/ (/ y (+ y x)) (+ x 1.0))) (/ (/ x y) (* (+ y (+ x 1.0)) (/ (+ y x) y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.5e-6) {
tmp = (x / (y + x)) * ((y / (y + x)) / (x + 1.0));
} else {
tmp = (x / y) / ((y + (x + 1.0)) * ((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.5d-6) then
tmp = (x / (y + x)) * ((y / (y + x)) / (x + 1.0d0))
else
tmp = (x / y) / ((y + (x + 1.0d0)) * ((y + x) / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.5e-6) {
tmp = (x / (y + x)) * ((y / (y + x)) / (x + 1.0));
} else {
tmp = (x / y) / ((y + (x + 1.0)) * ((y + x) / y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.5e-6: tmp = (x / (y + x)) * ((y / (y + x)) / (x + 1.0)) else: tmp = (x / y) / ((y + (x + 1.0)) * ((y + x) / y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.5e-6) tmp = Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(Float64(y + Float64(x + 1.0)) * Float64(Float64(y + x) / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.5e-6) tmp = (x / (y + x)) * ((y / (y + x)) / (x + 1.0)); else tmp = (x / y) / ((y + (x + 1.0)) * ((y + x) / y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.5e-6], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}}\\
\end{array}
\end{array}
if y < 1.5e-6Initial program 75.4%
Taylor expanded in x around inf 65.6%
associate-*l*65.6%
+-commutative65.6%
+-commutative65.6%
times-frac80.9%
+-commutative80.9%
+-commutative80.9%
Applied egg-rr80.9%
associate-/r*79.3%
Simplified79.3%
if 1.5e-6 < y Initial program 65.2%
*-commutative65.2%
associate-*l*65.2%
times-frac88.5%
+-commutative88.5%
+-commutative88.5%
associate-+r+88.5%
+-commutative88.5%
associate-+l+88.5%
Applied egg-rr88.5%
clear-num88.6%
associate-/r*99.7%
+-commutative99.7%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 86.7%
Final simplification81.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= y 3.1e-6)
(* t_0 (/ (/ y (+ y x)) (+ x 1.0)))
(/ t_0 (+ y (+ x 1.0))))))
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (y <= 3.1e-6) {
tmp = t_0 * ((y / (y + x)) / (x + 1.0));
} else {
tmp = t_0 / (y + (x + 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)
if (y <= 3.1d-6) then
tmp = t_0 * ((y / (y + x)) / (x + 1.0d0))
else
tmp = t_0 / (y + (x + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (y <= 3.1e-6) {
tmp = t_0 * ((y / (y + x)) / (x + 1.0));
} else {
tmp = t_0 / (y + (x + 1.0));
}
return tmp;
}
def code(x, y): t_0 = x / (y + x) tmp = 0 if y <= 3.1e-6: tmp = t_0 * ((y / (y + x)) / (x + 1.0)) else: tmp = t_0 / (y + (x + 1.0)) return tmp
function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (y <= 3.1e-6) tmp = Float64(t_0 * Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0))); else tmp = Float64(t_0 / Float64(y + Float64(x + 1.0))); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + x); tmp = 0.0; if (y <= 3.1e-6) tmp = t_0 * ((y / (y + x)) / (x + 1.0)); else tmp = t_0 / (y + (x + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.1e-6], N[(t$95$0 * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;y \leq 3.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0 \cdot \frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{y + \left(x + 1\right)}\\
\end{array}
\end{array}
if y < 3.1e-6Initial program 75.4%
Taylor expanded in x around inf 65.6%
associate-*l*65.6%
+-commutative65.6%
+-commutative65.6%
times-frac80.9%
+-commutative80.9%
+-commutative80.9%
Applied egg-rr80.9%
associate-/r*79.3%
Simplified79.3%
if 3.1e-6 < y Initial program 65.2%
*-commutative65.2%
associate-*l*65.2%
times-frac88.5%
+-commutative88.5%
+-commutative88.5%
associate-+r+88.5%
+-commutative88.5%
associate-+l+88.5%
Applied egg-rr88.5%
clear-num88.6%
associate-/r*99.7%
+-commutative99.7%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
*-un-lft-identity99.7%
times-frac99.7%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 77.6%
Final simplification78.9%
(FPCore (x y) :precision binary64 (if (<= x -8e-184) (* (/ y (+ y x)) (/ 1.0 (+ x 1.0))) (/ (/ x (+ y x)) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -8e-184) {
tmp = (y / (y + x)) * (1.0 / (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-8d-184)) then
tmp = (y / (y + x)) * (1.0d0 / (x + 1.0d0))
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -8e-184) {
tmp = (y / (y + x)) * (1.0 / (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8e-184: tmp = (y / (y + x)) * (1.0 / (x + 1.0)) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -8e-184) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -8e-184) tmp = (y / (y + x)) * (1.0 / (x + 1.0)); else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8e-184], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -8.0000000000000005e-184Initial program 72.9%
*-commutative72.9%
associate-*l*73.0%
times-frac90.6%
+-commutative90.6%
+-commutative90.6%
associate-+r+90.6%
+-commutative90.6%
associate-+l+90.6%
Applied egg-rr90.6%
Taylor expanded in y around 0 62.8%
if -8.0000000000000005e-184 < x Initial program 72.4%
*-commutative72.4%
associate-*l*72.4%
times-frac96.7%
+-commutative96.7%
+-commutative96.7%
associate-+r+96.7%
+-commutative96.7%
associate-+l+96.7%
Applied egg-rr96.7%
clear-num96.7%
associate-/r*99.8%
+-commutative99.8%
frac-times99.5%
metadata-eval99.5%
times-frac99.5%
*-un-lft-identity99.5%
*-un-lft-identity99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 57.6%
+-commutative57.6%
Simplified57.6%
Final simplification59.5%
(FPCore (x y) :precision binary64 (if (<= x -8e-184) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y x)) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -8e-184) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-8d-184)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -8e-184) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8e-184: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -8e-184) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -8e-184) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8e-184], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -8.0000000000000005e-184Initial program 72.9%
associate-/l*82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in y around 0 61.6%
associate-/r*62.1%
+-commutative62.1%
Simplified62.1%
if -8.0000000000000005e-184 < x Initial program 72.4%
*-commutative72.4%
associate-*l*72.4%
times-frac96.7%
+-commutative96.7%
+-commutative96.7%
associate-+r+96.7%
+-commutative96.7%
associate-+l+96.7%
Applied egg-rr96.7%
clear-num96.7%
associate-/r*99.8%
+-commutative99.8%
frac-times99.5%
metadata-eval99.5%
times-frac99.5%
*-un-lft-identity99.5%
*-un-lft-identity99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 57.6%
+-commutative57.6%
Simplified57.6%
Final simplification59.3%
(FPCore (x y) :precision binary64 (if (<= x -8e-184) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -8e-184) {
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 <= (-8d-184)) 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 <= -8e-184) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8e-184: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -8e-184) 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 <= -8e-184) tmp = (y / x) / (x + 1.0); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8e-184], 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 -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -8.0000000000000005e-184Initial program 72.9%
associate-/l*82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in y around 0 61.6%
associate-/r*62.1%
+-commutative62.1%
Simplified62.1%
if -8.0000000000000005e-184 < x Initial program 72.4%
*-commutative72.4%
associate-*l*72.4%
times-frac96.7%
+-commutative96.7%
+-commutative96.7%
associate-+r+96.7%
+-commutative96.7%
associate-+l+96.7%
Applied egg-rr96.7%
clear-num96.7%
associate-/r*99.8%
+-commutative99.8%
frac-times99.5%
metadata-eval99.5%
times-frac99.5%
*-un-lft-identity99.5%
*-un-lft-identity99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 56.8%
associate-/r*57.1%
+-commutative57.1%
Simplified57.1%
(FPCore (x y) :precision binary64 (if (<= x -8e-184) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -8e-184) {
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 <= (-8d-184)) 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 <= -8e-184) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8e-184: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -8e-184) 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 <= -8e-184) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8e-184], 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 -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -8.0000000000000005e-184Initial program 72.9%
associate-/l*82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in y around 0 61.6%
if -8.0000000000000005e-184 < x Initial program 72.4%
*-commutative72.4%
associate-*l*72.4%
times-frac96.7%
+-commutative96.7%
+-commutative96.7%
associate-+r+96.7%
+-commutative96.7%
associate-+l+96.7%
Applied egg-rr96.7%
clear-num96.7%
associate-/r*99.8%
+-commutative99.8%
frac-times99.5%
metadata-eval99.5%
times-frac99.5%
*-un-lft-identity99.5%
*-un-lft-identity99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 56.8%
associate-/r*57.1%
+-commutative57.1%
Simplified57.1%
Final simplification58.7%
(FPCore (x y) :precision binary64 (if (<= x -8e-184) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -8e-184) {
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 <= (-8d-184)) 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 <= -8e-184) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8e-184: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -8e-184) 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 <= -8e-184) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8e-184], 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 -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -8.0000000000000005e-184Initial program 72.9%
associate-/l*82.6%
associate-+l+82.6%
Simplified82.6%
Taylor expanded in y around 0 61.6%
if -8.0000000000000005e-184 < x Initial program 72.4%
associate-/l*84.1%
associate-+l+84.1%
Simplified84.1%
Taylor expanded in x around 0 56.8%
+-commutative56.8%
Simplified56.8%
Final simplification58.6%
(FPCore (x y) :precision binary64 (if (<= y 2.05e+165) (/ x (* y (+ y 1.0))) (/ (/ x y) y)))
double code(double x, double y) {
double tmp;
if (y <= 2.05e+165) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.05d+165) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.05e+165) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.05e+165: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 2.05e+165) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.05e+165) tmp = x / (y * (y + 1.0)); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.05e+165], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.05 \cdot 10^{+165}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 2.0500000000000001e165Initial program 74.9%
associate-/l*83.8%
associate-+l+83.8%
Simplified83.8%
Taylor expanded in x around 0 44.3%
+-commutative44.3%
Simplified44.3%
if 2.0500000000000001e165 < y Initial program 54.1%
*-commutative54.1%
associate-*l*54.1%
times-frac81.5%
+-commutative81.5%
+-commutative81.5%
associate-+r+81.5%
+-commutative81.5%
associate-+l+81.5%
Applied egg-rr81.5%
clear-num81.5%
associate-/r*99.9%
+-commutative99.9%
frac-times99.9%
metadata-eval99.9%
times-frac99.9%
*-un-lft-identity99.9%
*-un-lft-identity99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 90.1%
Taylor expanded in x around 0 89.9%
(FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (/ (/ x y) y)))
double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = (x / y) / 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.0d0) then
tmp = x / y
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.0: tmp = x / y else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.0) tmp = x / y; else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 1Initial program 75.5%
associate-/l*84.3%
associate-+l+84.3%
Simplified84.3%
Taylor expanded in x around 0 39.3%
+-commutative39.3%
Simplified39.3%
Taylor expanded in y around 0 19.6%
if 1 < y Initial program 64.6%
*-commutative64.6%
associate-*l*64.7%
times-frac88.4%
+-commutative88.4%
+-commutative88.4%
associate-+r+88.4%
+-commutative88.4%
associate-+l+88.4%
Applied egg-rr88.4%
clear-num88.4%
associate-/r*99.7%
+-commutative99.7%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 75.9%
Taylor expanded in x around 0 75.6%
(FPCore (x y) :precision binary64 (/ 1.0 (/ y x)))
double code(double x, double y) {
return 1.0 / (y / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / (y / x)
end function
public static double code(double x, double y) {
return 1.0 / (y / x);
}
def code(x, y): return 1.0 / (y / x)
function code(x, y) return Float64(1.0 / Float64(y / x)) end
function tmp = code(x, y) tmp = 1.0 / (y / x); end
code[x_, y_] := N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{y}{x}}
\end{array}
Initial program 72.6%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in x around 0 48.4%
+-commutative48.4%
Simplified48.4%
Taylor expanded in y around 0 22.5%
clear-num23.2%
inv-pow23.2%
Applied egg-rr23.2%
unpow-123.2%
Simplified23.2%
(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 72.6%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in x around 0 48.4%
+-commutative48.4%
Simplified48.4%
Taylor expanded in y around 0 22.5%
(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 72.6%
*-commutative72.6%
associate-*l*72.6%
times-frac94.5%
+-commutative94.5%
+-commutative94.5%
associate-+r+94.5%
+-commutative94.5%
associate-+l+94.5%
Applied egg-rr94.5%
Taylor expanded in x around inf 38.9%
Taylor expanded in y around inf 4.3%
(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 2024110
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))