
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (* (/ y (+ y (+ x 1.0))) (/ (/ x (+ y x)) (+ y x))))
double code(double x, double y) {
return (y / (y + (x + 1.0))) * ((x / (y + x)) / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + (x + 1.0d0))) * ((x / (y + x)) / (y + x))
end function
public static double code(double x, double y) {
return (y / (y + (x + 1.0))) * ((x / (y + x)) / (y + x));
}
def code(x, y): return (y / (y + (x + 1.0))) * ((x / (y + x)) / (y + x))
function code(x, y) return Float64(Float64(y / Float64(y + Float64(x + 1.0))) * Float64(Float64(x / Float64(y + x)) / Float64(y + x))) end
function tmp = code(x, y) tmp = (y / (y + (x + 1.0))) * ((x / (y + x)) / (y + x)); end
code[x_, y_] := N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{y + \left(x + 1\right)} \cdot \frac{\frac{x}{y + x}}{y + x}
\end{array}
Initial program 65.0%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
associate-*r/65.0%
associate-+r+65.0%
associate-*l*65.0%
associate-/r*70.7%
*-commutative70.7%
+-commutative70.7%
+-commutative70.7%
associate-+r+70.7%
+-commutative70.7%
associate-+l+70.7%
Applied egg-rr70.7%
associate-/l*94.4%
*-commutative94.4%
+-commutative94.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= y 1.8e-16)
(* (/ t_0 (+ y x)) (/ y (+ x 1.0)))
(if (<= y 4.2e+119)
(* x (/ y (* (* (+ y x) (+ y x)) (+ x (+ y 1.0)))))
(* t_0 (/ 1.0 (+ y (+ x 1.0))))))))
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (y <= 1.8e-16) {
tmp = (t_0 / (y + x)) * (y / (x + 1.0));
} else if (y <= 4.2e+119) {
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0))));
} else {
tmp = t_0 * (1.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 <= 1.8d-16) then
tmp = (t_0 / (y + x)) * (y / (x + 1.0d0))
else if (y <= 4.2d+119) then
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0d0))))
else
tmp = t_0 * (1.0d0 / (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 <= 1.8e-16) {
tmp = (t_0 / (y + x)) * (y / (x + 1.0));
} else if (y <= 4.2e+119) {
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0))));
} else {
tmp = t_0 * (1.0 / (y + (x + 1.0)));
}
return tmp;
}
def code(x, y): t_0 = x / (y + x) tmp = 0 if y <= 1.8e-16: tmp = (t_0 / (y + x)) * (y / (x + 1.0)) elif y <= 4.2e+119: tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0)))) else: tmp = t_0 * (1.0 / (y + (x + 1.0))) return tmp
function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (y <= 1.8e-16) tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(y / Float64(x + 1.0))); elseif (y <= 4.2e+119) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * Float64(y + x)) * Float64(x + Float64(y + 1.0))))); else tmp = Float64(t_0 * Float64(1.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 <= 1.8e-16) tmp = (t_0 / (y + x)) * (y / (x + 1.0)); elseif (y <= 4.2e+119) tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0)))); else tmp = t_0 * (1.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, 1.8e-16], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+119], N[(x * N[(y / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;y \leq 1.8 \cdot 10^{-16}:\\
\;\;\;\;\frac{t\_0}{y + x} \cdot \frac{y}{x + 1}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+119}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{y + \left(x + 1\right)}\\
\end{array}
\end{array}
if y < 1.79999999999999991e-16Initial program 64.4%
associate-/l*83.0%
associate-+l+83.0%
Simplified83.0%
associate-*r/64.4%
associate-+r+64.4%
associate-*l*64.4%
associate-/r*69.4%
*-commutative69.4%
+-commutative69.4%
+-commutative69.4%
associate-+r+69.4%
+-commutative69.4%
associate-+l+69.4%
Applied egg-rr69.4%
associate-/l*95.5%
*-commutative95.5%
+-commutative95.5%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 90.4%
+-commutative90.4%
Simplified90.4%
if 1.79999999999999991e-16 < y < 4.19999999999999966e119Initial program 74.6%
associate-/l*90.9%
associate-+l+90.9%
Simplified90.9%
if 4.19999999999999966e119 < y Initial program 61.0%
associate-/l*81.4%
associate-+l+81.4%
Simplified81.4%
associate-*r/61.0%
associate-+r+61.0%
associate-*l*61.0%
associate-/r*68.6%
*-commutative68.6%
+-commutative68.6%
+-commutative68.6%
associate-+r+68.6%
+-commutative68.6%
associate-+l+68.6%
Applied egg-rr68.6%
Taylor expanded in y around inf 88.1%
associate-/r*95.1%
+-commutative95.1%
+-commutative95.1%
div-inv95.1%
+-commutative95.1%
Applied egg-rr95.1%
Final simplification91.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))) (t_1 (/ x (+ y x))))
(if (<= y 2.05e-11)
(* (/ t_1 (+ y x)) (/ y (+ x 1.0)))
(if (<= y 1.9e+123) (/ x (* t_0 (+ y x))) (* t_1 (/ 1.0 t_0))))))
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double t_1 = x / (y + x);
double tmp;
if (y <= 2.05e-11) {
tmp = (t_1 / (y + x)) * (y / (x + 1.0));
} else if (y <= 1.9e+123) {
tmp = x / (t_0 * (y + x));
} else {
tmp = t_1 * (1.0 / 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) :: tmp
t_0 = y + (x + 1.0d0)
t_1 = x / (y + x)
if (y <= 2.05d-11) then
tmp = (t_1 / (y + x)) * (y / (x + 1.0d0))
else if (y <= 1.9d+123) then
tmp = x / (t_0 * (y + x))
else
tmp = t_1 * (1.0d0 / 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);
double tmp;
if (y <= 2.05e-11) {
tmp = (t_1 / (y + x)) * (y / (x + 1.0));
} else if (y <= 1.9e+123) {
tmp = x / (t_0 * (y + x));
} else {
tmp = t_1 * (1.0 / t_0);
}
return tmp;
}
def code(x, y): t_0 = y + (x + 1.0) t_1 = x / (y + x) tmp = 0 if y <= 2.05e-11: tmp = (t_1 / (y + x)) * (y / (x + 1.0)) elif y <= 1.9e+123: tmp = x / (t_0 * (y + x)) else: tmp = t_1 * (1.0 / t_0) return tmp
function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) t_1 = Float64(x / Float64(y + x)) tmp = 0.0 if (y <= 2.05e-11) tmp = Float64(Float64(t_1 / Float64(y + x)) * Float64(y / Float64(x + 1.0))); elseif (y <= 1.9e+123) tmp = Float64(x / Float64(t_0 * Float64(y + x))); else tmp = Float64(t_1 * Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (x + 1.0); t_1 = x / (y + x); tmp = 0.0; if (y <= 2.05e-11) tmp = (t_1 / (y + x)) * (y / (x + 1.0)); elseif (y <= 1.9e+123) tmp = x / (t_0 * (y + x)); else tmp = t_1 * (1.0 / 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[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.05e-11], N[(N[(t$95$1 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+123], N[(x / N[(t$95$0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
t_1 := \frac{x}{y + x}\\
\mathbf{if}\;y \leq 2.05 \cdot 10^{-11}:\\
\;\;\;\;\frac{t\_1}{y + x} \cdot \frac{y}{x + 1}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+123}:\\
\;\;\;\;\frac{x}{t\_0 \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{1}{t\_0}\\
\end{array}
\end{array}
if y < 2.05e-11Initial program 64.6%
associate-/l*83.1%
associate-+l+83.0%
Simplified83.0%
associate-*r/64.6%
associate-+r+64.6%
associate-*l*64.6%
associate-/r*69.6%
*-commutative69.6%
+-commutative69.6%
+-commutative69.6%
associate-+r+69.6%
+-commutative69.6%
associate-+l+69.6%
Applied egg-rr69.6%
associate-/l*95.5%
*-commutative95.5%
+-commutative95.5%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 90.5%
+-commutative90.5%
Simplified90.5%
if 2.05e-11 < y < 1.89999999999999997e123Initial program 73.8%
associate-/l*90.6%
associate-+l+90.6%
Simplified90.6%
associate-*r/73.8%
associate-+r+73.8%
associate-*l*73.9%
associate-/r*80.1%
*-commutative80.1%
+-commutative80.1%
+-commutative80.1%
associate-+r+80.1%
+-commutative80.1%
associate-+l+80.1%
Applied egg-rr80.1%
Taylor expanded in y around inf 89.3%
if 1.89999999999999997e123 < y Initial program 61.0%
associate-/l*81.4%
associate-+l+81.4%
Simplified81.4%
associate-*r/61.0%
associate-+r+61.0%
associate-*l*61.0%
associate-/r*68.6%
*-commutative68.6%
+-commutative68.6%
+-commutative68.6%
associate-+r+68.6%
+-commutative68.6%
associate-+l+68.6%
Applied egg-rr68.6%
Taylor expanded in y around inf 88.1%
associate-/r*95.1%
+-commutative95.1%
+-commutative95.1%
div-inv95.1%
+-commutative95.1%
Applied egg-rr95.1%
Final simplification91.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= y 3.5e-239)
(/ (/ y x) (+ x 1.0))
(if (<= y 1.9e+123)
(/ x (* t_0 (+ y x)))
(* (/ x (+ y x)) (/ 1.0 t_0))))))
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (y <= 3.5e-239) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1.9e+123) {
tmp = x / (t_0 * (y + x));
} else {
tmp = (x / (y + x)) * (1.0 / 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) :: tmp
t_0 = y + (x + 1.0d0)
if (y <= 3.5d-239) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 1.9d+123) then
tmp = x / (t_0 * (y + x))
else
tmp = (x / (y + x)) * (1.0d0 / t_0)
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 <= 3.5e-239) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1.9e+123) {
tmp = x / (t_0 * (y + x));
} else {
tmp = (x / (y + x)) * (1.0 / t_0);
}
return tmp;
}
def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if y <= 3.5e-239: tmp = (y / x) / (x + 1.0) elif y <= 1.9e+123: tmp = x / (t_0 * (y + x)) else: tmp = (x / (y + x)) * (1.0 / t_0) return tmp
function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (y <= 3.5e-239) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 1.9e+123) tmp = Float64(x / Float64(t_0 * Float64(y + x))); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (x + 1.0); tmp = 0.0; if (y <= 3.5e-239) tmp = (y / x) / (x + 1.0); elseif (y <= 1.9e+123) tmp = x / (t_0 * (y + x)); else tmp = (x / (y + x)) * (1.0 / t_0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.5e-239], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+123], N[(x / N[(t$95$0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;y \leq 3.5 \cdot 10^{-239}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+123}:\\
\;\;\;\;\frac{x}{t\_0 \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{t\_0}\\
\end{array}
\end{array}
if y < 3.50000000000000005e-239Initial program 63.4%
associate-/l*83.5%
associate-+l+83.5%
Simplified83.5%
Taylor expanded in y around 0 59.6%
associate-/r*56.9%
+-commutative56.9%
Simplified56.9%
if 3.50000000000000005e-239 < y < 1.89999999999999997e123Initial program 71.3%
associate-/l*85.5%
associate-+l+85.5%
Simplified85.5%
associate-*r/71.3%
associate-+r+71.3%
associate-*l*71.4%
associate-/r*75.8%
*-commutative75.8%
+-commutative75.8%
+-commutative75.8%
associate-+r+75.8%
+-commutative75.8%
associate-+l+75.8%
Applied egg-rr75.8%
Taylor expanded in y around inf 78.3%
if 1.89999999999999997e123 < y Initial program 61.0%
associate-/l*81.4%
associate-+l+81.4%
Simplified81.4%
associate-*r/61.0%
associate-+r+61.0%
associate-*l*61.0%
associate-/r*68.6%
*-commutative68.6%
+-commutative68.6%
+-commutative68.6%
associate-+r+68.6%
+-commutative68.6%
associate-+l+68.6%
Applied egg-rr68.6%
Taylor expanded in y around inf 88.1%
associate-/r*95.1%
+-commutative95.1%
+-commutative95.1%
div-inv95.1%
+-commutative95.1%
Applied egg-rr95.1%
Final simplification69.7%
(FPCore (x y) :precision binary64 (if (<= x -5.2e+73) (* (/ (/ x (+ y x)) (+ y x)) (/ y x)) (* x (/ (/ (/ y (+ y x)) (+ y (+ x 1.0))) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -5.2e+73) {
tmp = ((x / (y + x)) / (y + x)) * (y / x);
} else {
tmp = x * (((y / (y + x)) / (y + (x + 1.0))) / (y + x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5.2d+73)) then
tmp = ((x / (y + x)) / (y + x)) * (y / x)
else
tmp = x * (((y / (y + x)) / (y + (x + 1.0d0))) / (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5.2e+73) {
tmp = ((x / (y + x)) / (y + x)) * (y / x);
} else {
tmp = x * (((y / (y + x)) / (y + (x + 1.0))) / (y + x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.2e+73: tmp = ((x / (y + x)) / (y + x)) * (y / x) else: tmp = x * (((y / (y + x)) / (y + (x + 1.0))) / (y + x)) return tmp
function code(x, y) tmp = 0.0 if (x <= -5.2e+73) tmp = Float64(Float64(Float64(x / Float64(y + x)) / Float64(y + x)) * Float64(y / x)); else tmp = Float64(x * Float64(Float64(Float64(y / Float64(y + x)) / Float64(y + Float64(x + 1.0))) / Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5.2e+73) tmp = ((x / (y + x)) / (y + x)) * (y / x); else tmp = x * (((y / (y + x)) / (y + (x + 1.0))) / (y + x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.2e+73], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+73}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\frac{y}{y + x}}{y + \left(x + 1\right)}}{y + x}\\
\end{array}
\end{array}
if x < -5.2000000000000001e73Initial program 47.2%
associate-/l*78.0%
associate-+l+78.0%
Simplified78.0%
associate-*r/47.2%
associate-+r+47.2%
associate-*l*47.2%
associate-/r*56.2%
*-commutative56.2%
+-commutative56.2%
+-commutative56.2%
associate-+r+56.2%
+-commutative56.2%
associate-+l+56.2%
Applied egg-rr56.2%
associate-/l*89.1%
*-commutative89.1%
+-commutative89.1%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 92.6%
if -5.2000000000000001e73 < x Initial program 69.5%
associate-/l*85.1%
associate-+l+85.0%
Simplified85.0%
*-un-lft-identity85.0%
associate-+r+85.1%
associate-*l*85.0%
times-frac94.5%
+-commutative94.5%
+-commutative94.5%
associate-+r+94.5%
+-commutative94.5%
associate-+l+94.5%
Applied egg-rr94.5%
associate-*l/94.5%
*-lft-identity94.5%
associate-/r*94.5%
+-commutative94.5%
Simplified94.5%
Final simplification94.1%
(FPCore (x y)
:precision binary64
(if (<= y 3.5e-239)
(/ (/ y x) (+ x 1.0))
(if (<= y 3.5e+151)
(/ x (* (+ y (+ x 1.0)) (+ y x)))
(* (/ 1.0 y) (/ x (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (y <= 3.5e-239) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 3.5e+151) {
tmp = x / ((y + (x + 1.0)) * (y + x));
} else {
tmp = (1.0 / y) * (x / (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.5d-239) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 3.5d+151) then
tmp = x / ((y + (x + 1.0d0)) * (y + x))
else
tmp = (1.0d0 / y) * (x / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.5e-239) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 3.5e+151) {
tmp = x / ((y + (x + 1.0)) * (y + x));
} else {
tmp = (1.0 / y) * (x / (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.5e-239: tmp = (y / x) / (x + 1.0) elif y <= 3.5e+151: tmp = x / ((y + (x + 1.0)) * (y + x)) else: tmp = (1.0 / y) * (x / (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 3.5e-239) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 3.5e+151) tmp = Float64(x / Float64(Float64(y + Float64(x + 1.0)) * Float64(y + x))); else tmp = Float64(Float64(1.0 / y) * Float64(x / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.5e-239) tmp = (y / x) / (x + 1.0); elseif (y <= 3.5e+151) tmp = x / ((y + (x + 1.0)) * (y + x)); else tmp = (1.0 / y) * (x / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.5e-239], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+151], N[(x / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{-239}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+151}:\\
\;\;\;\;\frac{x}{\left(y + \left(x + 1\right)\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if y < 3.50000000000000005e-239Initial program 63.4%
associate-/l*83.5%
associate-+l+83.5%
Simplified83.5%
Taylor expanded in y around 0 59.6%
associate-/r*56.9%
+-commutative56.9%
Simplified56.9%
if 3.50000000000000005e-239 < y < 3.5000000000000003e151Initial program 66.6%
associate-/l*81.3%
associate-+l+81.3%
Simplified81.3%
associate-*r/66.6%
associate-+r+66.6%
associate-*l*66.7%
associate-/r*76.1%
*-commutative76.1%
+-commutative76.1%
+-commutative76.1%
associate-+r+76.1%
+-commutative76.1%
associate-+l+76.1%
Applied egg-rr76.1%
Taylor expanded in y around inf 79.1%
if 3.5000000000000003e151 < y Initial program 67.4%
associate-/l*87.9%
associate-+l+87.9%
Simplified87.9%
Taylor expanded in x around 0 87.9%
+-commutative87.9%
Simplified87.9%
*-un-lft-identity87.9%
times-frac97.8%
Applied egg-rr97.8%
Final simplification70.1%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (* (/ y x) (/ 1.0 x)) (if (<= x -5.5e-29) (- (/ y x) y) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -5.5e-29) {
tmp = (y / 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 <= (-1.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-5.5d-29)) then
tmp = (y / 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 <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -5.5e-29) {
tmp = (y / x) - y;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) * (1.0 / x) elif x <= -5.5e-29: tmp = (y / x) - y else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -5.5e-29) tmp = Float64(Float64(y / 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 <= -1.0) tmp = (y / x) * (1.0 / x); elseif (x <= -5.5e-29) tmp = (y / x) - y; else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e-29], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 51.1%
associate-/l*75.2%
associate-+l+75.2%
Simplified75.2%
associate-*r/51.1%
associate-+r+51.1%
associate-*l*51.1%
associate-/r*64.9%
*-commutative64.9%
+-commutative64.9%
+-commutative64.9%
associate-+r+64.9%
+-commutative64.9%
associate-+l+64.9%
Applied egg-rr64.9%
associate-/l*91.6%
*-commutative91.6%
+-commutative91.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 85.9%
Taylor expanded in x around inf 67.2%
if -1 < x < -5.4999999999999999e-29Initial program 79.9%
associate-/l*89.6%
associate-+l+89.5%
Simplified89.5%
Taylor expanded in y around 0 59.6%
associate-/r*59.8%
+-commutative59.8%
Simplified59.8%
Taylor expanded in x around 0 55.0%
associate-*r*55.0%
mul-1-neg55.0%
Simplified55.0%
Taylor expanded in x around inf 55.0%
neg-mul-155.0%
+-commutative55.0%
unsub-neg55.0%
Simplified55.0%
if -5.4999999999999999e-29 < x Initial program 69.5%
associate-/l*86.5%
associate-+l+86.5%
Simplified86.5%
Taylor expanded in x around 0 65.1%
+-commutative65.1%
Simplified65.1%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (* (/ y x) (/ 1.0 x)) (if (<= x -6e-158) (- (/ y x) y) (/ x y))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -6e-158) {
tmp = (y / 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 <= (-1.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-6d-158)) then
tmp = (y / x) - y
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -6e-158) {
tmp = (y / x) - y;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) * (1.0 / x) elif x <= -6e-158: tmp = (y / x) - y else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -6e-158) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = (y / x) * (1.0 / x); elseif (x <= -6e-158) tmp = (y / x) - y; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6e-158], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-158}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1Initial program 51.1%
associate-/l*75.2%
associate-+l+75.2%
Simplified75.2%
associate-*r/51.1%
associate-+r+51.1%
associate-*l*51.1%
associate-/r*64.9%
*-commutative64.9%
+-commutative64.9%
+-commutative64.9%
associate-+r+64.9%
+-commutative64.9%
associate-+l+64.9%
Applied egg-rr64.9%
associate-/l*91.6%
*-commutative91.6%
+-commutative91.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 85.9%
Taylor expanded in x around inf 67.2%
if -1 < x < -6e-158Initial program 83.7%
associate-/l*96.5%
associate-+l+96.5%
Simplified96.5%
Taylor expanded in y around 0 40.9%
associate-/r*40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in x around 0 39.4%
associate-*r*39.4%
mul-1-neg39.4%
Simplified39.4%
Taylor expanded in x around inf 39.4%
neg-mul-139.4%
+-commutative39.4%
unsub-neg39.4%
Simplified39.4%
if -6e-158 < x Initial program 67.5%
associate-/l*84.9%
associate-+l+84.9%
Simplified84.9%
Taylor expanded in x around 0 64.5%
+-commutative64.5%
Simplified64.5%
Taylor expanded in y around 0 41.3%
(FPCore (x y) :precision binary64 (if (<= y 3.5e-94) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) y)))
double code(double x, double y) {
double tmp;
if (y <= 3.5e-94) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.5d-94) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.5e-94) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.5e-94: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + 1.0)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 3.5e-94) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.5e-94) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + 1.0)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.5e-94], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{-94}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if y < 3.49999999999999998e-94Initial program 63.7%
associate-/l*82.3%
associate-+l+82.3%
Simplified82.3%
Taylor expanded in y around 0 60.6%
associate-/r*58.3%
+-commutative58.3%
Simplified58.3%
if 3.49999999999999998e-94 < y Initial program 67.2%
associate-/l*86.0%
associate-+l+86.0%
Simplified86.0%
Taylor expanded in x around 0 76.2%
+-commutative76.2%
Simplified76.2%
*-un-lft-identity76.2%
times-frac80.8%
Applied egg-rr80.8%
associate-*l/80.9%
*-un-lft-identity80.9%
Applied egg-rr80.9%
(FPCore (x y) :precision binary64 (if (<= y 2.1e-94) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y)))
double code(double x, double y) {
double tmp;
if (y <= 2.1e-94) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.1d-94) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.1e-94) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.1e-94: tmp = y / (x * (x + 1.0)) else: tmp = (x / (y + 1.0)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 2.1e-94) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.1e-94) tmp = y / (x * (x + 1.0)); else tmp = (x / (y + 1.0)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.1e-94], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{-94}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if y < 2.1000000000000001e-94Initial program 63.7%
associate-/l*82.3%
associate-+l+82.3%
Simplified82.3%
Taylor expanded in y around 0 60.6%
if 2.1000000000000001e-94 < y Initial program 67.2%
associate-/l*86.0%
associate-+l+86.0%
Simplified86.0%
Taylor expanded in x around 0 76.2%
+-commutative76.2%
Simplified76.2%
*-un-lft-identity76.2%
times-frac80.8%
Applied egg-rr80.8%
associate-*l/80.9%
*-un-lft-identity80.9%
Applied egg-rr80.9%
Final simplification67.9%
(FPCore (x y) :precision binary64 (if (<= y 3.5e-94) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 3.5e-94) {
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 <= 3.5d-94) 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 <= 3.5e-94) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.5e-94: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 3.5e-94) 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 <= 3.5e-94) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.5e-94], 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 3.5 \cdot 10^{-94}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 3.49999999999999998e-94Initial program 63.7%
associate-/l*82.3%
associate-+l+82.3%
Simplified82.3%
Taylor expanded in y around 0 60.6%
if 3.49999999999999998e-94 < y Initial program 67.2%
associate-/l*86.0%
associate-+l+86.0%
Simplified86.0%
Taylor expanded in x around 0 76.2%
+-commutative76.2%
Simplified76.2%
Final simplification66.2%
(FPCore (x y) :precision binary64 (if (<= y 3.5e-239) (- (/ y x) y) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 3.5e-239) {
tmp = (y / 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 (y <= 3.5d-239) then
tmp = (y / x) - y
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.5e-239) {
tmp = (y / x) - y;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.5e-239: tmp = (y / x) - y else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 3.5e-239) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.5e-239) tmp = (y / x) - y; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.5e-239], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{-239}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 3.50000000000000005e-239Initial program 63.4%
associate-/l*83.5%
associate-+l+83.5%
Simplified83.5%
Taylor expanded in y around 0 59.6%
associate-/r*56.9%
+-commutative56.9%
Simplified56.9%
Taylor expanded in x around 0 18.4%
associate-*r*18.4%
mul-1-neg18.4%
Simplified18.4%
Taylor expanded in x around inf 18.5%
neg-mul-118.5%
+-commutative18.5%
unsub-neg18.5%
Simplified18.5%
if 3.50000000000000005e-239 < y Initial program 66.9%
associate-/l*83.8%
associate-+l+83.8%
Simplified83.8%
Taylor expanded in x around 0 67.7%
+-commutative67.7%
Simplified67.7%
Taylor expanded in y around 0 36.4%
(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 65.0%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in x around 0 55.5%
+-commutative55.5%
Simplified55.5%
Taylor expanded in y around 0 29.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 65.0%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
associate-*r/65.0%
associate-+r+65.0%
associate-*l*65.0%
associate-/r*70.7%
*-commutative70.7%
+-commutative70.7%
+-commutative70.7%
associate-+r+70.7%
+-commutative70.7%
associate-+l+70.7%
Applied egg-rr70.7%
associate-/l*94.4%
*-commutative94.4%
+-commutative94.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 48.9%
Taylor expanded in y around inf 4.4%
(FPCore (x y) :precision binary64 (- y))
double code(double x, double y) {
return -y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -y
end function
public static double code(double x, double y) {
return -y;
}
def code(x, y): return -y
function code(x, y) return Float64(-y) end
function tmp = code(x, y) tmp = -y; end
code[x_, y_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 65.0%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in y around 0 47.0%
associate-/r*44.8%
+-commutative44.8%
Simplified44.8%
Taylor expanded in x around 0 12.5%
associate-*r*12.5%
mul-1-neg12.5%
Simplified12.5%
Taylor expanded in x around inf 3.7%
neg-mul-13.7%
Simplified3.7%
(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 2024091
(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))))