
(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 18 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 1.0))) (/ x (+ y x))) (+ y x)))
double code(double x, double y) {
return ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (y + (x + 1.0d0))) * (x / (y + x))) / (y + x)
end function
public static double code(double x, double y) {
return ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x);
}
def code(x, y): return ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x)
function code(x, y) return Float64(Float64(Float64(y / Float64(y + Float64(x + 1.0))) * Float64(x / Float64(y + x))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x); end
code[x_, y_] := N[(N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{y + \left(x + 1\right)} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Initial program 67.2%
associate-*r/80.9%
*-commutative80.9%
distribute-rgt1-in61.2%
fma-def80.9%
cube-unmult80.9%
Simplified80.9%
associate-*r/67.2%
fma-udef53.5%
cube-mult53.4%
distribute-rgt1-in67.2%
associate-+r+67.2%
*-commutative67.2%
frac-times87.1%
*-commutative87.1%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(if (<= x -3.2e+136)
(/ (/ y (+ x (- y (- -1.0 y)))) (+ y x))
(if (<= x -2.9e-18)
(* (/ y (+ x (+ y 1.0))) (/ x (* (+ y x) (+ y x))))
(/ (* (/ x (+ y x)) (/ y (+ y 1.0))) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -3.2e+136) {
tmp = (y / (x + (y - (-1.0 - y)))) / (y + x);
} else if (x <= -2.9e-18) {
tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
} else {
tmp = ((x / (y + x)) * (y / (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.2d+136)) then
tmp = (y / (x + (y - ((-1.0d0) - y)))) / (y + x)
else if (x <= (-2.9d-18)) then
tmp = (y / (x + (y + 1.0d0))) * (x / ((y + x) * (y + x)))
else
tmp = ((x / (y + x)) * (y / (y + 1.0d0))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.2e+136) {
tmp = (y / (x + (y - (-1.0 - y)))) / (y + x);
} else if (x <= -2.9e-18) {
tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
} else {
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.2e+136: tmp = (y / (x + (y - (-1.0 - y)))) / (y + x) elif x <= -2.9e-18: tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x))) else: tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.2e+136) tmp = Float64(Float64(y / Float64(x + Float64(y - Float64(-1.0 - y)))) / Float64(y + x)); elseif (x <= -2.9e-18) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(y + 1.0))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.2e+136) tmp = (y / (x + (y - (-1.0 - y)))) / (y + x); elseif (x <= -2.9e-18) tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x))); else tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.2e+136], N[(N[(y / N[(x + N[(y - N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9e-18], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y - \left(-1 - y\right)\right)}}{y + x}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-18}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -3.19999999999999988e136Initial program 46.6%
associate-*r/76.7%
*-commutative76.7%
distribute-rgt1-in3.0%
fma-def76.7%
cube-unmult76.7%
Simplified76.7%
associate-*r/46.6%
fma-udef3.0%
cube-mult3.0%
distribute-rgt1-in46.6%
associate-+r+46.6%
*-commutative46.6%
frac-times81.4%
*-commutative81.4%
associate-/r*99.9%
associate-*r/100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
+-commutative100.0%
Applied egg-rr100.0%
*-commutative100.0%
clear-num100.0%
associate-+r+100.0%
+-commutative100.0%
frac-times97.9%
*-un-lft-identity97.9%
Applied egg-rr97.9%
Taylor expanded in x around -inf 86.1%
+-commutative86.1%
mul-1-neg86.1%
unsub-neg86.1%
neg-mul-186.1%
unsub-neg86.1%
distribute-lft-in86.1%
metadata-eval86.1%
neg-mul-186.1%
unsub-neg86.1%
Simplified86.1%
if -3.19999999999999988e136 < x < -2.9e-18Initial program 62.2%
times-frac93.5%
/-rgt-identity93.5%
associate-/l/93.5%
*-lft-identity93.5%
associate-+l+93.5%
Simplified93.5%
if -2.9e-18 < x Initial program 72.4%
associate-*r/82.5%
*-commutative82.5%
distribute-rgt1-in72.6%
fma-def82.5%
cube-unmult82.5%
Simplified82.5%
associate-*r/72.4%
fma-udef63.2%
cube-mult63.2%
distribute-rgt1-in72.4%
associate-+r+72.4%
*-commutative72.4%
frac-times87.3%
*-commutative87.3%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 82.6%
+-commutative82.6%
Simplified82.6%
Final simplification84.4%
(FPCore (x y)
:precision binary64
(if (<= x -2.45e-15)
(/ (/ y (+ x (- y (- -1.0 y)))) (+ y x))
(if (<= x -8.5e-165)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ y 1.0)))
(/ (/ x (+ y 1.0)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -2.45e-15) {
tmp = (y / (x + (y - (-1.0 - y)))) / (y + x);
} else if (x <= -8.5e-165) {
tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0));
} else {
tmp = (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 <= (-2.45d-15)) then
tmp = (y / (x + (y - ((-1.0d0) - y)))) / (y + x)
else if (x <= (-8.5d-165)) then
tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0d0))
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.45e-15) {
tmp = (y / (x + (y - (-1.0 - y)))) / (y + x);
} else if (x <= -8.5e-165) {
tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.45e-15: tmp = (y / (x + (y - (-1.0 - y)))) / (y + x) elif x <= -8.5e-165: tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0)) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.45e-15) tmp = Float64(Float64(y / Float64(x + Float64(y - Float64(-1.0 - y)))) / Float64(y + x)); elseif (x <= -8.5e-165) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(y + 1.0))); else tmp = 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 <= -2.45e-15) tmp = (y / (x + (y - (-1.0 - y)))) / (y + x); elseif (x <= -8.5e-165) tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0)); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.45e-15], N[(N[(y / N[(x + N[(y - N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-165], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y - \left(-1 - y\right)\right)}}{y + x}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-165}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -2.45e-15Initial program 53.5%
associate-*r/76.7%
*-commutative76.7%
distribute-rgt1-in31.0%
fma-def76.6%
cube-unmult76.7%
Simplified76.7%
associate-*r/53.5%
fma-udef27.5%
cube-mult27.5%
distribute-rgt1-in53.5%
associate-+r+53.5%
*-commutative53.5%
frac-times86.8%
*-commutative86.8%
associate-/r*99.9%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.8%
associate-+r+99.8%
+-commutative99.8%
frac-times98.5%
*-un-lft-identity98.5%
Applied egg-rr98.5%
Taylor expanded in x around -inf 75.0%
+-commutative75.0%
mul-1-neg75.0%
unsub-neg75.0%
neg-mul-175.0%
unsub-neg75.0%
distribute-lft-in75.0%
metadata-eval75.0%
neg-mul-175.0%
unsub-neg75.0%
Simplified75.0%
if -2.45e-15 < x < -8.5e-165Initial program 87.4%
times-frac96.4%
/-rgt-identity96.4%
associate-/l/96.4%
*-lft-identity96.4%
associate-+l+96.4%
Simplified96.4%
Taylor expanded in x around 0 96.4%
+-commutative96.4%
Simplified96.4%
if -8.5e-165 < x Initial program 69.4%
associate-*r/80.3%
*-commutative80.3%
distribute-rgt1-in71.0%
fma-def80.4%
cube-unmult80.3%
Simplified80.3%
associate-*r/69.4%
fma-udef61.0%
cube-mult61.0%
distribute-rgt1-in69.4%
associate-+r+69.4%
*-commutative69.4%
frac-times85.4%
*-commutative85.4%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 60.3%
+-commutative60.3%
Simplified60.3%
Final simplification68.7%
(FPCore (x y) :precision binary64 (if (<= x -2.45e-15) (/ (/ y (+ x (- y (- -1.0 y)))) (+ y x)) (/ (* (/ x (+ y x)) (/ y (+ y 1.0))) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -2.45e-15) {
tmp = (y / (x + (y - (-1.0 - y)))) / (y + x);
} else {
tmp = ((x / (y + x)) * (y / (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 <= (-2.45d-15)) then
tmp = (y / (x + (y - ((-1.0d0) - y)))) / (y + x)
else
tmp = ((x / (y + x)) * (y / (y + 1.0d0))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.45e-15) {
tmp = (y / (x + (y - (-1.0 - y)))) / (y + x);
} else {
tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.45e-15: tmp = (y / (x + (y - (-1.0 - y)))) / (y + x) else: tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.45e-15) tmp = Float64(Float64(y / Float64(x + Float64(y - Float64(-1.0 - y)))) / Float64(y + x)); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(y + 1.0))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.45e-15) tmp = (y / (x + (y - (-1.0 - y)))) / (y + x); else tmp = ((x / (y + x)) * (y / (y + 1.0))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.45e-15], N[(N[(y / N[(x + N[(y - N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y - \left(-1 - y\right)\right)}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -2.45e-15Initial program 53.5%
associate-*r/76.7%
*-commutative76.7%
distribute-rgt1-in31.0%
fma-def76.6%
cube-unmult76.7%
Simplified76.7%
associate-*r/53.5%
fma-udef27.5%
cube-mult27.5%
distribute-rgt1-in53.5%
associate-+r+53.5%
*-commutative53.5%
frac-times86.8%
*-commutative86.8%
associate-/r*99.9%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.8%
associate-+r+99.8%
+-commutative99.8%
frac-times98.5%
*-un-lft-identity98.5%
Applied egg-rr98.5%
Taylor expanded in x around -inf 75.0%
+-commutative75.0%
mul-1-neg75.0%
unsub-neg75.0%
neg-mul-175.0%
unsub-neg75.0%
distribute-lft-in75.0%
metadata-eval75.0%
neg-mul-175.0%
unsub-neg75.0%
Simplified75.0%
if -2.45e-15 < x Initial program 72.4%
associate-*r/82.5%
*-commutative82.5%
distribute-rgt1-in72.6%
fma-def82.5%
cube-unmult82.5%
Simplified82.5%
associate-*r/72.4%
fma-udef63.2%
cube-mult63.2%
distribute-rgt1-in72.4%
associate-+r+72.4%
*-commutative72.4%
frac-times87.3%
*-commutative87.3%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 82.6%
+-commutative82.6%
Simplified82.6%
Final simplification80.5%
(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(Float64(x / Float64(y + x)) / Float64(y + x)) * Float64(y / Float64(x + Float64(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[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{x + \left(y + 1\right)}
\end{array}
Initial program 67.2%
times-frac87.1%
/-rgt-identity87.1%
associate-/l/87.1%
*-lft-identity87.1%
associate-+l+87.1%
Simplified87.1%
associate-/r*99.8%
div-inv99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y) :precision binary64 (if (<= y 4.2e-85) (/ (/ y (+ x (- y (- -1.0 y)))) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (y <= 4.2e-85) {
tmp = (y / (x + (y - (-1.0 - y)))) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.2d-85) then
tmp = (y / (x + (y - ((-1.0d0) - y)))) / (y + x)
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.2e-85) {
tmp = (y / (x + (y - (-1.0 - y)))) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.2e-85: tmp = (y / (x + (y - (-1.0 - y)))) / (y + x) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 4.2e-85) tmp = Float64(Float64(y / Float64(x + Float64(y - Float64(-1.0 - y)))) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.2e-85) tmp = (y / (x + (y - (-1.0 - y)))) / (y + x); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.2e-85], N[(N[(y / N[(x + N[(y - N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y - \left(-1 - y\right)\right)}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 4.2e-85Initial program 64.5%
associate-*r/79.1%
*-commutative79.1%
distribute-rgt1-in52.5%
fma-def79.1%
cube-unmult79.1%
Simplified79.1%
associate-*r/64.5%
fma-udef45.2%
cube-mult45.2%
distribute-rgt1-in64.5%
associate-+r+64.5%
*-commutative64.5%
frac-times82.4%
*-commutative82.4%
associate-/r*99.8%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
*-commutative99.9%
clear-num99.8%
associate-+r+99.8%
+-commutative99.8%
frac-times98.7%
*-un-lft-identity98.7%
Applied egg-rr98.7%
Taylor expanded in x around -inf 55.8%
+-commutative55.8%
mul-1-neg55.8%
unsub-neg55.8%
neg-mul-155.8%
unsub-neg55.8%
distribute-lft-in55.8%
metadata-eval55.8%
neg-mul-155.8%
unsub-neg55.8%
Simplified55.8%
if 4.2e-85 < y Initial program 72.3%
associate-*r/84.4%
*-commutative84.4%
distribute-rgt1-in77.5%
fma-def84.4%
cube-unmult84.4%
Simplified84.4%
associate-*r/72.3%
fma-udef68.9%
cube-mult68.8%
distribute-rgt1-in72.3%
associate-+r+72.3%
*-commutative72.3%
frac-times96.0%
*-commutative96.0%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 67.7%
+-commutative67.7%
Simplified67.7%
Final simplification59.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -1.6e-154)
t_0
(if (<= y 1.36e-177)
(/ y x)
(if (<= y 2.4e+26) t_0 (* (/ x y) (/ 1.0 y)))))))
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1.6e-154) {
tmp = t_0;
} else if (y <= 1.36e-177) {
tmp = y / x;
} else if (y <= 2.4e+26) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y / (x * x)
if (y <= (-1.6d-154)) then
tmp = t_0
else if (y <= 1.36d-177) then
tmp = y / x
else if (y <= 2.4d+26) then
tmp = t_0
else
tmp = (x / y) * (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1.6e-154) {
tmp = t_0;
} else if (y <= 1.36e-177) {
tmp = y / x;
} else if (y <= 2.4e+26) {
tmp = t_0;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -1.6e-154: tmp = t_0 elif y <= 1.36e-177: tmp = y / x elif y <= 2.4e+26: tmp = t_0 else: tmp = (x / y) * (1.0 / y) return tmp
function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -1.6e-154) tmp = t_0; elseif (y <= 1.36e-177) tmp = Float64(y / x); elseif (y <= 2.4e+26) tmp = t_0; else tmp = Float64(Float64(x / y) * Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x * x); tmp = 0.0; if (y <= -1.6e-154) tmp = t_0; elseif (y <= 1.36e-177) tmp = y / x; elseif (y <= 2.4e+26) tmp = t_0; else tmp = (x / y) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.6e-154], t$95$0, If[LessEqual[y, 1.36e-177], N[(y / x), $MachinePrecision], If[LessEqual[y, 2.4e+26], t$95$0, N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{-177}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+26}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < -1.60000000000000002e-154 or 1.35999999999999989e-177 < y < 2.40000000000000005e26Initial program 72.0%
associate-*r/84.9%
*-commutative84.9%
distribute-rgt1-in58.5%
fma-def84.9%
cube-unmult84.9%
Simplified84.9%
Taylor expanded in x around inf 38.2%
unpow238.2%
Simplified38.2%
if -1.60000000000000002e-154 < y < 1.35999999999999989e-177Initial program 54.8%
times-frac64.4%
/-rgt-identity64.4%
associate-/l/64.4%
*-lft-identity64.4%
associate-+l+64.4%
Simplified64.4%
Taylor expanded in y around 0 84.5%
Taylor expanded in x around 0 73.5%
if 2.40000000000000005e26 < y Initial program 64.1%
associate-*r/82.9%
*-commutative82.9%
distribute-rgt1-in77.5%
fma-def82.9%
cube-unmult82.9%
Simplified82.9%
Taylor expanded in y around inf 81.8%
unpow281.8%
Simplified81.8%
associate-/r*78.5%
div-inv78.6%
Applied egg-rr78.6%
Final simplification53.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -1.36e-154)
t_0
(if (<= y 2.85e-179) (/ y x) (if (<= y 2.3e+26) t_0 (/ x (* y y)))))))
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1.36e-154) {
tmp = t_0;
} else if (y <= 2.85e-179) {
tmp = y / x;
} else if (y <= 2.3e+26) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y / (x * x)
if (y <= (-1.36d-154)) then
tmp = t_0
else if (y <= 2.85d-179) then
tmp = y / x
else if (y <= 2.3d+26) then
tmp = t_0
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1.36e-154) {
tmp = t_0;
} else if (y <= 2.85e-179) {
tmp = y / x;
} else if (y <= 2.3e+26) {
tmp = t_0;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -1.36e-154: tmp = t_0 elif y <= 2.85e-179: tmp = y / x elif y <= 2.3e+26: tmp = t_0 else: tmp = x / (y * y) return tmp
function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -1.36e-154) tmp = t_0; elseif (y <= 2.85e-179) tmp = Float64(y / x); elseif (y <= 2.3e+26) tmp = t_0; else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x * x); tmp = 0.0; if (y <= -1.36e-154) tmp = t_0; elseif (y <= 2.85e-179) tmp = y / x; elseif (y <= 2.3e+26) tmp = t_0; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.36e-154], t$95$0, If[LessEqual[y, 2.85e-179], N[(y / x), $MachinePrecision], If[LessEqual[y, 2.3e+26], t$95$0, N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -1.36 \cdot 10^{-154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.85 \cdot 10^{-179}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+26}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -1.36e-154 or 2.85e-179 < y < 2.3000000000000001e26Initial program 72.0%
associate-*r/84.9%
*-commutative84.9%
distribute-rgt1-in58.5%
fma-def84.9%
cube-unmult84.9%
Simplified84.9%
Taylor expanded in x around inf 38.2%
unpow238.2%
Simplified38.2%
if -1.36e-154 < y < 2.85e-179Initial program 54.8%
times-frac64.4%
/-rgt-identity64.4%
associate-/l/64.4%
*-lft-identity64.4%
associate-+l+64.4%
Simplified64.4%
Taylor expanded in y around 0 84.5%
Taylor expanded in x around 0 73.5%
if 2.3000000000000001e26 < y Initial program 64.1%
associate-*r/82.9%
*-commutative82.9%
distribute-rgt1-in77.5%
fma-def82.9%
cube-unmult82.9%
Simplified82.9%
Taylor expanded in y around inf 81.8%
unpow281.8%
Simplified81.8%
Final simplification54.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -1.95e-154)
t_0
(if (<= y 4.9e-177) (/ y x) (if (<= y 2.4e+26) t_0 (/ (/ x y) y))))))
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1.95e-154) {
tmp = t_0;
} else if (y <= 4.9e-177) {
tmp = y / x;
} else if (y <= 2.4e+26) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y / (x * x)
if (y <= (-1.95d-154)) then
tmp = t_0
else if (y <= 4.9d-177) then
tmp = y / x
else if (y <= 2.4d+26) then
tmp = t_0
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1.95e-154) {
tmp = t_0;
} else if (y <= 4.9e-177) {
tmp = y / x;
} else if (y <= 2.4e+26) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -1.95e-154: tmp = t_0 elif y <= 4.9e-177: tmp = y / x elif y <= 2.4e+26: tmp = t_0 else: tmp = (x / y) / y return tmp
function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -1.95e-154) tmp = t_0; elseif (y <= 4.9e-177) tmp = Float64(y / x); elseif (y <= 2.4e+26) tmp = t_0; else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x * x); tmp = 0.0; if (y <= -1.95e-154) tmp = t_0; elseif (y <= 4.9e-177) tmp = y / x; elseif (y <= 2.4e+26) tmp = t_0; else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.95e-154], t$95$0, If[LessEqual[y, 4.9e-177], N[(y / x), $MachinePrecision], If[LessEqual[y, 2.4e+26], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{-154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{-177}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+26}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -1.95000000000000016e-154 or 4.89999999999999987e-177 < y < 2.40000000000000005e26Initial program 72.0%
associate-*r/84.9%
*-commutative84.9%
distribute-rgt1-in58.5%
fma-def84.9%
cube-unmult84.9%
Simplified84.9%
Taylor expanded in x around inf 38.2%
unpow238.2%
Simplified38.2%
if -1.95000000000000016e-154 < y < 4.89999999999999987e-177Initial program 54.8%
times-frac64.4%
/-rgt-identity64.4%
associate-/l/64.4%
*-lft-identity64.4%
associate-+l+64.4%
Simplified64.4%
Taylor expanded in y around 0 84.5%
Taylor expanded in x around 0 73.5%
if 2.40000000000000005e26 < y Initial program 64.1%
associate-*r/82.9%
*-commutative82.9%
distribute-rgt1-in77.5%
fma-def82.9%
cube-unmult82.9%
Simplified82.9%
Taylor expanded in y around inf 81.8%
unpow281.8%
Simplified81.8%
associate-/r*78.5%
div-inv78.6%
Applied egg-rr78.6%
un-div-inv78.5%
Applied egg-rr78.5%
Final simplification53.6%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (/ y (* x x)) (if (<= x -3.7e-57) (- (/ y x) y) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -3.7e-57) {
tmp = (y / x) - y;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-3.7d-57)) then
tmp = (y / x) - y
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -3.7e-57) {
tmp = (y / x) - y;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -3.7e-57: tmp = (y / x) - y else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -3.7e-57) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = y / (x * x); elseif (x <= -3.7e-57) tmp = (y / x) - y; else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.7e-57], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-57}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 52.1%
associate-*r/76.6%
*-commutative76.6%
distribute-rgt1-in28.2%
fma-def76.6%
cube-unmult76.6%
Simplified76.6%
Taylor expanded in x around inf 67.8%
unpow267.8%
Simplified67.8%
if -1 < x < -3.7e-57Initial program 85.8%
times-frac99.6%
/-rgt-identity99.6%
associate-/l/99.6%
*-lft-identity99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 33.3%
Taylor expanded in x around 0 30.1%
neg-mul-130.1%
unsub-neg30.1%
Simplified30.1%
if -3.7e-57 < x Initial program 71.5%
times-frac86.6%
/-rgt-identity86.6%
associate-/l/86.6%
*-lft-identity86.6%
associate-+l+86.6%
Simplified86.6%
Taylor expanded in x around 0 61.8%
+-commutative61.8%
Simplified61.8%
Final simplification61.7%
(FPCore (x y) :precision binary64 (if (<= y 5.2e-85) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (y <= 5.2e-85) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 5.2d-85) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 5.2e-85) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.2e-85: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 5.2e-85) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5.2e-85) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.2e-85], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 5.20000000000000023e-85Initial program 64.5%
times-frac82.4%
/-rgt-identity82.4%
associate-/l/82.4%
*-lft-identity82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in y around 0 52.8%
*-un-lft-identity52.8%
times-frac54.7%
Applied egg-rr54.7%
associate-*l/54.6%
*-lft-identity54.6%
Simplified54.6%
if 5.20000000000000023e-85 < y Initial program 72.3%
associate-*r/84.4%
*-commutative84.4%
distribute-rgt1-in77.5%
fma-def84.4%
cube-unmult84.4%
Simplified84.4%
associate-*r/72.3%
fma-udef68.9%
cube-mult68.8%
distribute-rgt1-in72.3%
associate-+r+72.3%
*-commutative72.3%
frac-times96.0%
*-commutative96.0%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 67.7%
+-commutative67.7%
Simplified67.7%
Final simplification59.2%
(FPCore (x y) :precision binary64 (if (<= y 5.8e-85) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (y <= 5.8e-85) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 5.8d-85) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 5.8e-85) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.8e-85: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 5.8e-85) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5.8e-85) tmp = (y / (x + 1.0)) / (y + x); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.8e-85], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.8 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 5.8000000000000004e-85Initial program 64.5%
associate-*r/79.1%
*-commutative79.1%
distribute-rgt1-in52.5%
fma-def79.1%
cube-unmult79.1%
Simplified79.1%
associate-*r/64.5%
fma-udef45.2%
cube-mult45.2%
distribute-rgt1-in64.5%
associate-+r+64.5%
*-commutative64.5%
frac-times82.4%
*-commutative82.4%
associate-/r*99.8%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 55.1%
if 5.8000000000000004e-85 < y Initial program 72.3%
associate-*r/84.4%
*-commutative84.4%
distribute-rgt1-in77.5%
fma-def84.4%
cube-unmult84.4%
Simplified84.4%
associate-*r/72.3%
fma-udef68.9%
cube-mult68.8%
distribute-rgt1-in72.3%
associate-+r+72.3%
*-commutative72.3%
frac-times96.0%
*-commutative96.0%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 67.7%
+-commutative67.7%
Simplified67.7%
Final simplification59.5%
(FPCore (x y) :precision binary64 (if (<= y 5.8e-85) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 5.8e-85) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 5.8d-85) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 5.8e-85) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.8e-85: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 5.8e-85) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5.8e-85) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.8e-85], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.8 \cdot 10^{-85}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 5.8000000000000004e-85Initial program 64.5%
times-frac82.4%
/-rgt-identity82.4%
associate-/l/82.4%
*-lft-identity82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in y around 0 52.8%
if 5.8000000000000004e-85 < y Initial program 72.3%
times-frac96.0%
/-rgt-identity96.0%
associate-/l/96.0%
*-lft-identity96.0%
associate-+l+96.0%
Simplified96.0%
Taylor expanded in x around 0 69.4%
+-commutative69.4%
Simplified69.4%
Final simplification58.6%
(FPCore (x y) :precision binary64 (if (<= y 5.8e-85) (/ (/ y x) (+ x 1.0)) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 5.8e-85) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 5.8d-85) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 5.8e-85) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.8e-85: tmp = (y / x) / (x + 1.0) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 5.8e-85) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5.8e-85) tmp = (y / x) / (x + 1.0); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.8e-85], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.8 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 5.8000000000000004e-85Initial program 64.5%
times-frac82.4%
/-rgt-identity82.4%
associate-/l/82.4%
*-lft-identity82.4%
associate-+l+82.4%
Simplified82.4%
Taylor expanded in y around 0 52.8%
*-un-lft-identity52.8%
times-frac54.7%
Applied egg-rr54.7%
associate-*l/54.6%
*-lft-identity54.6%
Simplified54.6%
if 5.8000000000000004e-85 < y Initial program 72.3%
times-frac96.0%
/-rgt-identity96.0%
associate-/l/96.0%
*-lft-identity96.0%
associate-+l+96.0%
Simplified96.0%
Taylor expanded in x around 0 69.4%
+-commutative69.4%
Simplified69.4%
Final simplification59.8%
(FPCore (x y) :precision binary64 (if (<= y 5.8e-49) (/ y x) (/ x (* y y))))
double code(double x, double y) {
double tmp;
if (y <= 5.8e-49) {
tmp = 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 <= 5.8d-49) then
tmp = 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 <= 5.8e-49) {
tmp = y / x;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.8e-49: tmp = y / x else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 5.8e-49) tmp = Float64(y / x); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5.8e-49) tmp = y / x; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.8e-49], N[(y / x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.8 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 5.8e-49Initial program 66.2%
times-frac83.4%
/-rgt-identity83.4%
associate-/l/83.4%
*-lft-identity83.4%
associate-+l+83.4%
Simplified83.4%
Taylor expanded in y around 0 52.7%
Taylor expanded in x around 0 28.8%
if 5.8e-49 < y Initial program 69.7%
associate-*r/83.7%
*-commutative83.7%
distribute-rgt1-in77.2%
fma-def83.7%
cube-unmult83.7%
Simplified83.7%
Taylor expanded in y around inf 63.4%
unpow263.4%
Simplified63.4%
Final simplification39.5%
(FPCore (x y) :precision binary64 (/ 1.0 y))
double code(double x, double y) {
return 1.0 / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / y
end function
public static double code(double x, double y) {
return 1.0 / y;
}
def code(x, y): return 1.0 / y
function code(x, y) return Float64(1.0 / y) end
function tmp = code(x, y) tmp = 1.0 / y; end
code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{y}
\end{array}
Initial program 67.2%
times-frac87.1%
/-rgt-identity87.1%
associate-/l/87.1%
*-lft-identity87.1%
associate-+l+87.1%
Simplified87.1%
Taylor expanded in x around 0 49.5%
unpow249.5%
Simplified49.5%
Taylor expanded in x around inf 4.4%
Final simplification4.4%
(FPCore (x y) :precision binary64 (/ y x))
double code(double x, double y) {
return y / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y / x
end function
public static double code(double x, double y) {
return y / x;
}
def code(x, y): return y / x
function code(x, y) return Float64(y / x) end
function tmp = code(x, y) tmp = y / x; end
code[x_, y_] := N[(y / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x}
\end{array}
Initial program 67.2%
times-frac87.1%
/-rgt-identity87.1%
associate-/l/87.1%
*-lft-identity87.1%
associate-+l+87.1%
Simplified87.1%
Taylor expanded in y around 0 45.8%
Taylor expanded in x around 0 21.2%
Final simplification21.2%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 67.2%
associate-*r/80.9%
*-commutative80.9%
distribute-rgt1-in61.2%
fma-def80.9%
cube-unmult80.9%
Simplified80.9%
associate-*r/67.2%
fma-udef53.5%
cube-mult53.4%
distribute-rgt1-in67.2%
associate-+r+67.2%
*-commutative67.2%
frac-times87.1%
*-commutative87.1%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 54.1%
+-commutative54.1%
Simplified54.1%
Taylor expanded in y around 0 3.5%
Final simplification3.5%
(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 2023230
(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))))