
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (* (/ y (+ y x)) (/ (/ x (+ y x)) (+ x (+ y 1.0)))))
double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0d0)))
end function
public static double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)));
}
def code(x, y): return (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)))
function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(x + Float64(y + 1.0)))) end
function tmp = code(x, y) tmp = (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0))); end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{x + \left(y + 1\right)}
\end{array}
Initial program 72.9%
+-commutative72.9%
+-commutative72.9%
+-commutative72.9%
*-commutative72.9%
distribute-rgt1-in61.5%
fma-define72.9%
+-commutative72.9%
+-commutative72.9%
cube-unmult72.9%
+-commutative72.9%
Simplified72.9%
*-commutative72.9%
fma-define61.5%
cube-mult61.5%
distribute-rgt1-in72.9%
*-commutative72.9%
associate-*l*72.9%
times-frac93.7%
associate-+r+93.7%
Applied egg-rr93.7%
clear-num93.7%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
*-lft-identity99.6%
Simplified99.6%
*-un-lft-identity99.6%
+-commutative99.6%
times-frac99.7%
+-commutative99.7%
clear-num99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))) (t_1 (+ x (+ y 1.0))))
(if (<= y 2e-289)
(/ (/ y (+ x 1.0)) (+ y x))
(if (<= y 5e-167)
(* (/ y (+ y x)) t_0)
(if (<= y 6.4e-13)
(* x (/ y (* (+ x 1.0) (* (+ y x) (+ y x)))))
(if (<= y 8e+116) (/ x (* (+ y x) t_1)) (/ t_0 t_1)))))))
double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= 2e-289) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 5e-167) {
tmp = (y / (y + x)) * t_0;
} else if (y <= 6.4e-13) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else if (y <= 8e+116) {
tmp = x / ((y + x) * t_1);
} else {
tmp = t_0 / t_1;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / (y + x)
t_1 = x + (y + 1.0d0)
if (y <= 2d-289) then
tmp = (y / (x + 1.0d0)) / (y + x)
else if (y <= 5d-167) then
tmp = (y / (y + x)) * t_0
else if (y <= 6.4d-13) then
tmp = x * (y / ((x + 1.0d0) * ((y + x) * (y + x))))
else if (y <= 8d+116) then
tmp = x / ((y + x) * t_1)
else
tmp = t_0 / t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= 2e-289) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 5e-167) {
tmp = (y / (y + x)) * t_0;
} else if (y <= 6.4e-13) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else if (y <= 8e+116) {
tmp = x / ((y + x) * t_1);
} else {
tmp = t_0 / t_1;
}
return tmp;
}
def code(x, y): t_0 = x / (y + x) t_1 = x + (y + 1.0) tmp = 0 if y <= 2e-289: tmp = (y / (x + 1.0)) / (y + x) elif y <= 5e-167: tmp = (y / (y + x)) * t_0 elif y <= 6.4e-13: tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x)))) elif y <= 8e+116: tmp = x / ((y + x) * t_1) else: tmp = t_0 / t_1 return tmp
function code(x, y) t_0 = Float64(x / Float64(y + x)) t_1 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 2e-289) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); elseif (y <= 5e-167) tmp = Float64(Float64(y / Float64(y + x)) * t_0); elseif (y <= 6.4e-13) tmp = Float64(x * Float64(y / Float64(Float64(x + 1.0) * Float64(Float64(y + x) * Float64(y + x))))); elseif (y <= 8e+116) tmp = Float64(x / Float64(Float64(y + x) * t_1)); else tmp = Float64(t_0 / t_1); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + x); t_1 = x + (y + 1.0); tmp = 0.0; if (y <= 2e-289) tmp = (y / (x + 1.0)) / (y + x); elseif (y <= 5e-167) tmp = (y / (y + x)) * t_0; elseif (y <= 6.4e-13) tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x)))); elseif (y <= 8e+116) tmp = x / ((y + x) * t_1); else tmp = t_0 / t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2e-289], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-167], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 6.4e-13], N[(x * N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+116], N[(x / N[(N[(y + x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
t_1 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 2 \cdot 10^{-289}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{y + x} \cdot t\_0\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+116}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{t\_1}\\
\end{array}
\end{array}
if y < 2e-289Initial program 66.0%
+-commutative66.0%
+-commutative66.0%
+-commutative66.0%
*-commutative66.0%
distribute-rgt1-in50.4%
fma-define66.0%
+-commutative66.0%
+-commutative66.0%
cube-unmult66.0%
+-commutative66.0%
Simplified66.0%
*-commutative66.0%
fma-define50.4%
cube-mult50.4%
distribute-rgt1-in66.0%
*-commutative66.0%
associate-*l*66.0%
times-frac92.0%
associate-+r+92.0%
Applied egg-rr92.0%
Taylor expanded in y around 0 58.8%
+-commutative58.8%
Simplified58.8%
associate-*l/58.8%
un-div-inv58.8%
Applied egg-rr58.8%
if 2e-289 < y < 5.0000000000000002e-167Initial program 79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
*-commutative79.1%
distribute-rgt1-in66.6%
fma-define79.1%
+-commutative79.1%
+-commutative79.1%
cube-unmult79.1%
+-commutative79.1%
Simplified79.1%
*-commutative79.1%
fma-define66.6%
cube-mult66.6%
distribute-rgt1-in79.1%
*-commutative79.1%
associate-*l*79.1%
times-frac99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 92.3%
+-commutative92.3%
Simplified92.3%
Taylor expanded in y around 0 92.3%
if 5.0000000000000002e-167 < y < 6.39999999999999999e-13Initial program 89.5%
associate-/l*92.6%
associate-+l+92.6%
Simplified92.6%
Taylor expanded in y around 0 92.6%
+-commutative99.6%
Simplified92.6%
if 6.39999999999999999e-13 < y < 8.00000000000000012e116Initial program 83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
*-commutative83.6%
distribute-rgt1-in77.0%
fma-define83.7%
+-commutative83.7%
+-commutative83.7%
cube-unmult83.6%
+-commutative83.6%
Simplified83.6%
*-commutative83.6%
fma-define76.9%
cube-mult77.0%
distribute-rgt1-in83.6%
*-commutative83.6%
associate-*l*83.7%
times-frac96.7%
associate-+r+96.7%
Applied egg-rr96.7%
Taylor expanded in y around inf 78.0%
if 8.00000000000000012e116 < y Initial program 70.5%
+-commutative70.5%
+-commutative70.5%
+-commutative70.5%
*-commutative70.5%
distribute-rgt1-in70.5%
fma-define70.5%
+-commutative70.5%
+-commutative70.5%
cube-unmult70.5%
+-commutative70.5%
Simplified70.5%
*-commutative70.5%
fma-define70.5%
cube-mult70.5%
distribute-rgt1-in70.5%
*-commutative70.5%
associate-*l*70.5%
times-frac89.0%
associate-+r+89.0%
Applied egg-rr89.0%
clear-num89.0%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
*-lft-identity99.9%
Simplified99.9%
*-un-lft-identity99.9%
+-commutative99.9%
times-frac99.9%
+-commutative99.9%
clear-num99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 93.6%
Final simplification74.0%
(FPCore (x y)
:precision binary64
(if (<= y -2.2e-146)
(/ (/ y (+ x 1.0)) (+ y x))
(if (<= y 2.5e+138)
(* (/ y (+ y x)) (/ x (* (+ y x) (+ x (+ y 1.0)))))
(/ (/ x y) (* (/ (+ y x) y) (+ y (+ x 1.0)))))))
double code(double x, double y) {
double tmp;
if (y <= -2.2e-146) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 2.5e+138) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + (y + 1.0))));
} else {
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2.2d-146)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else if (y <= 2.5d+138) then
tmp = (y / (y + x)) * (x / ((y + x) * (x + (y + 1.0d0))))
else
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.2e-146) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 2.5e+138) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + (y + 1.0))));
} else {
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.2e-146: tmp = (y / (x + 1.0)) / (y + x) elif y <= 2.5e+138: tmp = (y / (y + x)) * (x / ((y + x) * (x + (y + 1.0)))) else: tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0))) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.2e-146) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); elseif (y <= 2.5e+138) tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(y + x) * Float64(x + Float64(y + 1.0))))); else tmp = Float64(Float64(x / y) / Float64(Float64(Float64(y + x) / y) * Float64(y + Float64(x + 1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.2e-146) tmp = (y / (x + 1.0)) / (y + x); elseif (y <= 2.5e+138) tmp = (y / (y + x)) * (x / ((y + x) * (x + (y + 1.0)))); else tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.2e-146], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+138], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-146}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+138}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if y < -2.2e-146Initial program 64.3%
+-commutative64.3%
+-commutative64.3%
+-commutative64.3%
*-commutative64.3%
distribute-rgt1-in48.6%
fma-define64.3%
+-commutative64.3%
+-commutative64.3%
cube-unmult64.4%
+-commutative64.4%
Simplified64.4%
*-commutative64.4%
fma-define48.6%
cube-mult48.6%
distribute-rgt1-in64.3%
*-commutative64.3%
associate-*l*64.3%
times-frac86.6%
associate-+r+86.6%
Applied egg-rr86.6%
Taylor expanded in y around 0 38.1%
+-commutative38.1%
Simplified38.1%
associate-*l/38.1%
un-div-inv38.1%
Applied egg-rr38.1%
if -2.2e-146 < y < 2.50000000000000008e138Initial program 78.3%
+-commutative78.3%
+-commutative78.3%
+-commutative78.3%
*-commutative78.3%
distribute-rgt1-in66.9%
fma-define78.3%
+-commutative78.3%
+-commutative78.3%
cube-unmult78.3%
+-commutative78.3%
Simplified78.3%
*-commutative78.3%
fma-define66.9%
cube-mult66.9%
distribute-rgt1-in78.3%
*-commutative78.3%
associate-*l*78.3%
times-frac99.2%
associate-+r+99.2%
Applied egg-rr99.2%
if 2.50000000000000008e138 < y Initial program 67.9%
+-commutative67.9%
+-commutative67.9%
+-commutative67.9%
*-commutative67.9%
distribute-rgt1-in67.9%
fma-define67.9%
+-commutative67.9%
+-commutative67.9%
cube-unmult67.9%
+-commutative67.9%
Simplified67.9%
*-commutative67.9%
fma-define67.9%
cube-mult67.9%
distribute-rgt1-in67.9%
*-commutative67.9%
associate-*l*67.9%
times-frac84.7%
associate-+r+84.7%
Applied egg-rr84.7%
clear-num84.7%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 91.2%
Final simplification79.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y -2.2e-146)
(/ (/ y (+ x 1.0)) (+ y x))
(if (<= y 5.6e-10)
(* (/ y (+ y x)) (/ x (* (+ y x) (+ x 1.0))))
(if (<= y 8e+116) (/ x (* (+ y x) t_0)) (/ (/ x (+ y x)) t_0))))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= -2.2e-146) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 5.6e-10) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0)));
} else if (y <= 8e+116) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) / t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= (-2.2d-146)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else if (y <= 5.6d-10) then
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0d0)))
else if (y <= 8d+116) then
tmp = x / ((y + x) * t_0)
else
tmp = (x / (y + x)) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= -2.2e-146) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 5.6e-10) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0)));
} else if (y <= 8e+116) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) / t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= -2.2e-146: tmp = (y / (x + 1.0)) / (y + x) elif y <= 5.6e-10: tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0))) elif y <= 8e+116: tmp = x / ((y + x) * t_0) else: tmp = (x / (y + x)) / t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= -2.2e-146) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); elseif (y <= 5.6e-10) tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(y + x) * Float64(x + 1.0)))); elseif (y <= 8e+116) tmp = Float64(x / Float64(Float64(y + x) * t_0)); else tmp = Float64(Float64(x / Float64(y + x)) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); tmp = 0.0; if (y <= -2.2e-146) tmp = (y / (x + 1.0)) / (y + x); elseif (y <= 5.6e-10) tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0))); elseif (y <= 8e+116) tmp = x / ((y + x) * t_0); else tmp = (x / (y + x)) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e-146], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e-10], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+116], N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{-146}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-10}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+116}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0}\\
\end{array}
\end{array}
if y < -2.2e-146Initial program 64.3%
+-commutative64.3%
+-commutative64.3%
+-commutative64.3%
*-commutative64.3%
distribute-rgt1-in48.6%
fma-define64.3%
+-commutative64.3%
+-commutative64.3%
cube-unmult64.4%
+-commutative64.4%
Simplified64.4%
*-commutative64.4%
fma-define48.6%
cube-mult48.6%
distribute-rgt1-in64.3%
*-commutative64.3%
associate-*l*64.3%
times-frac86.6%
associate-+r+86.6%
Applied egg-rr86.6%
Taylor expanded in y around 0 38.1%
+-commutative38.1%
Simplified38.1%
associate-*l/38.1%
un-div-inv38.1%
Applied egg-rr38.1%
if -2.2e-146 < y < 5.60000000000000031e-10Initial program 77.1%
+-commutative77.1%
+-commutative77.1%
+-commutative77.1%
*-commutative77.1%
distribute-rgt1-in63.2%
fma-define77.1%
+-commutative77.1%
+-commutative77.1%
cube-unmult77.2%
+-commutative77.2%
Simplified77.2%
*-commutative77.2%
fma-define63.3%
cube-mult63.2%
distribute-rgt1-in77.1%
*-commutative77.1%
associate-*l*77.1%
times-frac99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
Simplified99.8%
if 5.60000000000000031e-10 < y < 8.00000000000000012e116Initial program 83.1%
+-commutative83.1%
+-commutative83.1%
+-commutative83.1%
*-commutative83.1%
distribute-rgt1-in76.2%
fma-define83.2%
+-commutative83.2%
+-commutative83.2%
cube-unmult83.1%
+-commutative83.1%
Simplified83.1%
*-commutative83.1%
fma-define76.1%
cube-mult76.2%
distribute-rgt1-in83.1%
*-commutative83.1%
associate-*l*83.2%
times-frac96.7%
associate-+r+96.7%
Applied egg-rr96.7%
Taylor expanded in y around inf 80.4%
if 8.00000000000000012e116 < y Initial program 70.5%
+-commutative70.5%
+-commutative70.5%
+-commutative70.5%
*-commutative70.5%
distribute-rgt1-in70.5%
fma-define70.5%
+-commutative70.5%
+-commutative70.5%
cube-unmult70.5%
+-commutative70.5%
Simplified70.5%
*-commutative70.5%
fma-define70.5%
cube-mult70.5%
distribute-rgt1-in70.5%
*-commutative70.5%
associate-*l*70.5%
times-frac89.0%
associate-+r+89.0%
Applied egg-rr89.0%
clear-num89.0%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
*-lft-identity99.9%
Simplified99.9%
*-un-lft-identity99.9%
+-commutative99.9%
times-frac99.9%
+-commutative99.9%
clear-num99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 93.6%
Final simplification78.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))) (t_1 (+ x (+ y 1.0))))
(if (<= y 5e-288)
(/ (/ y (+ x 1.0)) (+ y x))
(if (<= y 6.8e-86)
(* (/ y (+ y x)) t_0)
(if (<= y 8e+116) (/ x (* (+ y x) t_1)) (/ t_0 t_1))))))
double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= 5e-288) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 6.8e-86) {
tmp = (y / (y + x)) * t_0;
} else if (y <= 8e+116) {
tmp = x / ((y + x) * t_1);
} else {
tmp = t_0 / t_1;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / (y + x)
t_1 = x + (y + 1.0d0)
if (y <= 5d-288) then
tmp = (y / (x + 1.0d0)) / (y + x)
else if (y <= 6.8d-86) then
tmp = (y / (y + x)) * t_0
else if (y <= 8d+116) then
tmp = x / ((y + x) * t_1)
else
tmp = t_0 / t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= 5e-288) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 6.8e-86) {
tmp = (y / (y + x)) * t_0;
} else if (y <= 8e+116) {
tmp = x / ((y + x) * t_1);
} else {
tmp = t_0 / t_1;
}
return tmp;
}
def code(x, y): t_0 = x / (y + x) t_1 = x + (y + 1.0) tmp = 0 if y <= 5e-288: tmp = (y / (x + 1.0)) / (y + x) elif y <= 6.8e-86: tmp = (y / (y + x)) * t_0 elif y <= 8e+116: tmp = x / ((y + x) * t_1) else: tmp = t_0 / t_1 return tmp
function code(x, y) t_0 = Float64(x / Float64(y + x)) t_1 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 5e-288) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); elseif (y <= 6.8e-86) tmp = Float64(Float64(y / Float64(y + x)) * t_0); elseif (y <= 8e+116) tmp = Float64(x / Float64(Float64(y + x) * t_1)); else tmp = Float64(t_0 / t_1); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + x); t_1 = x + (y + 1.0); tmp = 0.0; if (y <= 5e-288) tmp = (y / (x + 1.0)) / (y + x); elseif (y <= 6.8e-86) tmp = (y / (y + x)) * t_0; elseif (y <= 8e+116) tmp = x / ((y + x) * t_1); else tmp = t_0 / t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5e-288], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e-86], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 8e+116], N[(x / N[(N[(y + x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
t_1 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 5 \cdot 10^{-288}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-86}:\\
\;\;\;\;\frac{y}{y + x} \cdot t\_0\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+116}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{t\_1}\\
\end{array}
\end{array}
if y < 5.00000000000000011e-288Initial program 66.0%
+-commutative66.0%
+-commutative66.0%
+-commutative66.0%
*-commutative66.0%
distribute-rgt1-in50.4%
fma-define66.0%
+-commutative66.0%
+-commutative66.0%
cube-unmult66.0%
+-commutative66.0%
Simplified66.0%
*-commutative66.0%
fma-define50.4%
cube-mult50.4%
distribute-rgt1-in66.0%
*-commutative66.0%
associate-*l*66.0%
times-frac92.0%
associate-+r+92.0%
Applied egg-rr92.0%
Taylor expanded in y around 0 58.8%
+-commutative58.8%
Simplified58.8%
associate-*l/58.8%
un-div-inv58.8%
Applied egg-rr58.8%
if 5.00000000000000011e-288 < y < 6.8000000000000001e-86Initial program 81.8%
+-commutative81.8%
+-commutative81.8%
+-commutative81.8%
*-commutative81.8%
distribute-rgt1-in69.3%
fma-define81.8%
+-commutative81.8%
+-commutative81.8%
cube-unmult81.9%
+-commutative81.9%
Simplified81.9%
*-commutative81.9%
fma-define69.4%
cube-mult69.3%
distribute-rgt1-in81.8%
*-commutative81.8%
associate-*l*81.8%
times-frac99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in y around 0 83.0%
if 6.8000000000000001e-86 < y < 8.00000000000000012e116Initial program 86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
*-commutative86.9%
distribute-rgt1-in78.0%
fma-define86.9%
+-commutative86.9%
+-commutative86.9%
cube-unmult86.9%
+-commutative86.9%
Simplified86.9%
*-commutative86.9%
fma-define78.0%
cube-mult78.0%
distribute-rgt1-in86.9%
*-commutative86.9%
associate-*l*87.0%
times-frac97.7%
associate-+r+97.7%
Applied egg-rr97.7%
Taylor expanded in y around inf 70.6%
if 8.00000000000000012e116 < y Initial program 70.5%
+-commutative70.5%
+-commutative70.5%
+-commutative70.5%
*-commutative70.5%
distribute-rgt1-in70.5%
fma-define70.5%
+-commutative70.5%
+-commutative70.5%
cube-unmult70.5%
+-commutative70.5%
Simplified70.5%
*-commutative70.5%
fma-define70.5%
cube-mult70.5%
distribute-rgt1-in70.5%
*-commutative70.5%
associate-*l*70.5%
times-frac89.0%
associate-+r+89.0%
Applied egg-rr89.0%
clear-num89.0%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
*-lft-identity99.9%
Simplified99.9%
*-un-lft-identity99.9%
+-commutative99.9%
times-frac99.9%
+-commutative99.9%
clear-num99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 93.6%
Final simplification70.4%
(FPCore (x y)
:precision binary64
(if (<= y -2.2e-146)
(/ (/ y (+ x 1.0)) (+ y x))
(if (<= y 8e-9)
(/ (* y (/ x (+ y x))) (* (+ y x) (+ x 1.0)))
(/ (/ x y) (* (/ (+ y x) y) (+ y (+ x 1.0)))))))
double code(double x, double y) {
double tmp;
if (y <= -2.2e-146) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 8e-9) {
tmp = (y * (x / (y + x))) / ((y + x) * (x + 1.0));
} else {
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2.2d-146)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else if (y <= 8d-9) then
tmp = (y * (x / (y + x))) / ((y + x) * (x + 1.0d0))
else
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.2e-146) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (y <= 8e-9) {
tmp = (y * (x / (y + x))) / ((y + x) * (x + 1.0));
} else {
tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.2e-146: tmp = (y / (x + 1.0)) / (y + x) elif y <= 8e-9: tmp = (y * (x / (y + x))) / ((y + x) * (x + 1.0)) else: tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0))) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.2e-146) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); elseif (y <= 8e-9) tmp = Float64(Float64(y * Float64(x / Float64(y + x))) / Float64(Float64(y + x) * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(Float64(Float64(y + x) / y) * Float64(y + Float64(x + 1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.2e-146) tmp = (y / (x + 1.0)) / (y + x); elseif (y <= 8e-9) tmp = (y * (x / (y + x))) / ((y + x) * (x + 1.0)); else tmp = (x / y) / (((y + x) / y) * (y + (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.2e-146], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-9], N[(N[(y * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-146}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-9}:\\
\;\;\;\;\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if y < -2.2e-146Initial program 64.3%
+-commutative64.3%
+-commutative64.3%
+-commutative64.3%
*-commutative64.3%
distribute-rgt1-in48.6%
fma-define64.3%
+-commutative64.3%
+-commutative64.3%
cube-unmult64.4%
+-commutative64.4%
Simplified64.4%
*-commutative64.4%
fma-define48.6%
cube-mult48.6%
distribute-rgt1-in64.3%
*-commutative64.3%
associate-*l*64.3%
times-frac86.6%
associate-+r+86.6%
Applied egg-rr86.6%
Taylor expanded in y around 0 38.1%
+-commutative38.1%
Simplified38.1%
associate-*l/38.1%
un-div-inv38.1%
Applied egg-rr38.1%
if -2.2e-146 < y < 8.0000000000000005e-9Initial program 77.3%
+-commutative77.3%
+-commutative77.3%
+-commutative77.3%
*-commutative77.3%
distribute-rgt1-in63.6%
fma-define77.3%
+-commutative77.3%
+-commutative77.3%
cube-unmult77.4%
+-commutative77.4%
Simplified77.4%
*-commutative77.4%
fma-define63.6%
cube-mult63.6%
distribute-rgt1-in77.3%
*-commutative77.3%
associate-*l*77.4%
times-frac99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 99.8%
+-commutative99.8%
Simplified99.8%
*-commutative99.8%
associate-/r*99.9%
+-commutative99.9%
frac-times99.8%
+-commutative99.8%
Applied egg-rr99.8%
if 8.0000000000000005e-9 < y Initial program 75.3%
+-commutative75.3%
+-commutative75.3%
+-commutative75.3%
*-commutative75.3%
distribute-rgt1-in72.5%
fma-define75.3%
+-commutative75.3%
+-commutative75.3%
cube-unmult75.3%
+-commutative75.3%
Simplified75.3%
*-commutative75.3%
fma-define72.4%
cube-mult72.5%
distribute-rgt1-in75.3%
*-commutative75.3%
associate-*l*75.3%
times-frac92.0%
associate-+r+92.0%
Applied egg-rr92.0%
clear-num92.0%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 89.3%
Final simplification78.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y 1.12e-172)
(/ (/ y x) (+ x 1.0))
(if (<= y 8e+116) (/ x (* (+ y x) t_0)) (/ (/ x (+ y x)) t_0)))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 1.12e-172) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 8e+116) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) / t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (y <= 1.12d-172) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 8d+116) then
tmp = x / ((y + x) * t_0)
else
tmp = (x / (y + x)) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 1.12e-172) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 8e+116) {
tmp = x / ((y + x) * t_0);
} else {
tmp = (x / (y + x)) / t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 1.12e-172: tmp = (y / x) / (x + 1.0) elif y <= 8e+116: tmp = x / ((y + x) * t_0) else: tmp = (x / (y + x)) / t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 1.12e-172) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 8e+116) tmp = Float64(x / Float64(Float64(y + x) * t_0)); else tmp = Float64(Float64(x / Float64(y + x)) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); tmp = 0.0; if (y <= 1.12e-172) tmp = (y / x) / (x + 1.0); elseif (y <= 8e+116) tmp = x / ((y + x) * t_0); else tmp = (x / (y + x)) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.12e-172], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+116], N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 1.12 \cdot 10^{-172}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+116}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0}\\
\end{array}
\end{array}
if y < 1.11999999999999996e-172Initial program 68.5%
+-commutative68.5%
+-commutative68.5%
+-commutative68.5%
*-commutative68.5%
distribute-rgt1-in53.3%
fma-define68.5%
+-commutative68.5%
+-commutative68.5%
cube-unmult68.5%
+-commutative68.5%
Simplified68.5%
*-commutative68.5%
fma-define53.3%
cube-mult53.3%
distribute-rgt1-in68.5%
*-commutative68.5%
associate-*l*68.5%
times-frac93.2%
associate-+r+93.2%
Applied egg-rr93.2%
clear-num93.1%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 61.8%
associate-/r*63.5%
+-commutative63.5%
Simplified63.5%
if 1.11999999999999996e-172 < y < 8.00000000000000012e116Initial program 85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
*-commutative85.2%
distribute-rgt1-in75.5%
fma-define85.2%
+-commutative85.2%
+-commutative85.2%
cube-unmult85.2%
+-commutative85.2%
Simplified85.2%
*-commutative85.2%
fma-define75.5%
cube-mult75.5%
distribute-rgt1-in85.2%
*-commutative85.2%
associate-*l*85.3%
times-frac98.2%
associate-+r+98.2%
Applied egg-rr98.2%
Taylor expanded in y around inf 66.6%
if 8.00000000000000012e116 < y Initial program 70.5%
+-commutative70.5%
+-commutative70.5%
+-commutative70.5%
*-commutative70.5%
distribute-rgt1-in70.5%
fma-define70.5%
+-commutative70.5%
+-commutative70.5%
cube-unmult70.5%
+-commutative70.5%
Simplified70.5%
*-commutative70.5%
fma-define70.5%
cube-mult70.5%
distribute-rgt1-in70.5%
*-commutative70.5%
associate-*l*70.5%
times-frac89.0%
associate-+r+89.0%
Applied egg-rr89.0%
clear-num89.0%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.9%
+-commutative99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
*-lft-identity99.9%
Simplified99.9%
*-un-lft-identity99.9%
+-commutative99.9%
times-frac99.9%
+-commutative99.9%
clear-num99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 93.6%
Final simplification69.2%
(FPCore (x y) :precision binary64 (if (<= y 3.1e-173) (/ (/ y x) (+ x 1.0)) (if (<= y 2.5e+138) (/ x (* (+ y x) (+ x (+ y 1.0)))) (/ (/ x (+ y x)) y))))
double code(double x, double y) {
double tmp;
if (y <= 3.1e-173) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 2.5e+138) {
tmp = x / ((y + x) * (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 <= 3.1d-173) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 2.5d+138) then
tmp = x / ((y + x) * (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 <= 3.1e-173) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 2.5e+138) {
tmp = x / ((y + x) * (x + (y + 1.0)));
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.1e-173: tmp = (y / x) / (x + 1.0) elif y <= 2.5e+138: tmp = x / ((y + x) * (x + (y + 1.0))) else: tmp = (x / (y + x)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 3.1e-173) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 2.5e+138) tmp = Float64(x / Float64(Float64(y + x) * 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 <= 3.1e-173) tmp = (y / x) / (x + 1.0); elseif (y <= 2.5e+138) tmp = x / ((y + x) * (x + (y + 1.0))); else tmp = (x / (y + x)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.1e-173], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+138], N[(x / N[(N[(y + x), $MachinePrecision] * 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 3.1 \cdot 10^{-173}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+138}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y}\\
\end{array}
\end{array}
if y < 3.10000000000000005e-173Initial program 68.5%
+-commutative68.5%
+-commutative68.5%
+-commutative68.5%
*-commutative68.5%
distribute-rgt1-in53.3%
fma-define68.5%
+-commutative68.5%
+-commutative68.5%
cube-unmult68.5%
+-commutative68.5%
Simplified68.5%
*-commutative68.5%
fma-define53.3%
cube-mult53.3%
distribute-rgt1-in68.5%
*-commutative68.5%
associate-*l*68.5%
times-frac93.2%
associate-+r+93.2%
Applied egg-rr93.2%
clear-num93.1%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 61.8%
associate-/r*63.5%
+-commutative63.5%
Simplified63.5%
if 3.10000000000000005e-173 < y < 2.50000000000000008e138Initial program 83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
*-commutative83.9%
distribute-rgt1-in75.8%
fma-define83.9%
+-commutative83.9%
+-commutative83.9%
cube-unmult83.9%
+-commutative83.9%
Simplified83.9%
*-commutative83.9%
fma-define75.8%
cube-mult75.8%
distribute-rgt1-in83.9%
*-commutative83.9%
associate-*l*83.9%
times-frac98.5%
associate-+r+98.5%
Applied egg-rr98.5%
Taylor expanded in y around inf 72.0%
if 2.50000000000000008e138 < y Initial program 67.9%
+-commutative67.9%
+-commutative67.9%
+-commutative67.9%
*-commutative67.9%
distribute-rgt1-in67.9%
fma-define67.9%
+-commutative67.9%
+-commutative67.9%
cube-unmult67.9%
+-commutative67.9%
Simplified67.9%
*-commutative67.9%
fma-define67.9%
cube-mult67.9%
distribute-rgt1-in67.9%
*-commutative67.9%
associate-*l*67.9%
times-frac84.7%
associate-+r+84.7%
Applied egg-rr84.7%
clear-num84.7%
associate-/r*99.9%
+-commutative99.9%
associate-+l+99.9%
frac-times99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
Taylor expanded in y around inf 91.1%
Final simplification69.2%
(FPCore (x y) :precision binary64 (if (<= x -940000.0) (/ (/ y (+ x 1.0)) (+ y x)) (* (/ y (+ y x)) (/ x (* (+ y x) (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -940000.0) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (y / (y + x)) * (x / ((y + x) * (y + 1.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-940000.0d0)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = (y / (y + x)) * (x / ((y + x) * (y + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -940000.0) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (y / (y + x)) * (x / ((y + x) * (y + 1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -940000.0: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (y / (y + x)) * (x / ((y + x) * (y + 1.0))) return tmp
function code(x, y) tmp = 0.0 if (x <= -940000.0) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(y + x) * Float64(y + 1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -940000.0) tmp = (y / (x + 1.0)) / (y + x); else tmp = (y / (y + x)) * (x / ((y + x) * (y + 1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -940000.0], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -940000:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -9.4e5Initial program 67.3%
+-commutative67.3%
+-commutative67.3%
+-commutative67.3%
*-commutative67.3%
distribute-rgt1-in32.7%
fma-define67.3%
+-commutative67.3%
+-commutative67.3%
cube-unmult67.4%
+-commutative67.4%
Simplified67.4%
*-commutative67.4%
fma-define32.8%
cube-mult32.7%
distribute-rgt1-in67.3%
*-commutative67.3%
associate-*l*67.3%
times-frac88.8%
associate-+r+88.8%
Applied egg-rr88.8%
Taylor expanded in y around 0 83.0%
+-commutative83.0%
Simplified83.0%
associate-*l/82.9%
un-div-inv83.0%
Applied egg-rr83.0%
if -9.4e5 < x Initial program 74.5%
+-commutative74.5%
+-commutative74.5%
+-commutative74.5%
*-commutative74.5%
distribute-rgt1-in69.9%
fma-define74.5%
+-commutative74.5%
+-commutative74.5%
cube-unmult74.5%
+-commutative74.5%
Simplified74.5%
*-commutative74.5%
fma-define69.9%
cube-mult69.9%
distribute-rgt1-in74.5%
*-commutative74.5%
associate-*l*74.5%
times-frac95.2%
associate-+r+95.2%
Applied egg-rr95.2%
Taylor expanded in x around 0 83.7%
+-commutative83.7%
Simplified83.7%
Final simplification83.5%
(FPCore (x y) :precision binary64 (if (<= y 1.3e-52) (/ y (* x (+ x 1.0))) (if (<= y 2e+144) (/ x (* y (+ y 1.0))) (/ 1.0 (* y (/ y x))))))
double code(double x, double y) {
double tmp;
if (y <= 1.3e-52) {
tmp = y / (x * (x + 1.0));
} else if (y <= 2e+144) {
tmp = x / (y * (y + 1.0));
} else {
tmp = 1.0 / (y * (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 <= 1.3d-52) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 2d+144) then
tmp = x / (y * (y + 1.0d0))
else
tmp = 1.0d0 / (y * (y / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.3e-52) {
tmp = y / (x * (x + 1.0));
} else if (y <= 2e+144) {
tmp = x / (y * (y + 1.0));
} else {
tmp = 1.0 / (y * (y / x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.3e-52: tmp = y / (x * (x + 1.0)) elif y <= 2e+144: tmp = x / (y * (y + 1.0)) else: tmp = 1.0 / (y * (y / x)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.3e-52) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 2e+144) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(1.0 / Float64(y * Float64(y / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.3e-52) tmp = y / (x * (x + 1.0)); elseif (y <= 2e+144) tmp = x / (y * (y + 1.0)); else tmp = 1.0 / (y * (y / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.3e-52], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+144], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.3 \cdot 10^{-52}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+144}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if y < 1.2999999999999999e-52Initial program 70.6%
associate-/l*78.7%
associate-+l+78.7%
Simplified78.7%
Taylor expanded in y around 0 64.0%
+-commutative64.0%
Simplified64.0%
if 1.2999999999999999e-52 < y < 2.00000000000000005e144Initial program 83.2%
associate-/l*87.2%
associate-+l+87.2%
Simplified87.2%
Taylor expanded in x around 0 69.0%
if 2.00000000000000005e144 < y Initial program 69.2%
associate-/l*84.2%
associate-+l+84.2%
Simplified84.2%
Taylor expanded in x around 0 84.2%
clear-num84.2%
inv-pow84.2%
distribute-rgt-in84.2%
*-un-lft-identity84.2%
pow284.2%
Applied egg-rr84.2%
unpow-184.2%
*-rgt-identity84.2%
unpow284.2%
distribute-lft-in84.2%
associate-/l*90.7%
+-commutative90.7%
Simplified90.7%
Taylor expanded in y around inf 90.7%
Final simplification68.0%
(FPCore (x y) :precision binary64 (if (<= y 1.6e-155) (/ y x) (if (<= y 2e+144) (/ x (* y (+ y 1.0))) (/ 1.0 (* y (/ y x))))))
double code(double x, double y) {
double tmp;
if (y <= 1.6e-155) {
tmp = y / x;
} else if (y <= 2e+144) {
tmp = x / (y * (y + 1.0));
} else {
tmp = 1.0 / (y * (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 <= 1.6d-155) then
tmp = y / x
else if (y <= 2d+144) then
tmp = x / (y * (y + 1.0d0))
else
tmp = 1.0d0 / (y * (y / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.6e-155) {
tmp = y / x;
} else if (y <= 2e+144) {
tmp = x / (y * (y + 1.0));
} else {
tmp = 1.0 / (y * (y / x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.6e-155: tmp = y / x elif y <= 2e+144: tmp = x / (y * (y + 1.0)) else: tmp = 1.0 / (y * (y / x)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.6e-155) tmp = Float64(y / x); elseif (y <= 2e+144) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(1.0 / Float64(y * Float64(y / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.6e-155) tmp = y / x; elseif (y <= 2e+144) tmp = x / (y * (y + 1.0)); else tmp = 1.0 / (y * (y / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.6e-155], N[(y / x), $MachinePrecision], If[LessEqual[y, 2e+144], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+144}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if y < 1.60000000000000006e-155Initial program 68.7%
+-commutative68.7%
+-commutative68.7%
+-commutative68.7%
*-commutative68.7%
distribute-rgt1-in52.5%
fma-define68.7%
+-commutative68.7%
+-commutative68.7%
cube-unmult68.7%
+-commutative68.7%
Simplified68.7%
*-commutative68.7%
fma-define52.6%
cube-mult52.5%
distribute-rgt1-in68.7%
*-commutative68.7%
associate-*l*68.7%
times-frac93.4%
associate-+r+93.4%
Applied egg-rr93.4%
Taylor expanded in x around 0 78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around 0 43.9%
if 1.60000000000000006e-155 < y < 2.00000000000000005e144Initial program 83.7%
associate-/l*87.8%
associate-+l+87.8%
Simplified87.8%
Taylor expanded in x around 0 55.0%
if 2.00000000000000005e144 < y Initial program 69.2%
associate-/l*84.2%
associate-+l+84.2%
Simplified84.2%
Taylor expanded in x around 0 84.2%
clear-num84.2%
inv-pow84.2%
distribute-rgt-in84.2%
*-un-lft-identity84.2%
pow284.2%
Applied egg-rr84.2%
unpow-184.2%
*-rgt-identity84.2%
unpow284.2%
distribute-lft-in84.2%
associate-/l*90.7%
+-commutative90.7%
Simplified90.7%
Taylor expanded in y around inf 90.7%
Final simplification52.3%
(FPCore (x y) :precision binary64 (if (<= y 1e-155) (/ y x) (if (<= y 1.0) (/ x y) (/ 1.0 (* y (/ y x))))))
double code(double x, double y) {
double tmp;
if (y <= 1e-155) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = 1.0 / (y * (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 <= 1d-155) then
tmp = y / x
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = 1.0d0 / (y * (y / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1e-155) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = 1.0 / (y * (y / x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1e-155: tmp = y / x elif y <= 1.0: tmp = x / y else: tmp = 1.0 / (y * (y / x)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1e-155) tmp = Float64(y / x); elseif (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(1.0 / Float64(y * Float64(y / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1e-155) tmp = y / x; elseif (y <= 1.0) tmp = x / y; else tmp = 1.0 / (y * (y / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1e-155], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(1.0 / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if y < 1.00000000000000001e-155Initial program 68.7%
+-commutative68.7%
+-commutative68.7%
+-commutative68.7%
*-commutative68.7%
distribute-rgt1-in52.5%
fma-define68.7%
+-commutative68.7%
+-commutative68.7%
cube-unmult68.7%
+-commutative68.7%
Simplified68.7%
*-commutative68.7%
fma-define52.6%
cube-mult52.5%
distribute-rgt1-in68.7%
*-commutative68.7%
associate-*l*68.7%
times-frac93.4%
associate-+r+93.4%
Applied egg-rr93.4%
Taylor expanded in x around 0 78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around 0 43.9%
if 1.00000000000000001e-155 < y < 1Initial program 89.7%
associate-/l*92.8%
associate-+l+92.8%
Simplified92.8%
Taylor expanded in x around 0 24.7%
Taylor expanded in y around 0 23.0%
if 1 < y Initial program 74.6%
associate-/l*83.9%
associate-+l+83.9%
Simplified83.9%
Taylor expanded in x around 0 81.7%
clear-num79.7%
inv-pow79.7%
distribute-rgt-in79.7%
*-un-lft-identity79.7%
pow279.7%
Applied egg-rr79.7%
unpow-179.7%
*-rgt-identity79.7%
unpow279.7%
distribute-lft-in79.7%
associate-/l*82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in y around inf 82.5%
(FPCore (x y) :precision binary64 (if (<= y 1.9e-155) (/ y x) (if (<= y 1.0) (/ x y) (/ x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.9e-155) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.9d-155) then
tmp = y / x
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.9e-155) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.9e-155: tmp = y / x elif y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.9e-155) tmp = Float64(y / x); elseif (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.9e-155) tmp = y / x; elseif (y <= 1.0) tmp = x / y; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.9e-155], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1.8999999999999999e-155Initial program 68.7%
+-commutative68.7%
+-commutative68.7%
+-commutative68.7%
*-commutative68.7%
distribute-rgt1-in52.5%
fma-define68.7%
+-commutative68.7%
+-commutative68.7%
cube-unmult68.7%
+-commutative68.7%
Simplified68.7%
*-commutative68.7%
fma-define52.6%
cube-mult52.5%
distribute-rgt1-in68.7%
*-commutative68.7%
associate-*l*68.7%
times-frac93.4%
associate-+r+93.4%
Applied egg-rr93.4%
Taylor expanded in x around 0 78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around 0 43.9%
if 1.8999999999999999e-155 < y < 1Initial program 89.7%
associate-/l*92.8%
associate-+l+92.8%
Simplified92.8%
Taylor expanded in x around 0 24.7%
Taylor expanded in y around 0 23.0%
if 1 < y Initial program 74.6%
associate-/l*83.9%
associate-+l+83.9%
Simplified83.9%
Taylor expanded in x around 0 81.7%
Taylor expanded in y around inf 81.7%
(FPCore (x y) :precision binary64 (if (<= x -4.8e-29) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -4.8e-29) {
tmp = (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 <= (-4.8d-29)) then
tmp = (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 <= -4.8e-29) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.8e-29: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.8e-29) tmp = Float64(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 <= -4.8e-29) tmp = (y / (x + 1.0)) / (y + x); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.8e-29], N[(N[(y / N[(x + 1.0), $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 -4.8 \cdot 10^{-29}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -4.79999999999999984e-29Initial program 70.6%
+-commutative70.6%
+-commutative70.6%
+-commutative70.6%
*-commutative70.6%
distribute-rgt1-in39.7%
fma-define70.6%
+-commutative70.6%
+-commutative70.6%
cube-unmult70.7%
+-commutative70.7%
Simplified70.7%
*-commutative70.7%
fma-define39.7%
cube-mult39.7%
distribute-rgt1-in70.6%
*-commutative70.6%
associate-*l*70.6%
times-frac90.4%
associate-+r+90.4%
Applied egg-rr90.4%
Taylor expanded in y around 0 79.8%
+-commutative79.8%
Simplified79.8%
associate-*l/79.7%
un-div-inv79.8%
Applied egg-rr79.8%
if -4.79999999999999984e-29 < x Initial program 73.7%
associate-/l*82.0%
associate-+l+82.0%
Simplified82.0%
Taylor expanded in x around 0 56.1%
associate-/r*57.8%
+-commutative57.8%
Simplified57.8%
Final simplification63.6%
(FPCore (x y) :precision binary64 (if (<= y 3e-52) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y x)) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (y <= 3e-52) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3d-52) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3e-52) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3e-52: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 3e-52) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3e-52) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3e-52], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{-52}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if y < 3e-52Initial program 70.6%
+-commutative70.6%
+-commutative70.6%
+-commutative70.6%
*-commutative70.6%
distribute-rgt1-in55.8%
fma-define70.6%
+-commutative70.6%
+-commutative70.6%
cube-unmult70.6%
+-commutative70.6%
Simplified70.6%
*-commutative70.6%
fma-define55.8%
cube-mult55.8%
distribute-rgt1-in70.6%
*-commutative70.6%
associate-*l*70.6%
times-frac94.1%
associate-+r+94.1%
Applied egg-rr94.1%
clear-num94.0%
associate-/r*99.7%
+-commutative99.7%
associate-+l+99.7%
frac-times99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
Applied egg-rr99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in y around 0 64.0%
associate-/r*65.5%
+-commutative65.5%
Simplified65.5%
if 3e-52 < y Initial program 78.0%
+-commutative78.0%
+-commutative78.0%
+-commutative78.0%
*-commutative78.0%
distribute-rgt1-in74.2%
fma-define78.1%
+-commutative78.1%
+-commutative78.1%
cube-unmult78.0%
+-commutative78.0%
Simplified78.0%
*-commutative78.0%
fma-define74.2%
cube-mult74.2%
distribute-rgt1-in78.0%
*-commutative78.0%
associate-*l*78.1%
times-frac92.9%
associate-+r+92.9%
Applied egg-rr92.9%
clear-num92.9%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 77.3%
+-commutative77.3%
Simplified77.3%
(FPCore (x y) :precision binary64 (if (<= x -2.3e-30) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -2.3e-30) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.3d-30)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.3e-30) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.3e-30: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.3e-30) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.3e-30) tmp = (y / x) / (x + 1.0); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.3e-30], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{-30}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.29999999999999984e-30Initial program 70.6%
+-commutative70.6%
+-commutative70.6%
+-commutative70.6%
*-commutative70.6%
distribute-rgt1-in39.7%
fma-define70.6%
+-commutative70.6%
+-commutative70.6%
cube-unmult70.7%
+-commutative70.7%
Simplified70.7%
*-commutative70.7%
fma-define39.7%
cube-mult39.7%
distribute-rgt1-in70.6%
*-commutative70.6%
associate-*l*70.6%
times-frac90.4%
associate-+r+90.4%
Applied egg-rr90.4%
clear-num90.4%
associate-/r*99.8%
+-commutative99.8%
associate-+l+99.8%
frac-times99.3%
+-commutative99.3%
+-commutative99.3%
+-commutative99.3%
Applied egg-rr99.3%
*-lft-identity99.3%
Simplified99.3%
Taylor expanded in y around 0 77.7%
associate-/r*79.3%
+-commutative79.3%
Simplified79.3%
if -2.29999999999999984e-30 < x Initial program 73.7%
associate-/l*82.0%
associate-+l+82.0%
Simplified82.0%
Taylor expanded in x around 0 56.1%
associate-/r*57.8%
+-commutative57.8%
Simplified57.8%
(FPCore (x y) :precision binary64 (if (<= y 5.8e-52) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (y <= 5.8e-52) {
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 <= 5.8d-52) 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 <= 5.8e-52) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.8e-52: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 5.8e-52) 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 <= 5.8e-52) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.8e-52], 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 5.8 \cdot 10^{-52}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 5.8000000000000003e-52Initial program 70.6%
associate-/l*78.7%
associate-+l+78.7%
Simplified78.7%
Taylor expanded in y around 0 64.0%
+-commutative64.0%
Simplified64.0%
if 5.8000000000000003e-52 < y Initial program 78.0%
associate-/l*86.1%
associate-+l+86.1%
Simplified86.1%
Taylor expanded in x around 0 74.6%
associate-/r*76.9%
+-commutative76.9%
Simplified76.9%
(FPCore (x y) :precision binary64 (if (<= y 4.5e-156) (/ y x) (/ 1.0 (/ y x))))
double code(double x, double y) {
double tmp;
if (y <= 4.5e-156) {
tmp = y / x;
} else {
tmp = 1.0 / (y / x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.5d-156) then
tmp = y / x
else
tmp = 1.0d0 / (y / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.5e-156) {
tmp = y / x;
} else {
tmp = 1.0 / (y / x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.5e-156: tmp = y / x else: tmp = 1.0 / (y / x) return tmp
function code(x, y) tmp = 0.0 if (y <= 4.5e-156) tmp = Float64(y / x); else tmp = Float64(1.0 / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.5e-156) tmp = y / x; else tmp = 1.0 / (y / x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.5e-156], N[(y / x), $MachinePrecision], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{-156}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\end{array}
\end{array}
if y < 4.49999999999999986e-156Initial program 68.7%
+-commutative68.7%
+-commutative68.7%
+-commutative68.7%
*-commutative68.7%
distribute-rgt1-in52.5%
fma-define68.7%
+-commutative68.7%
+-commutative68.7%
cube-unmult68.7%
+-commutative68.7%
Simplified68.7%
*-commutative68.7%
fma-define52.6%
cube-mult52.5%
distribute-rgt1-in68.7%
*-commutative68.7%
associate-*l*68.7%
times-frac93.4%
associate-+r+93.4%
Applied egg-rr93.4%
Taylor expanded in x around 0 78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around 0 43.9%
if 4.49999999999999986e-156 < y Initial program 79.5%
associate-/l*86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 63.5%
Taylor expanded in y around 0 31.6%
clear-num32.1%
inv-pow32.1%
Applied egg-rr32.1%
unpow-132.1%
Simplified32.1%
(FPCore (x y) :precision binary64 (if (<= y 9.2e-156) (/ y x) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 9.2e-156) {
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 (y <= 9.2d-156) 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 (y <= 9.2e-156) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 9.2e-156: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 9.2e-156) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 9.2e-156) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 9.2e-156], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{-156}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 9.1999999999999998e-156Initial program 68.7%
+-commutative68.7%
+-commutative68.7%
+-commutative68.7%
*-commutative68.7%
distribute-rgt1-in52.5%
fma-define68.7%
+-commutative68.7%
+-commutative68.7%
cube-unmult68.7%
+-commutative68.7%
Simplified68.7%
*-commutative68.7%
fma-define52.6%
cube-mult52.5%
distribute-rgt1-in68.7%
*-commutative68.7%
associate-*l*68.7%
times-frac93.4%
associate-+r+93.4%
Applied egg-rr93.4%
Taylor expanded in x around 0 78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around 0 43.9%
if 9.1999999999999998e-156 < y Initial program 79.5%
associate-/l*86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 63.5%
Taylor expanded in y around 0 31.6%
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
return x / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
public static double code(double x, double y) {
return x / y;
}
def code(x, y): return x / y
function code(x, y) return Float64(x / y) end
function tmp = code(x, y) tmp = x / y; end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y}
\end{array}
Initial program 72.9%
associate-/l*81.0%
associate-+l+81.0%
Simplified81.0%
Taylor expanded in x around 0 46.0%
Taylor expanded in y around 0 23.9%
(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 2024170
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))