
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (* (/ y (+ y x)) (/ (/ x (+ y (+ x 1.0))) (+ y x))))
double code(double x, double y) {
return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + x)) * ((x / (y + (x + 1.0d0))) / (y + x))
end function
public static double code(double x, double y) {
return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
}
def code(x, y): return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x))
function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x))) end
function tmp = code(x, y) tmp = (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x)); end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x}
\end{array}
Initial program 68.1%
associate-+r+68.1%
*-commutative68.1%
frac-times84.8%
associate-*l/79.3%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y (+ x 1.0)))))
(if (<= x -5.8e-33)
(* (/ t_0 (+ y x)) (/ y x))
(if (<= x -1.5e-162)
(* (/ x (+ y 1.0)) (/ y (* (+ y x) (+ y x))))
(if (<= x -1.05e-185)
(/ (/ y (+ y x)) (+ x (+ y (+ y 1.0))))
(/ t_0 (+ y (* x 2.0))))))))
double code(double x, double y) {
double t_0 = x / (y + (x + 1.0));
double tmp;
if (x <= -5.8e-33) {
tmp = (t_0 / (y + x)) * (y / x);
} else if (x <= -1.5e-162) {
tmp = (x / (y + 1.0)) * (y / ((y + x) * (y + x)));
} else if (x <= -1.05e-185) {
tmp = (y / (y + x)) / (x + (y + (y + 1.0)));
} else {
tmp = t_0 / (y + (x * 2.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 + (x + 1.0d0))
if (x <= (-5.8d-33)) then
tmp = (t_0 / (y + x)) * (y / x)
else if (x <= (-1.5d-162)) then
tmp = (x / (y + 1.0d0)) * (y / ((y + x) * (y + x)))
else if (x <= (-1.05d-185)) then
tmp = (y / (y + x)) / (x + (y + (y + 1.0d0)))
else
tmp = t_0 / (y + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + (x + 1.0));
double tmp;
if (x <= -5.8e-33) {
tmp = (t_0 / (y + x)) * (y / x);
} else if (x <= -1.5e-162) {
tmp = (x / (y + 1.0)) * (y / ((y + x) * (y + x)));
} else if (x <= -1.05e-185) {
tmp = (y / (y + x)) / (x + (y + (y + 1.0)));
} else {
tmp = t_0 / (y + (x * 2.0));
}
return tmp;
}
def code(x, y): t_0 = x / (y + (x + 1.0)) tmp = 0 if x <= -5.8e-33: tmp = (t_0 / (y + x)) * (y / x) elif x <= -1.5e-162: tmp = (x / (y + 1.0)) * (y / ((y + x) * (y + x))) elif x <= -1.05e-185: tmp = (y / (y + x)) / (x + (y + (y + 1.0))) else: tmp = t_0 / (y + (x * 2.0)) return tmp
function code(x, y) t_0 = Float64(x / Float64(y + Float64(x + 1.0))) tmp = 0.0 if (x <= -5.8e-33) tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(y / x)); elseif (x <= -1.5e-162) tmp = Float64(Float64(x / Float64(y + 1.0)) * Float64(y / Float64(Float64(y + x) * Float64(y + x)))); elseif (x <= -1.05e-185) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + Float64(y + Float64(y + 1.0)))); else tmp = Float64(t_0 / Float64(y + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + (x + 1.0)); tmp = 0.0; if (x <= -5.8e-33) tmp = (t_0 / (y + x)) * (y / x); elseif (x <= -1.5e-162) tmp = (x / (y + 1.0)) * (y / ((y + x) * (y + x))); elseif (x <= -1.05e-185) tmp = (y / (y + x)) / (x + (y + (y + 1.0))); else tmp = t_0 / (y + (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.8e-33], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.5e-162], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.05e-185], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + \left(x + 1\right)}\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{-33}:\\
\;\;\;\;\frac{t_0}{y + x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-162}:\\
\;\;\;\;\frac{x}{y + 1} \cdot \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-185}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y + x \cdot 2}\\
\end{array}
\end{array}
if x < -5.80000000000000005e-33Initial program 59.4%
associate-+r+59.4%
*-commutative59.4%
frac-times78.2%
associate-*l/78.3%
times-frac99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 89.9%
if -5.80000000000000005e-33 < x < -1.49999999999999999e-162Initial program 92.7%
associate-/r*92.9%
*-commutative92.9%
+-commutative92.9%
+-commutative92.9%
associate-*l/99.7%
+-commutative99.7%
associate-*r/99.7%
remove-double-neg99.7%
+-commutative99.7%
+-commutative99.7%
remove-double-neg99.7%
+-commutative99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
Simplified99.7%
if -1.49999999999999999e-162 < x < -1.05e-185Initial program 40.0%
associate-+r+40.0%
*-commutative40.0%
frac-times41.7%
associate-*l/40.0%
times-frac99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
clear-num99.1%
associate-+r+99.1%
+-commutative99.1%
associate-+r+99.1%
frac-times99.1%
*-un-lft-identity99.1%
+-commutative99.1%
associate-+r+99.1%
+-commutative99.1%
associate-+r+99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in x around -inf 44.3%
mul-1-neg44.3%
unsub-neg44.3%
neg-mul-144.3%
distribute-lft-in44.3%
metadata-eval44.3%
neg-mul-144.3%
+-commutative44.3%
+-commutative44.3%
neg-mul-144.3%
metadata-eval44.3%
sub-neg44.3%
unsub-neg44.3%
sub-neg44.3%
neg-mul-144.3%
metadata-eval44.3%
+-commutative44.3%
unsub-neg44.3%
Simplified44.3%
if -1.05e-185 < x Initial program 69.9%
times-frac87.0%
+-commutative87.0%
+-commutative87.0%
+-commutative87.0%
times-frac69.9%
associate-*l/83.2%
*-commutative83.2%
*-commutative83.2%
distribute-rgt1-in77.3%
fma-def83.1%
+-commutative83.1%
+-commutative83.1%
cube-unmult83.1%
+-commutative83.1%
Simplified83.1%
associate-*r/69.9%
fma-udef66.2%
cube-mult66.2%
distribute-rgt1-in69.9%
associate-+r+69.9%
*-commutative69.9%
frac-times87.1%
clear-num87.1%
associate-*l/87.1%
*-un-lft-identity87.1%
associate-+r+87.1%
+-commutative87.1%
associate-+l+87.1%
pow287.1%
Applied egg-rr87.1%
Taylor expanded in x around 0 58.7%
*-commutative58.7%
Simplified58.7%
Final simplification68.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ y (+ x 1.0))))
(if (<= x -1.35e+154)
(* (/ (/ x t_0) (+ y x)) (/ y x))
(* (/ x (+ y x)) (/ y (* (+ y x) t_0))))))
double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (x <= -1.35e+154) {
tmp = ((x / t_0) / (y + x)) * (y / x);
} else {
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y + (x + 1.0d0)
if (x <= (-1.35d+154)) then
tmp = ((x / t_0) / (y + x)) * (y / x)
else
tmp = (x / (y + x)) * (y / ((y + x) * t_0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y + (x + 1.0);
double tmp;
if (x <= -1.35e+154) {
tmp = ((x / t_0) / (y + x)) * (y / x);
} else {
tmp = (x / (y + x)) * (y / ((y + x) * t_0));
}
return tmp;
}
def code(x, y): t_0 = y + (x + 1.0) tmp = 0 if x <= -1.35e+154: tmp = ((x / t_0) / (y + x)) * (y / x) else: tmp = (x / (y + x)) * (y / ((y + x) * t_0)) return tmp
function code(x, y) t_0 = Float64(y + Float64(x + 1.0)) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(Float64(Float64(x / t_0) / Float64(y + x)) * Float64(y / x)); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + x) * t_0))); end return tmp end
function tmp_2 = code(x, y) t_0 = y + (x + 1.0); tmp = 0.0; if (x <= -1.35e+154) tmp = ((x / t_0) / (y + x)) * (y / x); else tmp = (x / (y + x)) * (y / ((y + x) * t_0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], N[(N[(N[(x / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{x}{t_0}}{y + x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) \cdot t_0}\\
\end{array}
\end{array}
if x < -1.35000000000000003e154Initial program 36.5%
associate-+r+36.5%
*-commutative36.5%
frac-times60.3%
associate-*l/60.3%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 93.3%
if -1.35000000000000003e154 < x Initial program 72.0%
associate-+r+72.0%
associate-*l*72.0%
times-frac94.3%
associate-+r+94.3%
+-commutative94.3%
associate-+l+94.3%
Applied egg-rr94.3%
Final simplification94.2%
(FPCore (x y) :precision binary64 (let* ((t_0 (/ x (+ y (+ x 1.0))))) (if (<= x -3.7e-174) (* (/ t_0 (+ y x)) (/ y x)) (/ t_0 (+ y (* x 2.0))))))
double code(double x, double y) {
double t_0 = x / (y + (x + 1.0));
double tmp;
if (x <= -3.7e-174) {
tmp = (t_0 / (y + x)) * (y / x);
} else {
tmp = t_0 / (y + (x * 2.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 + (x + 1.0d0))
if (x <= (-3.7d-174)) then
tmp = (t_0 / (y + x)) * (y / x)
else
tmp = t_0 / (y + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + (x + 1.0));
double tmp;
if (x <= -3.7e-174) {
tmp = (t_0 / (y + x)) * (y / x);
} else {
tmp = t_0 / (y + (x * 2.0));
}
return tmp;
}
def code(x, y): t_0 = x / (y + (x + 1.0)) tmp = 0 if x <= -3.7e-174: tmp = (t_0 / (y + x)) * (y / x) else: tmp = t_0 / (y + (x * 2.0)) return tmp
function code(x, y) t_0 = Float64(x / Float64(y + Float64(x + 1.0))) tmp = 0.0 if (x <= -3.7e-174) tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(y / x)); else tmp = Float64(t_0 / Float64(y + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + (x + 1.0)); tmp = 0.0; if (x <= -3.7e-174) tmp = (t_0 / (y + x)) * (y / x); else tmp = t_0 / (y + (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.7e-174], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + \left(x + 1\right)}\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{-174}:\\
\;\;\;\;\frac{t_0}{y + x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y + x \cdot 2}\\
\end{array}
\end{array}
if x < -3.7000000000000001e-174Initial program 63.2%
associate-+r+63.2%
*-commutative63.2%
frac-times79.2%
associate-*l/77.8%
times-frac99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 84.9%
if -3.7000000000000001e-174 < x Initial program 70.2%
times-frac87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
times-frac70.2%
associate-*l/83.4%
*-commutative83.4%
*-commutative83.4%
distribute-rgt1-in77.5%
fma-def83.3%
+-commutative83.3%
+-commutative83.3%
cube-unmult83.3%
+-commutative83.3%
Simplified83.3%
associate-*r/70.2%
fma-udef66.6%
cube-mult66.6%
distribute-rgt1-in70.2%
associate-+r+70.2%
*-commutative70.2%
frac-times87.2%
clear-num87.2%
associate-*l/87.3%
*-un-lft-identity87.3%
associate-+r+87.3%
+-commutative87.3%
associate-+l+87.3%
pow287.3%
Applied egg-rr87.3%
Taylor expanded in x around 0 59.2%
*-commutative59.2%
Simplified59.2%
Final simplification66.9%
(FPCore (x y) :precision binary64 (if (<= x -3.9e-10) (* (/ (/ x (+ y (+ x 1.0))) (+ y x)) (/ y x)) (* (/ y (+ y x)) (/ (/ x (+ y 1.0)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -3.9e-10) {
tmp = ((x / (y + (x + 1.0))) / (y + x)) * (y / x);
} else {
tmp = (y / (y + 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 (x <= (-3.9d-10)) then
tmp = ((x / (y + (x + 1.0d0))) / (y + x)) * (y / x)
else
tmp = (y / (y + x)) * ((x / (y + 1.0d0)) / (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.9e-10) {
tmp = ((x / (y + (x + 1.0))) / (y + x)) * (y / x);
} else {
tmp = (y / (y + x)) * ((x / (y + 1.0)) / (y + x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.9e-10: tmp = ((x / (y + (x + 1.0))) / (y + x)) * (y / x) else: tmp = (y / (y + x)) * ((x / (y + 1.0)) / (y + x)) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.9e-10) tmp = Float64(Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x)) * Float64(y / x)); else tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.9e-10) tmp = ((x / (y + (x + 1.0))) / (y + x)) * (y / x); else tmp = (y / (y + x)) * ((x / (y + 1.0)) / (y + x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.9e-10], N[(N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y + x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -3.9e-10Initial program 58.8%
associate-+r+58.8%
*-commutative58.8%
frac-times77.9%
associate-*l/77.9%
times-frac99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 89.8%
if -3.9e-10 < x Initial program 70.9%
associate-+r+70.9%
*-commutative70.9%
frac-times86.9%
associate-*l/79.7%
times-frac99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 81.2%
+-commutative81.2%
Simplified81.2%
Final simplification83.2%
(FPCore (x y) :precision binary64 (if (<= x -1.05e-185) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x (+ y (+ x 1.0))) (+ y (* x 2.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.05e-185) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (y + (x + 1.0))) / (y + (x * 2.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.05d-185)) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = (x / (y + (x + 1.0d0))) / (y + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.05e-185) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (y + (x + 1.0))) / (y + (x * 2.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.05e-185: tmp = (y / (y + x)) / (x + 1.0) else: tmp = (x / (y + (x + 1.0))) / (y + (x * 2.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.05e-185) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.05e-185) tmp = (y / (y + x)) / (x + 1.0); else tmp = (x / (y + (x + 1.0))) / (y + (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.05e-185], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-185}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y + x \cdot 2}\\
\end{array}
\end{array}
if x < -1.05e-185Initial program 64.1%
associate-+r+64.1%
*-commutative64.1%
frac-times79.7%
associate-*l/78.4%
times-frac99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.8%
associate-*r/99.8%
clear-num99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
frac-times99.6%
*-un-lft-identity99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 77.9%
+-commutative77.9%
Simplified77.9%
if -1.05e-185 < x Initial program 69.9%
times-frac87.0%
+-commutative87.0%
+-commutative87.0%
+-commutative87.0%
times-frac69.9%
associate-*l/83.2%
*-commutative83.2%
*-commutative83.2%
distribute-rgt1-in77.3%
fma-def83.1%
+-commutative83.1%
+-commutative83.1%
cube-unmult83.1%
+-commutative83.1%
Simplified83.1%
associate-*r/69.9%
fma-udef66.2%
cube-mult66.2%
distribute-rgt1-in69.9%
associate-+r+69.9%
*-commutative69.9%
frac-times87.1%
clear-num87.1%
associate-*l/87.1%
*-un-lft-identity87.1%
associate-+r+87.1%
+-commutative87.1%
associate-+l+87.1%
pow287.1%
Applied egg-rr87.1%
Taylor expanded in x around 0 58.7%
*-commutative58.7%
Simplified58.7%
Final simplification64.6%
(FPCore (x y) :precision binary64 (if (<= x -1.05e-185) (/ (/ y (+ y x)) (+ x (+ y (+ y 1.0)))) (/ (/ x (+ y (+ x 1.0))) (+ y (* x 2.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.05e-185) {
tmp = (y / (y + x)) / (x + (y + (y + 1.0)));
} else {
tmp = (x / (y + (x + 1.0))) / (y + (x * 2.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.05d-185)) then
tmp = (y / (y + x)) / (x + (y + (y + 1.0d0)))
else
tmp = (x / (y + (x + 1.0d0))) / (y + (x * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.05e-185) {
tmp = (y / (y + x)) / (x + (y + (y + 1.0)));
} else {
tmp = (x / (y + (x + 1.0))) / (y + (x * 2.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.05e-185: tmp = (y / (y + x)) / (x + (y + (y + 1.0))) else: tmp = (x / (y + (x + 1.0))) / (y + (x * 2.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.05e-185) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + Float64(y + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + Float64(x * 2.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.05e-185) tmp = (y / (y + x)) / (x + (y + (y + 1.0))); else tmp = (x / (y + (x + 1.0))) / (y + (x * 2.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.05e-185], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-185}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y + x \cdot 2}\\
\end{array}
\end{array}
if x < -1.05e-185Initial program 64.1%
associate-+r+64.1%
*-commutative64.1%
frac-times79.7%
associate-*l/78.4%
times-frac99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.8%
associate-*r/99.8%
clear-num99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
frac-times99.6%
*-un-lft-identity99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in x around -inf 78.6%
mul-1-neg78.6%
unsub-neg78.6%
neg-mul-178.6%
distribute-lft-in78.6%
metadata-eval78.6%
neg-mul-178.6%
+-commutative78.6%
+-commutative78.6%
neg-mul-178.6%
metadata-eval78.6%
sub-neg78.6%
unsub-neg78.6%
sub-neg78.6%
neg-mul-178.6%
metadata-eval78.6%
+-commutative78.6%
unsub-neg78.6%
Simplified78.6%
if -1.05e-185 < x Initial program 69.9%
times-frac87.0%
+-commutative87.0%
+-commutative87.0%
+-commutative87.0%
times-frac69.9%
associate-*l/83.2%
*-commutative83.2%
*-commutative83.2%
distribute-rgt1-in77.3%
fma-def83.1%
+-commutative83.1%
+-commutative83.1%
cube-unmult83.1%
+-commutative83.1%
Simplified83.1%
associate-*r/69.9%
fma-udef66.2%
cube-mult66.2%
distribute-rgt1-in69.9%
associate-+r+69.9%
*-commutative69.9%
frac-times87.1%
clear-num87.1%
associate-*l/87.1%
*-un-lft-identity87.1%
associate-+r+87.1%
+-commutative87.1%
associate-+l+87.1%
pow287.1%
Applied egg-rr87.1%
Taylor expanded in x around 0 58.7%
*-commutative58.7%
Simplified58.7%
Final simplification64.8%
(FPCore (x y) :precision binary64 (if (<= y 1.85e-161) (/ 1.0 (/ x y)) (if (<= y 7e+161) (/ x (* y (+ y 1.0))) (/ (/ x y) y))))
double code(double x, double y) {
double tmp;
if (y <= 1.85e-161) {
tmp = 1.0 / (x / y);
} else if (y <= 7e+161) {
tmp = x / (y * (y + 1.0));
} 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.85d-161) then
tmp = 1.0d0 / (x / y)
else if (y <= 7d+161) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.85e-161) {
tmp = 1.0 / (x / y);
} else if (y <= 7e+161) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.85e-161: tmp = 1.0 / (x / y) elif y <= 7e+161: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 1.85e-161) tmp = Float64(1.0 / Float64(x / y)); elseif (y <= 7e+161) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.85e-161) tmp = 1.0 / (x / y); elseif (y <= 7e+161) tmp = x / (y * (y + 1.0)); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.85e-161], N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+161], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.85 \cdot 10^{-161}:\\
\;\;\;\;\frac{1}{\frac{x}{y}}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+161}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 1.8499999999999999e-161Initial program 69.3%
associate-/r*72.7%
*-commutative72.7%
+-commutative72.7%
+-commutative72.7%
associate-*l/83.7%
+-commutative83.7%
associate-*r/83.7%
remove-double-neg83.7%
+-commutative83.7%
+-commutative83.7%
remove-double-neg83.7%
+-commutative83.7%
associate-+l+83.7%
Simplified83.7%
Taylor expanded in y around 0 59.8%
associate-/r*61.6%
+-commutative61.6%
Simplified61.6%
clear-num61.0%
inv-pow61.0%
div-inv61.0%
clear-num61.0%
Applied egg-rr61.0%
unpow-161.0%
associate-*r/59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 37.2%
if 1.8499999999999999e-161 < y < 6.99999999999999976e161Initial program 68.1%
associate-/r*74.4%
*-commutative74.4%
+-commutative74.4%
+-commutative74.4%
associate-*l/92.1%
+-commutative92.1%
associate-*r/92.2%
remove-double-neg92.2%
+-commutative92.2%
+-commutative92.2%
remove-double-neg92.2%
+-commutative92.2%
associate-+l+92.2%
Simplified92.2%
Taylor expanded in x around 0 48.4%
+-commutative48.4%
Simplified48.4%
if 6.99999999999999976e161 < y Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
+-commutative61.7%
+-commutative61.7%
associate-*l/76.1%
+-commutative76.1%
associate-*r/76.1%
remove-double-neg76.1%
+-commutative76.1%
+-commutative76.1%
remove-double-neg76.1%
+-commutative76.1%
associate-+l+76.1%
Simplified76.1%
Taylor expanded in x around 0 76.1%
+-commutative76.1%
Simplified76.1%
*-un-lft-identity76.1%
times-frac85.2%
Applied egg-rr85.2%
associate-*l/85.2%
+-commutative85.2%
*-lft-identity85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in y around inf 85.2%
Final simplification45.7%
(FPCore (x y) :precision binary64 (if (<= y 3.2e-118) (/ y (* x (+ x 1.0))) (if (<= y 3.5e+161) (/ x (* y (+ y 1.0))) (/ (/ x y) y))))
double code(double x, double y) {
double tmp;
if (y <= 3.2e-118) {
tmp = y / (x * (x + 1.0));
} else if (y <= 3.5e+161) {
tmp = x / (y * (y + 1.0));
} 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 <= 3.2d-118) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 3.5d+161) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.2e-118) {
tmp = y / (x * (x + 1.0));
} else if (y <= 3.5e+161) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.2e-118: tmp = y / (x * (x + 1.0)) elif y <= 3.5e+161: tmp = x / (y * (y + 1.0)) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 3.2e-118) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 3.5e+161) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.2e-118) tmp = y / (x * (x + 1.0)); elseif (y <= 3.5e+161) tmp = x / (y * (y + 1.0)); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.2e-118], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+161], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+161}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 3.20000000000000004e-118Initial program 69.0%
associate-/r*72.2%
*-commutative72.2%
+-commutative72.2%
+-commutative72.2%
associate-*l/84.4%
+-commutative84.4%
associate-*r/84.4%
remove-double-neg84.4%
+-commutative84.4%
+-commutative84.4%
remove-double-neg84.4%
+-commutative84.4%
associate-+l+84.4%
Simplified84.4%
Taylor expanded in y around 0 60.0%
if 3.20000000000000004e-118 < y < 3.49999999999999988e161Initial program 68.8%
associate-/r*76.1%
*-commutative76.1%
+-commutative76.1%
+-commutative76.1%
associate-*l/91.0%
+-commutative91.0%
associate-*r/91.1%
remove-double-neg91.1%
+-commutative91.1%
+-commutative91.1%
remove-double-neg91.1%
+-commutative91.1%
associate-+l+91.1%
Simplified91.1%
Taylor expanded in x around 0 49.7%
+-commutative49.7%
Simplified49.7%
if 3.49999999999999988e161 < y Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
+-commutative61.7%
+-commutative61.7%
associate-*l/76.1%
+-commutative76.1%
associate-*r/76.1%
remove-double-neg76.1%
+-commutative76.1%
+-commutative76.1%
remove-double-neg76.1%
+-commutative76.1%
associate-+l+76.1%
Simplified76.1%
Taylor expanded in x around 0 76.1%
+-commutative76.1%
Simplified76.1%
*-un-lft-identity76.1%
times-frac85.2%
Applied egg-rr85.2%
associate-*l/85.2%
+-commutative85.2%
*-lft-identity85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in y around inf 85.2%
Final simplification60.9%
(FPCore (x y) :precision binary64 (if (<= y 1.46e-160) (/ 1.0 (/ x y)) (if (<= y 0.75) (- (/ x y) x) (/ (/ x y) y))))
double code(double x, double y) {
double tmp;
if (y <= 1.46e-160) {
tmp = 1.0 / (x / y);
} else 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 <= 1.46d-160) then
tmp = 1.0d0 / (x / y)
else 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 <= 1.46e-160) {
tmp = 1.0 / (x / y);
} else if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.46e-160: tmp = 1.0 / (x / y) elif y <= 0.75: tmp = (x / y) - x else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 1.46e-160) tmp = Float64(1.0 / Float64(x / y)); elseif (y <= 0.75) tmp = Float64(Float64(x / y) - x); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.46e-160) tmp = 1.0 / (x / y); elseif (y <= 0.75) tmp = (x / y) - x; else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.46e-160], N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.75], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.46 \cdot 10^{-160}:\\
\;\;\;\;\frac{1}{\frac{x}{y}}\\
\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 1.4600000000000001e-160Initial program 69.3%
associate-/r*72.7%
*-commutative72.7%
+-commutative72.7%
+-commutative72.7%
associate-*l/83.7%
+-commutative83.7%
associate-*r/83.7%
remove-double-neg83.7%
+-commutative83.7%
+-commutative83.7%
remove-double-neg83.7%
+-commutative83.7%
associate-+l+83.7%
Simplified83.7%
Taylor expanded in y around 0 59.8%
associate-/r*61.6%
+-commutative61.6%
Simplified61.6%
clear-num61.0%
inv-pow61.0%
div-inv61.0%
clear-num61.0%
Applied egg-rr61.0%
unpow-161.0%
associate-*r/59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 37.2%
if 1.4600000000000001e-160 < y < 0.75Initial program 76.0%
associate-/r*79.2%
*-commutative79.2%
+-commutative79.2%
+-commutative79.2%
associate-*l/99.6%
+-commutative99.6%
associate-*r/99.6%
remove-double-neg99.6%
+-commutative99.6%
+-commutative99.6%
remove-double-neg99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in x around 0 41.3%
+-commutative41.3%
Simplified41.3%
Taylor expanded in y around 0 41.3%
neg-mul-141.3%
+-commutative41.3%
unsub-neg41.3%
Simplified41.3%
if 0.75 < y Initial program 61.6%
associate-/r*66.2%
*-commutative66.2%
+-commutative66.2%
+-commutative66.2%
associate-*l/81.1%
+-commutative81.1%
associate-*r/81.2%
remove-double-neg81.2%
+-commutative81.2%
+-commutative81.2%
remove-double-neg81.2%
+-commutative81.2%
associate-+l+81.2%
Simplified81.2%
Taylor expanded in x around 0 64.9%
+-commutative64.9%
Simplified64.9%
*-un-lft-identity64.9%
times-frac69.1%
Applied egg-rr69.1%
associate-*l/69.2%
+-commutative69.2%
*-lft-identity69.2%
+-commutative69.2%
Simplified69.2%
Taylor expanded in y around inf 67.3%
Final simplification45.2%
(FPCore (x y) :precision binary64 (if (<= x -3.7e-174) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y (+ x 1.0))) y)))
double code(double x, double y) {
double tmp;
if (x <= -3.7e-174) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + (x + 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.7d-174)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + (x + 1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.7e-174) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + (x + 1.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.7e-174: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + (x + 1.0))) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -3.7e-174) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.7e-174) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + (x + 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.7e-174], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-174}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\
\end{array}
\end{array}
if x < -3.7000000000000001e-174Initial program 63.2%
associate-/r*69.1%
*-commutative69.1%
+-commutative69.1%
+-commutative69.1%
associate-*l/79.1%
+-commutative79.1%
associate-*r/79.2%
remove-double-neg79.2%
+-commutative79.2%
+-commutative79.2%
remove-double-neg79.2%
+-commutative79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in y around 0 67.7%
associate-/r*79.6%
+-commutative79.6%
Simplified79.6%
if -3.7000000000000001e-174 < x Initial program 70.2%
times-frac87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
times-frac70.2%
associate-*l/83.4%
*-commutative83.4%
*-commutative83.4%
distribute-rgt1-in77.5%
fma-def83.3%
+-commutative83.3%
+-commutative83.3%
cube-unmult83.3%
+-commutative83.3%
Simplified83.3%
associate-*r/70.2%
fma-udef66.6%
cube-mult66.6%
distribute-rgt1-in70.2%
associate-+r+70.2%
*-commutative70.2%
frac-times87.2%
clear-num87.2%
associate-*l/87.3%
*-un-lft-identity87.3%
associate-+r+87.3%
+-commutative87.3%
associate-+l+87.3%
pow287.3%
Applied egg-rr87.3%
unpow287.3%
associate-/l*99.5%
associate-/r/99.4%
+-commutative99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 57.4%
Final simplification64.1%
(FPCore (x y) :precision binary64 (if (<= x -3.7e-174) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x (+ y (+ x 1.0))) y)))
double code(double x, double y) {
double tmp;
if (x <= -3.7e-174) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (y + (x + 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.7d-174)) then
tmp = (y / (y + x)) / (x + 1.0d0)
else
tmp = (x / (y + (x + 1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.7e-174) {
tmp = (y / (y + x)) / (x + 1.0);
} else {
tmp = (x / (y + (x + 1.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.7e-174: tmp = (y / (y + x)) / (x + 1.0) else: tmp = (x / (y + (x + 1.0))) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -3.7e-174) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.7e-174) tmp = (y / (y + x)) / (x + 1.0); else tmp = (x / (y + (x + 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.7e-174], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-174}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\
\end{array}
\end{array}
if x < -3.7000000000000001e-174Initial program 63.2%
associate-+r+63.2%
*-commutative63.2%
frac-times79.2%
associate-*l/77.8%
times-frac99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.8%
associate-*r/99.8%
clear-num99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
frac-times99.6%
*-un-lft-identity99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 79.9%
+-commutative79.9%
Simplified79.9%
if -3.7000000000000001e-174 < x Initial program 70.2%
times-frac87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
times-frac70.2%
associate-*l/83.4%
*-commutative83.4%
*-commutative83.4%
distribute-rgt1-in77.5%
fma-def83.3%
+-commutative83.3%
+-commutative83.3%
cube-unmult83.3%
+-commutative83.3%
Simplified83.3%
associate-*r/70.2%
fma-udef66.6%
cube-mult66.6%
distribute-rgt1-in70.2%
associate-+r+70.2%
*-commutative70.2%
frac-times87.2%
clear-num87.2%
associate-*l/87.3%
*-un-lft-identity87.3%
associate-+r+87.3%
+-commutative87.3%
associate-+l+87.3%
pow287.3%
Applied egg-rr87.3%
unpow287.3%
associate-/l*99.5%
associate-/r/99.4%
+-commutative99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 57.4%
Final simplification64.2%
(FPCore (x y) :precision binary64 (if (<= y 3.05e-118) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y)))
double code(double x, double y) {
double tmp;
if (y <= 3.05e-118) {
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 (y <= 3.05d-118) 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 (y <= 3.05e-118) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.05e-118: tmp = y / (x * (x + 1.0)) else: tmp = (x / (y + 1.0)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 3.05e-118) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.05e-118) tmp = y / (x * (x + 1.0)); else tmp = (x / (y + 1.0)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.05e-118], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.05 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if y < 3.04999999999999992e-118Initial program 69.0%
associate-/r*72.2%
*-commutative72.2%
+-commutative72.2%
+-commutative72.2%
associate-*l/84.4%
+-commutative84.4%
associate-*r/84.4%
remove-double-neg84.4%
+-commutative84.4%
+-commutative84.4%
remove-double-neg84.4%
+-commutative84.4%
associate-+l+84.4%
Simplified84.4%
Taylor expanded in y around 0 60.0%
if 3.04999999999999992e-118 < y Initial program 66.2%
associate-/r*70.8%
*-commutative70.8%
+-commutative70.8%
+-commutative70.8%
associate-*l/85.5%
+-commutative85.5%
associate-*r/85.6%
remove-double-neg85.6%
+-commutative85.6%
+-commutative85.6%
remove-double-neg85.6%
+-commutative85.6%
associate-+l+85.6%
Simplified85.6%
Taylor expanded in x around 0 59.5%
+-commutative59.5%
Simplified59.5%
*-un-lft-identity59.5%
times-frac62.7%
Applied egg-rr62.7%
associate-*l/62.7%
+-commutative62.7%
*-lft-identity62.7%
+-commutative62.7%
Simplified62.7%
Final simplification60.9%
(FPCore (x y) :precision binary64 (if (<= x -3.7e-174) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) y)))
double code(double x, double y) {
double tmp;
if (x <= -3.7e-174) {
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.7d-174)) 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.7e-174) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.7e-174: 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.7e-174) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.7e-174) 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.7e-174], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-174}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -3.7000000000000001e-174Initial program 63.2%
associate-/r*69.1%
*-commutative69.1%
+-commutative69.1%
+-commutative69.1%
associate-*l/79.1%
+-commutative79.1%
associate-*r/79.2%
remove-double-neg79.2%
+-commutative79.2%
+-commutative79.2%
remove-double-neg79.2%
+-commutative79.2%
associate-+l+79.2%
Simplified79.2%
Taylor expanded in y around 0 67.7%
associate-/r*79.6%
+-commutative79.6%
Simplified79.6%
if -3.7000000000000001e-174 < x Initial program 70.2%
associate-/r*72.9%
*-commutative72.9%
+-commutative72.9%
+-commutative72.9%
associate-*l/87.2%
+-commutative87.2%
associate-*r/87.2%
remove-double-neg87.2%
+-commutative87.2%
+-commutative87.2%
remove-double-neg87.2%
+-commutative87.2%
associate-+l+87.2%
Simplified87.2%
Taylor expanded in x around 0 54.3%
+-commutative54.3%
Simplified54.3%
*-un-lft-identity54.3%
times-frac57.0%
Applied egg-rr57.0%
associate-*l/57.1%
+-commutative57.1%
*-lft-identity57.1%
+-commutative57.1%
Simplified57.1%
Final simplification63.9%
(FPCore (x y) :precision binary64 (if (<= y 1.42e-154) (/ 1.0 (/ x y)) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 1.42e-154) {
tmp = 1.0 / (x / 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 (y <= 1.42d-154) then
tmp = 1.0d0 / (x / y)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.42e-154) {
tmp = 1.0 / (x / y);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.42e-154: tmp = 1.0 / (x / y) else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 1.42e-154) tmp = Float64(1.0 / Float64(x / y)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.42e-154) tmp = 1.0 / (x / y); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.42e-154], N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.42 \cdot 10^{-154}:\\
\;\;\;\;\frac{1}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 1.42e-154Initial program 69.3%
associate-/r*72.7%
*-commutative72.7%
+-commutative72.7%
+-commutative72.7%
associate-*l/83.7%
+-commutative83.7%
associate-*r/83.7%
remove-double-neg83.7%
+-commutative83.7%
+-commutative83.7%
remove-double-neg83.7%
+-commutative83.7%
associate-+l+83.7%
Simplified83.7%
Taylor expanded in y around 0 59.8%
associate-/r*61.6%
+-commutative61.6%
Simplified61.6%
clear-num61.0%
inv-pow61.0%
div-inv61.0%
clear-num61.0%
Applied egg-rr61.0%
unpow-161.0%
associate-*r/59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 37.2%
if 1.42e-154 < y Initial program 65.9%
associate-/r*70.1%
*-commutative70.1%
+-commutative70.1%
+-commutative70.1%
associate-*l/86.7%
+-commutative86.7%
associate-*r/86.8%
remove-double-neg86.8%
+-commutative86.8%
+-commutative86.8%
remove-double-neg86.8%
+-commutative86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 57.7%
+-commutative57.7%
Simplified57.7%
Taylor expanded in y around 0 35.7%
Final simplification36.6%
(FPCore (x y) :precision binary64 (if (<= y 3.5e-160) (/ y x) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 3.5e-160) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.5d-160) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.5e-160) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.5e-160: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 3.5e-160) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.5e-160) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.5e-160], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 3.5000000000000003e-160Initial program 69.3%
associate-/r*72.7%
*-commutative72.7%
+-commutative72.7%
+-commutative72.7%
associate-*l/83.7%
+-commutative83.7%
associate-*r/83.7%
remove-double-neg83.7%
+-commutative83.7%
+-commutative83.7%
remove-double-neg83.7%
+-commutative83.7%
associate-+l+83.7%
Simplified83.7%
Taylor expanded in y around 0 59.8%
associate-/r*61.6%
+-commutative61.6%
Simplified61.6%
clear-num61.0%
inv-pow61.0%
div-inv61.0%
clear-num61.0%
Applied egg-rr61.0%
unpow-161.0%
associate-*r/59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 36.5%
if 3.5000000000000003e-160 < y Initial program 65.9%
associate-/r*70.1%
*-commutative70.1%
+-commutative70.1%
+-commutative70.1%
associate-*l/86.7%
+-commutative86.7%
associate-*r/86.8%
remove-double-neg86.8%
+-commutative86.8%
+-commutative86.8%
remove-double-neg86.8%
+-commutative86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 57.7%
+-commutative57.7%
Simplified57.7%
Taylor expanded in y around 0 35.7%
Final simplification36.2%
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
return x / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
public static double code(double x, double y) {
return x / y;
}
def code(x, y): return x / y
function code(x, y) return Float64(x / y) end
function tmp = code(x, y) tmp = x / y; end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y}
\end{array}
Initial program 68.1%
associate-/r*71.7%
*-commutative71.7%
+-commutative71.7%
+-commutative71.7%
associate-*l/84.8%
+-commutative84.8%
associate-*r/84.8%
remove-double-neg84.8%
+-commutative84.8%
+-commutative84.8%
remove-double-neg84.8%
+-commutative84.8%
associate-+l+84.8%
Simplified84.8%
Taylor expanded in x around 0 43.2%
+-commutative43.2%
Simplified43.2%
Taylor expanded in y around 0 25.6%
Final simplification25.6%
(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 2024021
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))