
(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 23 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 (/ (/ (/ x (+ 1.0 (/ x y))) (+ x y)) (+ 1.0 (+ x y))))
double code(double x, double y) {
return ((x / (1.0 + (x / y))) / (x + y)) / (1.0 + (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / (1.0d0 + (x / y))) / (x + y)) / (1.0d0 + (x + y))
end function
public static double code(double x, double y) {
return ((x / (1.0 + (x / y))) / (x + y)) / (1.0 + (x + y));
}
def code(x, y): return ((x / (1.0 + (x / y))) / (x + y)) / (1.0 + (x + y))
function code(x, y) return Float64(Float64(Float64(x / Float64(1.0 + Float64(x / y))) / Float64(x + y)) / Float64(1.0 + Float64(x + y))) end
function tmp = code(x, y) tmp = ((x / (1.0 + (x / y))) / (x + y)) / (1.0 + (x + y)); end
code[x_, y_] := N[(N[(N[(x / N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{1 + \frac{x}{y}}}{x + y}}{1 + \left(x + y\right)}
\end{array}
Initial program 66.7%
+-commutative66.7%
+-commutative66.7%
+-commutative66.7%
*-commutative66.7%
distribute-rgt1-in50.5%
fma-define66.7%
+-commutative66.7%
+-commutative66.7%
cube-unmult66.7%
+-commutative66.7%
Simplified66.7%
*-commutative66.7%
fma-define50.6%
cube-mult50.5%
distribute-rgt1-in66.7%
*-commutative66.7%
associate-*l*66.7%
times-frac91.6%
associate-+r+91.6%
Applied egg-rr91.6%
clear-num91.5%
associate-/r*99.8%
frac-times99.0%
metadata-eval99.0%
times-frac99.0%
*-un-lft-identity99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
Applied egg-rr99.0%
add-exp-log74.7%
associate-/r*74.8%
log-div36.0%
div-inv35.9%
+-commutative35.9%
+-commutative35.9%
clear-num35.6%
+-commutative35.6%
+-commutative35.6%
associate-+l+35.6%
+-commutative35.6%
log1p-undefine35.6%
Applied egg-rr35.6%
exp-diff35.5%
rem-exp-log57.3%
associate-*r/57.3%
associate-/r/57.3%
log1p-undefine57.3%
rem-exp-log99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
(FPCore (x y)
:precision binary64
(if (<= x -3e-11)
(/ (/ y (+ x y)) (+ 1.0 (+ x y)))
(if (<= x -3e-197)
(* x (/ y (* (+ 1.0 y) (* (+ x y) (+ x y)))))
(/ (/ x y) (* (+ x (+ 1.0 y)) (/ (+ x y) y))))))
double code(double x, double y) {
double tmp;
if (x <= -3e-11) {
tmp = (y / (x + y)) / (1.0 + (x + y));
} else if (x <= -3e-197) {
tmp = x * (y / ((1.0 + y) * ((x + y) * (x + y))));
} else {
tmp = (x / y) / ((x + (1.0 + y)) * ((x + y) / y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3d-11)) then
tmp = (y / (x + y)) / (1.0d0 + (x + y))
else if (x <= (-3d-197)) then
tmp = x * (y / ((1.0d0 + y) * ((x + y) * (x + y))))
else
tmp = (x / y) / ((x + (1.0d0 + y)) * ((x + y) / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3e-11) {
tmp = (y / (x + y)) / (1.0 + (x + y));
} else if (x <= -3e-197) {
tmp = x * (y / ((1.0 + y) * ((x + y) * (x + y))));
} else {
tmp = (x / y) / ((x + (1.0 + y)) * ((x + y) / y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3e-11: tmp = (y / (x + y)) / (1.0 + (x + y)) elif x <= -3e-197: tmp = x * (y / ((1.0 + y) * ((x + y) * (x + y)))) else: tmp = (x / y) / ((x + (1.0 + y)) * ((x + y) / y)) return tmp
function code(x, y) tmp = 0.0 if (x <= -3e-11) tmp = Float64(Float64(y / Float64(x + y)) / Float64(1.0 + Float64(x + y))); elseif (x <= -3e-197) tmp = Float64(x * Float64(y / Float64(Float64(1.0 + y) * Float64(Float64(x + y) * Float64(x + y))))); else tmp = Float64(Float64(x / y) / Float64(Float64(x + Float64(1.0 + y)) * Float64(Float64(x + y) / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3e-11) tmp = (y / (x + y)) / (1.0 + (x + y)); elseif (x <= -3e-197) tmp = x * (y / ((1.0 + y) * ((x + y) * (x + y)))); else tmp = (x / y) / ((x + (1.0 + y)) * ((x + y) / y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3e-11], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3e-197], N[(x * N[(y / N[(N[(1.0 + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(x + N[(1.0 + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{1 + \left(x + y\right)}\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-197}:\\
\;\;\;\;x \cdot \frac{y}{\left(1 + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\left(x + \left(1 + y\right)\right) \cdot \frac{x + y}{y}}\\
\end{array}
\end{array}
if x < -3e-11Initial program 61.4%
+-commutative61.4%
+-commutative61.4%
+-commutative61.4%
*-commutative61.4%
distribute-rgt1-in24.2%
fma-define61.4%
+-commutative61.4%
+-commutative61.4%
cube-unmult61.4%
+-commutative61.4%
Simplified61.4%
*-commutative61.4%
fma-define24.2%
cube-mult24.2%
distribute-rgt1-in61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac87.5%
associate-+r+87.5%
Applied egg-rr87.5%
clear-num87.5%
associate-/r*99.8%
frac-times99.1%
metadata-eval99.1%
times-frac99.1%
*-un-lft-identity99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
add-exp-log75.5%
associate-/r*76.2%
log-div0.0%
div-inv0.0%
+-commutative0.0%
+-commutative0.0%
clear-num0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
+-commutative0.0%
log1p-undefine0.0%
Applied egg-rr0.0%
exp-diff0.0%
rem-exp-log11.9%
associate-*r/11.9%
associate-/r/11.9%
log1p-undefine11.9%
rem-exp-log99.8%
Simplified99.8%
Taylor expanded in x around inf 74.9%
if -3e-11 < x < -3.00000000000000026e-197Initial program 79.7%
associate-/l*92.5%
associate-+l+92.5%
Simplified92.5%
Taylor expanded in x around 0 92.5%
+-commutative92.5%
Simplified92.5%
if -3.00000000000000026e-197 < x Initial program 66.6%
+-commutative66.6%
+-commutative66.6%
+-commutative66.6%
*-commutative66.6%
distribute-rgt1-in60.1%
fma-define66.6%
+-commutative66.6%
+-commutative66.6%
cube-unmult66.6%
+-commutative66.6%
Simplified66.6%
*-commutative66.6%
fma-define60.1%
cube-mult60.1%
distribute-rgt1-in66.6%
*-commutative66.6%
associate-*l*66.6%
times-frac91.9%
associate-+r+91.9%
Applied egg-rr91.9%
clear-num91.8%
associate-/r*99.7%
frac-times98.7%
metadata-eval98.7%
times-frac98.7%
*-un-lft-identity98.7%
*-un-lft-identity98.7%
+-commutative98.7%
+-commutative98.7%
Applied egg-rr98.7%
Taylor expanded in x around 0 74.5%
Final simplification76.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ x y))))
(if (<= x -3.2e-11)
(/ (/ y (+ x y)) t_0)
(if (<= x -2.15e-197)
(* x (/ y (* (+ 1.0 y) (* (+ x y) (+ x y)))))
(/ (/ x (+ x y)) t_0)))))
double code(double x, double y) {
double t_0 = 1.0 + (x + y);
double tmp;
if (x <= -3.2e-11) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -2.15e-197) {
tmp = x * (y / ((1.0 + y) * ((x + y) * (x + y))));
} else {
tmp = (x / (x + y)) / 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 = 1.0d0 + (x + y)
if (x <= (-3.2d-11)) then
tmp = (y / (x + y)) / t_0
else if (x <= (-2.15d-197)) then
tmp = x * (y / ((1.0d0 + y) * ((x + y) * (x + y))))
else
tmp = (x / (x + y)) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (x + y);
double tmp;
if (x <= -3.2e-11) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -2.15e-197) {
tmp = x * (y / ((1.0 + y) * ((x + y) * (x + y))));
} else {
tmp = (x / (x + y)) / t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (x + y) tmp = 0 if x <= -3.2e-11: tmp = (y / (x + y)) / t_0 elif x <= -2.15e-197: tmp = x * (y / ((1.0 + y) * ((x + y) * (x + y)))) else: tmp = (x / (x + y)) / t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(x + y)) tmp = 0.0 if (x <= -3.2e-11) tmp = Float64(Float64(y / Float64(x + y)) / t_0); elseif (x <= -2.15e-197) tmp = Float64(x * Float64(y / Float64(Float64(1.0 + y) * Float64(Float64(x + y) * Float64(x + y))))); else tmp = Float64(Float64(x / Float64(x + y)) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (x + y); tmp = 0.0; if (x <= -3.2e-11) tmp = (y / (x + y)) / t_0; elseif (x <= -2.15e-197) tmp = x * (y / ((1.0 + y) * ((x + y) * (x + y)))); else tmp = (x / (x + y)) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e-11], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, -2.15e-197], N[(x * N[(y / N[(N[(1.0 + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(x + y\right)\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{t\_0}\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{-197}:\\
\;\;\;\;x \cdot \frac{y}{\left(1 + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{t\_0}\\
\end{array}
\end{array}
if x < -3.19999999999999994e-11Initial program 61.4%
+-commutative61.4%
+-commutative61.4%
+-commutative61.4%
*-commutative61.4%
distribute-rgt1-in24.2%
fma-define61.4%
+-commutative61.4%
+-commutative61.4%
cube-unmult61.4%
+-commutative61.4%
Simplified61.4%
*-commutative61.4%
fma-define24.2%
cube-mult24.2%
distribute-rgt1-in61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac87.5%
associate-+r+87.5%
Applied egg-rr87.5%
clear-num87.5%
associate-/r*99.8%
frac-times99.1%
metadata-eval99.1%
times-frac99.1%
*-un-lft-identity99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
add-exp-log75.5%
associate-/r*76.2%
log-div0.0%
div-inv0.0%
+-commutative0.0%
+-commutative0.0%
clear-num0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
+-commutative0.0%
log1p-undefine0.0%
Applied egg-rr0.0%
exp-diff0.0%
rem-exp-log11.9%
associate-*r/11.9%
associate-/r/11.9%
log1p-undefine11.9%
rem-exp-log99.8%
Simplified99.8%
Taylor expanded in x around inf 74.9%
if -3.19999999999999994e-11 < x < -2.15e-197Initial program 79.7%
associate-/l*92.5%
associate-+l+92.5%
Simplified92.5%
Taylor expanded in x around 0 92.5%
+-commutative92.5%
Simplified92.5%
if -2.15e-197 < x Initial program 66.6%
+-commutative66.6%
+-commutative66.6%
+-commutative66.6%
*-commutative66.6%
distribute-rgt1-in60.1%
fma-define66.6%
+-commutative66.6%
+-commutative66.6%
cube-unmult66.6%
+-commutative66.6%
Simplified66.6%
*-commutative66.6%
fma-define60.1%
cube-mult60.1%
distribute-rgt1-in66.6%
*-commutative66.6%
associate-*l*66.6%
times-frac91.9%
associate-+r+91.9%
Applied egg-rr91.9%
clear-num91.8%
associate-/r*99.7%
frac-times98.7%
metadata-eval98.7%
times-frac98.7%
*-un-lft-identity98.7%
*-un-lft-identity98.7%
+-commutative98.7%
+-commutative98.7%
Applied egg-rr98.7%
add-exp-log79.6%
associate-/r*79.4%
log-div54.5%
div-inv54.5%
+-commutative54.5%
+-commutative54.5%
clear-num53.8%
+-commutative53.8%
+-commutative53.8%
associate-+l+53.8%
+-commutative53.8%
log1p-undefine53.8%
Applied egg-rr53.8%
exp-diff53.7%
rem-exp-log74.9%
associate-*r/74.9%
associate-/r/74.9%
log1p-undefine74.9%
rem-exp-log99.8%
Simplified99.8%
Taylor expanded in x around 0 64.9%
Final simplification70.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ x y))))
(if (<= x -8.5e+33)
(/ (/ y (+ x y)) t_0)
(if (<= x -6.5e-150)
(* x (/ y (* (+ x 1.0) (* (+ x y) (+ x y)))))
(/ (/ x (+ x y)) t_0)))))
double code(double x, double y) {
double t_0 = 1.0 + (x + y);
double tmp;
if (x <= -8.5e+33) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -6.5e-150) {
tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y))));
} else {
tmp = (x / (x + y)) / 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 = 1.0d0 + (x + y)
if (x <= (-8.5d+33)) then
tmp = (y / (x + y)) / t_0
else if (x <= (-6.5d-150)) then
tmp = x * (y / ((x + 1.0d0) * ((x + y) * (x + y))))
else
tmp = (x / (x + y)) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (x + y);
double tmp;
if (x <= -8.5e+33) {
tmp = (y / (x + y)) / t_0;
} else if (x <= -6.5e-150) {
tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y))));
} else {
tmp = (x / (x + y)) / t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (x + y) tmp = 0 if x <= -8.5e+33: tmp = (y / (x + y)) / t_0 elif x <= -6.5e-150: tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y)))) else: tmp = (x / (x + y)) / t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(x + y)) tmp = 0.0 if (x <= -8.5e+33) tmp = Float64(Float64(y / Float64(x + y)) / t_0); elseif (x <= -6.5e-150) tmp = Float64(x * Float64(y / Float64(Float64(x + 1.0) * Float64(Float64(x + y) * Float64(x + y))))); else tmp = Float64(Float64(x / Float64(x + y)) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (x + y); tmp = 0.0; if (x <= -8.5e+33) tmp = (y / (x + y)) / t_0; elseif (x <= -6.5e-150) tmp = x * (y / ((x + 1.0) * ((x + y) * (x + y)))); else tmp = (x / (x + y)) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+33], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, -6.5e-150], N[(x * N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(x + y\right)\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+33}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{t\_0}\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-150}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{t\_0}\\
\end{array}
\end{array}
if x < -8.4999999999999998e33Initial program 59.2%
+-commutative59.2%
+-commutative59.2%
+-commutative59.2%
*-commutative59.2%
distribute-rgt1-in18.5%
fma-define59.2%
+-commutative59.2%
+-commutative59.2%
cube-unmult59.3%
+-commutative59.3%
Simplified59.3%
*-commutative59.3%
fma-define18.5%
cube-mult18.5%
distribute-rgt1-in59.2%
*-commutative59.2%
associate-*l*59.2%
times-frac87.8%
associate-+r+87.8%
Applied egg-rr87.8%
clear-num87.7%
associate-/r*99.9%
frac-times99.1%
metadata-eval99.1%
times-frac99.1%
*-un-lft-identity99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
add-exp-log79.5%
associate-/r*80.4%
log-div0.0%
div-inv0.0%
+-commutative0.0%
+-commutative0.0%
clear-num0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
+-commutative0.0%
log1p-undefine0.0%
Applied egg-rr0.0%
exp-diff0.0%
rem-exp-log10.2%
associate-*r/10.2%
associate-/r/10.2%
log1p-undefine10.2%
rem-exp-log99.9%
Simplified99.9%
Taylor expanded in x around inf 77.0%
if -8.4999999999999998e33 < x < -6.49999999999999997e-150Initial program 84.7%
associate-/l*96.0%
associate-+l+96.0%
Simplified96.0%
Taylor expanded in y around 0 71.5%
+-commutative71.5%
Simplified71.5%
if -6.49999999999999997e-150 < x Initial program 66.8%
+-commutative66.8%
+-commutative66.8%
+-commutative66.8%
*-commutative66.8%
distribute-rgt1-in59.5%
fma-define66.8%
+-commutative66.8%
+-commutative66.8%
cube-unmult66.8%
+-commutative66.8%
Simplified66.8%
*-commutative66.8%
fma-define59.5%
cube-mult59.5%
distribute-rgt1-in66.8%
*-commutative66.8%
associate-*l*66.8%
times-frac92.3%
associate-+r+92.3%
Applied egg-rr92.3%
clear-num92.3%
associate-/r*99.7%
frac-times98.8%
metadata-eval98.8%
times-frac98.8%
*-un-lft-identity98.8%
*-un-lft-identity98.8%
+-commutative98.8%
+-commutative98.8%
Applied egg-rr98.8%
add-exp-log77.8%
associate-/r*77.5%
log-div51.7%
div-inv51.7%
+-commutative51.7%
+-commutative51.7%
clear-num51.1%
+-commutative51.1%
+-commutative51.1%
associate-+l+51.1%
+-commutative51.1%
log1p-undefine51.1%
Applied egg-rr51.1%
exp-diff51.0%
rem-exp-log74.0%
associate-*r/74.0%
associate-/r/73.9%
log1p-undefine73.9%
rem-exp-log99.8%
Simplified99.8%
Taylor expanded in x around 0 65.2%
Final simplification68.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ 1.0 y))))
(if (<= y 7e+160)
(* (/ y (+ x y)) (/ x (* (+ x y) t_0)))
(/ (/ x y) (* t_0 (/ (+ x y) y))))))
double code(double x, double y) {
double t_0 = x + (1.0 + y);
double tmp;
if (y <= 7e+160) {
tmp = (y / (x + y)) * (x / ((x + y) * t_0));
} else {
tmp = (x / y) / (t_0 * ((x + y) / y));
}
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 + (1.0d0 + y)
if (y <= 7d+160) then
tmp = (y / (x + y)) * (x / ((x + y) * t_0))
else
tmp = (x / y) / (t_0 * ((x + y) / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (1.0 + y);
double tmp;
if (y <= 7e+160) {
tmp = (y / (x + y)) * (x / ((x + y) * t_0));
} else {
tmp = (x / y) / (t_0 * ((x + y) / y));
}
return tmp;
}
def code(x, y): t_0 = x + (1.0 + y) tmp = 0 if y <= 7e+160: tmp = (y / (x + y)) * (x / ((x + y) * t_0)) else: tmp = (x / y) / (t_0 * ((x + y) / y)) return tmp
function code(x, y) t_0 = Float64(x + Float64(1.0 + y)) tmp = 0.0 if (y <= 7e+160) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x + y) * t_0))); else tmp = Float64(Float64(x / y) / Float64(t_0 * Float64(Float64(x + y) / y))); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (1.0 + y); tmp = 0.0; if (y <= 7e+160) tmp = (y / (x + y)) * (x / ((x + y) * t_0)); else tmp = (x / y) / (t_0 * ((x + y) / y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 7e+160], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(t$95$0 * N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(1 + y\right)\\
\mathbf{if}\;y \leq 7 \cdot 10^{+160}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0 \cdot \frac{x + y}{y}}\\
\end{array}
\end{array}
if y < 7.00000000000000051e160Initial program 69.8%
+-commutative69.8%
+-commutative69.8%
+-commutative69.8%
*-commutative69.8%
distribute-rgt1-in50.7%
fma-define69.8%
+-commutative69.8%
+-commutative69.8%
cube-unmult69.8%
+-commutative69.8%
Simplified69.8%
*-commutative69.8%
fma-define50.7%
cube-mult50.7%
distribute-rgt1-in69.8%
*-commutative69.8%
associate-*l*69.8%
times-frac95.1%
associate-+r+95.1%
Applied egg-rr95.1%
if 7.00000000000000051e160 < y Initial program 49.7%
+-commutative49.7%
+-commutative49.7%
+-commutative49.7%
*-commutative49.7%
distribute-rgt1-in49.7%
fma-define49.7%
+-commutative49.7%
+-commutative49.7%
cube-unmult49.7%
+-commutative49.7%
Simplified49.7%
*-commutative49.7%
fma-define49.7%
cube-mult49.7%
distribute-rgt1-in49.7%
*-commutative49.7%
associate-*l*49.7%
times-frac72.3%
associate-+r+72.3%
Applied egg-rr72.3%
clear-num72.3%
associate-/r*99.8%
frac-times99.8%
metadata-eval99.8%
times-frac99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 91.7%
Final simplification94.6%
(FPCore (x y) :precision binary64 (let* ((t_0 (/ (/ x (/ (+ x y) y)) (+ x y)))) (if (<= x -3.2e-11) (/ t_0 (+ x 1.0)) (/ t_0 (+ 1.0 y)))))
double code(double x, double y) {
double t_0 = (x / ((x + y) / y)) / (x + y);
double tmp;
if (x <= -3.2e-11) {
tmp = t_0 / (x + 1.0);
} else {
tmp = t_0 / (1.0 + y);
}
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 / ((x + y) / y)) / (x + y)
if (x <= (-3.2d-11)) then
tmp = t_0 / (x + 1.0d0)
else
tmp = t_0 / (1.0d0 + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x / ((x + y) / y)) / (x + y);
double tmp;
if (x <= -3.2e-11) {
tmp = t_0 / (x + 1.0);
} else {
tmp = t_0 / (1.0 + y);
}
return tmp;
}
def code(x, y): t_0 = (x / ((x + y) / y)) / (x + y) tmp = 0 if x <= -3.2e-11: tmp = t_0 / (x + 1.0) else: tmp = t_0 / (1.0 + y) return tmp
function code(x, y) t_0 = Float64(Float64(x / Float64(Float64(x + y) / y)) / Float64(x + y)) tmp = 0.0 if (x <= -3.2e-11) tmp = Float64(t_0 / Float64(x + 1.0)); else tmp = Float64(t_0 / Float64(1.0 + y)); end return tmp end
function tmp_2 = code(x, y) t_0 = (x / ((x + y) / y)) / (x + y); tmp = 0.0; if (x <= -3.2e-11) tmp = t_0 / (x + 1.0); else tmp = t_0 / (1.0 + y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e-11], N[(t$95$0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{x}{\frac{x + y}{y}}}{x + y}\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{t\_0}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{1 + y}\\
\end{array}
\end{array}
if x < -3.19999999999999994e-11Initial program 61.4%
+-commutative61.4%
+-commutative61.4%
+-commutative61.4%
*-commutative61.4%
distribute-rgt1-in24.2%
fma-define61.4%
+-commutative61.4%
+-commutative61.4%
cube-unmult61.4%
+-commutative61.4%
Simplified61.4%
*-commutative61.4%
fma-define24.2%
cube-mult24.2%
distribute-rgt1-in61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac87.5%
associate-+r+87.5%
Applied egg-rr87.5%
clear-num87.5%
associate-/r*99.8%
frac-times99.1%
metadata-eval99.1%
times-frac99.1%
*-un-lft-identity99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
add-exp-log75.5%
associate-/r*76.2%
log-div0.0%
div-inv0.0%
+-commutative0.0%
+-commutative0.0%
clear-num0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
+-commutative0.0%
log1p-undefine0.0%
Applied egg-rr0.0%
exp-diff0.0%
rem-exp-log11.9%
associate-*r/11.9%
associate-/r/11.9%
log1p-undefine11.9%
rem-exp-log99.8%
Simplified99.8%
Taylor expanded in x around inf 74.9%
if -3.19999999999999994e-11 < x Initial program 68.6%
+-commutative68.6%
+-commutative68.6%
+-commutative68.6%
*-commutative68.6%
distribute-rgt1-in60.5%
fma-define68.6%
+-commutative68.6%
+-commutative68.6%
cube-unmult68.7%
+-commutative68.7%
Simplified68.7%
*-commutative68.7%
fma-define60.5%
cube-mult60.5%
distribute-rgt1-in68.6%
*-commutative68.6%
associate-*l*68.7%
times-frac93.1%
associate-+r+93.1%
Applied egg-rr93.1%
clear-num93.0%
associate-/r*99.7%
frac-times98.9%
metadata-eval98.9%
times-frac98.9%
*-un-lft-identity98.9%
*-un-lft-identity98.9%
+-commutative98.9%
+-commutative98.9%
Applied egg-rr98.9%
add-exp-log74.5%
associate-/r*74.3%
log-div49.5%
div-inv49.5%
+-commutative49.5%
+-commutative49.5%
clear-num48.9%
+-commutative48.9%
+-commutative48.9%
associate-+l+48.9%
+-commutative48.9%
log1p-undefine48.9%
Applied egg-rr48.9%
exp-diff48.8%
rem-exp-log74.4%
associate-*r/74.3%
associate-/r/74.3%
log1p-undefine74.3%
rem-exp-log99.8%
Simplified99.8%
Taylor expanded in x around 0 83.9%
Final simplification81.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (+ x y) y)))
(if (<= y 5.6e-17)
(/ (/ (/ x t_0) (+ x y)) (+ x 1.0))
(/ (/ x y) (* (+ x (+ 1.0 y)) t_0)))))
double code(double x, double y) {
double t_0 = (x + y) / y;
double tmp;
if (y <= 5.6e-17) {
tmp = ((x / t_0) / (x + y)) / (x + 1.0);
} else {
tmp = (x / y) / ((x + (1.0 + y)) * t_0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (x + y) / y
if (y <= 5.6d-17) then
tmp = ((x / t_0) / (x + y)) / (x + 1.0d0)
else
tmp = (x / y) / ((x + (1.0d0 + y)) * t_0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x + y) / y;
double tmp;
if (y <= 5.6e-17) {
tmp = ((x / t_0) / (x + y)) / (x + 1.0);
} else {
tmp = (x / y) / ((x + (1.0 + y)) * t_0);
}
return tmp;
}
def code(x, y): t_0 = (x + y) / y tmp = 0 if y <= 5.6e-17: tmp = ((x / t_0) / (x + y)) / (x + 1.0) else: tmp = (x / y) / ((x + (1.0 + y)) * t_0) return tmp
function code(x, y) t_0 = Float64(Float64(x + y) / y) tmp = 0.0 if (y <= 5.6e-17) tmp = Float64(Float64(Float64(x / t_0) / Float64(x + y)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(Float64(x + Float64(1.0 + y)) * t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = (x + y) / y; tmp = 0.0; if (y <= 5.6e-17) tmp = ((x / t_0) / (x + y)) / (x + 1.0); else tmp = (x / y) / ((x + (1.0 + y)) * t_0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, 5.6e-17], N[(N[(N[(x / t$95$0), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(x + N[(1.0 + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{y}\\
\mathbf{if}\;y \leq 5.6 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{\frac{x}{t\_0}}{x + y}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\left(x + \left(1 + y\right)\right) \cdot t\_0}\\
\end{array}
\end{array}
if y < 5.5999999999999998e-17Initial program 68.1%
+-commutative68.1%
+-commutative68.1%
+-commutative68.1%
*-commutative68.1%
distribute-rgt1-in46.9%
fma-define68.1%
+-commutative68.1%
+-commutative68.1%
cube-unmult68.1%
+-commutative68.1%
Simplified68.1%
*-commutative68.1%
fma-define46.9%
cube-mult46.9%
distribute-rgt1-in68.1%
*-commutative68.1%
associate-*l*68.1%
times-frac95.2%
associate-+r+95.2%
Applied egg-rr95.2%
clear-num95.2%
associate-/r*99.8%
frac-times98.6%
metadata-eval98.6%
times-frac98.6%
*-un-lft-identity98.6%
*-un-lft-identity98.6%
+-commutative98.6%
+-commutative98.6%
Applied egg-rr98.6%
add-exp-log74.0%
associate-/r*74.0%
log-div25.2%
div-inv25.2%
+-commutative25.2%
+-commutative25.2%
clear-num24.7%
+-commutative24.7%
+-commutative24.7%
associate-+l+24.7%
+-commutative24.7%
log1p-undefine24.7%
Applied egg-rr24.7%
exp-diff24.7%
rem-exp-log46.4%
associate-*r/46.4%
associate-/r/46.4%
log1p-undefine46.4%
rem-exp-log99.8%
Simplified99.8%
Taylor expanded in x around inf 79.1%
if 5.5999999999999998e-17 < y Initial program 63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
*-commutative63.2%
distribute-rgt1-in59.3%
fma-define63.2%
+-commutative63.2%
+-commutative63.2%
cube-unmult63.2%
+-commutative63.2%
Simplified63.2%
*-commutative63.2%
fma-define59.3%
cube-mult59.3%
distribute-rgt1-in63.2%
*-commutative63.2%
associate-*l*63.2%
times-frac82.8%
associate-+r+82.8%
Applied egg-rr82.8%
clear-num82.8%
associate-/r*99.7%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 90.6%
Final simplification82.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (+ x y) y)))
(if (<= y 5.6e-17)
(/ (/ x (+ x y)) (* t_0 (+ x 1.0)))
(/ (/ x y) (* (+ x (+ 1.0 y)) t_0)))))
double code(double x, double y) {
double t_0 = (x + y) / y;
double tmp;
if (y <= 5.6e-17) {
tmp = (x / (x + y)) / (t_0 * (x + 1.0));
} else {
tmp = (x / y) / ((x + (1.0 + y)) * t_0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (x + y) / y
if (y <= 5.6d-17) then
tmp = (x / (x + y)) / (t_0 * (x + 1.0d0))
else
tmp = (x / y) / ((x + (1.0d0 + y)) * t_0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x + y) / y;
double tmp;
if (y <= 5.6e-17) {
tmp = (x / (x + y)) / (t_0 * (x + 1.0));
} else {
tmp = (x / y) / ((x + (1.0 + y)) * t_0);
}
return tmp;
}
def code(x, y): t_0 = (x + y) / y tmp = 0 if y <= 5.6e-17: tmp = (x / (x + y)) / (t_0 * (x + 1.0)) else: tmp = (x / y) / ((x + (1.0 + y)) * t_0) return tmp
function code(x, y) t_0 = Float64(Float64(x + y) / y) tmp = 0.0 if (y <= 5.6e-17) tmp = Float64(Float64(x / Float64(x + y)) / Float64(t_0 * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(Float64(x + Float64(1.0 + y)) * t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = (x + y) / y; tmp = 0.0; if (y <= 5.6e-17) tmp = (x / (x + y)) / (t_0 * (x + 1.0)); else tmp = (x / y) / ((x + (1.0 + y)) * t_0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, 5.6e-17], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(N[(x + N[(1.0 + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{y}\\
\mathbf{if}\;y \leq 5.6 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{t\_0 \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\left(x + \left(1 + y\right)\right) \cdot t\_0}\\
\end{array}
\end{array}
if y < 5.5999999999999998e-17Initial program 68.1%
+-commutative68.1%
+-commutative68.1%
+-commutative68.1%
*-commutative68.1%
distribute-rgt1-in46.9%
fma-define68.1%
+-commutative68.1%
+-commutative68.1%
cube-unmult68.1%
+-commutative68.1%
Simplified68.1%
*-commutative68.1%
fma-define46.9%
cube-mult46.9%
distribute-rgt1-in68.1%
*-commutative68.1%
associate-*l*68.1%
times-frac95.2%
associate-+r+95.2%
Applied egg-rr95.2%
clear-num95.2%
associate-/r*99.8%
frac-times98.6%
metadata-eval98.6%
times-frac98.6%
*-un-lft-identity98.6%
*-un-lft-identity98.6%
+-commutative98.6%
+-commutative98.6%
Applied egg-rr98.6%
Taylor expanded in y around 0 77.8%
if 5.5999999999999998e-17 < y Initial program 63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
*-commutative63.2%
distribute-rgt1-in59.3%
fma-define63.2%
+-commutative63.2%
+-commutative63.2%
cube-unmult63.2%
+-commutative63.2%
Simplified63.2%
*-commutative63.2%
fma-define59.3%
cube-mult59.3%
distribute-rgt1-in63.2%
*-commutative63.2%
associate-*l*63.2%
times-frac82.8%
associate-+r+82.8%
Applied egg-rr82.8%
clear-num82.8%
associate-/r*99.7%
frac-times99.7%
metadata-eval99.7%
times-frac99.7%
*-un-lft-identity99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 90.6%
Final simplification81.6%
(FPCore (x y) :precision binary64 (/ (/ x (+ x y)) (* (+ 1.0 (/ x y)) (+ x (+ 1.0 y)))))
double code(double x, double y) {
return (x / (x + y)) / ((1.0 + (x / y)) * (x + (1.0 + y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (x + y)) / ((1.0d0 + (x / y)) * (x + (1.0d0 + y)))
end function
public static double code(double x, double y) {
return (x / (x + y)) / ((1.0 + (x / y)) * (x + (1.0 + y)));
}
def code(x, y): return (x / (x + y)) / ((1.0 + (x / y)) * (x + (1.0 + y)))
function code(x, y) return Float64(Float64(x / Float64(x + y)) / Float64(Float64(1.0 + Float64(x / y)) * Float64(x + Float64(1.0 + y)))) end
function tmp = code(x, y) tmp = (x / (x + y)) / ((1.0 + (x / y)) * (x + (1.0 + y))); end
code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision] * N[(x + N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{x + y}}{\left(1 + \frac{x}{y}\right) \cdot \left(x + \left(1 + y\right)\right)}
\end{array}
Initial program 66.7%
+-commutative66.7%
+-commutative66.7%
+-commutative66.7%
*-commutative66.7%
distribute-rgt1-in50.5%
fma-define66.7%
+-commutative66.7%
+-commutative66.7%
cube-unmult66.7%
+-commutative66.7%
Simplified66.7%
*-commutative66.7%
fma-define50.6%
cube-mult50.5%
distribute-rgt1-in66.7%
*-commutative66.7%
associate-*l*66.7%
times-frac91.6%
associate-+r+91.6%
Applied egg-rr91.6%
clear-num91.5%
associate-/r*99.8%
frac-times99.0%
metadata-eval99.0%
times-frac99.0%
*-un-lft-identity99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in y around inf 99.0%
Final simplification99.0%
(FPCore (x y) :precision binary64 (/ (/ x (* (+ x y) (/ (+ x y) y))) (+ 1.0 (+ x y))))
double code(double x, double y) {
return (x / ((x + y) * ((x + y) / y))) / (1.0 + (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / ((x + y) * ((x + y) / y))) / (1.0d0 + (x + y))
end function
public static double code(double x, double y) {
return (x / ((x + y) * ((x + y) / y))) / (1.0 + (x + y));
}
def code(x, y): return (x / ((x + y) * ((x + y) / y))) / (1.0 + (x + y))
function code(x, y) return Float64(Float64(x / Float64(Float64(x + y) * Float64(Float64(x + y) / y))) / Float64(1.0 + Float64(x + y))) end
function tmp = code(x, y) tmp = (x / ((x + y) * ((x + y) / y))) / (1.0 + (x + y)); end
code[x_, y_] := N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{\left(x + y\right) \cdot \frac{x + y}{y}}}{1 + \left(x + y\right)}
\end{array}
Initial program 66.7%
+-commutative66.7%
+-commutative66.7%
+-commutative66.7%
*-commutative66.7%
distribute-rgt1-in50.5%
fma-define66.7%
+-commutative66.7%
+-commutative66.7%
cube-unmult66.7%
+-commutative66.7%
Simplified66.7%
*-commutative66.7%
fma-define50.6%
cube-mult50.5%
distribute-rgt1-in66.7%
*-commutative66.7%
associate-*l*66.7%
times-frac91.6%
associate-+r+91.6%
Applied egg-rr91.6%
clear-num91.5%
associate-/r*99.8%
frac-times99.0%
metadata-eval99.0%
times-frac99.0%
*-un-lft-identity99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
Applied egg-rr99.0%
add-exp-log74.7%
associate-/r*74.8%
log-div36.0%
div-inv35.9%
+-commutative35.9%
+-commutative35.9%
clear-num35.6%
+-commutative35.6%
+-commutative35.6%
associate-+l+35.6%
+-commutative35.6%
log1p-undefine35.6%
Applied egg-rr35.6%
exp-diff35.5%
rem-exp-log57.3%
associate-*r/57.3%
associate-/r/57.3%
log1p-undefine57.3%
rem-exp-log99.8%
Simplified99.8%
associate-/l/98.9%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
(FPCore (x y) :precision binary64 (if (<= x -4.4e-67) (/ (/ y (+ x y)) (+ 1.0 (+ x y))) (/ (/ x y) (+ 1.0 y))))
double code(double x, double y) {
double tmp;
if (x <= -4.4e-67) {
tmp = (y / (x + y)) / (1.0 + (x + y));
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.4d-67)) then
tmp = (y / (x + y)) / (1.0d0 + (x + y))
else
tmp = (x / y) / (1.0d0 + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.4e-67) {
tmp = (y / (x + y)) / (1.0 + (x + y));
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.4e-67: tmp = (y / (x + y)) / (1.0 + (x + y)) else: tmp = (x / y) / (1.0 + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.4e-67) tmp = Float64(Float64(y / Float64(x + y)) / Float64(1.0 + Float64(x + y))); else tmp = Float64(Float64(x / y) / Float64(1.0 + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.4e-67) tmp = (y / (x + y)) / (1.0 + (x + y)); else tmp = (x / y) / (1.0 + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.4e-67], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-67}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{1 + \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{1 + y}\\
\end{array}
\end{array}
if x < -4.4000000000000002e-67Initial program 63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
*-commutative63.2%
distribute-rgt1-in27.6%
fma-define63.2%
+-commutative63.2%
+-commutative63.2%
cube-unmult63.2%
+-commutative63.2%
Simplified63.2%
*-commutative63.2%
fma-define27.6%
cube-mult27.6%
distribute-rgt1-in63.2%
*-commutative63.2%
associate-*l*63.2%
times-frac88.5%
associate-+r+88.5%
Applied egg-rr88.5%
clear-num88.4%
associate-/r*99.8%
frac-times99.2%
metadata-eval99.2%
times-frac99.2%
*-un-lft-identity99.2%
*-un-lft-identity99.2%
+-commutative99.2%
+-commutative99.2%
Applied egg-rr99.2%
add-exp-log75.7%
associate-/r*76.4%
log-div4.9%
div-inv4.9%
+-commutative4.9%
+-commutative4.9%
clear-num4.9%
+-commutative4.9%
+-commutative4.9%
associate-+l+4.9%
+-commutative4.9%
log1p-undefine4.9%
Applied egg-rr4.9%
exp-diff4.9%
rem-exp-log16.2%
associate-*r/16.2%
associate-/r/16.2%
log1p-undefine16.2%
rem-exp-log99.9%
Simplified99.9%
Taylor expanded in x around inf 72.0%
if -4.4000000000000002e-67 < x Initial program 68.1%
associate-/l*80.4%
associate-+l+80.4%
Simplified80.4%
Taylor expanded in x around 0 61.9%
associate-/r*64.6%
+-commutative64.6%
Simplified64.6%
Final simplification66.8%
(FPCore (x y) :precision binary64 (if (<= x -4.4e-67) (/ (/ y (+ x 1.0)) (+ x y)) (/ (/ x y) (+ 1.0 y))))
double code(double x, double y) {
double tmp;
if (x <= -4.4e-67) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.4d-67)) then
tmp = (y / (x + 1.0d0)) / (x + y)
else
tmp = (x / y) / (1.0d0 + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.4e-67) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.4e-67: tmp = (y / (x + 1.0)) / (x + y) else: tmp = (x / y) / (1.0 + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.4e-67) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); else tmp = Float64(Float64(x / y) / Float64(1.0 + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.4e-67) tmp = (y / (x + 1.0)) / (x + y); else tmp = (x / y) / (1.0 + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.4e-67], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-67}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{1 + y}\\
\end{array}
\end{array}
if x < -4.4000000000000002e-67Initial program 63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
*-commutative63.2%
distribute-rgt1-in27.6%
fma-define63.2%
+-commutative63.2%
+-commutative63.2%
cube-unmult63.2%
+-commutative63.2%
Simplified63.2%
*-commutative63.2%
fma-define27.6%
cube-mult27.6%
distribute-rgt1-in63.2%
*-commutative63.2%
associate-*l*63.2%
times-frac88.5%
associate-+r+88.5%
Applied egg-rr88.5%
Taylor expanded in y around 0 71.4%
+-commutative71.4%
Simplified71.4%
associate-*l/71.4%
un-div-inv71.4%
Applied egg-rr71.4%
if -4.4000000000000002e-67 < x Initial program 68.1%
associate-/l*80.4%
associate-+l+80.4%
Simplified80.4%
Taylor expanded in x around 0 61.9%
associate-/r*64.6%
+-commutative64.6%
Simplified64.6%
Final simplification66.6%
(FPCore (x y) :precision binary64 (if (<= x -2.8e-67) (/ (/ y (+ x 1.0)) x) (/ (/ x y) (+ 1.0 y))))
double code(double x, double y) {
double tmp;
if (x <= -2.8e-67) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.8d-67)) then
tmp = (y / (x + 1.0d0)) / x
else
tmp = (x / y) / (1.0d0 + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.8e-67) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.8e-67: tmp = (y / (x + 1.0)) / x else: tmp = (x / y) / (1.0 + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.8e-67) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); else tmp = Float64(Float64(x / y) / Float64(1.0 + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.8e-67) tmp = (y / (x + 1.0)) / x; else tmp = (x / y) / (1.0 + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.8e-67], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-67}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{1 + y}\\
\end{array}
\end{array}
if x < -2.8000000000000001e-67Initial program 63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
*-commutative63.2%
distribute-rgt1-in27.6%
fma-define63.2%
+-commutative63.2%
+-commutative63.2%
cube-unmult63.2%
+-commutative63.2%
Simplified63.2%
*-commutative63.2%
fma-define27.6%
cube-mult27.6%
distribute-rgt1-in63.2%
*-commutative63.2%
associate-*l*63.2%
times-frac88.5%
associate-+r+88.5%
Applied egg-rr88.5%
Taylor expanded in y around 0 71.4%
+-commutative71.4%
Simplified71.4%
associate-*l/71.4%
un-div-inv71.4%
Applied egg-rr71.4%
Taylor expanded in x around inf 70.9%
if -2.8000000000000001e-67 < x Initial program 68.1%
associate-/l*80.4%
associate-+l+80.4%
Simplified80.4%
Taylor expanded in x around 0 61.9%
associate-/r*64.6%
+-commutative64.6%
Simplified64.6%
Final simplification66.5%
(FPCore (x y) :precision binary64 (if (<= x -2.75e-67) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ 1.0 y))))
double code(double x, double y) {
double tmp;
if (x <= -2.75e-67) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.75d-67)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / y) / (1.0d0 + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.75e-67) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.75e-67: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (1.0 + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.75e-67) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(1.0 + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.75e-67) tmp = (y / x) / (x + 1.0); else tmp = (x / y) / (1.0 + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.75e-67], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.75 \cdot 10^{-67}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{1 + y}\\
\end{array}
\end{array}
if x < -2.7500000000000001e-67Initial program 63.2%
+-commutative63.2%
+-commutative63.2%
+-commutative63.2%
*-commutative63.2%
distribute-rgt1-in27.6%
fma-define63.2%
+-commutative63.2%
+-commutative63.2%
cube-unmult63.2%
+-commutative63.2%
Simplified63.2%
*-commutative63.2%
fma-define27.6%
cube-mult27.6%
distribute-rgt1-in63.2%
*-commutative63.2%
associate-*l*63.2%
times-frac88.5%
associate-+r+88.5%
Applied egg-rr88.5%
clear-num88.4%
associate-/r*99.8%
frac-times99.2%
metadata-eval99.2%
times-frac99.2%
*-un-lft-identity99.2%
*-un-lft-identity99.2%
+-commutative99.2%
+-commutative99.2%
Applied egg-rr99.2%
Taylor expanded in y around 0 67.3%
associate-/r*70.9%
+-commutative70.9%
Simplified70.9%
if -2.7500000000000001e-67 < x Initial program 68.1%
associate-/l*80.4%
associate-+l+80.4%
Simplified80.4%
Taylor expanded in x around 0 61.9%
associate-/r*64.6%
+-commutative64.6%
Simplified64.6%
Final simplification66.5%
(FPCore (x y) :precision binary64 (if (<= x -4.4e-67) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ 1.0 y))))
double code(double x, double y) {
double tmp;
if (x <= -4.4e-67) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.4d-67)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (1.0d0 + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.4e-67) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (1.0 + y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.4e-67: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (1.0 + y) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.4e-67) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(1.0 + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.4e-67) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (1.0 + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.4e-67], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-67}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{1 + y}\\
\end{array}
\end{array}
if x < -4.4000000000000002e-67Initial program 63.2%
associate-/l*84.1%
associate-+l+84.1%
Simplified84.1%
Taylor expanded in y around 0 67.3%
+-commutative67.3%
Simplified67.3%
if -4.4000000000000002e-67 < x Initial program 68.1%
associate-/l*80.4%
associate-+l+80.4%
Simplified80.4%
Taylor expanded in x around 0 61.9%
associate-/r*64.6%
+-commutative64.6%
Simplified64.6%
Final simplification65.4%
(FPCore (x y) :precision binary64 (if (<= x -3.6e-67) (/ y (* x (+ x 1.0))) (/ x (* y (+ 1.0 y)))))
double code(double x, double y) {
double tmp;
if (x <= -3.6e-67) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (1.0 + y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.6d-67)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (1.0d0 + y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.6e-67) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (1.0 + y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.6e-67: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (1.0 + y)) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.6e-67) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(1.0 + y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.6e-67) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (1.0 + y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.6e-67], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-67}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(1 + y\right)}\\
\end{array}
\end{array}
if x < -3.59999999999999999e-67Initial program 63.2%
associate-/l*84.1%
associate-+l+84.1%
Simplified84.1%
Taylor expanded in y around 0 67.3%
+-commutative67.3%
Simplified67.3%
if -3.59999999999999999e-67 < x Initial program 68.1%
associate-/l*80.4%
associate-+l+80.4%
Simplified80.4%
Taylor expanded in x around 0 61.9%
(FPCore (x y) :precision binary64 (if (<= y 0.75) (- (/ x y) x) (/ x (* y y))))
double code(double x, double y) {
double tmp;
if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 0.75d0) then
tmp = (x / y) - x
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 0.75: tmp = (x / y) - x else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 0.75) tmp = Float64(Float64(x / y) - x); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 0.75) tmp = (x / y) - x; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 0.75], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 0.75Initial program 69.3%
associate-/l*83.6%
associate-+l+83.6%
Simplified83.6%
Taylor expanded in x around 0 46.6%
associate-/r*49.3%
+-commutative49.3%
Simplified49.3%
Taylor expanded in y around 0 20.4%
neg-mul-120.4%
unsub-neg20.4%
Simplified20.4%
Taylor expanded in x around 0 20.4%
sub-neg20.4%
distribute-lft-in20.4%
distribute-rgt-neg-in20.4%
unsub-neg20.4%
*-rgt-identity20.4%
div-sub20.4%
associate-/l*20.5%
*-inverses20.5%
*-rgt-identity20.5%
Simplified20.5%
if 0.75 < y Initial program 59.5%
associate-/l*75.7%
associate-+l+75.7%
Simplified75.7%
Taylor expanded in x around 0 67.0%
Taylor expanded in y around inf 66.1%
(FPCore (x y) :precision binary64 (if (<= x -3.2e-11) (/ 1.0 (+ x 1.0)) (/ 1.0 (/ y x))))
double code(double x, double y) {
double tmp;
if (x <= -3.2e-11) {
tmp = 1.0 / (x + 1.0);
} 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 <= (-3.2d-11)) then
tmp = 1.0d0 / (x + 1.0d0)
else
tmp = 1.0d0 / (y / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.2e-11) {
tmp = 1.0 / (x + 1.0);
} else {
tmp = 1.0 / (y / x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.2e-11: tmp = 1.0 / (x + 1.0) else: tmp = 1.0 / (y / x) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.2e-11) tmp = Float64(1.0 / Float64(x + 1.0)); else tmp = Float64(1.0 / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.2e-11) tmp = 1.0 / (x + 1.0); else tmp = 1.0 / (y / x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.2e-11], N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\end{array}
\end{array}
if x < -3.19999999999999994e-11Initial program 61.4%
+-commutative61.4%
+-commutative61.4%
+-commutative61.4%
*-commutative61.4%
distribute-rgt1-in24.2%
fma-define61.4%
+-commutative61.4%
+-commutative61.4%
cube-unmult61.4%
+-commutative61.4%
Simplified61.4%
*-commutative61.4%
fma-define24.2%
cube-mult24.2%
distribute-rgt1-in61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac87.5%
associate-+r+87.5%
Applied egg-rr87.5%
Taylor expanded in y around 0 74.4%
+-commutative74.4%
Simplified74.4%
Taylor expanded in y around inf 6.4%
+-commutative6.4%
Simplified6.4%
if -3.19999999999999994e-11 < x Initial program 68.6%
associate-/l*81.0%
associate-+l+81.0%
Simplified81.0%
Taylor expanded in x around 0 62.1%
Taylor expanded in y around 0 36.6%
clear-num36.5%
inv-pow36.5%
Applied egg-rr36.5%
unpow-136.5%
Simplified36.5%
(FPCore (x y) :precision binary64 (if (<= x -3.2e-11) (/ 1.0 (+ x 1.0)) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -3.2e-11) {
tmp = 1.0 / (x + 1.0);
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.2d-11)) then
tmp = 1.0d0 / (x + 1.0d0)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.2e-11) {
tmp = 1.0 / (x + 1.0);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.2e-11: tmp = 1.0 / (x + 1.0) else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -3.2e-11) tmp = Float64(1.0 / Float64(x + 1.0)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.2e-11) tmp = 1.0 / (x + 1.0); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.2e-11], N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -3.19999999999999994e-11Initial program 61.4%
+-commutative61.4%
+-commutative61.4%
+-commutative61.4%
*-commutative61.4%
distribute-rgt1-in24.2%
fma-define61.4%
+-commutative61.4%
+-commutative61.4%
cube-unmult61.4%
+-commutative61.4%
Simplified61.4%
*-commutative61.4%
fma-define24.2%
cube-mult24.2%
distribute-rgt1-in61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac87.5%
associate-+r+87.5%
Applied egg-rr87.5%
Taylor expanded in y around 0 74.4%
+-commutative74.4%
Simplified74.4%
Taylor expanded in y around inf 6.4%
+-commutative6.4%
Simplified6.4%
if -3.19999999999999994e-11 < x Initial program 68.6%
associate-/l*81.0%
associate-+l+81.0%
Simplified81.0%
Taylor expanded in x around 0 62.1%
Taylor expanded in y around 0 36.6%
(FPCore (x y) :precision binary64 (if (<= x -3800.0) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -3800.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 <= (-3800.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 <= -3800.0) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3800.0: tmp = 1.0 / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -3800.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 <= -3800.0) tmp = 1.0 / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3800.0], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3800:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -3800Initial program 61.4%
+-commutative61.4%
+-commutative61.4%
+-commutative61.4%
*-commutative61.4%
distribute-rgt1-in24.2%
fma-define61.4%
+-commutative61.4%
+-commutative61.4%
cube-unmult61.4%
+-commutative61.4%
Simplified61.4%
*-commutative61.4%
fma-define24.2%
cube-mult24.2%
distribute-rgt1-in61.4%
*-commutative61.4%
associate-*l*61.4%
times-frac87.5%
associate-+r+87.5%
Applied egg-rr87.5%
clear-num87.5%
associate-/r*99.8%
frac-times99.1%
metadata-eval99.1%
times-frac99.1%
*-un-lft-identity99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in x around 0 55.6%
Taylor expanded in x around inf 6.4%
if -3800 < x Initial program 68.6%
associate-/l*81.0%
associate-+l+81.0%
Simplified81.0%
Taylor expanded in x around 0 62.1%
Taylor expanded in y around 0 36.6%
(FPCore (x y) :precision binary64 (/ x (* y (+ 1.0 y))))
double code(double x, double y) {
return x / (y * (1.0 + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / (y * (1.0d0 + y))
end function
public static double code(double x, double y) {
return x / (y * (1.0 + y));
}
def code(x, y): return x / (y * (1.0 + y))
function code(x, y) return Float64(x / Float64(y * Float64(1.0 + y))) end
function tmp = code(x, y) tmp = x / (y * (1.0 + y)); end
code[x_, y_] := N[(x / N[(y * N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot \left(1 + y\right)}
\end{array}
Initial program 66.7%
associate-/l*81.5%
associate-+l+81.5%
Simplified81.5%
Taylor expanded in x around 0 52.1%
(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 66.7%
+-commutative66.7%
+-commutative66.7%
+-commutative66.7%
*-commutative66.7%
distribute-rgt1-in50.5%
fma-define66.7%
+-commutative66.7%
+-commutative66.7%
cube-unmult66.7%
+-commutative66.7%
Simplified66.7%
*-commutative66.7%
fma-define50.6%
cube-mult50.5%
distribute-rgt1-in66.7%
*-commutative66.7%
associate-*l*66.7%
times-frac91.6%
associate-+r+91.6%
Applied egg-rr91.6%
clear-num91.5%
associate-/r*99.8%
frac-times99.0%
metadata-eval99.0%
times-frac99.0%
*-un-lft-identity99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in x around 0 68.8%
Taylor expanded in x around inf 4.6%
(FPCore (x y) :precision binary64 (- x))
double code(double x, double y) {
return -x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -x
end function
public static double code(double x, double y) {
return -x;
}
def code(x, y): return -x
function code(x, y) return Float64(-x) end
function tmp = code(x, y) tmp = -x; end
code[x_, y_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 66.7%
associate-/l*81.5%
associate-+l+81.5%
Simplified81.5%
Taylor expanded in x around 0 52.1%
associate-/r*54.5%
+-commutative54.5%
Simplified54.5%
Taylor expanded in y around 0 15.8%
neg-mul-115.8%
unsub-neg15.8%
Simplified15.8%
Taylor expanded in y around inf 3.4%
neg-mul-13.4%
Simplified3.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 2024144
(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))))