
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (* (/ y (+ y x)) (/ (/ x (+ x (+ y 1.0))) (+ y x))))
double code(double x, double y) {
return (y / (y + x)) * ((x / (x + (y + 1.0))) / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + x)) * ((x / (x + (y + 1.0d0))) / (y + x))
end function
public static double code(double x, double y) {
return (y / (y + x)) * ((x / (x + (y + 1.0))) / (y + x));
}
def code(x, y): return (y / (y + x)) * ((x / (x + (y + 1.0))) / (y + x))
function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(x + Float64(y + 1.0))) / Float64(y + x))) end
function tmp = code(x, y) tmp = (y / (y + x)) * ((x / (x + (y + 1.0))) / (y + x)); end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{x + \left(y + 1\right)}}{y + x}
\end{array}
Initial program 68.6%
associate-+r+68.6%
*-commutative68.6%
frac-times89.4%
associate-*l/82.9%
times-frac99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(if (<= y 2.2e-23)
(* (/ y (+ y x)) (/ (/ x (+ x 1.0)) (+ y x)))
(if (<= y 1.7e+122)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x (+ y 1.0))))
(/ (/ x (+ y x)) y))))
double code(double x, double y) {
double tmp;
if (y <= 2.2e-23) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else if (y <= 1.7e+122) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.2d-23) then
tmp = (y / (y + x)) * ((x / (x + 1.0d0)) / (y + x))
else if (y <= 1.7d+122) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0d0)))
else
tmp = (x / (y + x)) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.2e-23) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else if (y <= 1.7e+122) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.2e-23: tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x)) elif y <= 1.7e+122: tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0))) else: tmp = (x / (y + x)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 2.2e-23) tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(x + 1.0)) / Float64(y + x))); elseif (y <= 1.7e+122) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + x)) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.2e-23) tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x)); elseif (y <= 1.7e+122) tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0))); else tmp = (x / (y + x)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.2e-23], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+122], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-23}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+122}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y}\\
\end{array}
\end{array}
if y < 2.1999999999999999e-23Initial program 67.5%
associate-+r+67.5%
*-commutative67.5%
frac-times88.6%
associate-*l/80.6%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 82.5%
+-commutative82.5%
Simplified82.5%
if 2.1999999999999999e-23 < y < 1.7e122Initial program 81.6%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
if 1.7e122 < y Initial program 67.4%
associate-/r*70.7%
+-commutative70.7%
+-commutative70.7%
+-commutative70.7%
associate-/r*67.4%
associate-*l/84.2%
*-commutative84.2%
*-commutative84.2%
distribute-rgt1-in84.0%
fma-def84.2%
+-commutative84.2%
+-commutative84.2%
cube-unmult84.2%
+-commutative84.2%
Simplified84.2%
associate-*r/67.4%
fma-udef67.4%
cube-mult67.4%
distribute-rgt1-in67.4%
associate-+r+67.4%
*-commutative67.4%
*-commutative67.4%
frac-times87.5%
associate-/r*99.9%
clear-num99.9%
frac-times100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 93.0%
Final simplification85.0%
(FPCore (x y)
:precision binary64
(if (<= x -2.1e+167)
(/ (/ y (+ x (+ y 1.0))) x)
(if (<= x -4.1e-156)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x 1.0)))
(/ (/ x (+ y x)) (+ y (+ x (- x -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= -2.1e+167) {
tmp = (y / (x + (y + 1.0))) / x;
} else if (x <= -4.1e-156) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + (x + (x - -1.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.1d+167)) then
tmp = (y / (x + (y + 1.0d0))) / x
else if (x <= (-4.1d-156)) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0d0))
else
tmp = (x / (y + x)) / (y + (x + (x - (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.1e+167) {
tmp = (y / (x + (y + 1.0))) / x;
} else if (x <= -4.1e-156) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + (x + (x - -1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.1e+167: tmp = (y / (x + (y + 1.0))) / x elif x <= -4.1e-156: tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)) else: tmp = (x / (y + x)) / (y + (x + (x - -1.0))) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.1e+167) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / x); elseif (x <= -4.1e-156) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + Float64(x + Float64(x - -1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.1e+167) tmp = (y / (x + (y + 1.0))) / x; elseif (x <= -4.1e-156) tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)); else tmp = (x / (y + x)) / (y + (x + (x - -1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.1e+167], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -4.1e-156], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+167}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x}\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-156}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + \left(x - -1\right)\right)}\\
\end{array}
\end{array}
if x < -2.0999999999999999e167Initial program 53.3%
times-frac85.9%
associate-+l+85.9%
Simplified85.9%
Taylor expanded in x around inf 87.7%
associate-*l/87.7%
*-un-lft-identity87.7%
+-commutative87.7%
Applied egg-rr87.7%
if -2.0999999999999999e167 < x < -4.1000000000000002e-156Initial program 76.4%
times-frac98.5%
associate-+l+98.5%
Simplified98.5%
Taylor expanded in y around 0 81.3%
+-commutative81.3%
Simplified81.3%
if -4.1000000000000002e-156 < x Initial program 68.0%
associate-/r*70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-/r*68.0%
associate-*l/82.2%
*-commutative82.2%
*-commutative82.2%
distribute-rgt1-in75.1%
fma-def82.2%
+-commutative82.2%
+-commutative82.2%
cube-unmult82.2%
+-commutative82.2%
Simplified82.2%
associate-*r/68.1%
fma-udef61.0%
cube-mult60.9%
distribute-rgt1-in68.0%
associate-+r+68.0%
*-commutative68.0%
*-commutative68.0%
frac-times85.9%
associate-/r*99.8%
clear-num99.7%
frac-times98.9%
*-un-lft-identity98.9%
Applied egg-rr98.9%
Taylor expanded in y around -inf 55.5%
mul-1-neg55.5%
unsub-neg55.5%
neg-mul-155.5%
+-commutative55.5%
unsub-neg55.5%
distribute-lft-in55.5%
metadata-eval55.5%
neg-mul-155.5%
unsub-neg55.5%
Simplified55.5%
Final simplification66.4%
(FPCore (x y)
:precision binary64
(if (<= x -5e+46)
(* (/ (/ x (+ x (+ y 1.0))) (+ y x)) (/ y x))
(if (<= x -6e-156)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x 1.0)))
(/ (/ x (+ y x)) (+ y (+ x (- x -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= -5e+46) {
tmp = ((x / (x + (y + 1.0))) / (y + x)) * (y / x);
} else if (x <= -6e-156) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + (x + (x - -1.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5d+46)) then
tmp = ((x / (x + (y + 1.0d0))) / (y + x)) * (y / x)
else if (x <= (-6d-156)) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0d0))
else
tmp = (x / (y + x)) / (y + (x + (x - (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5e+46) {
tmp = ((x / (x + (y + 1.0))) / (y + x)) * (y / x);
} else if (x <= -6e-156) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + (x + (x - -1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5e+46: tmp = ((x / (x + (y + 1.0))) / (y + x)) * (y / x) elif x <= -6e-156: tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)) else: tmp = (x / (y + x)) / (y + (x + (x - -1.0))) return tmp
function code(x, y) tmp = 0.0 if (x <= -5e+46) tmp = Float64(Float64(Float64(x / Float64(x + Float64(y + 1.0))) / Float64(y + x)) * Float64(y / x)); elseif (x <= -6e-156) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + Float64(x + Float64(x - -1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5e+46) tmp = ((x / (x + (y + 1.0))) / (y + x)) * (y / x); elseif (x <= -6e-156) tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)); else tmp = (x / (y + x)) / (y + (x + (x - -1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5e+46], N[(N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6e-156], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+46}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y + x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-156}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + \left(x - -1\right)\right)}\\
\end{array}
\end{array}
if x < -5.0000000000000002e46Initial program 57.1%
associate-+r+57.1%
*-commutative57.1%
frac-times90.7%
associate-*l/90.7%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 91.6%
if -5.0000000000000002e46 < x < -6e-156Initial program 85.1%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 74.8%
+-commutative74.8%
Simplified74.8%
if -6e-156 < x Initial program 68.0%
associate-/r*70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-/r*68.0%
associate-*l/82.2%
*-commutative82.2%
*-commutative82.2%
distribute-rgt1-in75.1%
fma-def82.2%
+-commutative82.2%
+-commutative82.2%
cube-unmult82.2%
+-commutative82.2%
Simplified82.2%
associate-*r/68.1%
fma-udef61.0%
cube-mult60.9%
distribute-rgt1-in68.0%
associate-+r+68.0%
*-commutative68.0%
*-commutative68.0%
frac-times85.9%
associate-/r*99.8%
clear-num99.7%
frac-times98.9%
*-un-lft-identity98.9%
Applied egg-rr98.9%
Taylor expanded in y around -inf 55.5%
mul-1-neg55.5%
unsub-neg55.5%
neg-mul-155.5%
+-commutative55.5%
unsub-neg55.5%
distribute-lft-in55.5%
metadata-eval55.5%
neg-mul-155.5%
unsub-neg55.5%
Simplified55.5%
Final simplification66.8%
(FPCore (x y)
:precision binary64
(if (<= y -2e-283)
(/ (/ y (+ x (+ y 1.0))) x)
(if (<= y 1.25e-28)
(/ (/ x (+ (+ x (/ x y)) 1.0)) (+ y x))
(/ (/ x (+ y x)) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -2e-283) {
tmp = (y / (x + (y + 1.0))) / x;
} else if (y <= 1.25e-28) {
tmp = (x / ((x + (x / y)) + 1.0)) / (y + x);
} 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 (y <= (-2d-283)) then
tmp = (y / (x + (y + 1.0d0))) / x
else if (y <= 1.25d-28) then
tmp = (x / ((x + (x / y)) + 1.0d0)) / (y + x)
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 (y <= -2e-283) {
tmp = (y / (x + (y + 1.0))) / x;
} else if (y <= 1.25e-28) {
tmp = (x / ((x + (x / y)) + 1.0)) / (y + x);
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2e-283: tmp = (y / (x + (y + 1.0))) / x elif y <= 1.25e-28: tmp = (x / ((x + (x / y)) + 1.0)) / (y + x) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -2e-283) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / x); elseif (y <= 1.25e-28) tmp = Float64(Float64(x / Float64(Float64(x + Float64(x / y)) + 1.0)) / Float64(y + x)); 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 (y <= -2e-283) tmp = (y / (x + (y + 1.0))) / x; elseif (y <= 1.25e-28) tmp = (x / ((x + (x / y)) + 1.0)) / (y + x); else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2e-283], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.25e-28], N[(N[(x / N[(N[(x + N[(x / y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-283}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-28}:\\
\;\;\;\;\frac{\frac{x}{\left(x + \frac{x}{y}\right) + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if y < -1.99999999999999989e-283Initial program 65.1%
times-frac91.3%
associate-+l+91.3%
Simplified91.3%
Taylor expanded in x around inf 51.4%
associate-*l/51.5%
*-un-lft-identity51.5%
+-commutative51.5%
Applied egg-rr51.5%
if -1.99999999999999989e-283 < y < 1.25e-28Initial program 70.7%
associate-+r+70.7%
*-commutative70.7%
frac-times83.8%
associate-*l/72.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
Simplified99.9%
associate-*r/99.9%
clear-num99.7%
frac-times98.0%
*-un-lft-identity98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Applied egg-rr98.0%
Taylor expanded in x around 0 80.8%
distribute-lft-in80.8%
*-rgt-identity80.8%
/-rgt-identity80.8%
times-frac80.8%
*-rgt-identity80.8%
*-lft-identity80.8%
Simplified80.8%
if 1.25e-28 < y Initial program 74.6%
associate-/r*80.0%
+-commutative80.0%
+-commutative80.0%
+-commutative80.0%
associate-/r*74.6%
associate-*l/86.4%
*-commutative86.4%
*-commutative86.4%
distribute-rgt1-in82.3%
fma-def86.4%
+-commutative86.4%
+-commutative86.4%
cube-unmult86.5%
+-commutative86.5%
Simplified86.5%
associate-*r/74.6%
fma-udef72.6%
cube-mult72.6%
distribute-rgt1-in74.6%
associate-+r+74.6%
*-commutative74.6%
*-commutative74.6%
frac-times93.1%
associate-/r*99.9%
clear-num99.9%
frac-times99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 76.6%
+-commutative76.6%
Simplified76.6%
Final simplification65.1%
(FPCore (x y)
:precision binary64
(if (<= y -1.4e-283)
(/ (/ y (+ x (+ y 1.0))) x)
(if (<= y 3.4e-14)
(/ (/ x (+ (+ x (/ x y)) 1.0)) (+ y x))
(/ (/ x (+ y x)) (- y (- (- -1.0 x) x))))))
double code(double x, double y) {
double tmp;
if (y <= -1.4e-283) {
tmp = (y / (x + (y + 1.0))) / x;
} else if (y <= 3.4e-14) {
tmp = (x / ((x + (x / y)) + 1.0)) / (y + x);
} else {
tmp = (x / (y + x)) / (y - ((-1.0 - x) - x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.4d-283)) then
tmp = (y / (x + (y + 1.0d0))) / x
else if (y <= 3.4d-14) then
tmp = (x / ((x + (x / y)) + 1.0d0)) / (y + x)
else
tmp = (x / (y + x)) / (y - (((-1.0d0) - x) - x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.4e-283) {
tmp = (y / (x + (y + 1.0))) / x;
} else if (y <= 3.4e-14) {
tmp = (x / ((x + (x / y)) + 1.0)) / (y + x);
} else {
tmp = (x / (y + x)) / (y - ((-1.0 - x) - x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.4e-283: tmp = (y / (x + (y + 1.0))) / x elif y <= 3.4e-14: tmp = (x / ((x + (x / y)) + 1.0)) / (y + x) else: tmp = (x / (y + x)) / (y - ((-1.0 - x) - x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.4e-283) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / x); elseif (y <= 3.4e-14) tmp = Float64(Float64(x / Float64(Float64(x + Float64(x / y)) + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y - Float64(Float64(-1.0 - x) - x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.4e-283) tmp = (y / (x + (y + 1.0))) / x; elseif (y <= 3.4e-14) tmp = (x / ((x + (x / y)) + 1.0)) / (y + x); else tmp = (x / (y + x)) / (y - ((-1.0 - x) - x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.4e-283], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.4e-14], N[(N[(x / N[(N[(x + N[(x / y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y - N[(N[(-1.0 - x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-283}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{x}{\left(x + \frac{x}{y}\right) + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y - \left(\left(-1 - x\right) - x\right)}\\
\end{array}
\end{array}
if y < -1.3999999999999999e-283Initial program 65.1%
times-frac91.3%
associate-+l+91.3%
Simplified91.3%
Taylor expanded in x around inf 51.4%
associate-*l/51.5%
*-un-lft-identity51.5%
+-commutative51.5%
Applied egg-rr51.5%
if -1.3999999999999999e-283 < y < 3.40000000000000003e-14Initial program 71.8%
associate-+r+71.8%
*-commutative71.8%
frac-times84.4%
associate-*l/73.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
Simplified99.9%
associate-*r/99.9%
clear-num99.7%
frac-times98.1%
*-un-lft-identity98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Applied egg-rr98.1%
Taylor expanded in x around 0 79.1%
distribute-lft-in79.1%
*-rgt-identity79.1%
/-rgt-identity79.1%
times-frac79.1%
*-rgt-identity79.1%
*-lft-identity79.1%
Simplified79.1%
if 3.40000000000000003e-14 < y Initial program 73.1%
associate-/r*78.7%
+-commutative78.7%
+-commutative78.7%
+-commutative78.7%
associate-/r*73.1%
associate-*l/85.6%
*-commutative85.6%
*-commutative85.6%
distribute-rgt1-in81.2%
fma-def85.6%
+-commutative85.6%
+-commutative85.6%
cube-unmult85.7%
+-commutative85.7%
Simplified85.7%
associate-*r/73.1%
fma-udef70.9%
cube-mult70.9%
distribute-rgt1-in73.1%
associate-+r+73.1%
*-commutative73.1%
*-commutative73.1%
frac-times92.7%
associate-/r*99.9%
clear-num99.9%
frac-times100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Taylor expanded in y around -inf 79.8%
mul-1-neg79.8%
unsub-neg79.8%
neg-mul-179.8%
+-commutative79.8%
unsub-neg79.8%
distribute-lft-in79.8%
metadata-eval79.8%
neg-mul-179.8%
unsub-neg79.8%
Simplified79.8%
Final simplification65.2%
(FPCore (x y) :precision binary64 (if (<= y 7e+15) (* (/ y (+ y x)) (/ (/ x (+ x 1.0)) (+ y x))) (/ (/ x (+ y x)) (+ y (+ x (- x -1.0))))))
double code(double x, double y) {
double tmp;
if (y <= 7e+15) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else {
tmp = (x / (y + x)) / (y + (x + (x - -1.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 7d+15) then
tmp = (y / (y + x)) * ((x / (x + 1.0d0)) / (y + x))
else
tmp = (x / (y + x)) / (y + (x + (x - (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 7e+15) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else {
tmp = (x / (y + x)) / (y + (x + (x - -1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7e+15: tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x)) else: tmp = (x / (y + x)) / (y + (x + (x - -1.0))) return tmp
function code(x, y) tmp = 0.0 if (y <= 7e+15) tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(x + 1.0)) / Float64(y + x))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + Float64(x + Float64(x - -1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 7e+15) tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x)); else tmp = (x / (y + x)) / (y + (x + (x - -1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7e+15], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{+15}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + \left(x - -1\right)\right)}\\
\end{array}
\end{array}
if y < 7e15Initial program 68.1%
associate-+r+68.1%
*-commutative68.1%
frac-times88.8%
associate-*l/80.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 82.3%
+-commutative82.3%
Simplified82.3%
if 7e15 < y Initial program 71.2%
associate-/r*77.4%
+-commutative77.4%
+-commutative77.4%
+-commutative77.4%
associate-/r*71.2%
associate-*l/84.6%
*-commutative84.6%
*-commutative84.6%
distribute-rgt1-in79.9%
fma-def84.6%
+-commutative84.6%
+-commutative84.6%
cube-unmult84.7%
+-commutative84.7%
Simplified84.7%
associate-*r/71.2%
fma-udef69.0%
cube-mult69.0%
distribute-rgt1-in71.2%
associate-+r+71.2%
*-commutative71.2%
*-commutative71.2%
frac-times92.2%
associate-/r*99.9%
clear-num99.9%
frac-times100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Taylor expanded in y around -inf 82.8%
mul-1-neg82.8%
unsub-neg82.8%
neg-mul-182.8%
+-commutative82.8%
unsub-neg82.8%
distribute-lft-in82.8%
metadata-eval82.8%
neg-mul-182.8%
unsub-neg82.8%
Simplified82.8%
Final simplification82.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y y))))
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -4.6e-91)
(- (/ y x) y)
(if (<= x -1.85e-138)
t_0
(if (<= x -7.5e-156)
(/ y x)
(if (<= x 1e-104) (/ x (+ y x)) t_0)))))))
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -4.6e-91) {
tmp = (y / x) - y;
} else if (x <= -1.85e-138) {
tmp = t_0;
} else if (x <= -7.5e-156) {
tmp = y / x;
} else if (x <= 1e-104) {
tmp = x / (y + x);
} else {
tmp = 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 = x / (y * y)
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-4.6d-91)) then
tmp = (y / x) - y
else if (x <= (-1.85d-138)) then
tmp = t_0
else if (x <= (-7.5d-156)) then
tmp = y / x
else if (x <= 1d-104) then
tmp = x / (y + x)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -4.6e-91) {
tmp = (y / x) - y;
} else if (x <= -1.85e-138) {
tmp = t_0;
} else if (x <= -7.5e-156) {
tmp = y / x;
} else if (x <= 1e-104) {
tmp = x / (y + x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (y * y) tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -4.6e-91: tmp = (y / x) - y elif x <= -1.85e-138: tmp = t_0 elif x <= -7.5e-156: tmp = y / x elif x <= 1e-104: tmp = x / (y + x) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -4.6e-91) tmp = Float64(Float64(y / x) - y); elseif (x <= -1.85e-138) tmp = t_0; elseif (x <= -7.5e-156) tmp = Float64(y / x); elseif (x <= 1e-104) tmp = Float64(x / Float64(y + x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y * y); tmp = 0.0; if (x <= -1.0) tmp = y / (x * x); elseif (x <= -4.6e-91) tmp = (y / x) - y; elseif (x <= -1.85e-138) tmp = t_0; elseif (x <= -7.5e-156) tmp = y / x; elseif (x <= 1e-104) tmp = x / (y + x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.6e-91], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -1.85e-138], t$95$0, If[LessEqual[x, -7.5e-156], N[(y / x), $MachinePrecision], If[LessEqual[x, 1e-104], N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{-91}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-138}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-156}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 10^{-104}:\\
\;\;\;\;\frac{x}{y + x}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1Initial program 61.8%
associate-/r*72.0%
+-commutative72.0%
+-commutative72.0%
+-commutative72.0%
associate-/r*61.8%
associate-*l/82.0%
*-commutative82.0%
*-commutative82.0%
distribute-rgt1-in34.3%
fma-def82.0%
+-commutative82.0%
+-commutative82.0%
cube-unmult82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in x around inf 77.3%
unpow277.3%
Simplified77.3%
if -1 < x < -4.59999999999999991e-91Initial program 86.6%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 43.9%
Taylor expanded in x around 0 43.9%
neg-mul-143.9%
+-commutative43.9%
unsub-neg43.9%
Simplified43.9%
if -4.59999999999999991e-91 < x < -1.84999999999999995e-138 or 9.99999999999999927e-105 < x Initial program 74.3%
associate-/r*78.4%
+-commutative78.4%
+-commutative78.4%
+-commutative78.4%
associate-/r*74.3%
associate-*l/87.3%
*-commutative87.3%
*-commutative87.3%
distribute-rgt1-in84.9%
fma-def87.3%
+-commutative87.3%
+-commutative87.3%
cube-unmult87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in y around inf 25.8%
unpow225.8%
Simplified25.8%
if -1.84999999999999995e-138 < x < -7.49999999999999959e-156Initial program 52.2%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 51.4%
Taylor expanded in x around 0 51.4%
if -7.49999999999999959e-156 < x < 9.99999999999999927e-105Initial program 64.2%
associate-+r+64.2%
*-commutative64.2%
frac-times79.8%
associate-*l/64.2%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 82.6%
+-commutative82.6%
Simplified82.6%
associate-*r/82.6%
clear-num82.6%
frac-times82.6%
*-un-lft-identity82.6%
+-commutative82.6%
+-commutative82.6%
+-commutative82.6%
Applied egg-rr82.6%
Taylor expanded in x around 0 65.8%
Final simplification53.2%
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -9e-91)
(- (/ y x) y)
(if (<= x -8e-140)
(/ x (* y y))
(if (<= x -8e-155)
(/ y x)
(if (<= x 6.6e-104) (/ x (+ y x)) (/ (/ x y) y)))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -9e-91) {
tmp = (y / x) - y;
} else if (x <= -8e-140) {
tmp = x / (y * y);
} else if (x <= -8e-155) {
tmp = y / x;
} else if (x <= 6.6e-104) {
tmp = x / (y + x);
} 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 (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-9d-91)) then
tmp = (y / x) - y
else if (x <= (-8d-140)) then
tmp = x / (y * y)
else if (x <= (-8d-155)) then
tmp = y / x
else if (x <= 6.6d-104) then
tmp = x / (y + x)
else
tmp = (x / y) / 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 <= -9e-91) {
tmp = (y / x) - y;
} else if (x <= -8e-140) {
tmp = x / (y * y);
} else if (x <= -8e-155) {
tmp = y / x;
} else if (x <= 6.6e-104) {
tmp = x / (y + x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -9e-91: tmp = (y / x) - y elif x <= -8e-140: tmp = x / (y * y) elif x <= -8e-155: tmp = y / x elif x <= 6.6e-104: tmp = x / (y + x) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -9e-91) tmp = Float64(Float64(y / x) - y); elseif (x <= -8e-140) tmp = Float64(x / Float64(y * y)); elseif (x <= -8e-155) tmp = Float64(y / x); elseif (x <= 6.6e-104) tmp = Float64(x / Float64(y + x)); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = y / (x * x); elseif (x <= -9e-91) tmp = (y / x) - y; elseif (x <= -8e-140) tmp = x / (y * y); elseif (x <= -8e-155) tmp = y / x; elseif (x <= 6.6e-104) tmp = x / (y + x); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9e-91], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -8e-140], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-155], N[(y / x), $MachinePrecision], If[LessEqual[x, 6.6e-104], N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-91}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-140}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1Initial program 61.8%
associate-/r*72.0%
+-commutative72.0%
+-commutative72.0%
+-commutative72.0%
associate-/r*61.8%
associate-*l/82.0%
*-commutative82.0%
*-commutative82.0%
distribute-rgt1-in34.3%
fma-def82.0%
+-commutative82.0%
+-commutative82.0%
cube-unmult82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in x around inf 77.3%
unpow277.3%
Simplified77.3%
if -1 < x < -8.99999999999999952e-91Initial program 86.6%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 43.9%
Taylor expanded in x around 0 43.9%
neg-mul-143.9%
+-commutative43.9%
unsub-neg43.9%
Simplified43.9%
if -8.99999999999999952e-91 < x < -7.9999999999999999e-140Initial program 99.8%
associate-/r*99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.8%
associate-*l/88.4%
*-commutative88.4%
*-commutative88.4%
distribute-rgt1-in88.4%
fma-def88.4%
+-commutative88.4%
+-commutative88.4%
cube-unmult88.4%
+-commutative88.4%
Simplified88.4%
Taylor expanded in y around inf 51.7%
unpow251.7%
Simplified51.7%
if -7.9999999999999999e-140 < x < -8.00000000000000011e-155Initial program 52.2%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 51.4%
Taylor expanded in x around 0 51.4%
if -8.00000000000000011e-155 < x < 6.60000000000000004e-104Initial program 64.2%
associate-+r+64.2%
*-commutative64.2%
frac-times79.8%
associate-*l/64.2%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 82.6%
+-commutative82.6%
Simplified82.6%
associate-*r/82.6%
clear-num82.6%
frac-times82.6%
*-un-lft-identity82.6%
+-commutative82.6%
+-commutative82.6%
+-commutative82.6%
Applied egg-rr82.6%
Taylor expanded in x around 0 65.8%
if 6.60000000000000004e-104 < x Initial program 71.8%
associate-/r*76.3%
+-commutative76.3%
+-commutative76.3%
+-commutative76.3%
associate-/r*71.8%
associate-*l/87.2%
*-commutative87.2%
*-commutative87.2%
distribute-rgt1-in84.6%
fma-def87.2%
+-commutative87.2%
+-commutative87.2%
cube-unmult87.2%
+-commutative87.2%
Simplified87.2%
associate-*r/71.8%
fma-udef69.3%
cube-mult69.2%
distribute-rgt1-in71.8%
associate-+r+71.8%
*-commutative71.8%
*-commutative71.8%
frac-times91.8%
associate-/r*99.8%
clear-num99.7%
frac-times98.1%
*-un-lft-identity98.1%
Applied egg-rr98.1%
Taylor expanded in y around inf 25.2%
Taylor expanded in x around 0 24.5%
Final simplification53.6%
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(* (/ y x) (/ 1.0 x))
(if (<= x -5.2e-91)
(- (/ y x) y)
(if (<= x -1.25e-138)
(/ x (* y y))
(if (<= x -8e-155)
(/ y x)
(if (<= x 2.5e-104) (/ x (+ y x)) (/ (/ x y) y)))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -5.2e-91) {
tmp = (y / x) - y;
} else if (x <= -1.25e-138) {
tmp = x / (y * y);
} else if (x <= -8e-155) {
tmp = y / x;
} else if (x <= 2.5e-104) {
tmp = x / (y + x);
} 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 (x <= (-1.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-5.2d-91)) then
tmp = (y / x) - y
else if (x <= (-1.25d-138)) then
tmp = x / (y * y)
else if (x <= (-8d-155)) then
tmp = y / x
else if (x <= 2.5d-104) then
tmp = x / (y + x)
else
tmp = (x / y) / 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 <= -5.2e-91) {
tmp = (y / x) - y;
} else if (x <= -1.25e-138) {
tmp = x / (y * y);
} else if (x <= -8e-155) {
tmp = y / x;
} else if (x <= 2.5e-104) {
tmp = x / (y + x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) * (1.0 / x) elif x <= -5.2e-91: tmp = (y / x) - y elif x <= -1.25e-138: tmp = x / (y * y) elif x <= -8e-155: tmp = y / x elif x <= 2.5e-104: tmp = x / (y + x) else: tmp = (x / y) / 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 <= -5.2e-91) tmp = Float64(Float64(y / x) - y); elseif (x <= -1.25e-138) tmp = Float64(x / Float64(y * y)); elseif (x <= -8e-155) tmp = Float64(y / x); elseif (x <= 2.5e-104) tmp = Float64(x / Float64(y + x)); else tmp = Float64(Float64(x / y) / 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 <= -5.2e-91) tmp = (y / x) - y; elseif (x <= -1.25e-138) tmp = x / (y * y); elseif (x <= -8e-155) tmp = y / x; elseif (x <= 2.5e-104) tmp = x / (y + x); else tmp = (x / y) / 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, -5.2e-91], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -1.25e-138], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-155], N[(y / x), $MachinePrecision], If[LessEqual[x, 2.5e-104], N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-91}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-138}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1Initial program 61.8%
times-frac92.3%
associate-+l+92.3%
Simplified92.3%
Taylor expanded in x around inf 79.5%
Taylor expanded in x around inf 78.1%
if -1 < x < -5.20000000000000028e-91Initial program 86.6%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 43.9%
Taylor expanded in x around 0 43.9%
neg-mul-143.9%
+-commutative43.9%
unsub-neg43.9%
Simplified43.9%
if -5.20000000000000028e-91 < x < -1.24999999999999997e-138Initial program 99.8%
associate-/r*99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.8%
associate-*l/88.4%
*-commutative88.4%
*-commutative88.4%
distribute-rgt1-in88.4%
fma-def88.4%
+-commutative88.4%
+-commutative88.4%
cube-unmult88.4%
+-commutative88.4%
Simplified88.4%
Taylor expanded in y around inf 51.7%
unpow251.7%
Simplified51.7%
if -1.24999999999999997e-138 < x < -8.00000000000000011e-155Initial program 52.2%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 51.4%
Taylor expanded in x around 0 51.4%
if -8.00000000000000011e-155 < x < 2.49999999999999989e-104Initial program 64.2%
associate-+r+64.2%
*-commutative64.2%
frac-times79.8%
associate-*l/64.2%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 82.6%
+-commutative82.6%
Simplified82.6%
associate-*r/82.6%
clear-num82.6%
frac-times82.6%
*-un-lft-identity82.6%
+-commutative82.6%
+-commutative82.6%
+-commutative82.6%
Applied egg-rr82.6%
Taylor expanded in x around 0 65.8%
if 2.49999999999999989e-104 < x Initial program 71.8%
associate-/r*76.3%
+-commutative76.3%
+-commutative76.3%
+-commutative76.3%
associate-/r*71.8%
associate-*l/87.2%
*-commutative87.2%
*-commutative87.2%
distribute-rgt1-in84.6%
fma-def87.2%
+-commutative87.2%
+-commutative87.2%
cube-unmult87.2%
+-commutative87.2%
Simplified87.2%
associate-*r/71.8%
fma-udef69.3%
cube-mult69.2%
distribute-rgt1-in71.8%
associate-+r+71.8%
*-commutative71.8%
*-commutative71.8%
frac-times91.8%
associate-/r*99.8%
clear-num99.7%
frac-times98.1%
*-un-lft-identity98.1%
Applied egg-rr98.1%
Taylor expanded in y around inf 25.2%
Taylor expanded in x around 0 24.5%
Final simplification53.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y y))))
(if (<= y -8e+144)
t_0
(if (<= y 3.4e-222)
(/ y x)
(if (<= y 52000000000.0) (/ x (+ y x)) t_0)))))
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -8e+144) {
tmp = t_0;
} else if (y <= 3.4e-222) {
tmp = y / x;
} else if (y <= 52000000000.0) {
tmp = x / (y + x);
} else {
tmp = 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 = x / (y * y)
if (y <= (-8d+144)) then
tmp = t_0
else if (y <= 3.4d-222) then
tmp = y / x
else if (y <= 52000000000.0d0) then
tmp = x / (y + x)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -8e+144) {
tmp = t_0;
} else if (y <= 3.4e-222) {
tmp = y / x;
} else if (y <= 52000000000.0) {
tmp = x / (y + x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (y * y) tmp = 0 if y <= -8e+144: tmp = t_0 elif y <= 3.4e-222: tmp = y / x elif y <= 52000000000.0: tmp = x / (y + x) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (y <= -8e+144) tmp = t_0; elseif (y <= 3.4e-222) tmp = Float64(y / x); elseif (y <= 52000000000.0) tmp = Float64(x / Float64(y + x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y * y); tmp = 0.0; if (y <= -8e+144) tmp = t_0; elseif (y <= 3.4e-222) tmp = y / x; elseif (y <= 52000000000.0) tmp = x / (y + x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8e+144], t$95$0, If[LessEqual[y, 3.4e-222], N[(y / x), $MachinePrecision], If[LessEqual[y, 52000000000.0], N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;y \leq -8 \cdot 10^{+144}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-222}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 52000000000:\\
\;\;\;\;\frac{x}{y + x}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -8.00000000000000019e144 or 5.2e10 < y Initial program 60.8%
associate-/r*64.3%
+-commutative64.3%
+-commutative64.3%
+-commutative64.3%
associate-/r*60.8%
associate-*l/82.0%
*-commutative82.0%
*-commutative82.0%
distribute-rgt1-in46.6%
fma-def82.0%
+-commutative82.0%
+-commutative82.0%
cube-unmult82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in y around inf 78.4%
unpow278.4%
Simplified78.4%
if -8.00000000000000019e144 < y < 3.4000000000000001e-222Initial program 67.4%
times-frac90.9%
associate-+l+90.9%
Simplified90.9%
Taylor expanded in y around 0 66.7%
Taylor expanded in x around 0 41.8%
if 3.4000000000000001e-222 < y < 5.2e10Initial program 83.4%
associate-+r+83.4%
*-commutative83.4%
frac-times90.5%
associate-*l/86.5%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 97.7%
+-commutative97.7%
Simplified97.7%
associate-*r/97.7%
clear-num97.5%
frac-times95.1%
*-un-lft-identity95.1%
+-commutative95.1%
+-commutative95.1%
+-commutative95.1%
Applied egg-rr95.1%
Taylor expanded in x around 0 28.6%
Final simplification50.3%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (* (/ y x) (/ 1.0 x)) (if (<= x -1.7e-90) (- (/ 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 <= -1.7e-90) {
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 <= (-1.7d-90)) 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 <= -1.7e-90) {
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 <= -1.7e-90: 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 <= -1.7e-90) 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 <= -1.7e-90) 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, -1.7e-90], 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 -1.7 \cdot 10^{-90}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 61.8%
times-frac92.3%
associate-+l+92.3%
Simplified92.3%
Taylor expanded in x around inf 79.5%
Taylor expanded in x around inf 78.1%
if -1 < x < -1.69999999999999997e-90Initial program 86.6%
times-frac99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 43.9%
Taylor expanded in x around 0 43.9%
neg-mul-143.9%
+-commutative43.9%
unsub-neg43.9%
Simplified43.9%
if -1.69999999999999997e-90 < x Initial program 69.2%
times-frac86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in x around 0 55.0%
+-commutative55.0%
Simplified55.0%
Final simplification60.2%
(FPCore (x y) :precision binary64 (if (<= x -1.85e+167) (* (/ y x) (/ 1.0 x)) (if (<= x -6.2e-91) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.85e+167) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -6.2e-91) {
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 <= (-1.85d+167)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-6.2d-91)) 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 <= -1.85e+167) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -6.2e-91) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.85e+167: tmp = (y / x) * (1.0 / x) elif x <= -6.2e-91: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.85e+167) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -6.2e-91) 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 <= -1.85e+167) tmp = (y / x) * (1.0 / x); elseif (x <= -6.2e-91) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.85e+167], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.2e-91], 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 -1.85 \cdot 10^{+167}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-91}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1.85e167Initial program 53.3%
times-frac85.9%
associate-+l+85.9%
Simplified85.9%
Taylor expanded in x around inf 87.7%
Taylor expanded in x around inf 87.5%
if -1.85e167 < x < -6.19999999999999962e-91Initial program 74.9%
times-frac98.2%
associate-+l+98.2%
Simplified98.2%
Taylor expanded in y around 0 62.5%
if -6.19999999999999962e-91 < x Initial program 69.2%
times-frac86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in x around 0 55.0%
+-commutative55.0%
Simplified55.0%
Final simplification60.5%
(FPCore (x y) :precision binary64 (if (<= y 4.2e-82) (/ (/ y (+ x 1.0)) x) (/ (/ x (+ y x)) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (y <= 4.2e-82) {
tmp = (y / (x + 1.0)) / x;
} 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 (y <= 4.2d-82) then
tmp = (y / (x + 1.0d0)) / x
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 (y <= 4.2e-82) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.2e-82: tmp = (y / (x + 1.0)) / x else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 4.2e-82) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); 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 (y <= 4.2e-82) tmp = (y / (x + 1.0)) / x; else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.2e-82], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if y < 4.2000000000000001e-82Initial program 65.3%
times-frac87.3%
associate-+l+87.3%
Simplified87.3%
Taylor expanded in y around 0 60.2%
*-un-lft-identity60.2%
times-frac61.5%
+-commutative61.5%
Applied egg-rr61.5%
associate-*l/61.6%
*-lft-identity61.6%
Simplified61.6%
if 4.2000000000000001e-82 < y Initial program 77.7%
associate-/r*82.7%
+-commutative82.7%
+-commutative82.7%
+-commutative82.7%
associate-/r*77.7%
associate-*l/88.9%
*-commutative88.9%
*-commutative88.9%
distribute-rgt1-in84.5%
fma-def88.9%
+-commutative88.9%
+-commutative88.9%
cube-unmult89.0%
+-commutative89.0%
Simplified89.0%
associate-*r/77.7%
fma-udef74.8%
cube-mult74.8%
distribute-rgt1-in77.7%
associate-+r+77.7%
*-commutative77.7%
*-commutative77.7%
frac-times94.9%
associate-/r*99.8%
clear-num99.8%
frac-times98.8%
*-un-lft-identity98.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 66.4%
+-commutative66.4%
Simplified66.4%
Final simplification62.9%
(FPCore (x y) :precision binary64 (if (<= y 4e-82) (/ (/ y (+ x (+ y 1.0))) x) (/ (/ x (+ y x)) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (y <= 4e-82) {
tmp = (y / (x + (y + 1.0))) / x;
} 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 (y <= 4d-82) then
tmp = (y / (x + (y + 1.0d0))) / x
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 (y <= 4e-82) {
tmp = (y / (x + (y + 1.0))) / x;
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4e-82: tmp = (y / (x + (y + 1.0))) / x else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 4e-82) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / x); 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 (y <= 4e-82) tmp = (y / (x + (y + 1.0))) / x; else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4e-82], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if y < 4e-82Initial program 65.3%
times-frac87.3%
associate-+l+87.3%
Simplified87.3%
Taylor expanded in x around inf 61.9%
associate-*l/61.9%
*-un-lft-identity61.9%
+-commutative61.9%
Applied egg-rr61.9%
if 4e-82 < y Initial program 77.7%
associate-/r*82.7%
+-commutative82.7%
+-commutative82.7%
+-commutative82.7%
associate-/r*77.7%
associate-*l/88.9%
*-commutative88.9%
*-commutative88.9%
distribute-rgt1-in84.5%
fma-def88.9%
+-commutative88.9%
+-commutative88.9%
cube-unmult89.0%
+-commutative89.0%
Simplified89.0%
associate-*r/77.7%
fma-udef74.8%
cube-mult74.8%
distribute-rgt1-in77.7%
associate-+r+77.7%
*-commutative77.7%
*-commutative77.7%
frac-times94.9%
associate-/r*99.8%
clear-num99.8%
frac-times98.8%
*-un-lft-identity98.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 66.4%
+-commutative66.4%
Simplified66.4%
Final simplification63.1%
(FPCore (x y) :precision binary64 (if (or (<= y -8e+144) (not (<= y 4.2e-34))) (/ x (* y y)) (/ y x)))
double code(double x, double y) {
double tmp;
if ((y <= -8e+144) || !(y <= 4.2e-34)) {
tmp = x / (y * y);
} else {
tmp = y / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-8d+144)) .or. (.not. (y <= 4.2d-34))) then
tmp = x / (y * y)
else
tmp = y / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -8e+144) || !(y <= 4.2e-34)) {
tmp = x / (y * y);
} else {
tmp = y / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -8e+144) or not (y <= 4.2e-34): tmp = x / (y * y) else: tmp = y / x return tmp
function code(x, y) tmp = 0.0 if ((y <= -8e+144) || !(y <= 4.2e-34)) tmp = Float64(x / Float64(y * y)); else tmp = Float64(y / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -8e+144) || ~((y <= 4.2e-34))) tmp = x / (y * y); else tmp = y / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -8e+144], N[Not[LessEqual[y, 4.2e-34]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(y / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+144} \lor \neg \left(y \leq 4.2 \cdot 10^{-34}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x}\\
\end{array}
\end{array}
if y < -8.00000000000000019e144 or 4.2000000000000002e-34 < y Initial program 64.4%
associate-/r*67.5%
+-commutative67.5%
+-commutative67.5%
+-commutative67.5%
associate-/r*64.4%
associate-*l/83.6%
*-commutative83.6%
*-commutative83.6%
distribute-rgt1-in51.5%
fma-def83.6%
+-commutative83.6%
+-commutative83.6%
cube-unmult83.6%
+-commutative83.6%
Simplified83.6%
Taylor expanded in y around inf 71.5%
unpow271.5%
Simplified71.5%
if -8.00000000000000019e144 < y < 4.2000000000000002e-34Initial program 70.8%
times-frac90.3%
associate-+l+90.3%
Simplified90.3%
Taylor expanded in y around 0 68.5%
Taylor expanded in x around 0 42.0%
Final simplification52.0%
(FPCore (x y) :precision binary64 (if (<= x -1.4e-90) (/ (/ y x) (+ x 1.0)) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.4e-90) {
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 <= (-1.4d-90)) 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 <= -1.4e-90) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.4e-90: tmp = (y / x) / (x + 1.0) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.4e-90) tmp = Float64(Float64(y / 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 <= -1.4e-90) tmp = (y / x) / (x + 1.0); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.4e-90], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-90}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1.3999999999999999e-90Initial program 67.6%
times-frac94.0%
associate-+l+94.0%
Simplified94.0%
Taylor expanded in y around 0 70.3%
associate-/r*70.9%
+-commutative70.9%
Simplified70.9%
if -1.3999999999999999e-90 < x Initial program 69.2%
times-frac86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in x around 0 55.0%
+-commutative55.0%
Simplified55.0%
Final simplification60.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 68.6%
times-frac89.4%
associate-+l+89.4%
Simplified89.4%
Taylor expanded in x around inf 54.7%
Taylor expanded in y around inf 4.2%
Final simplification4.2%
(FPCore (x y) :precision binary64 (/ y x))
double code(double x, double y) {
return y / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y / x
end function
public static double code(double x, double y) {
return y / x;
}
def code(x, y): return y / x
function code(x, y) return Float64(y / x) end
function tmp = code(x, y) tmp = y / x; end
code[x_, y_] := N[(y / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x}
\end{array}
Initial program 68.6%
times-frac89.4%
associate-+l+89.4%
Simplified89.4%
Taylor expanded in y around 0 53.9%
Taylor expanded in x around 0 28.8%
Final simplification28.8%
(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 2023279
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))