
(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 26 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)) (+ y x)) (/ x (+ x (+ y 1.0)))))
double code(double x, double y) {
return ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0d0)))
end function
public static double code(double x, double y) {
return ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0)));
}
def code(x, y): return ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0)))
function code(x, y) return Float64(Float64(Float64(y / Float64(y + x)) / Float64(y + x)) * Float64(x / Float64(x + Float64(y + 1.0)))) end
function tmp = code(x, y) tmp = ((y / (y + x)) / (y + x)) * (x / (x + (y + 1.0))); end
code[x_, y_] := N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{y + x}}{y + x} \cdot \frac{x}{x + \left(y + 1\right)}
\end{array}
Initial program 68.7%
associate-/r*73.5%
+-commutative73.5%
+-commutative73.5%
+-commutative73.5%
associate-/l/68.7%
times-frac88.4%
*-commutative88.4%
+-commutative88.4%
+-commutative88.4%
+-commutative88.4%
associate-+l+88.4%
Simplified88.4%
associate-/r*99.7%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y)
:precision binary64
(if (<= x -1.45e+152)
(/ (/ 1.0 x) (/ (+ y (+ x 1.0)) y))
(if (<= x -5e-17)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x (+ y 1.0))))
(* (/ (/ y (+ y x)) (+ y x)) (/ x (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.45e+152) {
tmp = (1.0 / x) / ((y + (x + 1.0)) / y);
} else if (x <= -5e-17) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.45d+152)) then
tmp = (1.0d0 / x) / ((y + (x + 1.0d0)) / y)
else if (x <= (-5d-17)) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0d0)))
else
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.45e+152) {
tmp = (1.0 / x) / ((y + (x + 1.0)) / y);
} else if (x <= -5e-17) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.45e+152: tmp = (1.0 / x) / ((y + (x + 1.0)) / y) elif x <= -5e-17: tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0))) else: tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.45e+152) tmp = Float64(Float64(1.0 / x) / Float64(Float64(y + Float64(x + 1.0)) / y)); elseif (x <= -5e-17) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(Float64(y / Float64(y + x)) / Float64(y + x)) * Float64(x / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.45e+152) tmp = (1.0 / x) / ((y + (x + 1.0)) / y); elseif (x <= -5e-17) tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0))); else tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.45e+152], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-17], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+152}:\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{y + \left(x + 1\right)}{y}}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{y + x} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -1.4499999999999999e152Initial program 59.5%
times-frac78.8%
associate-+l+78.8%
Simplified78.8%
Taylor expanded in x around inf 85.9%
clear-num85.9%
un-div-inv86.0%
associate-+r+86.0%
+-commutative86.0%
associate-+l+86.0%
Applied egg-rr86.0%
if -1.4499999999999999e152 < x < -4.9999999999999999e-17Initial program 74.7%
times-frac99.5%
associate-+l+99.5%
Simplified99.5%
if -4.9999999999999999e-17 < x Initial program 69.1%
associate-/r*72.6%
+-commutative72.6%
+-commutative72.6%
+-commutative72.6%
associate-/l/69.1%
times-frac87.8%
*-commutative87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
Simplified87.8%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 91.2%
+-commutative91.2%
Simplified91.2%
Final simplification91.8%
(FPCore (x y)
:precision binary64
(if (<= x -1.45e+152)
(/ (/ 1.0 x) (/ (+ y (+ x 1.0)) y))
(if (<= x -5e-16)
(* (/ x (+ x (+ y 1.0))) (/ y (* (+ y x) (+ y x))))
(* (/ (/ y (+ y x)) (+ y x)) (/ x (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.45e+152) {
tmp = (1.0 / x) / ((y + (x + 1.0)) / y);
} else if (x <= -5e-16) {
tmp = (x / (x + (y + 1.0))) * (y / ((y + x) * (y + x)));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.45d+152)) then
tmp = (1.0d0 / x) / ((y + (x + 1.0d0)) / y)
else if (x <= (-5d-16)) then
tmp = (x / (x + (y + 1.0d0))) * (y / ((y + x) * (y + x)))
else
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.45e+152) {
tmp = (1.0 / x) / ((y + (x + 1.0)) / y);
} else if (x <= -5e-16) {
tmp = (x / (x + (y + 1.0))) * (y / ((y + x) * (y + x)));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.45e+152: tmp = (1.0 / x) / ((y + (x + 1.0)) / y) elif x <= -5e-16: tmp = (x / (x + (y + 1.0))) * (y / ((y + x) * (y + x))) else: tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.45e+152) tmp = Float64(Float64(1.0 / x) / Float64(Float64(y + Float64(x + 1.0)) / y)); elseif (x <= -5e-16) tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) * Float64(y / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(Float64(y / Float64(y + x)) / Float64(y + x)) * Float64(x / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.45e+152) tmp = (1.0 / x) / ((y + (x + 1.0)) / y); elseif (x <= -5e-16) tmp = (x / (x + (y + 1.0))) * (y / ((y + x) * (y + x))); else tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.45e+152], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-16], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+152}:\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{y + \left(x + 1\right)}{y}}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{y + x} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -1.4499999999999999e152Initial program 59.5%
times-frac78.8%
associate-+l+78.8%
Simplified78.8%
Taylor expanded in x around inf 85.9%
clear-num85.9%
un-div-inv86.0%
associate-+r+86.0%
+-commutative86.0%
associate-+l+86.0%
Applied egg-rr86.0%
if -1.4499999999999999e152 < x < -5.0000000000000004e-16Initial program 74.7%
associate-/r*89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
associate-/l/74.7%
times-frac99.6%
*-commutative99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
Simplified99.6%
if -5.0000000000000004e-16 < x Initial program 69.1%
associate-/r*72.6%
+-commutative72.6%
+-commutative72.6%
+-commutative72.6%
associate-/l/69.1%
times-frac87.8%
*-commutative87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
Simplified87.8%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 91.2%
+-commutative91.2%
Simplified91.2%
Final simplification91.8%
(FPCore (x y)
:precision binary64
(if (<= x -2.6e+132)
(/ (/ 1.0 x) (/ (+ y (+ x 1.0)) y))
(if (<= x -2.9e-154)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x 1.0)))
(/ (/ x (+ y x)) (+ y (+ x (+ x 1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= -2.6e+132) {
tmp = (1.0 / x) / ((y + (x + 1.0)) / y);
} else if (x <= -2.9e-154) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + (x + (x + 1.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.6d+132)) then
tmp = (1.0d0 / x) / ((y + (x + 1.0d0)) / y)
else if (x <= (-2.9d-154)) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0d0))
else
tmp = (x / (y + x)) / (y + (x + (x + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.6e+132) {
tmp = (1.0 / x) / ((y + (x + 1.0)) / y);
} else if (x <= -2.9e-154) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = (x / (y + x)) / (y + (x + (x + 1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.6e+132: tmp = (1.0 / x) / ((y + (x + 1.0)) / y) elif x <= -2.9e-154: tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)) else: tmp = (x / (y + x)) / (y + (x + (x + 1.0))) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.6e+132) tmp = Float64(Float64(1.0 / x) / Float64(Float64(y + Float64(x + 1.0)) / y)); elseif (x <= -2.9e-154) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + Float64(x + Float64(x + 1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.6e+132) tmp = (1.0 / x) / ((y + (x + 1.0)) / y); elseif (x <= -2.9e-154) tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)); else tmp = (x / (y + x)) / (y + (x + (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.6e+132], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9e-154], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+132}:\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{y + \left(x + 1\right)}{y}}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-154}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if x < -2.6e132Initial program 61.3%
times-frac81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around inf 85.0%
clear-num85.0%
un-div-inv85.1%
associate-+r+85.1%
+-commutative85.1%
associate-+l+85.1%
Applied egg-rr85.1%
if -2.6e132 < x < -2.9e-154Initial program 82.6%
times-frac99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 82.7%
+-commutative82.7%
Simplified82.7%
if -2.9e-154 < x Initial program 65.9%
associate-/r*69.9%
+-commutative69.9%
+-commutative69.9%
+-commutative69.9%
associate-/r*65.9%
associate-*l/81.7%
*-commutative81.7%
*-commutative81.7%
distribute-rgt1-in74.5%
fma-def81.7%
+-commutative81.7%
+-commutative81.7%
cube-unmult81.7%
+-commutative81.7%
Simplified81.7%
associate-*r/65.9%
fma-udef61.1%
cube-mult61.2%
distribute-rgt1-in65.9%
associate-+r+65.9%
*-commutative65.9%
*-commutative65.9%
frac-times86.5%
associate-/r*99.7%
clear-num99.6%
frac-times99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
Taylor expanded in y around -inf 60.9%
mul-1-neg60.9%
unsub-neg60.9%
neg-mul-160.9%
unsub-neg60.9%
distribute-lft-in60.9%
metadata-eval60.9%
neg-mul-160.9%
unsub-neg60.9%
Simplified60.9%
Final simplification68.9%
(FPCore (x y)
:precision binary64
(if (<= x -3.2e+132)
(/ (/ 1.0 x) (/ (+ y (+ x 1.0)) y))
(if (<= x -4.8e-12)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x 1.0)))
(* (/ (/ y (+ y x)) (+ y x)) (/ x (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -3.2e+132) {
tmp = (1.0 / x) / ((y + (x + 1.0)) / y);
} else if (x <= -4.8e-12) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.2d+132)) then
tmp = (1.0d0 / x) / ((y + (x + 1.0d0)) / y)
else if (x <= (-4.8d-12)) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0d0))
else
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.2e+132) {
tmp = (1.0 / x) / ((y + (x + 1.0)) / y);
} else if (x <= -4.8e-12) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.2e+132: tmp = (1.0 / x) / ((y + (x + 1.0)) / y) elif x <= -4.8e-12: tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)) else: tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.2e+132) tmp = Float64(Float64(1.0 / x) / Float64(Float64(y + Float64(x + 1.0)) / y)); elseif (x <= -4.8e-12) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + 1.0))); else tmp = Float64(Float64(Float64(y / Float64(y + x)) / Float64(y + x)) * Float64(x / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.2e+132) tmp = (1.0 / x) / ((y + (x + 1.0)) / y); elseif (x <= -4.8e-12) tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)); else tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.2e+132], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e-12], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+132}:\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{y + \left(x + 1\right)}{y}}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{y + x} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if x < -3.1999999999999997e132Initial program 61.3%
times-frac81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around inf 85.0%
clear-num85.0%
un-div-inv85.1%
associate-+r+85.1%
+-commutative85.1%
associate-+l+85.1%
Applied egg-rr85.1%
if -3.1999999999999997e132 < x < -4.79999999999999974e-12Initial program 74.6%
times-frac99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 85.0%
+-commutative85.0%
Simplified85.0%
if -4.79999999999999974e-12 < x Initial program 69.1%
associate-/r*72.6%
+-commutative72.6%
+-commutative72.6%
+-commutative72.6%
associate-/l/69.1%
times-frac87.8%
*-commutative87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
Simplified87.8%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 91.2%
+-commutative91.2%
Simplified91.2%
Final simplification89.5%
(FPCore (x y)
:precision binary64
(if (<= x -0.0018)
(* (/ 1.0 x) (/ y (+ x (+ y 1.0))))
(if (<= x -2.9e-154)
(* y (/ x (* (+ y x) (+ y x))))
(/ (/ x (+ y x)) (+ y (+ x (+ x 1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= -0.0018) {
tmp = (1.0 / x) * (y / (x + (y + 1.0)));
} else if (x <= -2.9e-154) {
tmp = y * (x / ((y + x) * (y + x)));
} else {
tmp = (x / (y + x)) / (y + (x + (x + 1.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-0.0018d0)) then
tmp = (1.0d0 / x) * (y / (x + (y + 1.0d0)))
else if (x <= (-2.9d-154)) then
tmp = y * (x / ((y + x) * (y + x)))
else
tmp = (x / (y + x)) / (y + (x + (x + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.0018) {
tmp = (1.0 / x) * (y / (x + (y + 1.0)));
} else if (x <= -2.9e-154) {
tmp = y * (x / ((y + x) * (y + x)));
} else {
tmp = (x / (y + x)) / (y + (x + (x + 1.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.0018: tmp = (1.0 / x) * (y / (x + (y + 1.0))) elif x <= -2.9e-154: tmp = y * (x / ((y + x) * (y + x))) else: tmp = (x / (y + x)) / (y + (x + (x + 1.0))) return tmp
function code(x, y) tmp = 0.0 if (x <= -0.0018) tmp = Float64(Float64(1.0 / x) * Float64(y / Float64(x + Float64(y + 1.0)))); elseif (x <= -2.9e-154) tmp = Float64(y * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + Float64(x + Float64(x + 1.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.0018) tmp = (1.0 / x) * (y / (x + (y + 1.0))); elseif (x <= -2.9e-154) tmp = y * (x / ((y + x) * (y + x))); else tmp = (x / (y + x)) / (y + (x + (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.0018], N[(N[(1.0 / x), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.9e-154], N[(y * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0018:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-154}:\\
\;\;\;\;y \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if x < -0.0018Initial program 66.8%
times-frac89.7%
associate-+l+89.7%
Simplified89.7%
Taylor expanded in x around inf 79.3%
if -0.0018 < x < -2.9e-154Initial program 98.5%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 80.5%
+-commutative80.5%
Simplified80.5%
Taylor expanded in x around 0 79.2%
if -2.9e-154 < x Initial program 65.9%
associate-/r*69.9%
+-commutative69.9%
+-commutative69.9%
+-commutative69.9%
associate-/r*65.9%
associate-*l/81.7%
*-commutative81.7%
*-commutative81.7%
distribute-rgt1-in74.5%
fma-def81.7%
+-commutative81.7%
+-commutative81.7%
cube-unmult81.7%
+-commutative81.7%
Simplified81.7%
associate-*r/65.9%
fma-udef61.1%
cube-mult61.2%
distribute-rgt1-in65.9%
associate-+r+65.9%
*-commutative65.9%
*-commutative65.9%
frac-times86.5%
associate-/r*99.7%
clear-num99.6%
frac-times99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
Taylor expanded in y around -inf 60.9%
mul-1-neg60.9%
unsub-neg60.9%
neg-mul-160.9%
unsub-neg60.9%
distribute-lft-in60.9%
metadata-eval60.9%
neg-mul-160.9%
unsub-neg60.9%
Simplified60.9%
Final simplification67.4%
(FPCore (x y) :precision binary64 (if (<= y 6.6e+35) (/ (/ x (+ y x)) (* (+ y x) (/ (+ x 1.0) y))) (* (/ (/ y (+ y x)) (+ y x)) (/ x (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 6.6e+35) {
tmp = (x / (y + x)) / ((y + x) * ((x + 1.0) / y));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6.6d+35) then
tmp = (x / (y + x)) / ((y + x) * ((x + 1.0d0) / y))
else
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6.6e+35) {
tmp = (x / (y + x)) / ((y + x) * ((x + 1.0) / y));
} else {
tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.6e+35: tmp = (x / (y + x)) / ((y + x) * ((x + 1.0) / y)) else: tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 6.6e+35) tmp = Float64(Float64(x / Float64(y + x)) / Float64(Float64(y + x) * Float64(Float64(x + 1.0) / y))); else tmp = Float64(Float64(Float64(y / Float64(y + x)) / Float64(y + x)) * Float64(x / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6.6e+35) tmp = (x / (y + x)) / ((y + x) * ((x + 1.0) / y)); else tmp = ((y / (y + x)) / (y + x)) * (x / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.6e+35], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(x + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.6 \cdot 10^{+35}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{\left(y + x\right) \cdot \frac{x + 1}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{y + x} \cdot \frac{x}{y + 1}\\
\end{array}
\end{array}
if y < 6.6000000000000003e35Initial program 70.8%
times-frac89.2%
associate-+l+89.2%
Simplified89.2%
Taylor expanded in y around 0 81.3%
+-commutative81.3%
Simplified81.3%
*-commutative81.3%
clear-num81.2%
associate-/r*90.2%
frac-times83.1%
*-un-lft-identity83.1%
+-commutative83.1%
+-commutative83.1%
Applied egg-rr83.1%
if 6.6000000000000003e35 < y Initial program 61.4%
associate-/r*68.1%
+-commutative68.1%
+-commutative68.1%
+-commutative68.1%
associate-/l/61.4%
times-frac85.5%
*-commutative85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
associate-+l+85.5%
Simplified85.5%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around 0 88.6%
+-commutative88.6%
Simplified88.6%
Final simplification84.3%
(FPCore (x y)
:precision binary64
(if (<= x -1.3e-6)
(* (/ 1.0 x) (/ y (+ x (+ y 1.0))))
(if (<= x -9e-155)
(* y (/ x (* (+ y x) (+ y x))))
(/ (/ x (+ y x)) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.3e-6) {
tmp = (1.0 / x) * (y / (x + (y + 1.0)));
} else if (x <= -9e-155) {
tmp = y * (x / ((y + x) * (y + x)));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.3d-6)) then
tmp = (1.0d0 / x) * (y / (x + (y + 1.0d0)))
else if (x <= (-9d-155)) then
tmp = y * (x / ((y + x) * (y + x)))
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.3e-6) {
tmp = (1.0 / x) * (y / (x + (y + 1.0)));
} else if (x <= -9e-155) {
tmp = y * (x / ((y + x) * (y + x)));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.3e-6: tmp = (1.0 / x) * (y / (x + (y + 1.0))) elif x <= -9e-155: tmp = y * (x / ((y + x) * (y + x))) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.3e-6) tmp = Float64(Float64(1.0 / x) * Float64(y / Float64(x + Float64(y + 1.0)))); elseif (x <= -9e-155) tmp = Float64(y * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.3e-6) tmp = (1.0 / x) * (y / (x + (y + 1.0))); elseif (x <= -9e-155) tmp = y * (x / ((y + x) * (y + x))); else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.3e-6], N[(N[(1.0 / x), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9e-155], N[(y * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-155}:\\
\;\;\;\;y \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -1.30000000000000005e-6Initial program 66.8%
times-frac89.7%
associate-+l+89.7%
Simplified89.7%
Taylor expanded in x around inf 79.3%
if -1.30000000000000005e-6 < x < -9.0000000000000007e-155Initial program 98.5%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 80.5%
+-commutative80.5%
Simplified80.5%
Taylor expanded in x around 0 79.2%
if -9.0000000000000007e-155 < x Initial program 65.9%
associate-/r*69.9%
+-commutative69.9%
+-commutative69.9%
+-commutative69.9%
associate-/r*65.9%
associate-*l/81.7%
*-commutative81.7%
*-commutative81.7%
distribute-rgt1-in74.5%
fma-def81.7%
+-commutative81.7%
+-commutative81.7%
cube-unmult81.7%
+-commutative81.7%
Simplified81.7%
associate-*r/65.9%
fma-udef61.1%
cube-mult61.2%
distribute-rgt1-in65.9%
associate-+r+65.9%
*-commutative65.9%
*-commutative65.9%
frac-times86.5%
associate-/r*99.7%
clear-num99.6%
frac-times99.2%
*-un-lft-identity99.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 60.1%
+-commutative60.1%
Simplified60.1%
Final simplification66.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= x -1.95e-5)
(* (/ 1.0 x) (/ y t_0))
(if (<= x -1.7e-154)
(* y (/ x (* (+ y x) (+ y x))))
(/ (/ x t_0) (+ y x))))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.95e-5) {
tmp = (1.0 / x) * (y / t_0);
} else if (x <= -1.7e-154) {
tmp = y * (x / ((y + x) * (y + x)));
} else {
tmp = (x / t_0) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (x <= (-1.95d-5)) then
tmp = (1.0d0 / x) * (y / t_0)
else if (x <= (-1.7d-154)) then
tmp = y * (x / ((y + x) * (y + x)))
else
tmp = (x / t_0) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.95e-5) {
tmp = (1.0 / x) * (y / t_0);
} else if (x <= -1.7e-154) {
tmp = y * (x / ((y + x) * (y + x)));
} else {
tmp = (x / t_0) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if x <= -1.95e-5: tmp = (1.0 / x) * (y / t_0) elif x <= -1.7e-154: tmp = y * (x / ((y + x) * (y + x))) else: tmp = (x / t_0) / (y + x) return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -1.95e-5) tmp = Float64(Float64(1.0 / x) * Float64(y / t_0)); elseif (x <= -1.7e-154) tmp = Float64(y * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(x / t_0) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); tmp = 0.0; if (x <= -1.95e-5) tmp = (1.0 / x) * (y / t_0); elseif (x <= -1.7e-154) tmp = y * (x / ((y + x) * (y + x))); else tmp = (x / t_0) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e-5], N[(N[(1.0 / x), $MachinePrecision] * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-154], N[(y * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{t_0}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-154}:\\
\;\;\;\;y \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t_0}}{y + x}\\
\end{array}
\end{array}
if x < -1.95e-5Initial program 66.8%
times-frac89.7%
associate-+l+89.7%
Simplified89.7%
Taylor expanded in x around inf 79.3%
if -1.95e-5 < x < -1.6999999999999999e-154Initial program 98.5%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 80.5%
+-commutative80.5%
Simplified80.5%
Taylor expanded in x around 0 79.2%
if -1.6999999999999999e-154 < x Initial program 65.9%
associate-/r*69.9%
+-commutative69.9%
+-commutative69.9%
+-commutative69.9%
associate-/l/65.9%
times-frac86.5%
*-commutative86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
associate-+l+86.5%
Simplified86.5%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in y around inf 60.5%
associate-*l/60.6%
*-un-lft-identity60.6%
Applied egg-rr60.6%
Final simplification67.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -7.8e-175)
t_0
(if (<= y 5.4e-148)
(/ y x)
(if (<= y 1.9e-17) (/ x y) (if (<= y 2.25e+36) t_0 (/ (/ x y) y)))))))
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -7.8e-175) {
tmp = t_0;
} else if (y <= 5.4e-148) {
tmp = y / x;
} else if (y <= 1.9e-17) {
tmp = x / y;
} else if (y <= 2.25e+36) {
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 <= (-7.8d-175)) then
tmp = t_0
else if (y <= 5.4d-148) then
tmp = y / x
else if (y <= 1.9d-17) then
tmp = x / y
else if (y <= 2.25d+36) 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 <= -7.8e-175) {
tmp = t_0;
} else if (y <= 5.4e-148) {
tmp = y / x;
} else if (y <= 1.9e-17) {
tmp = x / y;
} else if (y <= 2.25e+36) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -7.8e-175: tmp = t_0 elif y <= 5.4e-148: tmp = y / x elif y <= 1.9e-17: tmp = x / y elif y <= 2.25e+36: 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 <= -7.8e-175) tmp = t_0; elseif (y <= 5.4e-148) tmp = Float64(y / x); elseif (y <= 1.9e-17) tmp = Float64(x / y); elseif (y <= 2.25e+36) 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 <= -7.8e-175) tmp = t_0; elseif (y <= 5.4e-148) tmp = y / x; elseif (y <= 1.9e-17) tmp = x / y; elseif (y <= 2.25e+36) 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, -7.8e-175], t$95$0, If[LessEqual[y, 5.4e-148], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.9e-17], N[(x / y), $MachinePrecision], If[LessEqual[y, 2.25e+36], 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 -7.8 \cdot 10^{-175}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-148}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{+36}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -7.79999999999999997e-175 or 1.9000000000000001e-17 < y < 2.24999999999999998e36Initial program 69.8%
associate-/r*76.5%
+-commutative76.5%
+-commutative76.5%
+-commutative76.5%
associate-/r*69.8%
associate-*l/85.1%
*-commutative85.1%
*-commutative85.1%
distribute-rgt1-in61.7%
fma-def85.1%
+-commutative85.1%
+-commutative85.1%
cube-unmult85.1%
+-commutative85.1%
Simplified85.1%
Taylor expanded in x around inf 37.6%
unpow237.6%
Simplified37.6%
if -7.79999999999999997e-175 < y < 5.39999999999999976e-148Initial program 68.3%
times-frac78.5%
associate-+l+78.5%
Simplified78.5%
Taylor expanded in y around 0 87.1%
Taylor expanded in x around 0 74.6%
if 5.39999999999999976e-148 < y < 1.9000000000000001e-17Initial program 80.7%
times-frac99.3%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in x around 0 43.9%
if 2.24999999999999998e36 < y Initial program 61.4%
associate-/r*68.1%
+-commutative68.1%
+-commutative68.1%
+-commutative68.1%
associate-/r*61.4%
associate-*l/76.3%
*-commutative76.3%
*-commutative76.3%
distribute-rgt1-in74.1%
fma-def76.3%
+-commutative76.3%
+-commutative76.3%
cube-unmult76.3%
+-commutative76.3%
Simplified76.3%
Taylor expanded in y around inf 81.8%
unpow281.8%
Simplified81.8%
associate-/r*86.6%
div-inv86.6%
Applied egg-rr86.6%
associate-*r/86.6%
*-rgt-identity86.6%
Simplified86.6%
Final simplification57.6%
(FPCore (x y)
:precision binary64
(if (<= y -8e-175)
(* y (/ 1.0 (* x x)))
(if (<= y 5.2e-148)
(/ y x)
(if (<= y 1.72e-18)
(/ x y)
(if (<= y 6.6e+35) (/ y (* x x)) (/ (/ x y) y))))))
double code(double x, double y) {
double tmp;
if (y <= -8e-175) {
tmp = y * (1.0 / (x * x));
} else if (y <= 5.2e-148) {
tmp = y / x;
} else if (y <= 1.72e-18) {
tmp = x / y;
} else if (y <= 6.6e+35) {
tmp = y / (x * 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 <= (-8d-175)) then
tmp = y * (1.0d0 / (x * x))
else if (y <= 5.2d-148) then
tmp = y / x
else if (y <= 1.72d-18) then
tmp = x / y
else if (y <= 6.6d+35) then
tmp = y / (x * x)
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -8e-175) {
tmp = y * (1.0 / (x * x));
} else if (y <= 5.2e-148) {
tmp = y / x;
} else if (y <= 1.72e-18) {
tmp = x / y;
} else if (y <= 6.6e+35) {
tmp = y / (x * x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -8e-175: tmp = y * (1.0 / (x * x)) elif y <= 5.2e-148: tmp = y / x elif y <= 1.72e-18: tmp = x / y elif y <= 6.6e+35: tmp = y / (x * x) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= -8e-175) tmp = Float64(y * Float64(1.0 / Float64(x * x))); elseif (y <= 5.2e-148) tmp = Float64(y / x); elseif (y <= 1.72e-18) tmp = Float64(x / y); elseif (y <= 6.6e+35) tmp = Float64(y / Float64(x * x)); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -8e-175) tmp = y * (1.0 / (x * x)); elseif (y <= 5.2e-148) tmp = y / x; elseif (y <= 1.72e-18) tmp = x / y; elseif (y <= 6.6e+35) tmp = y / (x * x); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -8e-175], N[(y * N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-148], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.72e-18], N[(x / y), $MachinePrecision], If[LessEqual[y, 6.6e+35], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-175}:\\
\;\;\;\;y \cdot \frac{1}{x \cdot x}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-148}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1.72 \cdot 10^{-18}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+35}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -8e-175Initial program 67.4%
associate-/r*74.2%
+-commutative74.2%
+-commutative74.2%
+-commutative74.2%
associate-/r*67.4%
associate-*l/84.3%
*-commutative84.3%
*-commutative84.3%
distribute-rgt1-in58.7%
fma-def84.3%
+-commutative84.3%
+-commutative84.3%
cube-unmult84.3%
+-commutative84.3%
Simplified84.3%
Taylor expanded in x around inf 31.8%
unpow231.8%
Simplified31.8%
if -8e-175 < y < 5.20000000000000015e-148Initial program 68.3%
times-frac78.5%
associate-+l+78.5%
Simplified78.5%
Taylor expanded in y around 0 87.1%
Taylor expanded in x around 0 74.6%
if 5.20000000000000015e-148 < y < 1.72e-18Initial program 79.9%
times-frac99.3%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in x around 0 45.5%
if 1.72e-18 < y < 6.6000000000000003e35Initial program 85.5%
associate-/r*91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
associate-/r*85.5%
associate-*l/90.5%
*-commutative90.5%
*-commutative90.5%
distribute-rgt1-in81.4%
fma-def90.6%
+-commutative90.6%
+-commutative90.6%
cube-unmult90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in x around inf 74.4%
unpow274.4%
Simplified74.4%
if 6.6000000000000003e35 < y Initial program 61.4%
associate-/r*68.1%
+-commutative68.1%
+-commutative68.1%
+-commutative68.1%
associate-/r*61.4%
associate-*l/76.3%
*-commutative76.3%
*-commutative76.3%
distribute-rgt1-in74.1%
fma-def76.3%
+-commutative76.3%
+-commutative76.3%
cube-unmult76.3%
+-commutative76.3%
Simplified76.3%
Taylor expanded in y around inf 81.8%
unpow281.8%
Simplified81.8%
associate-/r*86.6%
div-inv86.6%
Applied egg-rr86.6%
associate-*r/86.6%
*-rgt-identity86.6%
Simplified86.6%
Final simplification58.0%
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(* (/ 1.0 x) (/ y x))
(if (<= x -8.2e-154)
(- (/ y x) y)
(if (<= x 2.2e-127) (/ x y) (* (/ x y) (/ 1.0 y))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -8.2e-154) {
tmp = (y / x) - y;
} else if (x <= 2.2e-127) {
tmp = x / y;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-8.2d-154)) then
tmp = (y / x) - y
else if (x <= 2.2d-127) then
tmp = x / y
else
tmp = (x / y) * (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -8.2e-154) {
tmp = (y / x) - y;
} else if (x <= 2.2e-127) {
tmp = x / y;
} else {
tmp = (x / y) * (1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (1.0 / x) * (y / x) elif x <= -8.2e-154: tmp = (y / x) - y elif x <= 2.2e-127: tmp = x / y else: tmp = (x / y) * (1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -8.2e-154) tmp = Float64(Float64(y / x) - y); elseif (x <= 2.2e-127) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) * Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = (1.0 / x) * (y / x); elseif (x <= -8.2e-154) tmp = (y / x) - y; elseif (x <= 2.2e-127) tmp = x / y; else tmp = (x / y) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.2e-154], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 2.2e-127], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{-154}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-127}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -1Initial program 66.3%
times-frac89.6%
associate-+l+89.6%
Simplified89.6%
Taylor expanded in x around inf 78.9%
Taylor expanded in x around inf 76.4%
if -1 < x < -8.2e-154Initial program 98.5%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 36.1%
Taylor expanded in x around 0 32.1%
neg-mul-132.1%
unsub-neg32.1%
Simplified32.1%
if -8.2e-154 < x < 2.2000000000000001e-127Initial program 61.1%
times-frac80.5%
associate-+l+80.5%
Simplified80.5%
Taylor expanded in y around 0 76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in x around 0 77.2%
if 2.2000000000000001e-127 < x Initial program 70.1%
associate-/r*77.5%
+-commutative77.5%
+-commutative77.5%
+-commutative77.5%
associate-/r*70.1%
associate-*l/83.2%
*-commutative83.2%
*-commutative83.2%
distribute-rgt1-in75.4%
fma-def83.2%
+-commutative83.2%
+-commutative83.2%
cube-unmult83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in y around inf 32.4%
unpow232.4%
Simplified32.4%
associate-/r*35.2%
div-inv35.2%
Applied egg-rr35.2%
Final simplification58.7%
(FPCore (x y) :precision binary64 (if (<= x -2.7e+154) (* (/ 1.0 x) (/ y x)) (if (<= x -1.42e-112) (/ y (+ x (* x (+ y x)))) (/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -2.7e+154) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -1.42e-112) {
tmp = y / (x + (x * (y + x)));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.7d+154)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-1.42d-112)) then
tmp = y / (x + (x * (y + x)))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.7e+154) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -1.42e-112) {
tmp = y / (x + (x * (y + x)));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.7e+154: tmp = (1.0 / x) * (y / x) elif x <= -1.42e-112: tmp = y / (x + (x * (y + x))) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.7e+154) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -1.42e-112) tmp = Float64(y / Float64(x + Float64(x * Float64(y + x)))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.7e+154) tmp = (1.0 / x) * (y / x); elseif (x <= -1.42e-112) tmp = y / (x + (x * (y + x))); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.7e+154], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.42e-112], N[(y / N[(x + N[(x * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.42 \cdot 10^{-112}:\\
\;\;\;\;\frac{y}{x + x \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.70000000000000006e154Initial program 61.3%
times-frac81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around inf 81.1%
Taylor expanded in x around inf 88.0%
if -2.70000000000000006e154 < x < -1.42e-112Initial program 79.1%
times-frac97.7%
associate-+l+97.7%
Simplified97.7%
Taylor expanded in x around inf 61.7%
frac-times69.0%
*-un-lft-identity69.0%
associate-+r+69.0%
distribute-rgt-in68.9%
+-commutative68.9%
*-un-lft-identity68.9%
Applied egg-rr68.9%
if -1.42e-112 < x Initial program 66.9%
associate-/r*70.8%
+-commutative70.8%
+-commutative70.8%
+-commutative70.8%
associate-/l/66.9%
times-frac86.9%
*-commutative86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
associate-+l+86.9%
Simplified86.9%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 58.7%
associate-/r*60.1%
+-commutative60.1%
Simplified60.1%
Final simplification65.4%
(FPCore (x y)
:precision binary64
(if (<= x -1.32e+154)
(* (/ 1.0 x) (/ y x))
(if (<= x -4.8e-110)
(/ y (+ x (* x (+ y x))))
(/ (/ x (+ y x)) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.32e+154) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -4.8e-110) {
tmp = y / (x + (x * (y + x)));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.32d+154)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-4.8d-110)) then
tmp = y / (x + (x * (y + x)))
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.32e+154) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -4.8e-110) {
tmp = y / (x + (x * (y + x)));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.32e+154: tmp = (1.0 / x) * (y / x) elif x <= -4.8e-110: tmp = y / (x + (x * (y + x))) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.32e+154) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -4.8e-110) tmp = Float64(y / Float64(x + Float64(x * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.32e+154) tmp = (1.0 / x) * (y / x); elseif (x <= -4.8e-110) tmp = y / (x + (x * (y + x))); else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.32e+154], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e-110], N[(y / N[(x + N[(x * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-110}:\\
\;\;\;\;\frac{y}{x + x \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -1.31999999999999998e154Initial program 61.3%
times-frac81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around inf 81.1%
Taylor expanded in x around inf 88.0%
if -1.31999999999999998e154 < x < -4.80000000000000013e-110Initial program 79.1%
times-frac97.7%
associate-+l+97.7%
Simplified97.7%
Taylor expanded in x around inf 61.7%
frac-times69.0%
*-un-lft-identity69.0%
associate-+r+69.0%
distribute-rgt-in68.9%
+-commutative68.9%
*-un-lft-identity68.9%
Applied egg-rr68.9%
if -4.80000000000000013e-110 < x Initial program 66.9%
associate-/r*70.8%
+-commutative70.8%
+-commutative70.8%
+-commutative70.8%
associate-/r*66.9%
associate-*l/82.2%
*-commutative82.2%
*-commutative82.2%
distribute-rgt1-in75.3%
fma-def82.2%
+-commutative82.2%
+-commutative82.2%
cube-unmult82.2%
+-commutative82.2%
Simplified82.2%
associate-*r/66.9%
fma-udef62.3%
cube-mult62.3%
distribute-rgt1-in66.9%
associate-+r+66.9%
*-commutative66.9%
*-commutative66.9%
frac-times86.9%
associate-/r*99.7%
clear-num99.6%
frac-times99.3%
*-un-lft-identity99.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 60.3%
+-commutative60.3%
Simplified60.3%
Final simplification65.5%
(FPCore (x y) :precision binary64 (if (<= x -4.8e-110) (* (/ 1.0 x) (/ y (+ x (+ y 1.0)))) (/ (/ x (+ y x)) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -4.8e-110) {
tmp = (1.0 / x) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.8d-110)) then
tmp = (1.0d0 / x) * (y / (x + (y + 1.0d0)))
else
tmp = (x / (y + x)) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.8e-110) {
tmp = (1.0 / x) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (y + x)) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.8e-110: tmp = (1.0 / x) * (y / (x + (y + 1.0))) else: tmp = (x / (y + x)) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.8e-110) tmp = Float64(Float64(1.0 / x) * Float64(y / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.8e-110) tmp = (1.0 / x) * (y / (x + (y + 1.0))); else tmp = (x / (y + x)) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.8e-110], N[(N[(1.0 / x), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-110}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -4.80000000000000013e-110Initial program 72.3%
times-frac91.4%
associate-+l+91.4%
Simplified91.4%
Taylor expanded in x around inf 71.8%
if -4.80000000000000013e-110 < x Initial program 66.9%
associate-/r*70.8%
+-commutative70.8%
+-commutative70.8%
+-commutative70.8%
associate-/r*66.9%
associate-*l/82.2%
*-commutative82.2%
*-commutative82.2%
distribute-rgt1-in75.3%
fma-def82.2%
+-commutative82.2%
+-commutative82.2%
cube-unmult82.2%
+-commutative82.2%
Simplified82.2%
associate-*r/66.9%
fma-udef62.3%
cube-mult62.3%
distribute-rgt1-in66.9%
associate-+r+66.9%
*-commutative66.9%
*-commutative66.9%
frac-times86.9%
associate-/r*99.7%
clear-num99.6%
frac-times99.3%
*-un-lft-identity99.3%
Applied egg-rr99.3%
Taylor expanded in x around 0 60.3%
+-commutative60.3%
Simplified60.3%
Final simplification64.1%
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -9.5e-154)
(- (/ y x) y)
(if (<= x 1.75e-127) (/ x y) (/ x (* y y))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -9.5e-154) {
tmp = (y / x) - y;
} else if (x <= 1.75e-127) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-9.5d-154)) then
tmp = (y / x) - y
else if (x <= 1.75d-127) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -9.5e-154) {
tmp = (y / x) - y;
} else if (x <= 1.75e-127) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -9.5e-154: tmp = (y / x) - y elif x <= 1.75e-127: tmp = x / y else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -9.5e-154) tmp = Float64(Float64(y / x) - y); elseif (x <= 1.75e-127) tmp = Float64(x / y); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = y / (x * x); elseif (x <= -9.5e-154) tmp = (y / x) - y; elseif (x <= 1.75e-127) tmp = x / y; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.5e-154], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.75e-127], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-154}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-127}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if x < -1Initial program 66.3%
associate-/r*74.7%
+-commutative74.7%
+-commutative74.7%
+-commutative74.7%
associate-/r*66.3%
associate-*l/81.4%
*-commutative81.4%
*-commutative81.4%
distribute-rgt1-in45.4%
fma-def81.4%
+-commutative81.4%
+-commutative81.4%
cube-unmult81.5%
+-commutative81.5%
Simplified81.5%
Taylor expanded in x around inf 73.2%
unpow273.2%
Simplified73.2%
if -1 < x < -9.50000000000000057e-154Initial program 98.5%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 36.1%
Taylor expanded in x around 0 32.1%
neg-mul-132.1%
unsub-neg32.1%
Simplified32.1%
if -9.50000000000000057e-154 < x < 1.74999999999999995e-127Initial program 61.1%
times-frac80.5%
associate-+l+80.5%
Simplified80.5%
Taylor expanded in y around 0 76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in x around 0 77.2%
if 1.74999999999999995e-127 < x Initial program 70.1%
associate-/r*77.5%
+-commutative77.5%
+-commutative77.5%
+-commutative77.5%
associate-/r*70.1%
associate-*l/83.2%
*-commutative83.2%
*-commutative83.2%
distribute-rgt1-in75.4%
fma-def83.2%
+-commutative83.2%
+-commutative83.2%
cube-unmult83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in y around inf 32.4%
unpow232.4%
Simplified32.4%
Final simplification56.8%
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(* (/ 1.0 x) (/ y x))
(if (<= x -9.5e-154)
(- (/ y x) y)
(if (<= x 5.5e-127) (/ x y) (/ (/ x y) y)))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -9.5e-154) {
tmp = (y / x) - y;
} else if (x <= 5.5e-127) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-9.5d-154)) then
tmp = (y / x) - y
else if (x <= 5.5d-127) then
tmp = x / y
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -9.5e-154) {
tmp = (y / x) - y;
} else if (x <= 5.5e-127) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (1.0 / x) * (y / x) elif x <= -9.5e-154: tmp = (y / x) - y elif x <= 5.5e-127: tmp = x / y else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -9.5e-154) tmp = Float64(Float64(y / x) - y); elseif (x <= 5.5e-127) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = (1.0 / x) * (y / x); elseif (x <= -9.5e-154) tmp = (y / x) - y; elseif (x <= 5.5e-127) tmp = x / y; else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.5e-154], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 5.5e-127], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-154}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-127}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1Initial program 66.3%
times-frac89.6%
associate-+l+89.6%
Simplified89.6%
Taylor expanded in x around inf 78.9%
Taylor expanded in x around inf 76.4%
if -1 < x < -9.50000000000000057e-154Initial program 98.5%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 36.1%
Taylor expanded in x around 0 32.1%
neg-mul-132.1%
unsub-neg32.1%
Simplified32.1%
if -9.50000000000000057e-154 < x < 5.50000000000000036e-127Initial program 61.1%
times-frac80.5%
associate-+l+80.5%
Simplified80.5%
Taylor expanded in y around 0 76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in x around 0 77.2%
if 5.50000000000000036e-127 < x Initial program 70.1%
associate-/r*77.5%
+-commutative77.5%
+-commutative77.5%
+-commutative77.5%
associate-/r*70.1%
associate-*l/83.2%
*-commutative83.2%
*-commutative83.2%
distribute-rgt1-in75.4%
fma-def83.2%
+-commutative83.2%
+-commutative83.2%
cube-unmult83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in y around inf 32.4%
unpow232.4%
Simplified32.4%
associate-/r*35.2%
div-inv35.2%
Applied egg-rr35.2%
associate-*r/35.2%
*-rgt-identity35.2%
Simplified35.2%
Final simplification58.7%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (* (/ 1.0 x) (/ y x)) (if (<= x -1.6e-112) (- (/ y x) y) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -1.6e-112) {
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 = (1.0d0 / x) * (y / x)
else if (x <= (-1.6d-112)) 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 = (1.0 / x) * (y / x);
} else if (x <= -1.6e-112) {
tmp = (y / x) - y;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (1.0 / x) * (y / x) elif x <= -1.6e-112: 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(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -1.6e-112) 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 = (1.0 / x) * (y / x); elseif (x <= -1.6e-112) 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[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.6e-112], 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{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-112}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 66.3%
times-frac89.6%
associate-+l+89.6%
Simplified89.6%
Taylor expanded in x around inf 78.9%
Taylor expanded in x around inf 76.4%
if -1 < x < -1.59999999999999997e-112Initial program 99.8%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 38.4%
Taylor expanded in x around 0 32.7%
neg-mul-132.7%
unsub-neg32.7%
Simplified32.7%
if -1.59999999999999997e-112 < x Initial program 66.9%
times-frac86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in x around 0 58.7%
+-commutative58.7%
Simplified58.7%
Final simplification61.9%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (* (/ 1.0 x) (/ y x)) (if (<= x -1.14e-110) (- (/ y x) y) (/ x (+ y (* y y))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -1.14e-110) {
tmp = (y / x) - y;
} else {
tmp = x / (y + (y * y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-1.14d-110)) then
tmp = (y / x) - y
else
tmp = x / (y + (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -1.14e-110) {
tmp = (y / x) - y;
} else {
tmp = x / (y + (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (1.0 / x) * (y / x) elif x <= -1.14e-110: tmp = (y / x) - y else: tmp = x / (y + (y * y)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -1.14e-110) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / Float64(y + Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = (1.0 / x) * (y / x); elseif (x <= -1.14e-110) tmp = (y / x) - y; else tmp = x / (y + (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.14e-110], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.14 \cdot 10^{-110}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\end{array}
\end{array}
if x < -1Initial program 66.3%
times-frac89.6%
associate-+l+89.6%
Simplified89.6%
Taylor expanded in x around inf 78.9%
Taylor expanded in x around inf 76.4%
if -1 < x < -1.14e-110Initial program 99.8%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 38.4%
Taylor expanded in x around 0 32.7%
neg-mul-132.7%
unsub-neg32.7%
Simplified32.7%
if -1.14e-110 < x Initial program 66.9%
associate-/r*70.8%
+-commutative70.8%
+-commutative70.8%
+-commutative70.8%
associate-/l/66.9%
times-frac86.9%
*-commutative86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
associate-+l+86.9%
Simplified86.9%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 58.7%
distribute-rgt-in58.7%
*-lft-identity58.7%
Simplified58.7%
Final simplification61.9%
(FPCore (x y) :precision binary64 (if (<= x -1.08e+15) (* (/ 1.0 x) (/ y x)) (if (<= x -4.1e-110) (/ y (* x (+ x 1.0))) (/ x (+ y (* y y))))))
double code(double x, double y) {
double tmp;
if (x <= -1.08e+15) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -4.1e-110) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y + (y * y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.08d+15)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-4.1d-110)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y + (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.08e+15) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -4.1e-110) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y + (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.08e+15: tmp = (1.0 / x) * (y / x) elif x <= -4.1e-110: tmp = y / (x * (x + 1.0)) else: tmp = x / (y + (y * y)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.08e+15) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -4.1e-110) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y + Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.08e+15) tmp = (1.0 / x) * (y / x); elseif (x <= -4.1e-110) tmp = y / (x * (x + 1.0)); else tmp = x / (y + (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.08e+15], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.1e-110], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.08 \cdot 10^{+15}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-110}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\end{array}
\end{array}
if x < -1.08e15Initial program 65.7%
times-frac89.0%
associate-+l+89.0%
Simplified89.0%
Taylor expanded in x around inf 81.2%
Taylor expanded in x around inf 78.5%
if -1.08e15 < x < -4.09999999999999983e-110Initial program 94.8%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 46.2%
if -4.09999999999999983e-110 < x Initial program 66.9%
associate-/r*70.8%
+-commutative70.8%
+-commutative70.8%
+-commutative70.8%
associate-/l/66.9%
times-frac86.9%
*-commutative86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
associate-+l+86.9%
Simplified86.9%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 58.7%
distribute-rgt-in58.7%
*-lft-identity58.7%
Simplified58.7%
Final simplification62.8%
(FPCore (x y) :precision binary64 (if (<= x -1.08e+15) (* (/ 1.0 x) (/ y x)) (if (<= x -4.8e-110) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.08e+15) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -4.8e-110) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.08d+15)) then
tmp = (1.0d0 / x) * (y / x)
else if (x <= (-4.8d-110)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.08e+15) {
tmp = (1.0 / x) * (y / x);
} else if (x <= -4.8e-110) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.08e+15: tmp = (1.0 / x) * (y / x) elif x <= -4.8e-110: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.08e+15) tmp = Float64(Float64(1.0 / x) * Float64(y / x)); elseif (x <= -4.8e-110) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.08e+15) tmp = (1.0 / x) * (y / x); elseif (x <= -4.8e-110) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.08e+15], N[(N[(1.0 / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e-110], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.08 \cdot 10^{+15}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-110}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.08e15Initial program 65.7%
times-frac89.0%
associate-+l+89.0%
Simplified89.0%
Taylor expanded in x around inf 81.2%
Taylor expanded in x around inf 78.5%
if -1.08e15 < x < -4.80000000000000013e-110Initial program 94.8%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 46.2%
if -4.80000000000000013e-110 < x Initial program 66.9%
associate-/r*70.8%
+-commutative70.8%
+-commutative70.8%
+-commutative70.8%
associate-/l/66.9%
times-frac86.9%
*-commutative86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
associate-+l+86.9%
Simplified86.9%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 58.7%
associate-/r*60.1%
+-commutative60.1%
Simplified60.1%
Final simplification63.7%
(FPCore (x y) :precision binary64 (if (<= y 2.4e-150) (/ y x) (if (<= y 1.0) (/ x y) (/ x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 2.4e-150) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.4d-150) then
tmp = y / x
else if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.4e-150) {
tmp = y / x;
} else if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.4e-150: tmp = y / x elif y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.4e-150) tmp = Float64(y / x); elseif (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.4e-150) tmp = y / x; elseif (y <= 1.0) tmp = x / y; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.4e-150], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{-150}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 2.4e-150Initial program 67.7%
times-frac86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in y around 0 59.2%
Taylor expanded in x around 0 36.1%
if 2.4e-150 < y < 1Initial program 82.3%
times-frac97.9%
associate-+l+97.9%
Simplified97.9%
Taylor expanded in y around 0 95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in x around 0 40.6%
if 1 < y Initial program 64.7%
associate-/r*71.8%
+-commutative71.8%
+-commutative71.8%
+-commutative71.8%
associate-/r*64.7%
associate-*l/78.5%
*-commutative78.5%
*-commutative78.5%
distribute-rgt1-in75.2%
fma-def78.5%
+-commutative78.5%
+-commutative78.5%
cube-unmult78.4%
+-commutative78.4%
Simplified78.4%
Taylor expanded in y around inf 71.1%
unpow271.1%
Simplified71.1%
Final simplification45.8%
(FPCore (x y) :precision binary64 (if (<= x -4.8e-110) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -4.8e-110) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.8d-110)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.8e-110) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.8e-110: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.8e-110) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.8e-110) tmp = (y / x) / (x + 1.0); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.8e-110], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-110}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -4.80000000000000013e-110Initial program 72.3%
associate-/r*79.1%
+-commutative79.1%
+-commutative79.1%
+-commutative79.1%
associate-/l/72.3%
times-frac91.4%
*-commutative91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
associate-+l+91.4%
Simplified91.4%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in y around 0 68.5%
+-commutative68.5%
*-commutative68.5%
associate-/r*71.2%
+-commutative71.2%
Simplified71.2%
if -4.80000000000000013e-110 < x Initial program 66.9%
associate-/r*70.8%
+-commutative70.8%
+-commutative70.8%
+-commutative70.8%
associate-/l/66.9%
times-frac86.9%
*-commutative86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
associate-+l+86.9%
Simplified86.9%
associate-/r*99.7%
div-inv99.6%
Applied egg-rr99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around 0 58.7%
associate-/r*60.1%
+-commutative60.1%
Simplified60.1%
Final simplification63.7%
(FPCore (x y) :precision binary64 (if (<= y 5.4e-149) (/ y x) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 5.4e-149) {
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 <= 5.4d-149) 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 <= 5.4e-149) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.4e-149: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 5.4e-149) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5.4e-149) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.4e-149], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.4 \cdot 10^{-149}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 5.40000000000000028e-149Initial program 67.7%
times-frac86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in y around 0 59.2%
Taylor expanded in x around 0 36.1%
if 5.40000000000000028e-149 < y Initial program 70.3%
times-frac91.0%
associate-+l+91.0%
Simplified91.0%
Taylor expanded in y around 0 80.6%
+-commutative80.6%
Simplified80.6%
Taylor expanded in x around 0 34.5%
Final simplification35.5%
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
return 1.0 / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
public static double code(double x, double y) {
return 1.0 / x;
}
def code(x, y): return 1.0 / x
function code(x, y) return Float64(1.0 / x) end
function tmp = code(x, y) tmp = 1.0 / x; end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x}
\end{array}
Initial program 68.7%
times-frac88.4%
associate-+l+88.4%
Simplified88.4%
Taylor expanded in x around inf 50.6%
Taylor expanded in y around inf 4.2%
Final simplification4.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.7%
times-frac88.4%
associate-+l+88.4%
Simplified88.4%
Taylor expanded in y around 0 79.3%
+-commutative79.3%
Simplified79.3%
Taylor expanded in x around 0 26.8%
Final simplification26.8%
(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 2023268
(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))))