
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (* (/ y (+ y x)) (/ (/ x (+ y x)) (+ y (+ x 1.0)))))
double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0d0)))
end function
public static double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)));
}
def code(x, y): return (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)))
function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(y + Float64(x + 1.0)))) end
function tmp = code(x, y) tmp = (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0))); end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{y + \left(x + 1\right)}
\end{array}
Initial program 61.2%
+-commutative61.2%
+-commutative61.2%
+-commutative61.2%
*-commutative61.2%
distribute-rgt1-in47.5%
fma-define61.2%
+-commutative61.2%
+-commutative61.2%
cube-unmult61.2%
+-commutative61.2%
Simplified61.2%
*-commutative61.2%
fma-define47.5%
cube-mult47.5%
distribute-rgt1-in61.2%
*-commutative61.2%
associate-*l*61.2%
times-frac92.6%
associate-+r+92.6%
Applied egg-rr92.6%
div-inv92.5%
+-commutative92.5%
+-commutative92.5%
associate-+l+92.5%
+-commutative92.5%
Applied egg-rr92.5%
associate-*r/92.6%
*-rgt-identity92.6%
associate-/r*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(if (<= x -5.6e+85)
(* (/ y (+ y x)) (/ 1.0 (+ y (+ x 1.0))))
(if (<= x -1.1e-159)
(* x (/ y (* (+ x 1.0) (* (+ y x) (+ y x)))))
(/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -5.6e+85) {
tmp = (y / (y + x)) * (1.0 / (y + (x + 1.0)));
} else if (x <= -1.1e-159) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5.6d+85)) then
tmp = (y / (y + x)) * (1.0d0 / (y + (x + 1.0d0)))
else if (x <= (-1.1d-159)) then
tmp = x * (y / ((x + 1.0d0) * ((y + x) * (y + x))))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5.6e+85) {
tmp = (y / (y + x)) * (1.0 / (y + (x + 1.0)));
} else if (x <= -1.1e-159) {
tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x))));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.6e+85: tmp = (y / (y + x)) * (1.0 / (y + (x + 1.0))) elif x <= -1.1e-159: tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x)))) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -5.6e+85) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(y + Float64(x + 1.0)))); elseif (x <= -1.1e-159) tmp = Float64(x * Float64(y / Float64(Float64(x + 1.0) * Float64(Float64(y + x) * Float64(y + x))))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5.6e+85) tmp = (y / (y + x)) * (1.0 / (y + (x + 1.0))); elseif (x <= -1.1e-159) tmp = x * (y / ((x + 1.0) * ((y + x) * (y + x)))); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.6e+85], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.1e-159], N[(x * N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{+85}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{y + \left(x + 1\right)}\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-159}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -5.5999999999999998e85Initial program 55.2%
+-commutative55.2%
+-commutative55.2%
+-commutative55.2%
*-commutative55.2%
distribute-rgt1-in22.9%
fma-define55.2%
+-commutative55.2%
+-commutative55.2%
cube-unmult55.2%
+-commutative55.2%
Simplified55.2%
*-commutative55.2%
fma-define22.9%
cube-mult22.9%
distribute-rgt1-in55.2%
*-commutative55.2%
associate-*l*55.2%
times-frac88.2%
associate-+r+88.2%
Applied egg-rr88.2%
div-inv88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
+-commutative88.2%
Applied egg-rr88.2%
associate-*r/88.2%
*-rgt-identity88.2%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around inf 80.6%
if -5.5999999999999998e85 < x < -1.1e-159Initial program 81.8%
associate-/l*90.5%
associate-+l+90.5%
Simplified90.5%
Taylor expanded in y around 0 74.5%
+-commutative61.0%
Simplified74.5%
if -1.1e-159 < x Initial program 56.3%
associate-/l*75.8%
associate-+l+75.8%
Simplified75.8%
Taylor expanded in x around 0 58.3%
associate-/r*61.1%
+-commutative61.1%
Simplified61.1%
Final simplification67.5%
(FPCore (x y) :precision binary64 (if (<= y 1.8e+167) (* (/ y (+ y x)) (/ x (* (+ y x) (+ x (+ y 1.0))))) (/ (/ x (+ y x)) y)))
double code(double x, double y) {
double tmp;
if (y <= 1.8e+167) {
tmp = (y / (y + x)) * (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 <= 1.8d+167) then
tmp = (y / (y + x)) * (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 <= 1.8e+167) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + (y + 1.0))));
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.8e+167: tmp = (y / (y + x)) * (x / ((y + x) * (x + (y + 1.0)))) else: tmp = (x / (y + x)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 1.8e+167) tmp = Float64(Float64(y / Float64(y + x)) * 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 <= 1.8e+167) tmp = (y / (y + x)) * (x / ((y + x) * (x + (y + 1.0)))); else tmp = (x / (y + x)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.8e+167], 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 / N[(y + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{+167}:\\
\;\;\;\;\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 + x}}{y}\\
\end{array}
\end{array}
if y < 1.80000000000000012e167Initial program 63.3%
+-commutative63.3%
+-commutative63.3%
+-commutative63.3%
*-commutative63.3%
distribute-rgt1-in47.6%
fma-define63.4%
+-commutative63.4%
+-commutative63.4%
cube-unmult63.4%
+-commutative63.4%
Simplified63.4%
*-commutative63.4%
fma-define47.6%
cube-mult47.6%
distribute-rgt1-in63.3%
*-commutative63.3%
associate-*l*63.3%
times-frac95.6%
associate-+r+95.6%
Applied egg-rr95.6%
if 1.80000000000000012e167 < y Initial program 47.1%
+-commutative47.1%
+-commutative47.1%
+-commutative47.1%
*-commutative47.1%
distribute-rgt1-in47.1%
fma-define47.1%
+-commutative47.1%
+-commutative47.1%
cube-unmult47.1%
+-commutative47.1%
Simplified47.1%
*-commutative47.1%
fma-define47.1%
cube-mult47.1%
distribute-rgt1-in47.1%
*-commutative47.1%
associate-*l*47.1%
times-frac73.1%
associate-+r+73.1%
Applied egg-rr73.1%
div-inv73.1%
+-commutative73.1%
+-commutative73.1%
associate-+l+73.1%
+-commutative73.1%
Applied egg-rr73.1%
associate-*r/73.1%
*-rgt-identity73.1%
associate-/r*99.7%
Simplified99.7%
+-commutative99.7%
clear-num99.8%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 84.4%
Final simplification94.1%
(FPCore (x y) :precision binary64 (if (<= y 7e-230) (/ (/ y (+ y x)) (+ x 1.0)) (if (<= y 1.3e+167) (/ x (* (+ y x) (+ y (+ x 1.0)))) (/ (/ x (+ y x)) y))))
double code(double x, double y) {
double tmp;
if (y <= 7e-230) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 1.3e+167) {
tmp = x / ((y + x) * (y + (x + 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 <= 7d-230) then
tmp = (y / (y + x)) / (x + 1.0d0)
else if (y <= 1.3d+167) then
tmp = x / ((y + x) * (y + (x + 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 <= 7e-230) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 1.3e+167) {
tmp = x / ((y + x) * (y + (x + 1.0)));
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7e-230: tmp = (y / (y + x)) / (x + 1.0) elif y <= 1.3e+167: tmp = x / ((y + x) * (y + (x + 1.0))) else: tmp = (x / (y + x)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 7e-230) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); elseif (y <= 1.3e+167) tmp = Float64(x / Float64(Float64(y + x) * Float64(y + Float64(x + 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 <= 7e-230) tmp = (y / (y + x)) / (x + 1.0); elseif (y <= 1.3e+167) tmp = x / ((y + x) * (y + (x + 1.0))); else tmp = (x / (y + x)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7e-230], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+167], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 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 7 \cdot 10^{-230}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+167}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y}\\
\end{array}
\end{array}
if y < 6.99999999999999975e-230Initial program 62.4%
+-commutative62.4%
+-commutative62.4%
+-commutative62.4%
*-commutative62.4%
distribute-rgt1-in43.8%
fma-define62.4%
+-commutative62.4%
+-commutative62.4%
cube-unmult62.4%
+-commutative62.4%
Simplified62.4%
*-commutative62.4%
fma-define43.8%
cube-mult43.8%
distribute-rgt1-in62.4%
*-commutative62.4%
associate-*l*62.4%
times-frac93.1%
associate-+r+93.1%
Applied egg-rr93.1%
div-inv93.0%
+-commutative93.0%
+-commutative93.0%
associate-+l+93.0%
+-commutative93.0%
Applied egg-rr93.0%
associate-*r/93.1%
*-rgt-identity93.1%
associate-/r*99.9%
Simplified99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-/r*93.1%
clear-num93.0%
un-div-inv93.1%
+-commutative93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+r+93.1%
clear-num93.0%
*-commutative93.0%
associate-/l/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 52.8%
+-commutative52.8%
Simplified52.8%
if 6.99999999999999975e-230 < y < 1.3000000000000001e167Initial program 64.9%
+-commutative64.9%
+-commutative64.9%
+-commutative64.9%
*-commutative64.9%
distribute-rgt1-in54.0%
fma-define65.0%
+-commutative65.0%
+-commutative65.0%
cube-unmult65.0%
+-commutative65.0%
Simplified65.0%
*-commutative65.0%
fma-define54.0%
cube-mult54.0%
distribute-rgt1-in64.9%
*-commutative64.9%
associate-*l*64.9%
times-frac99.8%
associate-+r+99.8%
Applied egg-rr99.8%
associate-*r/99.8%
+-commutative99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 74.6%
if 1.3000000000000001e167 < y Initial program 47.1%
+-commutative47.1%
+-commutative47.1%
+-commutative47.1%
*-commutative47.1%
distribute-rgt1-in47.1%
fma-define47.1%
+-commutative47.1%
+-commutative47.1%
cube-unmult47.1%
+-commutative47.1%
Simplified47.1%
*-commutative47.1%
fma-define47.1%
cube-mult47.1%
distribute-rgt1-in47.1%
*-commutative47.1%
associate-*l*47.1%
times-frac73.1%
associate-+r+73.1%
Applied egg-rr73.1%
div-inv73.1%
+-commutative73.1%
+-commutative73.1%
associate-+l+73.1%
+-commutative73.1%
Applied egg-rr73.1%
associate-*r/73.1%
*-rgt-identity73.1%
associate-/r*99.7%
Simplified99.7%
+-commutative99.7%
clear-num99.8%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 84.4%
Final simplification64.0%
(FPCore (x y) :precision binary64 (if (<= x -850000.0) (* (/ y x) (/ 1.0 x)) (if (or (<= x -2e-142) (not (<= x 7.2e-102))) (/ x (* y y)) (/ x y))))
double code(double x, double y) {
double tmp;
if (x <= -850000.0) {
tmp = (y / x) * (1.0 / x);
} else if ((x <= -2e-142) || !(x <= 7.2e-102)) {
tmp = x / (y * y);
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-850000.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if ((x <= (-2d-142)) .or. (.not. (x <= 7.2d-102))) then
tmp = x / (y * y)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -850000.0) {
tmp = (y / x) * (1.0 / x);
} else if ((x <= -2e-142) || !(x <= 7.2e-102)) {
tmp = x / (y * y);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -850000.0: tmp = (y / x) * (1.0 / x) elif (x <= -2e-142) or not (x <= 7.2e-102): tmp = x / (y * y) else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -850000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif ((x <= -2e-142) || !(x <= 7.2e-102)) tmp = Float64(x / Float64(y * y)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -850000.0) tmp = (y / x) * (1.0 / x); elseif ((x <= -2e-142) || ~((x <= 7.2e-102))) tmp = x / (y * y); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -850000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -2e-142], N[Not[LessEqual[x, 7.2e-102]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -850000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-142} \lor \neg \left(x \leq 7.2 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -8.5e5Initial program 61.5%
+-commutative61.5%
+-commutative61.5%
+-commutative61.5%
*-commutative61.5%
distribute-rgt1-in34.9%
fma-define61.5%
+-commutative61.5%
+-commutative61.5%
cube-unmult61.5%
+-commutative61.5%
Simplified61.5%
*-commutative61.5%
fma-define34.9%
cube-mult34.9%
distribute-rgt1-in61.5%
*-commutative61.5%
associate-*l*61.5%
times-frac91.2%
associate-+r+91.2%
Applied egg-rr91.2%
div-inv91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l+91.1%
+-commutative91.1%
Applied egg-rr91.1%
associate-*r/91.2%
*-rgt-identity91.2%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around inf 73.6%
Taylor expanded in x around inf 73.2%
if -8.5e5 < x < -2.0000000000000001e-142 or 7.2e-102 < x Initial program 62.0%
associate-/l*81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around 0 43.7%
Taylor expanded in y around inf 36.0%
if -2.0000000000000001e-142 < x < 7.2e-102Initial program 59.9%
associate-/l*76.7%
associate-+l+76.7%
Simplified76.7%
Taylor expanded in x around 0 84.5%
Taylor expanded in y around 0 74.7%
Final simplification58.0%
(FPCore (x y) :precision binary64 (if (<= y 3.65e+55) (* (/ y (+ y x)) (/ x (* (+ y x) (+ x 1.0)))) (/ (/ x (+ x (+ y 1.0))) (+ y x))))
double code(double x, double y) {
double tmp;
if (y <= 3.65e+55) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0)));
} else {
tmp = (x / (x + (y + 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 <= 3.65d+55) then
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0d0)))
else
tmp = (x / (x + (y + 1.0d0))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.65e+55) {
tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0)));
} else {
tmp = (x / (x + (y + 1.0))) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.65e+55: tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0))) else: tmp = (x / (x + (y + 1.0))) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 3.65e+55) tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(y + x) * Float64(x + 1.0)))); else tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.65e+55) tmp = (y / (y + x)) * (x / ((y + x) * (x + 1.0))); else tmp = (x / (x + (y + 1.0))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.65e+55], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.65 \cdot 10^{+55}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y + x}\\
\end{array}
\end{array}
if y < 3.6499999999999998e55Initial program 64.6%
+-commutative64.6%
+-commutative64.6%
+-commutative64.6%
*-commutative64.6%
distribute-rgt1-in47.5%
fma-define64.6%
+-commutative64.6%
+-commutative64.6%
cube-unmult64.7%
+-commutative64.7%
Simplified64.7%
*-commutative64.7%
fma-define47.6%
cube-mult47.5%
distribute-rgt1-in64.6%
*-commutative64.6%
associate-*l*64.6%
times-frac95.2%
associate-+r+95.2%
Applied egg-rr95.2%
Taylor expanded in y around 0 83.3%
+-commutative83.3%
Simplified83.3%
if 3.6499999999999998e55 < y Initial program 47.3%
+-commutative47.3%
+-commutative47.3%
+-commutative47.3%
*-commutative47.3%
distribute-rgt1-in47.3%
fma-define47.3%
+-commutative47.3%
+-commutative47.3%
cube-unmult47.3%
+-commutative47.3%
Simplified47.3%
*-commutative47.3%
fma-define47.3%
cube-mult47.3%
distribute-rgt1-in47.3%
*-commutative47.3%
associate-*l*47.3%
times-frac82.0%
associate-+r+82.0%
Applied egg-rr82.0%
Taylor expanded in y around inf 81.3%
*-un-lft-identity81.3%
associate-/r*78.3%
+-commutative78.3%
associate-+r+78.3%
+-commutative78.3%
associate-+r+78.3%
div-inv78.3%
associate-*l/78.3%
div-inv78.3%
associate-+r+78.3%
+-commutative78.3%
associate-+r+78.3%
+-commutative78.3%
Applied egg-rr78.3%
Final simplification82.3%
(FPCore (x y)
:precision binary64
(if (<= y 7e-230)
(/ (/ y (+ y x)) (+ x 1.0))
(if (<= y 1.02e+41)
(/ x (* (+ y x) (+ x 1.0)))
(/ (/ x (+ y x)) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 7e-230) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 1.02e+41) {
tmp = x / ((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 <= 7d-230) then
tmp = (y / (y + x)) / (x + 1.0d0)
else if (y <= 1.02d+41) then
tmp = x / ((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 <= 7e-230) {
tmp = (y / (y + x)) / (x + 1.0);
} else if (y <= 1.02e+41) {
tmp = x / ((y + x) * (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7e-230: tmp = (y / (y + x)) / (x + 1.0) elif y <= 1.02e+41: tmp = x / ((y + x) * (x + 1.0)) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 7e-230) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); elseif (y <= 1.02e+41) tmp = Float64(x / 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 <= 7e-230) tmp = (y / (y + x)) / (x + 1.0); elseif (y <= 1.02e+41) tmp = x / ((y + x) * (x + 1.0)); else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7e-230], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+41], N[(x / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{-230}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if y < 6.99999999999999975e-230Initial program 62.4%
+-commutative62.4%
+-commutative62.4%
+-commutative62.4%
*-commutative62.4%
distribute-rgt1-in43.8%
fma-define62.4%
+-commutative62.4%
+-commutative62.4%
cube-unmult62.4%
+-commutative62.4%
Simplified62.4%
*-commutative62.4%
fma-define43.8%
cube-mult43.8%
distribute-rgt1-in62.4%
*-commutative62.4%
associate-*l*62.4%
times-frac93.1%
associate-+r+93.1%
Applied egg-rr93.1%
div-inv93.0%
+-commutative93.0%
+-commutative93.0%
associate-+l+93.0%
+-commutative93.0%
Applied egg-rr93.0%
associate-*r/93.1%
*-rgt-identity93.1%
associate-/r*99.9%
Simplified99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-/r*93.1%
clear-num93.0%
un-div-inv93.1%
+-commutative93.1%
+-commutative93.1%
associate-+r+93.1%
+-commutative93.1%
associate-+r+93.1%
clear-num93.0%
*-commutative93.0%
associate-/l/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 52.8%
+-commutative52.8%
Simplified52.8%
if 6.99999999999999975e-230 < y < 1.01999999999999992e41Initial program 71.2%
+-commutative71.2%
+-commutative71.2%
+-commutative71.2%
*-commutative71.2%
distribute-rgt1-in56.0%
fma-define71.3%
+-commutative71.3%
+-commutative71.3%
cube-unmult71.3%
+-commutative71.3%
Simplified71.3%
*-commutative71.3%
fma-define56.0%
cube-mult56.0%
distribute-rgt1-in71.2%
*-commutative71.2%
associate-*l*71.2%
times-frac99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 70.1%
Taylor expanded in y around 0 69.1%
if 1.01999999999999992e41 < y Initial program 47.8%
+-commutative47.8%
+-commutative47.8%
+-commutative47.8%
*-commutative47.8%
distribute-rgt1-in47.8%
fma-define47.8%
+-commutative47.8%
+-commutative47.8%
cube-unmult47.8%
+-commutative47.8%
Simplified47.8%
*-commutative47.8%
fma-define47.8%
cube-mult47.8%
distribute-rgt1-in47.8%
*-commutative47.8%
associate-*l*47.8%
times-frac83.8%
associate-+r+83.8%
Applied egg-rr83.8%
div-inv83.7%
+-commutative83.7%
+-commutative83.7%
associate-+l+83.7%
+-commutative83.7%
Applied egg-rr83.7%
associate-*r/83.8%
*-rgt-identity83.8%
associate-/r*99.7%
Simplified99.7%
+-commutative99.7%
clear-num99.8%
frac-times99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 73.2%
+-commutative73.2%
Simplified73.2%
Final simplification61.1%
(FPCore (x y) :precision binary64 (if (<= x -1.1e-171) (/ y (* (+ y x) (+ y (+ x 1.0)))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -1.1e-171) {
tmp = y / ((y + x) * (y + (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.1d-171)) then
tmp = y / ((y + x) * (y + (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.1e-171) {
tmp = y / ((y + x) * (y + (x + 1.0)));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.1e-171: tmp = y / ((y + x) * (y + (x + 1.0))) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.1e-171) tmp = Float64(y / Float64(Float64(y + x) * Float64(y + Float64(x + 1.0)))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.1e-171) tmp = y / ((y + x) * (y + (x + 1.0))); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.1e-171], N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-171}:\\
\;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.1000000000000001e-171Initial program 68.8%
+-commutative68.8%
+-commutative68.8%
+-commutative68.8%
*-commutative68.8%
distribute-rgt1-in49.0%
fma-define68.8%
+-commutative68.8%
+-commutative68.8%
cube-unmult68.9%
+-commutative68.9%
Simplified68.9%
*-commutative68.9%
fma-define49.0%
cube-mult49.0%
distribute-rgt1-in68.8%
*-commutative68.8%
associate-*l*68.8%
times-frac94.0%
associate-+r+94.0%
Applied egg-rr94.0%
associate-*r/94.1%
+-commutative94.1%
+-commutative94.1%
+-commutative94.1%
associate-+l+94.1%
+-commutative94.1%
Applied egg-rr94.1%
Taylor expanded in y around 0 73.8%
if -1.1000000000000001e-171 < x Initial program 56.3%
associate-/l*75.8%
associate-+l+75.8%
Simplified75.8%
Taylor expanded in x around 0 58.3%
associate-/r*61.1%
+-commutative61.1%
Simplified61.1%
(FPCore (x y) :precision binary64 (if (<= x -1.55e-111) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -1.55e-111) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.55d-111)) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.55e-111) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.55e-111: tmp = (y / (y + x)) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.55e-111) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.55e-111) tmp = (y / (y + x)) / (x + 1.0); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.55e-111], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-111}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.55000000000000007e-111Initial program 66.7%
+-commutative66.7%
+-commutative66.7%
+-commutative66.7%
*-commutative66.7%
distribute-rgt1-in44.2%
fma-define66.8%
+-commutative66.8%
+-commutative66.8%
cube-unmult66.8%
+-commutative66.8%
Simplified66.8%
*-commutative66.8%
fma-define44.2%
cube-mult44.2%
distribute-rgt1-in66.7%
*-commutative66.7%
associate-*l*66.7%
times-frac93.2%
associate-+r+93.2%
Applied egg-rr93.2%
div-inv93.2%
+-commutative93.2%
+-commutative93.2%
associate-+l+93.2%
+-commutative93.2%
Applied egg-rr93.2%
associate-*r/93.2%
*-rgt-identity93.2%
associate-/r*99.8%
Simplified99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-/r*93.2%
clear-num93.2%
un-div-inv93.3%
+-commutative93.3%
+-commutative93.3%
associate-+r+93.3%
+-commutative93.3%
associate-+r+93.3%
clear-num93.2%
*-commutative93.2%
associate-/l/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 64.8%
+-commutative64.8%
Simplified64.8%
if -1.55000000000000007e-111 < x Initial program 58.3%
associate-/l*77.2%
associate-+l+77.2%
Simplified77.2%
Taylor expanded in x around 0 60.2%
associate-/r*62.7%
+-commutative62.7%
Simplified62.7%
Final simplification63.5%
(FPCore (x y) :precision binary64 (if (<= x -1.5e-111) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -1.5e-111) {
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.5d-111)) 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.5e-111) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.5e-111: 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.5e-111) 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 <= -1.5e-111) 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.5e-111], 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 -1.5 \cdot 10^{-111}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.50000000000000004e-111Initial program 66.7%
+-commutative66.7%
+-commutative66.7%
+-commutative66.7%
*-commutative66.7%
distribute-rgt1-in44.2%
fma-define66.8%
+-commutative66.8%
+-commutative66.8%
cube-unmult66.8%
+-commutative66.8%
Simplified66.8%
*-commutative66.8%
fma-define44.2%
cube-mult44.2%
distribute-rgt1-in66.7%
*-commutative66.7%
associate-*l*66.7%
times-frac93.2%
associate-+r+93.2%
Applied egg-rr93.2%
div-inv93.2%
+-commutative93.2%
+-commutative93.2%
associate-+l+93.2%
+-commutative93.2%
Applied egg-rr93.2%
associate-*r/93.2%
*-rgt-identity93.2%
associate-/r*99.8%
Simplified99.8%
+-commutative99.8%
clear-num99.8%
frac-times98.9%
*-un-lft-identity98.9%
+-commutative98.9%
+-commutative98.9%
associate-+r+98.9%
+-commutative98.9%
associate-+r+98.9%
Applied egg-rr98.9%
Taylor expanded in y around 0 65.4%
associate-/r*64.5%
+-commutative64.5%
Simplified64.5%
if -1.50000000000000004e-111 < x Initial program 58.3%
associate-/l*77.2%
associate-+l+77.2%
Simplified77.2%
Taylor expanded in x around 0 60.2%
associate-/r*62.7%
+-commutative62.7%
Simplified62.7%
(FPCore (x y) :precision binary64 (if (<= x -850000.0) (* (/ y x) (/ 1.0 x)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -850000.0) {
tmp = (y / x) * (1.0 / 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 <= (-850000.0d0)) then
tmp = (y / x) * (1.0d0 / 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 <= -850000.0) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -850000.0: tmp = (y / x) * (1.0 / x) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -850000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / 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 <= -850000.0) tmp = (y / x) * (1.0 / x); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -850000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -850000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -8.5e5Initial program 61.5%
+-commutative61.5%
+-commutative61.5%
+-commutative61.5%
*-commutative61.5%
distribute-rgt1-in34.9%
fma-define61.5%
+-commutative61.5%
+-commutative61.5%
cube-unmult61.5%
+-commutative61.5%
Simplified61.5%
*-commutative61.5%
fma-define34.9%
cube-mult34.9%
distribute-rgt1-in61.5%
*-commutative61.5%
associate-*l*61.5%
times-frac91.2%
associate-+r+91.2%
Applied egg-rr91.2%
div-inv91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l+91.1%
+-commutative91.1%
Applied egg-rr91.1%
associate-*r/91.2%
*-rgt-identity91.2%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around inf 73.6%
Taylor expanded in x around inf 73.2%
if -8.5e5 < x Initial program 61.1%
associate-/l*79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in x around 0 61.2%
associate-/r*63.5%
+-commutative63.5%
Simplified63.5%
(FPCore (x y) :precision binary64 (if (<= x -620000.0) (* (/ y x) (/ 1.0 x)) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -620000.0) {
tmp = (y / x) * (1.0 / 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 <= (-620000.0d0)) then
tmp = (y / x) * (1.0d0 / 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 <= -620000.0) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -620000.0: tmp = (y / x) * (1.0 / x) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -620000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -620000.0) tmp = (y / x) * (1.0 / x); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -620000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -620000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -6.2e5Initial program 61.5%
+-commutative61.5%
+-commutative61.5%
+-commutative61.5%
*-commutative61.5%
distribute-rgt1-in34.9%
fma-define61.5%
+-commutative61.5%
+-commutative61.5%
cube-unmult61.5%
+-commutative61.5%
Simplified61.5%
*-commutative61.5%
fma-define34.9%
cube-mult34.9%
distribute-rgt1-in61.5%
*-commutative61.5%
associate-*l*61.5%
times-frac91.2%
associate-+r+91.2%
Applied egg-rr91.2%
div-inv91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l+91.1%
+-commutative91.1%
Applied egg-rr91.1%
associate-*r/91.2%
*-rgt-identity91.2%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around inf 73.6%
Taylor expanded in x around inf 73.2%
if -6.2e5 < x Initial program 61.1%
associate-/l*79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in x around 0 61.2%
Final simplification64.3%
(FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (/ x (* y y))))
double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.0) tmp = x / y; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1Initial program 65.1%
associate-/l*80.3%
associate-+l+80.3%
Simplified80.3%
Taylor expanded in x around 0 47.6%
Taylor expanded in y around 0 31.4%
if 1 < y Initial program 48.9%
associate-/l*76.0%
associate-+l+76.0%
Simplified76.0%
Taylor expanded in x around 0 64.1%
Taylor expanded in y around inf 64.1%
(FPCore (x y) :precision binary64 (if (<= x -118000.0) (/ 1.0 x) (/ 1.0 (/ y x))))
double code(double x, double y) {
double tmp;
if (x <= -118000.0) {
tmp = 1.0 / 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 (x <= (-118000.0d0)) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (y / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -118000.0) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (y / x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -118000.0: tmp = 1.0 / x else: tmp = 1.0 / (y / x) return tmp
function code(x, y) tmp = 0.0 if (x <= -118000.0) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -118000.0) tmp = 1.0 / x; else tmp = 1.0 / (y / x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -118000.0], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -118000:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\end{array}
\end{array}
if x < -118000Initial program 61.5%
+-commutative61.5%
+-commutative61.5%
+-commutative61.5%
*-commutative61.5%
distribute-rgt1-in34.9%
fma-define61.5%
+-commutative61.5%
+-commutative61.5%
cube-unmult61.5%
+-commutative61.5%
Simplified61.5%
*-commutative61.5%
fma-define34.9%
cube-mult34.9%
distribute-rgt1-in61.5%
*-commutative61.5%
associate-*l*61.5%
times-frac91.2%
associate-+r+91.2%
Applied egg-rr91.2%
div-inv91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l+91.1%
+-commutative91.1%
Applied egg-rr91.1%
associate-*r/91.2%
*-rgt-identity91.2%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around inf 73.6%
Taylor expanded in y around inf 5.5%
if -118000 < x Initial program 61.1%
associate-/l*79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in x around 0 61.2%
Taylor expanded in y around 0 39.0%
clear-num40.3%
inv-pow40.3%
Applied egg-rr40.3%
unpow-140.3%
Simplified40.3%
(FPCore (x y) :precision binary64 (if (<= x -4600.0) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -4600.0) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4600.0d0)) then
tmp = 1.0d0 / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4600.0) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4600.0: tmp = 1.0 / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -4600.0) tmp = Float64(1.0 / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4600.0) tmp = 1.0 / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4600.0], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4600:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -4600Initial program 61.5%
+-commutative61.5%
+-commutative61.5%
+-commutative61.5%
*-commutative61.5%
distribute-rgt1-in34.9%
fma-define61.5%
+-commutative61.5%
+-commutative61.5%
cube-unmult61.5%
+-commutative61.5%
Simplified61.5%
*-commutative61.5%
fma-define34.9%
cube-mult34.9%
distribute-rgt1-in61.5%
*-commutative61.5%
associate-*l*61.5%
times-frac91.2%
associate-+r+91.2%
Applied egg-rr91.2%
div-inv91.1%
+-commutative91.1%
+-commutative91.1%
associate-+l+91.1%
+-commutative91.1%
Applied egg-rr91.1%
associate-*r/91.2%
*-rgt-identity91.2%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around inf 73.6%
Taylor expanded in y around inf 5.5%
if -4600 < x Initial program 61.1%
associate-/l*79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in x around 0 61.2%
Taylor expanded in y around 0 39.0%
(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 61.2%
+-commutative61.2%
+-commutative61.2%
+-commutative61.2%
*-commutative61.2%
distribute-rgt1-in47.5%
fma-define61.2%
+-commutative61.2%
+-commutative61.2%
cube-unmult61.2%
+-commutative61.2%
Simplified61.2%
*-commutative61.2%
fma-define47.5%
cube-mult47.5%
distribute-rgt1-in61.2%
*-commutative61.2%
associate-*l*61.2%
times-frac92.6%
associate-+r+92.6%
Applied egg-rr92.6%
div-inv92.5%
+-commutative92.5%
+-commutative92.5%
associate-+l+92.5%
+-commutative92.5%
Applied egg-rr92.5%
associate-*r/92.6%
*-rgt-identity92.6%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around inf 37.8%
Taylor expanded in y around inf 4.4%
(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 2024145
(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))))