
(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 20 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 (+ x (+ y 1.0))) (/ x (+ y x))) (+ y x)))
double code(double x, double y) {
return ((y / (x + (y + 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 / (x + (y + 1.0d0))) * (x / (y + x))) / (y + x)
end function
public static double code(double x, double y) {
return ((y / (x + (y + 1.0))) * (x / (y + x))) / (y + x);
}
def code(x, y): return ((y / (x + (y + 1.0))) * (x / (y + x))) / (y + x)
function code(x, y) return Float64(Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(x / Float64(y + x))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y / (x + (y + 1.0))) * (x / (y + x))) / (y + x); end
code[x_, y_] := N[(N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Initial program 70.6%
associate-*r/83.1%
*-commutative83.1%
distribute-rgt1-in65.4%
fma-def83.1%
cube-unmult83.1%
Simplified83.1%
associate-*r/70.6%
fma-udef57.1%
cube-mult57.1%
distribute-rgt1-in70.6%
associate-+r+70.6%
*-commutative70.6%
frac-times87.6%
*-commutative87.6%
associate-/r*99.8%
associate-*r/99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(if (<= y 1.55e-162)
(/ (/ y x) (+ x 1.0))
(if (<= y 3.55e+152)
(* (/ y (+ x (+ y 1.0))) (/ x (* (+ y x) (+ y x))))
(/ (/ x (+ y x)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (y <= 1.55e-162) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 3.55e+152) {
tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
} else {
tmp = (x / (y + x)) / (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 <= 1.55d-162) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 3.55d+152) then
tmp = (y / (x + (y + 1.0d0))) * (x / ((y + x) * (y + x)))
else
tmp = (x / (y + x)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.55e-162) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 3.55e+152) {
tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
} else {
tmp = (x / (y + x)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.55e-162: tmp = (y / x) / (x + 1.0) elif y <= 3.55e+152: tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x))) else: tmp = (x / (y + x)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.55e-162) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 3.55e+152) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.55e-162) tmp = (y / x) / (x + 1.0); elseif (y <= 3.55e+152) tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x))); else tmp = (x / (y + x)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.55e-162], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.55e+152], 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[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.55 \cdot 10^{-162}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 3.55 \cdot 10^{+152}:\\
\;\;\;\;\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}}{y + x}\\
\end{array}
\end{array}
if y < 1.5499999999999999e-162Initial program 67.0%
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 59.3%
*-un-lft-identity59.3%
times-frac62.6%
+-commutative62.6%
Applied egg-rr62.6%
associate-*l/62.7%
*-lft-identity62.7%
+-commutative62.7%
Simplified62.7%
if 1.5499999999999999e-162 < y < 3.55000000000000008e152Initial program 86.7%
times-frac99.7%
/-rgt-identity99.7%
associate-/l/99.7%
*-lft-identity99.7%
associate-+l+99.7%
Simplified99.7%
if 3.55000000000000008e152 < y Initial program 53.5%
associate-*r/80.9%
*-commutative80.9%
distribute-rgt1-in80.0%
fma-def80.9%
cube-unmult80.9%
Simplified80.9%
associate-*r/53.5%
fma-udef53.5%
cube-mult53.5%
distribute-rgt1-in53.5%
associate-+r+53.5%
*-commutative53.5%
frac-times80.9%
*-commutative80.9%
associate-/r*99.8%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 82.0%
Final simplification75.7%
(FPCore (x y)
:precision binary64
(if (<= y 1.55e-162)
(/ (/ y x) (+ x 1.0))
(if (<= y 8e-8)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x 1.0)))
(/ (/ x (+ y 1.0)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (y <= 1.55e-162) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 8e-8) {
tmp = (x / ((y + x) * (y + x))) * (y / (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 <= 1.55d-162) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 8d-8) then
tmp = (x / ((y + x) * (y + x))) * (y / (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 <= 1.55e-162) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 8e-8) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.55e-162: tmp = (y / x) / (x + 1.0) elif y <= 8e-8: tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.55e-162) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 8e-8) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / 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 <= 1.55e-162) tmp = (y / x) / (x + 1.0); elseif (y <= 8e-8) tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.55e-162], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-8], 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 + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.55 \cdot 10^{-162}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 1.5499999999999999e-162Initial program 67.0%
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 59.3%
*-un-lft-identity59.3%
times-frac62.6%
+-commutative62.6%
Applied egg-rr62.6%
associate-*l/62.7%
*-lft-identity62.7%
+-commutative62.7%
Simplified62.7%
if 1.5499999999999999e-162 < y < 8.0000000000000002e-8Initial program 86.5%
times-frac99.7%
/-rgt-identity99.7%
associate-/l/99.7%
*-lft-identity99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
Simplified99.0%
if 8.0000000000000002e-8 < y Initial program 70.5%
associate-*r/85.4%
*-commutative85.4%
distribute-rgt1-in84.9%
fma-def85.4%
cube-unmult85.4%
Simplified85.4%
associate-*r/70.5%
fma-udef70.5%
cube-mult70.5%
distribute-rgt1-in70.5%
associate-+r+70.5%
*-commutative70.5%
frac-times90.4%
*-commutative90.4%
associate-/r*99.8%
associate-*r/99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 81.8%
+-commutative81.8%
Simplified81.8%
Final simplification72.9%
(FPCore (x y)
:precision binary64
(if (<= x -1.4e+129)
(/ (/ y x) (+ y x))
(if (<= x -9e+17)
(* (/ y x) (/ x (* (+ y x) (+ y x))))
(if (<= x -1.35e-127)
(/ (/ y (+ x (+ y 1.0))) (+ y x))
(/ (/ x (+ y 1.0)) (+ y x))))))
double code(double x, double y) {
double tmp;
if (x <= -1.4e+129) {
tmp = (y / x) / (y + x);
} else if (x <= -9e+17) {
tmp = (y / x) * (x / ((y + x) * (y + x)));
} else if (x <= -1.35e-127) {
tmp = (y / (x + (y + 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 (x <= (-1.4d+129)) then
tmp = (y / x) / (y + x)
else if (x <= (-9d+17)) then
tmp = (y / x) * (x / ((y + x) * (y + x)))
else if (x <= (-1.35d-127)) then
tmp = (y / (x + (y + 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 (x <= -1.4e+129) {
tmp = (y / x) / (y + x);
} else if (x <= -9e+17) {
tmp = (y / x) * (x / ((y + x) * (y + x)));
} else if (x <= -1.35e-127) {
tmp = (y / (x + (y + 1.0))) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.4e+129: tmp = (y / x) / (y + x) elif x <= -9e+17: tmp = (y / x) * (x / ((y + x) * (y + x))) elif x <= -1.35e-127: tmp = (y / (x + (y + 1.0))) / (y + x) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.4e+129) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -9e+17) tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); elseif (x <= -1.35e-127) tmp = Float64(Float64(y / Float64(x + Float64(y + 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 (x <= -1.4e+129) tmp = (y / x) / (y + x); elseif (x <= -9e+17) tmp = (y / x) * (x / ((y + x) * (y + x))); elseif (x <= -1.35e-127) tmp = (y / (x + (y + 1.0))) / (y + x); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.4e+129], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9e+17], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.35e-127], N[(N[(y / N[(x + N[(y + 1.0), $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}\;x \leq -1.4 \cdot 10^{+129}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-127}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -1.39999999999999987e129Initial program 57.8%
associate-*r/77.5%
*-commutative77.5%
distribute-rgt1-in10.7%
fma-def77.5%
cube-unmult77.5%
Simplified77.5%
associate-*r/57.8%
fma-udef7.8%
cube-mult7.8%
distribute-rgt1-in57.8%
associate-+r+57.8%
*-commutative57.8%
frac-times82.2%
*-commutative82.2%
associate-/r*99.9%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 92.9%
if -1.39999999999999987e129 < x < -9e17Initial program 67.1%
times-frac93.8%
/-rgt-identity93.8%
associate-/l/93.8%
*-lft-identity93.8%
associate-+l+93.8%
Simplified93.8%
Taylor expanded in x around inf 79.5%
if -9e17 < x < -1.35e-127Initial program 80.4%
associate-*r/93.4%
*-commutative93.4%
distribute-rgt1-in82.7%
fma-def93.5%
cube-unmult93.5%
Simplified93.5%
associate-*r/80.6%
fma-udef69.7%
cube-mult69.6%
distribute-rgt1-in80.4%
associate-+r+80.4%
*-commutative80.4%
frac-times96.4%
*-commutative96.4%
associate-/r*99.5%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 55.6%
if -1.35e-127 < x Initial program 72.6%
associate-*r/83.2%
*-commutative83.2%
distribute-rgt1-in75.0%
fma-def83.2%
cube-unmult83.3%
Simplified83.3%
associate-*r/72.5%
fma-udef65.6%
cube-mult65.6%
distribute-rgt1-in72.6%
associate-+r+72.6%
*-commutative72.6%
frac-times86.3%
*-commutative86.3%
associate-/r*99.8%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 62.2%
+-commutative62.2%
Simplified62.2%
Final simplification68.0%
(FPCore (x y)
:precision binary64
(if (<= x -1.85e+129)
(/ (/ y x) (+ y x))
(if (<= x -9e+17)
(* (/ y x) (/ x (* (+ y x) (+ y x))))
(if (<= x -1.35e-127)
(/ (/ y (+ x 1.0)) (+ y x))
(/ (/ x (+ y 1.0)) (+ y x))))))
double code(double x, double y) {
double tmp;
if (x <= -1.85e+129) {
tmp = (y / x) / (y + x);
} else if (x <= -9e+17) {
tmp = (y / x) * (x / ((y + x) * (y + x)));
} else if (x <= -1.35e-127) {
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 (x <= (-1.85d+129)) then
tmp = (y / x) / (y + x)
else if (x <= (-9d+17)) then
tmp = (y / x) * (x / ((y + x) * (y + x)))
else if (x <= (-1.35d-127)) 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 (x <= -1.85e+129) {
tmp = (y / x) / (y + x);
} else if (x <= -9e+17) {
tmp = (y / x) * (x / ((y + x) * (y + x)));
} else if (x <= -1.35e-127) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.85e+129: tmp = (y / x) / (y + x) elif x <= -9e+17: tmp = (y / x) * (x / ((y + x) * (y + x))) elif x <= -1.35e-127: 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 (x <= -1.85e+129) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -9e+17) tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(y + x) * Float64(y + x)))); elseif (x <= -1.35e-127) 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 (x <= -1.85e+129) tmp = (y / x) / (y + x); elseif (x <= -9e+17) tmp = (y / x) * (x / ((y + x) * (y + x))); elseif (x <= -1.35e-127) 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[x, -1.85e+129], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9e+17], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.35e-127], 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}\;x \leq -1.85 \cdot 10^{+129}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-127}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -1.84999999999999989e129Initial program 57.8%
associate-*r/77.5%
*-commutative77.5%
distribute-rgt1-in10.7%
fma-def77.5%
cube-unmult77.5%
Simplified77.5%
associate-*r/57.8%
fma-udef7.8%
cube-mult7.8%
distribute-rgt1-in57.8%
associate-+r+57.8%
*-commutative57.8%
frac-times82.2%
*-commutative82.2%
associate-/r*99.9%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 92.9%
if -1.84999999999999989e129 < x < -9e17Initial program 67.1%
times-frac93.8%
/-rgt-identity93.8%
associate-/l/93.8%
*-lft-identity93.8%
associate-+l+93.8%
Simplified93.8%
Taylor expanded in x around inf 79.5%
if -9e17 < x < -1.35e-127Initial program 80.4%
associate-*r/93.4%
*-commutative93.4%
distribute-rgt1-in82.7%
fma-def93.5%
cube-unmult93.5%
Simplified93.5%
associate-*r/80.6%
fma-udef69.7%
cube-mult69.6%
distribute-rgt1-in80.4%
associate-+r+80.4%
*-commutative80.4%
frac-times96.4%
*-commutative96.4%
associate-/r*99.5%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 55.0%
if -1.35e-127 < x Initial program 72.6%
associate-*r/83.2%
*-commutative83.2%
distribute-rgt1-in75.0%
fma-def83.2%
cube-unmult83.3%
Simplified83.3%
associate-*r/72.5%
fma-udef65.6%
cube-mult65.6%
distribute-rgt1-in72.6%
associate-+r+72.6%
*-commutative72.6%
frac-times86.3%
*-commutative86.3%
associate-/r*99.8%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 62.2%
+-commutative62.2%
Simplified62.2%
Final simplification67.9%
(FPCore (x y) :precision binary64 (* (/ x (+ y x)) (/ (/ y (+ x (+ y 1.0))) (+ y x))))
double code(double x, double y) {
return (x / (y + x)) * ((y / (x + (y + 1.0))) / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (y + x)) * ((y / (x + (y + 1.0d0))) / (y + x))
end function
public static double code(double x, double y) {
return (x / (y + x)) * ((y / (x + (y + 1.0))) / (y + x));
}
def code(x, y): return (x / (y + x)) * ((y / (x + (y + 1.0))) / (y + x))
function code(x, y) return Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(x + Float64(y + 1.0))) / Float64(y + x))) end
function tmp = code(x, y) tmp = (x / (y + x)) * ((y / (x + (y + 1.0))) / (y + x)); end
code[x_, y_] := N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y + x} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{y + x}
\end{array}
Initial program 70.6%
times-frac87.6%
associate-+r+87.6%
associate-*l/83.0%
times-frac99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(if (<= y -2.6e-8)
(/ 1.0 (* x (/ x y)))
(if (<= y 1.06e-57)
(/ y (* x (+ x 1.0)))
(if (<= y 16000000.0)
(/ x (* y (+ y 1.0)))
(if (<= y 54000000000.0) (* (/ y x) (/ 1.0 x)) (/ (/ x y) y))))))
double code(double x, double y) {
double tmp;
if (y <= -2.6e-8) {
tmp = 1.0 / (x * (x / y));
} else if (y <= 1.06e-57) {
tmp = y / (x * (x + 1.0));
} else if (y <= 16000000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 54000000000.0) {
tmp = (y / x) * (1.0 / 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 <= (-2.6d-8)) then
tmp = 1.0d0 / (x * (x / y))
else if (y <= 1.06d-57) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 16000000.0d0) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 54000000000.0d0) then
tmp = (y / x) * (1.0d0 / x)
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.6e-8) {
tmp = 1.0 / (x * (x / y));
} else if (y <= 1.06e-57) {
tmp = y / (x * (x + 1.0));
} else if (y <= 16000000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 54000000000.0) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.6e-8: tmp = 1.0 / (x * (x / y)) elif y <= 1.06e-57: tmp = y / (x * (x + 1.0)) elif y <= 16000000.0: tmp = x / (y * (y + 1.0)) elif y <= 54000000000.0: tmp = (y / x) * (1.0 / x) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= -2.6e-8) tmp = Float64(1.0 / Float64(x * Float64(x / y))); elseif (y <= 1.06e-57) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 16000000.0) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 54000000000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.6e-8) tmp = 1.0 / (x * (x / y)); elseif (y <= 1.06e-57) tmp = y / (x * (x + 1.0)); elseif (y <= 16000000.0) tmp = x / (y * (y + 1.0)); elseif (y <= 54000000000.0) tmp = (y / x) * (1.0 / x); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.6e-8], N[(1.0 / N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e-57], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 16000000.0], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 54000000000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{1}{x \cdot \frac{x}{y}}\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{-57}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 16000000:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 54000000000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -2.6000000000000001e-8Initial program 56.8%
associate-*r/75.5%
*-commutative75.5%
distribute-rgt1-in35.8%
fma-def75.5%
cube-unmult75.5%
Simplified75.5%
Taylor expanded in x around inf 26.3%
unpow226.3%
Simplified26.3%
clear-num26.3%
inv-pow26.3%
Applied egg-rr26.3%
unpow-126.3%
*-lft-identity26.3%
times-frac33.7%
/-rgt-identity33.7%
Simplified33.7%
if -2.6000000000000001e-8 < y < 1.0600000000000001e-57Initial program 76.4%
times-frac89.0%
/-rgt-identity89.0%
associate-/l/89.0%
*-lft-identity89.0%
associate-+l+89.0%
Simplified89.0%
Taylor expanded in y around 0 83.6%
if 1.0600000000000001e-57 < y < 1.6e7Initial program 94.7%
times-frac99.3%
/-rgt-identity99.3%
associate-/l/99.3%
*-lft-identity99.3%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in x around 0 56.3%
+-commutative56.3%
Simplified56.3%
if 1.6e7 < y < 5.4e10Initial program 98.4%
times-frac98.4%
/-rgt-identity98.4%
associate-/l/98.4%
*-lft-identity98.4%
associate-+l+98.4%
Simplified98.4%
Taylor expanded in x around inf 98.4%
Taylor expanded in x around inf 100.0%
if 5.4e10 < y Initial program 68.8%
associate-*r/84.6%
*-commutative84.6%
distribute-rgt1-in84.1%
fma-def84.6%
cube-unmult84.6%
Simplified84.6%
Taylor expanded in y around inf 81.5%
unpow281.5%
Simplified81.5%
associate-/r*81.8%
div-inv81.7%
Applied egg-rr81.7%
associate-*r/81.8%
*-rgt-identity81.8%
Simplified81.8%
Final simplification67.9%
(FPCore (x y)
:precision binary64
(if (<= y -2.6e-8)
(/ 1.0 (* x (/ x y)))
(if (<= y 1.1e-59)
(/ y (* x (+ x 1.0)))
(if (<= y 8000000.0)
(/ x (* y (+ y 1.0)))
(if (<= y 1.06e+16) (* (/ y x) (/ 1.0 x)) (/ (/ x y) (+ y x)))))))
double code(double x, double y) {
double tmp;
if (y <= -2.6e-8) {
tmp = 1.0 / (x * (x / y));
} else if (y <= 1.1e-59) {
tmp = y / (x * (x + 1.0));
} else if (y <= 8000000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 1.06e+16) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = (x / y) / (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 <= (-2.6d-8)) then
tmp = 1.0d0 / (x * (x / y))
else if (y <= 1.1d-59) then
tmp = y / (x * (x + 1.0d0))
else if (y <= 8000000.0d0) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 1.06d+16) then
tmp = (y / x) * (1.0d0 / x)
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.6e-8) {
tmp = 1.0 / (x * (x / y));
} else if (y <= 1.1e-59) {
tmp = y / (x * (x + 1.0));
} else if (y <= 8000000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 1.06e+16) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.6e-8: tmp = 1.0 / (x * (x / y)) elif y <= 1.1e-59: tmp = y / (x * (x + 1.0)) elif y <= 8000000.0: tmp = x / (y * (y + 1.0)) elif y <= 1.06e+16: tmp = (y / x) * (1.0 / x) else: tmp = (x / y) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.6e-8) tmp = Float64(1.0 / Float64(x * Float64(x / y))); elseif (y <= 1.1e-59) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (y <= 8000000.0) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 1.06e+16) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.6e-8) tmp = 1.0 / (x * (x / y)); elseif (y <= 1.1e-59) tmp = y / (x * (x + 1.0)); elseif (y <= 8000000.0) tmp = x / (y * (y + 1.0)); elseif (y <= 1.06e+16) tmp = (y / x) * (1.0 / x); else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.6e-8], N[(1.0 / N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-59], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8000000.0], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e+16], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{1}{x \cdot \frac{x}{y}}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-59}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 8000000:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{+16}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < -2.6000000000000001e-8Initial program 56.8%
associate-*r/75.5%
*-commutative75.5%
distribute-rgt1-in35.8%
fma-def75.5%
cube-unmult75.5%
Simplified75.5%
Taylor expanded in x around inf 26.3%
unpow226.3%
Simplified26.3%
clear-num26.3%
inv-pow26.3%
Applied egg-rr26.3%
unpow-126.3%
*-lft-identity26.3%
times-frac33.7%
/-rgt-identity33.7%
Simplified33.7%
if -2.6000000000000001e-8 < y < 1.0999999999999999e-59Initial program 76.4%
times-frac89.0%
/-rgt-identity89.0%
associate-/l/89.0%
*-lft-identity89.0%
associate-+l+89.0%
Simplified89.0%
Taylor expanded in y around 0 83.6%
if 1.0999999999999999e-59 < y < 8e6Initial program 94.7%
times-frac99.3%
/-rgt-identity99.3%
associate-/l/99.3%
*-lft-identity99.3%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in x around 0 56.3%
+-commutative56.3%
Simplified56.3%
if 8e6 < y < 1.06e16Initial program 99.2%
times-frac99.2%
/-rgt-identity99.2%
associate-/l/99.2%
*-lft-identity99.2%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in x around inf 99.2%
Taylor expanded in x around inf 100.0%
if 1.06e16 < y Initial program 68.4%
associate-*r/84.3%
*-commutative84.3%
distribute-rgt1-in83.9%
fma-def84.3%
cube-unmult84.4%
Simplified84.4%
associate-*r/68.4%
fma-udef68.4%
cube-mult68.4%
distribute-rgt1-in68.4%
associate-+r+68.4%
*-commutative68.4%
frac-times89.8%
*-commutative89.8%
associate-/r*99.9%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 83.3%
Final simplification68.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ y x) (/ 1.0 x))))
(if (<= y -3.8e-124)
t_0
(if (<= y 1.26e-105)
(/ y x)
(if (<= y 13500000000000.0) t_0 (/ (/ x y) y))))))
double code(double x, double y) {
double t_0 = (y / x) * (1.0 / x);
double tmp;
if (y <= -3.8e-124) {
tmp = t_0;
} else if (y <= 1.26e-105) {
tmp = y / x;
} else if (y <= 13500000000000.0) {
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) * (1.0d0 / x)
if (y <= (-3.8d-124)) then
tmp = t_0
else if (y <= 1.26d-105) then
tmp = y / x
else if (y <= 13500000000000.0d0) 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) * (1.0 / x);
double tmp;
if (y <= -3.8e-124) {
tmp = t_0;
} else if (y <= 1.26e-105) {
tmp = y / x;
} else if (y <= 13500000000000.0) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): t_0 = (y / x) * (1.0 / x) tmp = 0 if y <= -3.8e-124: tmp = t_0 elif y <= 1.26e-105: tmp = y / x elif y <= 13500000000000.0: tmp = t_0 else: tmp = (x / y) / y return tmp
function code(x, y) t_0 = Float64(Float64(y / x) * Float64(1.0 / x)) tmp = 0.0 if (y <= -3.8e-124) tmp = t_0; elseif (y <= 1.26e-105) tmp = Float64(y / x); elseif (y <= 13500000000000.0) tmp = t_0; else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) t_0 = (y / x) * (1.0 / x); tmp = 0.0; if (y <= -3.8e-124) tmp = t_0; elseif (y <= 1.26e-105) tmp = y / x; elseif (y <= 13500000000000.0) tmp = t_0; else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.8e-124], t$95$0, If[LessEqual[y, 1.26e-105], N[(y / x), $MachinePrecision], If[LessEqual[y, 13500000000000.0], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{-124}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 13500000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -3.80000000000000012e-124 or 1.2600000000000001e-105 < y < 1.35e13Initial program 71.7%
times-frac88.0%
/-rgt-identity88.0%
associate-/l/88.0%
*-lft-identity88.0%
associate-+l+88.0%
Simplified88.0%
Taylor expanded in x around inf 52.1%
Taylor expanded in x around inf 43.3%
if -3.80000000000000012e-124 < y < 1.2600000000000001e-105Initial program 71.0%
times-frac84.7%
/-rgt-identity84.7%
associate-/l/84.7%
*-lft-identity84.7%
associate-+l+84.7%
Simplified84.7%
Taylor expanded in y around 0 89.2%
Taylor expanded in x around 0 77.3%
if 1.35e13 < y Initial program 68.4%
associate-*r/84.3%
*-commutative84.3%
distribute-rgt1-in83.9%
fma-def84.3%
cube-unmult84.4%
Simplified84.4%
Taylor expanded in y around inf 82.7%
unpow282.7%
Simplified82.7%
associate-/r*83.0%
div-inv82.9%
Applied egg-rr82.9%
associate-*r/83.0%
*-rgt-identity83.0%
Simplified83.0%
Final simplification63.3%
(FPCore (x y)
:precision binary64
(if (<= y -1.05e-125)
(/ 1.0 (* x (/ x y)))
(if (<= y 3.3e-105)
(/ y x)
(if (<= y 270000000000.0) (* (/ y x) (/ 1.0 x)) (/ (/ x y) y)))))
double code(double x, double y) {
double tmp;
if (y <= -1.05e-125) {
tmp = 1.0 / (x * (x / y));
} else if (y <= 3.3e-105) {
tmp = y / x;
} else if (y <= 270000000000.0) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.05d-125)) then
tmp = 1.0d0 / (x * (x / y))
else if (y <= 3.3d-105) then
tmp = y / x
else if (y <= 270000000000.0d0) then
tmp = (y / x) * (1.0d0 / x)
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.05e-125) {
tmp = 1.0 / (x * (x / y));
} else if (y <= 3.3e-105) {
tmp = y / x;
} else if (y <= 270000000000.0) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.05e-125: tmp = 1.0 / (x * (x / y)) elif y <= 3.3e-105: tmp = y / x elif y <= 270000000000.0: tmp = (y / x) * (1.0 / x) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= -1.05e-125) tmp = Float64(1.0 / Float64(x * Float64(x / y))); elseif (y <= 3.3e-105) tmp = Float64(y / x); elseif (y <= 270000000000.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.05e-125) tmp = 1.0 / (x * (x / y)); elseif (y <= 3.3e-105) tmp = y / x; elseif (y <= 270000000000.0) tmp = (y / x) * (1.0 / x); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.05e-125], N[(1.0 / N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e-105], N[(y / x), $MachinePrecision], If[LessEqual[y, 270000000000.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-125}:\\
\;\;\;\;\frac{1}{x \cdot \frac{x}{y}}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 270000000000:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -1.05e-125Initial program 64.1%
associate-*r/79.4%
*-commutative79.4%
distribute-rgt1-in44.7%
fma-def79.4%
cube-unmult79.4%
Simplified79.4%
Taylor expanded in x around inf 35.2%
unpow235.2%
Simplified35.2%
clear-num34.4%
inv-pow34.4%
Applied egg-rr34.4%
unpow-134.4%
*-lft-identity34.4%
times-frac40.1%
/-rgt-identity40.1%
Simplified40.1%
if -1.05e-125 < y < 3.2999999999999999e-105Initial program 71.0%
times-frac84.7%
/-rgt-identity84.7%
associate-/l/84.7%
*-lft-identity84.7%
associate-+l+84.7%
Simplified84.7%
Taylor expanded in y around 0 89.2%
Taylor expanded in x around 0 77.3%
if 3.2999999999999999e-105 < y < 2.7e11Initial program 95.4%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in x around inf 49.9%
Taylor expanded in x around inf 49.3%
if 2.7e11 < y Initial program 68.8%
associate-*r/84.6%
*-commutative84.6%
distribute-rgt1-in84.1%
fma-def84.6%
cube-unmult84.6%
Simplified84.6%
Taylor expanded in y around inf 81.5%
unpow281.5%
Simplified81.5%
associate-/r*81.8%
div-inv81.7%
Applied egg-rr81.7%
associate-*r/81.8%
*-rgt-identity81.8%
Simplified81.8%
Final simplification62.7%
(FPCore (x y)
:precision binary64
(if (<= y 1.15e-58)
(/ (/ y x) (+ x 1.0))
(if (<= y 11600000.0)
(/ x (* y (+ y 1.0)))
(if (<= y 8.5e+15) (* (/ y x) (/ 1.0 x)) (/ (/ x y) (+ y x))))))
double code(double x, double y) {
double tmp;
if (y <= 1.15e-58) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 11600000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 8.5e+15) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = (x / y) / (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 <= 1.15d-58) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 11600000.0d0) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 8.5d+15) then
tmp = (y / x) * (1.0d0 / x)
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.15e-58) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 11600000.0) {
tmp = x / (y * (y + 1.0));
} else if (y <= 8.5e+15) {
tmp = (y / x) * (1.0 / x);
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.15e-58: tmp = (y / x) / (x + 1.0) elif y <= 11600000.0: tmp = x / (y * (y + 1.0)) elif y <= 8.5e+15: tmp = (y / x) * (1.0 / x) else: tmp = (x / y) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.15e-58) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 11600000.0) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 8.5e+15) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.15e-58) tmp = (y / x) / (x + 1.0); elseif (y <= 11600000.0) tmp = x / (y * (y + 1.0)); elseif (y <= 8.5e+15) tmp = (y / x) * (1.0 / x); else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.15e-58], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 11600000.0], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+15], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{-58}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 11600000:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < 1.1499999999999999e-58Initial program 68.4%
times-frac85.2%
/-rgt-identity85.2%
associate-/l/85.2%
*-lft-identity85.2%
associate-+l+85.2%
Simplified85.2%
Taylor expanded in y around 0 60.3%
*-un-lft-identity60.3%
times-frac63.2%
+-commutative63.2%
Applied egg-rr63.2%
associate-*l/63.3%
*-lft-identity63.3%
+-commutative63.3%
Simplified63.3%
if 1.1499999999999999e-58 < y < 1.16e7Initial program 94.7%
times-frac99.3%
/-rgt-identity99.3%
associate-/l/99.3%
*-lft-identity99.3%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in x around 0 56.3%
+-commutative56.3%
Simplified56.3%
if 1.16e7 < y < 8.5e15Initial program 99.2%
times-frac99.2%
/-rgt-identity99.2%
associate-/l/99.2%
*-lft-identity99.2%
associate-+l+99.2%
Simplified99.2%
Taylor expanded in x around inf 99.2%
Taylor expanded in x around inf 100.0%
if 8.5e15 < y Initial program 68.4%
associate-*r/84.3%
*-commutative84.3%
distribute-rgt1-in83.9%
fma-def84.3%
cube-unmult84.4%
Simplified84.4%
associate-*r/68.4%
fma-udef68.4%
cube-mult68.4%
distribute-rgt1-in68.4%
associate-+r+68.4%
*-commutative68.4%
frac-times89.8%
*-commutative89.8%
associate-/r*99.9%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 83.3%
Final simplification68.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -4e-124)
t_0
(if (<= y 1.26e-105)
(/ y x)
(if (<= y 2000000000000.0) t_0 (/ x (* y y)))))))
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -4e-124) {
tmp = t_0;
} else if (y <= 1.26e-105) {
tmp = y / x;
} else if (y <= 2000000000000.0) {
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 <= (-4d-124)) then
tmp = t_0
else if (y <= 1.26d-105) then
tmp = y / x
else if (y <= 2000000000000.0d0) 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 <= -4e-124) {
tmp = t_0;
} else if (y <= 1.26e-105) {
tmp = y / x;
} else if (y <= 2000000000000.0) {
tmp = t_0;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -4e-124: tmp = t_0 elif y <= 1.26e-105: tmp = y / x elif y <= 2000000000000.0: 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 <= -4e-124) tmp = t_0; elseif (y <= 1.26e-105) tmp = Float64(y / x); elseif (y <= 2000000000000.0) 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 <= -4e-124) tmp = t_0; elseif (y <= 1.26e-105) tmp = y / x; elseif (y <= 2000000000000.0) 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, -4e-124], t$95$0, If[LessEqual[y, 1.26e-105], N[(y / x), $MachinePrecision], If[LessEqual[y, 2000000000000.0], 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 -4 \cdot 10^{-124}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 2000000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -3.99999999999999973e-124 or 1.2600000000000001e-105 < y < 2e12Initial program 71.4%
associate-*r/82.4%
*-commutative82.4%
distribute-rgt1-in51.4%
fma-def82.4%
cube-unmult82.4%
Simplified82.4%
Taylor expanded in x around inf 38.5%
unpow238.5%
Simplified38.5%
if -3.99999999999999973e-124 < y < 1.2600000000000001e-105Initial program 71.0%
times-frac84.7%
/-rgt-identity84.7%
associate-/l/84.7%
*-lft-identity84.7%
associate-+l+84.7%
Simplified84.7%
Taylor expanded in y around 0 89.2%
Taylor expanded in x around 0 77.3%
if 2e12 < y Initial program 68.8%
associate-*r/84.6%
*-commutative84.6%
distribute-rgt1-in84.1%
fma-def84.6%
cube-unmult84.6%
Simplified84.6%
Taylor expanded in y around inf 81.5%
unpow281.5%
Simplified81.5%
Final simplification60.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -4e-124)
t_0
(if (<= y 6.1e-105) (/ y x) (if (<= y 2.05e+14) t_0 (/ (/ x y) y))))))
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -4e-124) {
tmp = t_0;
} else if (y <= 6.1e-105) {
tmp = y / x;
} else if (y <= 2.05e+14) {
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 <= (-4d-124)) then
tmp = t_0
else if (y <= 6.1d-105) then
tmp = y / x
else if (y <= 2.05d+14) 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 <= -4e-124) {
tmp = t_0;
} else if (y <= 6.1e-105) {
tmp = y / x;
} else if (y <= 2.05e+14) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -4e-124: tmp = t_0 elif y <= 6.1e-105: tmp = y / x elif y <= 2.05e+14: 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 <= -4e-124) tmp = t_0; elseif (y <= 6.1e-105) tmp = Float64(y / x); elseif (y <= 2.05e+14) 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 <= -4e-124) tmp = t_0; elseif (y <= 6.1e-105) tmp = y / x; elseif (y <= 2.05e+14) 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, -4e-124], t$95$0, If[LessEqual[y, 6.1e-105], N[(y / x), $MachinePrecision], If[LessEqual[y, 2.05e+14], 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 -4 \cdot 10^{-124}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+14}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -3.99999999999999973e-124 or 6.09999999999999985e-105 < y < 2.05e14Initial program 71.7%
associate-*r/82.5%
*-commutative82.5%
distribute-rgt1-in51.8%
fma-def82.5%
cube-unmult82.6%
Simplified82.6%
Taylor expanded in x around inf 39.0%
unpow239.0%
Simplified39.0%
if -3.99999999999999973e-124 < y < 6.09999999999999985e-105Initial program 71.0%
times-frac84.7%
/-rgt-identity84.7%
associate-/l/84.7%
*-lft-identity84.7%
associate-+l+84.7%
Simplified84.7%
Taylor expanded in y around 0 89.2%
Taylor expanded in x around 0 77.3%
if 2.05e14 < y Initial program 68.4%
associate-*r/84.3%
*-commutative84.3%
distribute-rgt1-in83.9%
fma-def84.3%
cube-unmult84.4%
Simplified84.4%
Taylor expanded in y around inf 82.7%
unpow282.7%
Simplified82.7%
associate-/r*83.0%
div-inv82.9%
Applied egg-rr82.9%
associate-*r/83.0%
*-rgt-identity83.0%
Simplified83.0%
Final simplification61.3%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (* (/ y x) (/ 1.0 x)) (if (<= x -1.35e-127) (- (/ y x) y) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -1.35e-127) {
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) * (1.0d0 / x)
else if (x <= (-1.35d-127)) 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) * (1.0 / x);
} else if (x <= -1.35e-127) {
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) * (1.0 / x) elif x <= -1.35e-127: 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(y / x) * Float64(1.0 / x)); elseif (x <= -1.35e-127) 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) * (1.0 / x); elseif (x <= -1.35e-127) 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[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.35e-127], 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 \frac{1}{x}\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-127}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 61.9%
times-frac86.0%
/-rgt-identity86.0%
associate-/l/86.0%
*-lft-identity86.0%
associate-+l+86.0%
Simplified86.0%
Taylor expanded in x around inf 78.3%
Taylor expanded in x around inf 72.3%
if -1 < x < -1.35e-127Initial program 81.6%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in y around 0 56.8%
Taylor expanded in x around 0 55.8%
neg-mul-155.8%
unsub-neg55.8%
Simplified55.8%
if -1.35e-127 < x Initial program 72.6%
times-frac86.3%
/-rgt-identity86.3%
associate-/l/86.3%
*-lft-identity86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in x around 0 60.6%
+-commutative60.6%
Simplified60.6%
Final simplification63.3%
(FPCore (x y) :precision binary64 (if (<= x -9.5e-128) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -9.5e-128) {
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 (x <= (-9.5d-128)) 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 (x <= -9.5e-128) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -9.5e-128: tmp = (y / x) / (x + 1.0) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -9.5e-128) 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 (x <= -9.5e-128) tmp = (y / x) / (x + 1.0); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -9.5e-128], 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}\;x \leq -9.5 \cdot 10^{-128}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -9.50000000000000006e-128Initial program 67.3%
times-frac89.7%
/-rgt-identity89.7%
associate-/l/89.7%
*-lft-identity89.7%
associate-+l+89.7%
Simplified89.7%
Taylor expanded in y around 0 64.3%
*-un-lft-identity64.3%
times-frac68.8%
+-commutative68.8%
Applied egg-rr68.8%
associate-*l/68.8%
*-lft-identity68.8%
+-commutative68.8%
Simplified68.8%
if -9.50000000000000006e-128 < x Initial program 72.6%
associate-*r/83.2%
*-commutative83.2%
distribute-rgt1-in75.0%
fma-def83.2%
cube-unmult83.3%
Simplified83.3%
associate-*r/72.5%
fma-udef65.6%
cube-mult65.6%
distribute-rgt1-in72.6%
associate-+r+72.6%
*-commutative72.6%
frac-times86.3%
*-commutative86.3%
associate-/r*99.8%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 62.2%
+-commutative62.2%
Simplified62.2%
Final simplification64.6%
(FPCore (x y) :precision binary64 (if (<= x -1.35e-127) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -1.35e-127) {
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 (x <= (-1.35d-127)) 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 (x <= -1.35e-127) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.35e-127: 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 (x <= -1.35e-127) 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 (x <= -1.35e-127) 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[x, -1.35e-127], 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}\;x \leq -1.35 \cdot 10^{-127}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -1.35e-127Initial program 67.3%
associate-*r/82.8%
*-commutative82.8%
distribute-rgt1-in49.1%
fma-def82.8%
cube-unmult82.8%
Simplified82.8%
associate-*r/67.3%
fma-udef42.8%
cube-mult42.8%
distribute-rgt1-in67.3%
associate-+r+67.2%
*-commutative67.2%
frac-times89.7%
*-commutative89.7%
associate-/r*99.7%
associate-*r/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 69.2%
if -1.35e-127 < x Initial program 72.6%
associate-*r/83.2%
*-commutative83.2%
distribute-rgt1-in75.0%
fma-def83.2%
cube-unmult83.3%
Simplified83.3%
associate-*r/72.5%
fma-udef65.6%
cube-mult65.6%
distribute-rgt1-in72.6%
associate-+r+72.6%
*-commutative72.6%
frac-times86.3%
*-commutative86.3%
associate-/r*99.8%
associate-*r/99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 62.2%
+-commutative62.2%
Simplified62.2%
Final simplification64.8%
(FPCore (x y) :precision binary64 (if (<= y 1.2e-61) (/ y x) (if (<= y 0.76) (- (/ x y) x) (/ x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.2e-61) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.2d-61) then
tmp = y / x
else if (y <= 0.76d0) then
tmp = (x / y) - x
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.2e-61) {
tmp = y / x;
} else if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.2e-61: tmp = y / x elif y <= 0.76: tmp = (x / y) - x else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.2e-61) tmp = Float64(y / x); elseif (y <= 0.76) tmp = Float64(Float64(x / y) - x); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.2e-61) tmp = y / x; elseif (y <= 0.76) tmp = (x / y) - x; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.2e-61], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.76], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 0.76:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1.2e-61Initial program 68.4%
times-frac85.2%
/-rgt-identity85.2%
associate-/l/85.2%
*-lft-identity85.2%
associate-+l+85.2%
Simplified85.2%
Taylor expanded in y around 0 60.3%
Taylor expanded in x around 0 37.5%
if 1.2e-61 < y < 0.76000000000000001Initial program 94.4%
times-frac99.4%
/-rgt-identity99.4%
associate-/l/99.4%
*-lft-identity99.4%
associate-+l+99.3%
Simplified99.3%
Taylor expanded in x around 0 53.8%
+-commutative53.8%
Simplified53.8%
Taylor expanded in y around 0 51.9%
neg-mul-151.9%
unsub-neg51.9%
Simplified51.9%
if 0.76000000000000001 < y Initial program 69.7%
associate-*r/85.0%
*-commutative85.0%
distribute-rgt1-in84.5%
fma-def85.0%
cube-unmult85.0%
Simplified85.0%
Taylor expanded in y around inf 79.6%
unpow279.6%
Simplified79.6%
Final simplification50.2%
(FPCore (x y) :precision binary64 (if (<= x -2.6e-10) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -2.6e-10) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.6d-10)) then
tmp = 1.0d0 / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.6e-10) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.6e-10: tmp = 1.0 / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -2.6e-10) tmp = Float64(1.0 / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.6e-10) tmp = 1.0 / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.6e-10], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-10}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -2.59999999999999981e-10Initial program 63.5%
associate-*r/78.7%
*-commutative78.7%
distribute-rgt1-in38.4%
fma-def78.7%
cube-unmult78.7%
Simplified78.7%
associate-*r/63.5%
fma-udef35.3%
cube-mult35.3%
distribute-rgt1-in63.5%
associate-+r+63.4%
*-commutative63.4%
frac-times86.6%
*-commutative86.6%
associate-/r*99.8%
associate-*r/99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 30.6%
Taylor expanded in x around inf 5.8%
if -2.59999999999999981e-10 < x Initial program 73.4%
times-frac87.9%
/-rgt-identity87.9%
associate-/l/87.9%
*-lft-identity87.9%
associate-+l+87.9%
Simplified87.9%
Taylor expanded in x around 0 59.3%
+-commutative59.3%
Simplified59.3%
Taylor expanded in y around 0 30.7%
Final simplification23.7%
(FPCore (x y) :precision binary64 (if (<= x -1.15e-127) (/ y x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -1.15e-127) {
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 (x <= (-1.15d-127)) 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 (x <= -1.15e-127) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.15e-127: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.15e-127) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.15e-127) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.15e-127], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-127}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1.15000000000000009e-127Initial program 67.3%
times-frac89.7%
/-rgt-identity89.7%
associate-/l/89.7%
*-lft-identity89.7%
associate-+l+89.7%
Simplified89.7%
Taylor expanded in y around 0 64.3%
Taylor expanded in x around 0 36.1%
if -1.15000000000000009e-127 < x Initial program 72.6%
times-frac86.3%
/-rgt-identity86.3%
associate-/l/86.3%
*-lft-identity86.3%
associate-+l+86.3%
Simplified86.3%
Taylor expanded in x around 0 60.6%
+-commutative60.6%
Simplified60.6%
Taylor expanded in y around 0 34.1%
Final simplification34.9%
(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 70.6%
associate-*r/83.1%
*-commutative83.1%
distribute-rgt1-in65.4%
fma-def83.1%
cube-unmult83.1%
Simplified83.1%
associate-*r/70.6%
fma-udef57.1%
cube-mult57.1%
distribute-rgt1-in70.6%
associate-+r+70.6%
*-commutative70.6%
frac-times87.6%
*-commutative87.6%
associate-/r*99.8%
associate-*r/99.9%
Applied egg-rr99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 41.9%
Taylor expanded in x around inf 4.3%
Final simplification4.3%
(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 2023200
(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))))