
(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 (/ (/ y (+ y x)) (* (/ (+ y x) x) (+ y (+ x 1.0)))))
double code(double x, double y) {
return (y / (y + x)) / (((y + x) / 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)) / (((y + x) / x) * (y + (x + 1.0d0)))
end function
public static double code(double x, double y) {
return (y / (y + x)) / (((y + x) / x) * (y + (x + 1.0)));
}
def code(x, y): return (y / (y + x)) / (((y + x) / x) * (y + (x + 1.0)))
function code(x, y) return Float64(Float64(y / Float64(y + x)) / Float64(Float64(Float64(y + x) / x) * Float64(y + Float64(x + 1.0)))) end
function tmp = code(x, y) tmp = (y / (y + x)) / (((y + x) / x) * (y + (x + 1.0))); end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] / x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{y + x}}{\frac{y + x}{x} \cdot \left(y + \left(x + 1\right)\right)}
\end{array}
Initial program 71.6%
associate-*l*71.6%
times-frac95.5%
+-commutative95.5%
+-commutative95.5%
associate-+r+95.5%
+-commutative95.5%
associate-+l+95.5%
Applied egg-rr95.5%
associate-/r*99.8%
+-commutative99.8%
associate-/r*95.5%
clear-num95.5%
associate-/r*99.8%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y)
:precision binary64
(if (<= x -4.2e+82)
(/ (/ y (+ y x)) (+ y x))
(if (<= x -1.75e-14)
(* x (/ y (* (* (+ y x) (+ y x)) (+ x (+ y 1.0)))))
(if (<= x 1.4e-14)
(/ x (* (+ y x) (/ (* (+ y x) (+ y 1.0)) y)))
(/ (/ x y) (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -4.2e+82) {
tmp = (y / (y + x)) / (y + x);
} else if (x <= -1.75e-14) {
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0))));
} else if (x <= 1.4e-14) {
tmp = x / ((y + x) * (((y + x) * (y + 1.0)) / 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 <= (-4.2d+82)) then
tmp = (y / (y + x)) / (y + x)
else if (x <= (-1.75d-14)) then
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0d0))))
else if (x <= 1.4d-14) then
tmp = x / ((y + x) * (((y + x) * (y + 1.0d0)) / 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 <= -4.2e+82) {
tmp = (y / (y + x)) / (y + x);
} else if (x <= -1.75e-14) {
tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0))));
} else if (x <= 1.4e-14) {
tmp = x / ((y + x) * (((y + x) * (y + 1.0)) / y));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.2e+82: tmp = (y / (y + x)) / (y + x) elif x <= -1.75e-14: tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0)))) elif x <= 1.4e-14: tmp = x / ((y + x) * (((y + x) * (y + 1.0)) / y)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.2e+82) tmp = Float64(Float64(y / Float64(y + x)) / Float64(y + x)); elseif (x <= -1.75e-14) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * Float64(y + x)) * Float64(x + Float64(y + 1.0))))); elseif (x <= 1.4e-14) tmp = Float64(x / Float64(Float64(y + x) * Float64(Float64(Float64(y + x) * Float64(y + 1.0)) / 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 <= -4.2e+82) tmp = (y / (y + x)) / (y + x); elseif (x <= -1.75e-14) tmp = x * (y / (((y + x) * (y + x)) * (x + (y + 1.0)))); elseif (x <= 1.4e-14) tmp = x / ((y + x) * (((y + x) * (y + 1.0)) / y)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.2e+82], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.75e-14], 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], If[LessEqual[x, 1.4e-14], N[(x / N[(N[(y + x), $MachinePrecision] * N[(N[(N[(y + x), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $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.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{y + x}\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \frac{\left(y + x\right) \cdot \left(y + 1\right)}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -4.2e82Initial program 58.8%
Taylor expanded in x around inf 58.8%
associate-*l*58.8%
+-commutative58.8%
times-frac87.4%
+-commutative87.4%
Applied egg-rr87.4%
associate-*r/87.4%
associate-*l/64.9%
associate-*r/87.4%
*-commutative87.4%
associate-*r/87.4%
associate-*l/87.4%
associate-/l*64.8%
times-frac85.5%
*-inverses85.5%
*-rgt-identity85.5%
Simplified85.5%
if -4.2e82 < x < -1.7500000000000001e-14Initial program 88.8%
associate-/l*88.6%
associate-+l+88.6%
Simplified88.6%
if -1.7500000000000001e-14 < x < 1.4e-14Initial program 73.4%
associate-*l*73.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.7%
frac-times99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
if 1.4e-14 < x Initial program 71.3%
associate-*l*71.3%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
associate-+r+88.2%
+-commutative88.2%
associate-+l+88.2%
Applied egg-rr88.2%
associate-/r*99.8%
+-commutative99.8%
associate-/r*88.2%
clear-num88.2%
associate-/r*99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 18.8%
associate-/r*18.1%
+-commutative18.1%
Simplified18.1%
Final simplification77.3%
(FPCore (x y)
:precision binary64
(if (<= x -5.2e+82)
(/ (/ y (+ y x)) (+ y x))
(if (<= x 5.8e-49)
(* x (/ (/ y (* (+ y x) (+ y (+ x 1.0)))) (+ y x)))
(/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -5.2e+82) {
tmp = (y / (y + x)) / (y + x);
} else if (x <= 5.8e-49) {
tmp = x * ((y / ((y + x) * (y + (x + 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 <= (-5.2d+82)) then
tmp = (y / (y + x)) / (y + x)
else if (x <= 5.8d-49) then
tmp = x * ((y / ((y + x) * (y + (x + 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 <= -5.2e+82) {
tmp = (y / (y + x)) / (y + x);
} else if (x <= 5.8e-49) {
tmp = x * ((y / ((y + x) * (y + (x + 1.0)))) / (y + x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.2e+82: tmp = (y / (y + x)) / (y + x) elif x <= 5.8e-49: tmp = x * ((y / ((y + x) * (y + (x + 1.0)))) / (y + x)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -5.2e+82) tmp = Float64(Float64(y / Float64(y + x)) / Float64(y + x)); elseif (x <= 5.8e-49) tmp = Float64(x * Float64(Float64(y / Float64(Float64(y + x) * Float64(y + Float64(x + 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 <= -5.2e+82) tmp = (y / (y + x)) / (y + x); elseif (x <= 5.8e-49) tmp = x * ((y / ((y + x) * (y + (x + 1.0)))) / (y + x)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.2e+82], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.8e-49], N[(x * N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{y + x}\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-49}:\\
\;\;\;\;x \cdot \frac{\frac{y}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -5.1999999999999997e82Initial program 58.8%
Taylor expanded in x around inf 58.8%
associate-*l*58.8%
+-commutative58.8%
times-frac87.4%
+-commutative87.4%
Applied egg-rr87.4%
associate-*r/87.4%
associate-*l/64.9%
associate-*r/87.4%
*-commutative87.4%
associate-*r/87.4%
associate-*l/87.4%
associate-/l*64.8%
times-frac85.5%
*-inverses85.5%
*-rgt-identity85.5%
Simplified85.5%
if -5.1999999999999997e82 < x < 5.8e-49Initial program 74.9%
associate-/l*85.1%
associate-+l+85.1%
Simplified85.1%
*-un-lft-identity85.1%
associate-+r+85.1%
associate-*l*85.1%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+l+99.6%
Applied egg-rr99.6%
+-commutative99.6%
Simplified99.6%
associate-*l/99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
if 5.8e-49 < x Initial program 72.1%
associate-*l*72.1%
times-frac89.1%
+-commutative89.1%
+-commutative89.1%
associate-+r+89.1%
+-commutative89.1%
associate-+l+89.1%
Applied egg-rr89.1%
associate-/r*99.8%
+-commutative99.8%
associate-/r*89.1%
clear-num89.1%
associate-/r*99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 20.6%
associate-/r*19.9%
+-commutative19.9%
Simplified19.9%
Final simplification76.8%
(FPCore (x y)
:precision binary64
(if (<= x -0.0016)
(/ (/ y x) (* (/ (+ y x) x) (+ x 1.0)))
(if (<= x 1.4e-14)
(* x (/ (/ (/ y (+ y x)) (+ y 1.0)) (+ y x)))
(/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -0.0016) {
tmp = (y / x) / (((y + x) / x) * (x + 1.0));
} else if (x <= 1.4e-14) {
tmp = x * (((y / (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 <= (-0.0016d0)) then
tmp = (y / x) / (((y + x) / x) * (x + 1.0d0))
else if (x <= 1.4d-14) then
tmp = x * (((y / (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 <= -0.0016) {
tmp = (y / x) / (((y + x) / x) * (x + 1.0));
} else if (x <= 1.4e-14) {
tmp = x * (((y / (y + x)) / (y + 1.0)) / (y + x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.0016: tmp = (y / x) / (((y + x) / x) * (x + 1.0)) elif x <= 1.4e-14: tmp = x * (((y / (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 <= -0.0016) tmp = Float64(Float64(y / x) / Float64(Float64(Float64(y + x) / x) * Float64(x + 1.0))); elseif (x <= 1.4e-14) tmp = Float64(x * Float64(Float64(Float64(y / Float64(y + 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 <= -0.0016) tmp = (y / x) / (((y + x) / x) * (x + 1.0)); elseif (x <= 1.4e-14) tmp = x * (((y / (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, -0.0016], N[(N[(y / x), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] / x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-14], N[(x * N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0016:\\
\;\;\;\;\frac{\frac{y}{x}}{\frac{y + x}{x} \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \frac{\frac{\frac{y}{y + x}}{y + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -0.00160000000000000008Initial program 67.1%
associate-*l*67.0%
times-frac93.0%
+-commutative93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+l+93.0%
Applied egg-rr93.0%
Taylor expanded in y around 0 77.5%
clear-num77.5%
associate-/r*77.7%
+-commutative77.7%
frac-times77.7%
*-un-lft-identity77.7%
Applied egg-rr77.7%
if -0.00160000000000000008 < x < 1.4e-14Initial program 73.6%
associate-*l*73.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
Simplified99.7%
associate-*l/99.7%
Applied egg-rr99.7%
associate-/l*99.6%
associate-/r*99.6%
Simplified99.6%
if 1.4e-14 < x Initial program 71.3%
associate-*l*71.3%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
associate-+r+88.2%
+-commutative88.2%
associate-+l+88.2%
Applied egg-rr88.2%
associate-/r*99.8%
+-commutative99.8%
associate-/r*88.2%
clear-num88.2%
associate-/r*99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 18.8%
associate-/r*18.1%
+-commutative18.1%
Simplified18.1%
Final simplification75.3%
(FPCore (x y)
:precision binary64
(if (<= x -0.00145)
(/ (/ y x) (* (/ (+ y x) x) (+ x 1.0)))
(if (<= x 6.4e-105)
(* (/ x (+ y x)) (/ y (* (+ y x) (+ y 1.0))))
(/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -0.00145) {
tmp = (y / x) / (((y + x) / x) * (x + 1.0));
} else if (x <= 6.4e-105) {
tmp = (x / (y + x)) * (y / ((y + x) * (y + 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 <= (-0.00145d0)) then
tmp = (y / x) / (((y + x) / x) * (x + 1.0d0))
else if (x <= 6.4d-105) then
tmp = (x / (y + x)) * (y / ((y + x) * (y + 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 <= -0.00145) {
tmp = (y / x) / (((y + x) / x) * (x + 1.0));
} else if (x <= 6.4e-105) {
tmp = (x / (y + x)) * (y / ((y + x) * (y + 1.0)));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.00145: tmp = (y / x) / (((y + x) / x) * (x + 1.0)) elif x <= 6.4e-105: tmp = (x / (y + x)) * (y / ((y + x) * (y + 1.0))) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -0.00145) tmp = Float64(Float64(y / x) / Float64(Float64(Float64(y + x) / x) * Float64(x + 1.0))); elseif (x <= 6.4e-105) tmp = Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + x) * Float64(y + 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 <= -0.00145) tmp = (y / x) / (((y + x) / x) * (x + 1.0)); elseif (x <= 6.4e-105) tmp = (x / (y + x)) * (y / ((y + x) * (y + 1.0))); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.00145], N[(N[(y / x), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] / x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.4e-105], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00145:\\
\;\;\;\;\frac{\frac{y}{x}}{\frac{y + x}{x} \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{-105}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -0.00145Initial program 67.1%
associate-*l*67.0%
times-frac93.0%
+-commutative93.0%
+-commutative93.0%
associate-+r+93.0%
+-commutative93.0%
associate-+l+93.0%
Applied egg-rr93.0%
Taylor expanded in y around 0 77.5%
clear-num77.5%
associate-/r*77.7%
+-commutative77.7%
frac-times77.7%
*-un-lft-identity77.7%
Applied egg-rr77.7%
if -0.00145 < x < 6.39999999999999962e-105Initial program 71.0%
associate-*l*71.0%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
Simplified99.7%
if 6.39999999999999962e-105 < x Initial program 75.8%
associate-*l*75.8%
times-frac91.0%
+-commutative91.0%
+-commutative91.0%
associate-+r+91.0%
+-commutative91.0%
associate-+l+91.0%
Applied egg-rr91.0%
associate-/r*99.8%
+-commutative99.8%
associate-/r*91.0%
clear-num90.9%
associate-/r*99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 29.4%
associate-/r*28.8%
+-commutative28.8%
Simplified28.8%
Final simplification72.6%
(FPCore (x y) :precision binary64 (if (<= x 6.4e-105) (* (/ y (* (+ y x) (+ y (+ x 1.0)))) (/ x (+ y x))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= 6.4e-105) {
tmp = (y / ((y + x) * (y + (x + 1.0)))) * (x / (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 <= 6.4d-105) then
tmp = (y / ((y + x) * (y + (x + 1.0d0)))) * (x / (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 <= 6.4e-105) {
tmp = (y / ((y + x) * (y + (x + 1.0)))) * (x / (y + x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 6.4e-105: tmp = (y / ((y + x) * (y + (x + 1.0)))) * (x / (y + x)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 6.4e-105) tmp = Float64(Float64(y / Float64(Float64(y + x) * Float64(y + Float64(x + 1.0)))) * Float64(x / 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 <= 6.4e-105) tmp = (y / ((y + x) * (y + (x + 1.0)))) * (x / (y + x)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 6.4e-105], N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.4 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)} \cdot \frac{x}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < 6.39999999999999962e-105Initial program 69.7%
associate-*l*69.7%
times-frac97.6%
+-commutative97.6%
+-commutative97.6%
associate-+r+97.6%
+-commutative97.6%
associate-+l+97.6%
Applied egg-rr97.6%
if 6.39999999999999962e-105 < x Initial program 75.8%
associate-*l*75.8%
times-frac91.0%
+-commutative91.0%
+-commutative91.0%
associate-+r+91.0%
+-commutative91.0%
associate-+l+91.0%
Applied egg-rr91.0%
associate-/r*99.8%
+-commutative99.8%
associate-/r*91.0%
clear-num90.9%
associate-/r*99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 29.4%
associate-/r*28.8%
+-commutative28.8%
Simplified28.8%
Final simplification76.1%
(FPCore (x y) :precision binary64 (if (<= x 1.4e-14) (/ (* x (/ y (* (+ y x) (+ y (+ x 1.0))))) (+ y x)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= 1.4e-14) {
tmp = (x * (y / ((y + x) * (y + (x + 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 <= 1.4d-14) then
tmp = (x * (y / ((y + x) * (y + (x + 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 <= 1.4e-14) {
tmp = (x * (y / ((y + x) * (y + (x + 1.0))))) / (y + x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.4e-14: tmp = (x * (y / ((y + x) * (y + (x + 1.0))))) / (y + x) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.4e-14) tmp = Float64(Float64(x * Float64(y / Float64(Float64(y + x) * Float64(y + Float64(x + 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 <= 1.4e-14) tmp = (x * (y / ((y + x) * (y + (x + 1.0))))) / (y + x); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.4e-14], N[(N[(x * N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $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.4 \cdot 10^{-14}:\\
\;\;\;\;\frac{x \cdot \frac{y}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < 1.4e-14Initial program 71.7%
associate-*l*71.6%
times-frac97.8%
+-commutative97.8%
+-commutative97.8%
associate-+r+97.8%
+-commutative97.8%
associate-+l+97.8%
Applied egg-rr97.8%
associate-*l/97.9%
associate-/r*99.8%
+-commutative99.8%
associate-/r*97.9%
Applied egg-rr97.9%
if 1.4e-14 < x Initial program 71.3%
associate-*l*71.3%
times-frac88.2%
+-commutative88.2%
+-commutative88.2%
associate-+r+88.2%
+-commutative88.2%
associate-+l+88.2%
Applied egg-rr88.2%
associate-/r*99.8%
+-commutative99.8%
associate-/r*88.2%
clear-num88.2%
associate-/r*99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 18.8%
associate-/r*18.1%
+-commutative18.1%
Simplified18.1%
Final simplification78.8%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (/ (/ y x) x) (if (<= x -1.45e-111) (/ y x) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -1.45e-111) {
tmp = 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 <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-1.45d-111)) then
tmp = 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 <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -1.45e-111) {
tmp = y / x;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) / x elif x <= -1.45e-111: tmp = y / x 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) / x); elseif (x <= -1.45e-111) tmp = Float64(y / x); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = (y / x) / x; elseif (x <= -1.45e-111) tmp = y / x; 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] / x), $MachinePrecision], If[LessEqual[x, -1.45e-111], N[(y / x), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-111}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 65.9%
associate-*l*65.8%
times-frac92.8%
+-commutative92.8%
+-commutative92.8%
associate-+r+92.8%
+-commutative92.8%
associate-+l+92.8%
Applied egg-rr92.8%
Taylor expanded in y around 0 76.8%
clear-num76.8%
associate-/r*76.8%
+-commutative76.8%
frac-times76.8%
*-un-lft-identity76.8%
Applied egg-rr76.8%
Taylor expanded in x around inf 72.9%
if -1 < x < -1.45000000000000001e-111Initial program 82.1%
associate-*l*81.9%
times-frac99.5%
+-commutative99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+l+99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 93.3%
+-commutative93.3%
Simplified93.3%
*-commutative93.3%
clear-num93.2%
frac-times93.2%
*-un-lft-identity93.2%
Applied egg-rr93.2%
Taylor expanded in y around 0 43.4%
if -1.45000000000000001e-111 < x Initial program 71.8%
associate-/l*81.9%
associate-+l+81.9%
Simplified81.9%
Taylor expanded in x around 0 56.4%
+-commutative56.4%
Simplified56.4%
Final simplification58.6%
(FPCore (x y) :precision binary64 (if (<= x -1.45e-111) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -1.45e-111) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.45d-111)) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.45e-111) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.45e-111: tmp = (y / (y + x)) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.45e-111) tmp = Float64(Float64(y / 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 <= -1.45e-111) tmp = (y / (y + x)) / (x + 1.0); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.45e-111], N[(N[(y / N[(y + x), $MachinePrecision]), $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 -1.45 \cdot 10^{-111}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.45000000000000001e-111Initial program 71.1%
associate-*l*71.0%
times-frac95.0%
+-commutative95.0%
+-commutative95.0%
associate-+r+95.0%
+-commutative95.0%
associate-+l+95.0%
Applied egg-rr95.0%
associate-/r*99.7%
+-commutative99.7%
associate-/r*95.0%
clear-num95.0%
associate-/r*99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 68.3%
+-commutative68.3%
Simplified68.3%
if -1.45000000000000001e-111 < x Initial program 71.8%
associate-*l*71.8%
times-frac95.8%
+-commutative95.8%
+-commutative95.8%
associate-+r+95.8%
+-commutative95.8%
associate-+l+95.8%
Applied egg-rr95.8%
associate-/r*99.8%
+-commutative99.8%
associate-/r*95.8%
clear-num95.7%
associate-/r*99.8%
frac-times99.6%
metadata-eval99.6%
times-frac99.6%
*-un-lft-identity99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 56.4%
associate-/r*56.1%
+-commutative56.1%
Simplified56.1%
Final simplification59.9%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (/ (/ y x) x) (if (<= x -2.85e-201) (/ y x) (/ x y))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -2.85e-201) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-2.85d-201)) then
tmp = y / x
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) / x;
} else if (x <= -2.85e-201) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) / x elif x <= -2.85e-201: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -2.85e-201) tmp = Float64(y / x); 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) / x; elseif (x <= -2.85e-201) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.85e-201], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.85 \cdot 10^{-201}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1Initial program 65.9%
associate-*l*65.8%
times-frac92.8%
+-commutative92.8%
+-commutative92.8%
associate-+r+92.8%
+-commutative92.8%
associate-+l+92.8%
Applied egg-rr92.8%
Taylor expanded in y around 0 76.8%
clear-num76.8%
associate-/r*76.8%
+-commutative76.8%
frac-times76.8%
*-un-lft-identity76.8%
Applied egg-rr76.8%
Taylor expanded in x around inf 72.9%
if -1 < x < -2.85e-201Initial program 76.4%
associate-*l*76.2%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+l+99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 96.3%
+-commutative96.3%
Simplified96.3%
*-commutative96.3%
clear-num96.2%
frac-times96.3%
*-un-lft-identity96.3%
Applied egg-rr96.3%
Taylor expanded in y around 0 36.3%
if -2.85e-201 < x Initial program 72.1%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 53.8%
+-commutative53.8%
Simplified53.8%
Taylor expanded in y around 0 35.6%
Final simplification43.8%
(FPCore (x y) :precision binary64 (if (<= y 2.2e-82) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 2.2e-82) {
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 <= 2.2d-82) 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 <= 2.2e-82) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.2e-82: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.2e-82) 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 <= 2.2e-82) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.2e-82], 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 2.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 2.19999999999999986e-82Initial program 69.9%
associate-/l*82.9%
associate-+l+82.9%
Simplified82.9%
Taylor expanded in y around 0 60.4%
if 2.19999999999999986e-82 < y Initial program 75.4%
associate-/l*84.6%
associate-+l+84.6%
Simplified84.6%
Taylor expanded in x around 0 67.5%
+-commutative67.5%
Simplified67.5%
Final simplification62.7%
(FPCore (x y) :precision binary64 (if (<= y 1.15e-82) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (y <= 1.15e-82) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.15d-82) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.15e-82) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.15e-82: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.15e-82) 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 (y <= 1.15e-82) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.15e-82], 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}\;y \leq 1.15 \cdot 10^{-82}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 1.14999999999999998e-82Initial program 69.9%
associate-/l*82.9%
associate-+l+82.9%
Simplified82.9%
Taylor expanded in y around 0 60.4%
if 1.14999999999999998e-82 < y Initial program 75.4%
associate-*l*75.4%
times-frac91.6%
+-commutative91.6%
+-commutative91.6%
associate-+r+91.6%
+-commutative91.6%
associate-+l+91.6%
Applied egg-rr91.6%
associate-/r*99.7%
+-commutative99.7%
associate-/r*91.6%
clear-num91.5%
associate-/r*99.6%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 67.5%
associate-/r*65.9%
+-commutative65.9%
Simplified65.9%
Final simplification62.1%
(FPCore (x y) :precision binary64 (if (<= x -8e-112) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -8e-112) {
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-112)) 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-112) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8e-112: 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-112) 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-112) 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-112], 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^{-112}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -7.9999999999999996e-112Initial program 71.1%
associate-/l*86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in y around 0 67.8%
associate-/r*67.9%
+-commutative67.9%
Simplified67.9%
if -7.9999999999999996e-112 < x Initial program 71.8%
associate-*l*71.8%
times-frac95.8%
+-commutative95.8%
+-commutative95.8%
associate-+r+95.8%
+-commutative95.8%
associate-+l+95.8%
Applied egg-rr95.8%
associate-/r*99.8%
+-commutative99.8%
associate-/r*95.8%
clear-num95.7%
associate-/r*99.8%
frac-times99.6%
metadata-eval99.6%
times-frac99.6%
*-un-lft-identity99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 56.4%
associate-/r*56.1%
+-commutative56.1%
Simplified56.1%
Final simplification59.8%
(FPCore (x y) :precision binary64 (if (<= x -3.05e-201) (/ y x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -3.05e-201) {
tmp = y / 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 <= (-3.05d-201)) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.05e-201) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.05e-201: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -3.05e-201) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.05e-201) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.05e-201], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.05 \cdot 10^{-201}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -3.05000000000000013e-201Initial program 70.8%
associate-*l*70.7%
times-frac96.0%
+-commutative96.0%
+-commutative96.0%
associate-+r+96.0%
+-commutative96.0%
associate-+l+96.0%
Applied egg-rr96.0%
Taylor expanded in x around 0 77.9%
+-commutative77.9%
Simplified77.9%
*-commutative77.9%
clear-num77.9%
frac-times85.8%
*-un-lft-identity85.8%
Applied egg-rr85.8%
Taylor expanded in y around 0 34.1%
if -3.05000000000000013e-201 < x Initial program 72.1%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 53.8%
+-commutative53.8%
Simplified53.8%
Taylor expanded in y around 0 35.6%
Final simplification35.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 71.6%
associate-*l*71.6%
times-frac95.5%
+-commutative95.5%
+-commutative95.5%
associate-+r+95.5%
+-commutative95.5%
associate-+l+95.5%
Applied egg-rr95.5%
Taylor expanded in y around inf 36.1%
Taylor expanded in x around inf 4.0%
Final simplification4.0%
(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 71.6%
associate-/l*83.5%
associate-+l+83.5%
Simplified83.5%
Taylor expanded in x around 0 49.7%
+-commutative49.7%
Simplified49.7%
Taylor expanded in y around 0 26.0%
Final simplification26.0%
(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.6%
associate-*l*71.6%
times-frac95.5%
+-commutative95.5%
+-commutative95.5%
associate-+r+95.5%
+-commutative95.5%
associate-+l+95.5%
Applied egg-rr95.5%
Taylor expanded in y around 0 51.3%
clear-num51.3%
associate-/r*52.4%
+-commutative52.4%
frac-times52.4%
*-un-lft-identity52.4%
Applied egg-rr52.4%
Taylor expanded in x around 0 3.5%
Final simplification3.5%
(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 2024084
(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))))