
(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 15 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 72.6%
*-commutative72.6%
times-frac88.9%
pow288.9%
associate-+r+88.9%
Applied egg-rr88.9%
*-un-lft-identity88.9%
pow288.9%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
associate-*l/99.8%
*-lft-identity99.8%
Simplified99.8%
(FPCore (x y)
:precision binary64
(if (<= y 5e-271)
(* (/ y (+ y x)) (/ 1.0 (+ x 1.0)))
(if (<= y 1.12e-6)
(* x (/ (/ y (* (+ y x) (+ x 1.0))) (+ y x)))
(if (<= y 4.16e+99)
(* x (/ y (* (+ y 1.0) (* (+ y x) (+ y x)))))
(/ (/ x (+ y 1.0)) (+ y x))))))
double code(double x, double y) {
double tmp;
if (y <= 5e-271) {
tmp = (y / (y + x)) * (1.0 / (x + 1.0));
} else if (y <= 1.12e-6) {
tmp = x * ((y / ((y + x) * (x + 1.0))) / (y + x));
} else if (y <= 4.16e+99) {
tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x))));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 5d-271) then
tmp = (y / (y + x)) * (1.0d0 / (x + 1.0d0))
else if (y <= 1.12d-6) then
tmp = x * ((y / ((y + x) * (x + 1.0d0))) / (y + x))
else if (y <= 4.16d+99) then
tmp = x * (y / ((y + 1.0d0) * ((y + x) * (y + x))))
else
tmp = (x / (y + 1.0d0)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 5e-271) {
tmp = (y / (y + x)) * (1.0 / (x + 1.0));
} else if (y <= 1.12e-6) {
tmp = x * ((y / ((y + x) * (x + 1.0))) / (y + x));
} else if (y <= 4.16e+99) {
tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x))));
} else {
tmp = (x / (y + 1.0)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5e-271: tmp = (y / (y + x)) * (1.0 / (x + 1.0)) elif y <= 1.12e-6: tmp = x * ((y / ((y + x) * (x + 1.0))) / (y + x)) elif y <= 4.16e+99: tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x)))) else: tmp = (x / (y + 1.0)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (y <= 5e-271) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(x + 1.0))); elseif (y <= 1.12e-6) tmp = Float64(x * Float64(Float64(y / Float64(Float64(y + x) * Float64(x + 1.0))) / Float64(y + x))); elseif (y <= 4.16e+99) tmp = Float64(x * Float64(y / Float64(Float64(y + 1.0) * Float64(Float64(y + x) * Float64(y + x))))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5e-271) tmp = (y / (y + x)) * (1.0 / (x + 1.0)); elseif (y <= 1.12e-6) tmp = x * ((y / ((y + x) * (x + 1.0))) / (y + x)); elseif (y <= 4.16e+99) tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x)))); else tmp = (x / (y + 1.0)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5e-271], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e-6], N[(x * N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.16e+99], N[(x * N[(y / N[(N[(y + 1.0), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $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 5 \cdot 10^{-271}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \frac{\frac{y}{\left(y + x\right) \cdot \left(x + 1\right)}}{y + x}\\
\mathbf{elif}\;y \leq 4.16 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \frac{y}{\left(y + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if y < 5.0000000000000002e-271Initial program 75.4%
*-commutative75.4%
associate-*l*75.4%
times-frac95.5%
+-commutative95.5%
distribute-lft-in95.5%
*-rgt-identity95.5%
pow295.5%
Applied egg-rr95.5%
clear-num94.4%
inv-pow94.4%
+-commutative94.4%
associate-+l+94.4%
+-commutative94.4%
Applied egg-rr94.4%
unpow-194.4%
associate-+r+94.4%
*-rgt-identity94.4%
unpow294.4%
distribute-lft-in94.4%
+-commutative94.4%
associate-+l+94.4%
Simplified94.4%
Taylor expanded in y around 0 46.2%
if 5.0000000000000002e-271 < y < 1.12000000000000008e-6Initial program 77.6%
associate-/l*79.7%
associate-+l+79.7%
Simplified79.7%
Taylor expanded in y around 0 79.0%
+-commutative79.0%
Simplified79.0%
*-un-lft-identity79.0%
associate-*l*79.0%
times-frac93.6%
+-commutative93.6%
+-commutative93.6%
+-commutative93.6%
Applied egg-rr93.6%
associate-*l/93.7%
*-lft-identity93.7%
*-commutative93.7%
+-commutative93.7%
Simplified93.7%
if 1.12000000000000008e-6 < y < 4.1599999999999999e99Initial program 73.8%
associate-/l*85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in x around 0 76.8%
+-commutative76.8%
Simplified76.8%
if 4.1599999999999999e99 < y Initial program 52.3%
associate-/l*76.4%
associate-+l+76.4%
Simplified76.4%
Taylor expanded in x around 0 76.4%
+-commutative76.4%
Simplified76.4%
*-un-lft-identity76.4%
associate-*l*76.4%
times-frac84.4%
+-commutative84.4%
+-commutative84.4%
Applied egg-rr84.4%
associate-*l/84.4%
*-lft-identity84.4%
associate-/r*85.5%
Simplified85.5%
associate-*r/86.7%
associate-/l/84.4%
Applied egg-rr84.4%
Taylor expanded in x around 0 86.5%
+-commutative86.5%
Simplified86.5%
Final simplification66.5%
(FPCore (x y)
:precision binary64
(if (<= x -1.3e+85)
(* (/ y (+ y x)) (/ 1.0 x))
(if (<= x -5e-11)
(* x (/ y (* (+ x (+ y 1.0)) (* (+ y x) (+ y x)))))
(* (/ y (+ y 1.0)) (/ (/ x (+ y x)) (+ y x))))))
double code(double x, double y) {
double tmp;
if (x <= -1.3e+85) {
tmp = (y / (y + x)) * (1.0 / x);
} else if (x <= -5e-11) {
tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x))));
} else {
tmp = (y / (y + 1.0)) * ((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 (x <= (-1.3d+85)) then
tmp = (y / (y + x)) * (1.0d0 / x)
else if (x <= (-5d-11)) then
tmp = x * (y / ((x + (y + 1.0d0)) * ((y + x) * (y + x))))
else
tmp = (y / (y + 1.0d0)) * ((x / (y + x)) / (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.3e+85) {
tmp = (y / (y + x)) * (1.0 / x);
} else if (x <= -5e-11) {
tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x))));
} else {
tmp = (y / (y + 1.0)) * ((x / (y + x)) / (y + x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.3e+85: tmp = (y / (y + x)) * (1.0 / x) elif x <= -5e-11: tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x)))) else: tmp = (y / (y + 1.0)) * ((x / (y + x)) / (y + x)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.3e+85) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / x)); elseif (x <= -5e-11) tmp = Float64(x * Float64(y / Float64(Float64(x + Float64(y + 1.0)) * Float64(Float64(y + x) * Float64(y + x))))); else tmp = Float64(Float64(y / Float64(y + 1.0)) * Float64(Float64(x / Float64(y + x)) / Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.3e+85) tmp = (y / (y + x)) * (1.0 / x); elseif (x <= -5e-11) tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x)))); else tmp = (y / (y + 1.0)) * ((x / (y + x)) / (y + x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.3e+85], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-11], N[(x * N[(y / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+85}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + \left(y + 1\right)\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y + 1} \cdot \frac{\frac{x}{y + x}}{y + x}\\
\end{array}
\end{array}
if x < -1.30000000000000005e85Initial program 61.0%
*-commutative61.0%
associate-*l*61.0%
times-frac90.3%
+-commutative90.3%
distribute-lft-in90.3%
*-rgt-identity90.3%
pow290.3%
Applied egg-rr90.3%
Taylor expanded in x around inf 84.3%
if -1.30000000000000005e85 < x < -5.00000000000000018e-11Initial program 87.4%
associate-/l*87.6%
associate-+l+87.6%
Simplified87.6%
if -5.00000000000000018e-11 < x Initial program 73.2%
associate-/l*83.1%
associate-+l+83.1%
Simplified83.1%
Taylor expanded in x around 0 79.6%
+-commutative79.6%
Simplified79.6%
associate-*r/66.2%
associate-*l*66.2%
associate-/r*64.2%
*-commutative64.2%
+-commutative64.2%
+-commutative64.2%
Applied egg-rr64.2%
associate-/l*84.2%
*-commutative84.2%
times-frac84.4%
Simplified84.4%
Final simplification84.7%
(FPCore (x y)
:precision binary64
(if (<= x -4e-5)
(* (/ y (+ y x)) (/ 1.0 (+ x 1.0)))
(if (<= x -5.8e-162)
(* x (/ y (* (+ y 1.0) (* (+ y x) (+ y x)))))
(/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -4e-5) {
tmp = (y / (y + x)) * (1.0 / (x + 1.0));
} else if (x <= -5.8e-162) {
tmp = x * (y / ((y + 1.0) * ((y + 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 <= (-4d-5)) then
tmp = (y / (y + x)) * (1.0d0 / (x + 1.0d0))
else if (x <= (-5.8d-162)) then
tmp = x * (y / ((y + 1.0d0) * ((y + 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 <= -4e-5) {
tmp = (y / (y + x)) * (1.0 / (x + 1.0));
} else if (x <= -5.8e-162) {
tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x))));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4e-5: tmp = (y / (y + x)) * (1.0 / (x + 1.0)) elif x <= -5.8e-162: tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x)))) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -4e-5) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(x + 1.0))); elseif (x <= -5.8e-162) tmp = Float64(x * Float64(y / Float64(Float64(y + 1.0) * Float64(Float64(y + 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 <= -4e-5) tmp = (y / (y + x)) * (1.0 / (x + 1.0)); elseif (x <= -5.8e-162) tmp = x * (y / ((y + 1.0) * ((y + x) * (y + x)))); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4e-5], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.8e-162], N[(x * N[(y / N[(N[(y + 1.0), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $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 -4 \cdot 10^{-5}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-162}:\\
\;\;\;\;x \cdot \frac{y}{\left(y + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -4.00000000000000033e-5Initial program 70.4%
*-commutative70.4%
associate-*l*70.4%
times-frac92.3%
+-commutative92.3%
distribute-lft-in92.3%
*-rgt-identity92.3%
pow292.3%
Applied egg-rr92.3%
clear-num92.2%
inv-pow92.2%
+-commutative92.2%
associate-+l+92.2%
+-commutative92.2%
Applied egg-rr92.2%
unpow-192.2%
associate-+r+92.2%
*-rgt-identity92.2%
unpow292.2%
distribute-lft-in92.2%
+-commutative92.2%
associate-+l+92.2%
Simplified92.2%
Taylor expanded in y around 0 77.8%
if -4.00000000000000033e-5 < x < -5.8000000000000002e-162Initial program 82.6%
associate-/l*94.6%
associate-+l+94.6%
Simplified94.6%
Taylor expanded in x around 0 94.6%
+-commutative94.6%
Simplified94.6%
if -5.8000000000000002e-162 < x Initial program 71.4%
associate-/l*80.8%
associate-+l+80.8%
Simplified80.8%
Taylor expanded in x around 0 76.6%
+-commutative76.6%
Simplified76.6%
*-un-lft-identity76.6%
associate-*l*76.7%
times-frac89.1%
+-commutative89.1%
+-commutative89.1%
Applied egg-rr89.1%
associate-*l/89.1%
*-lft-identity89.1%
associate-/r*89.2%
Simplified89.2%
Taylor expanded in x around 0 57.4%
associate-/r*58.8%
Simplified58.8%
Final simplification68.1%
(FPCore (x y)
:precision binary64
(if (<= x -2.65e+67)
(* (/ y (+ y x)) (/ 1.0 x))
(if (<= x -3.5e-161)
(* x (/ y (* (* (+ y x) (+ y x)) (+ x 1.0))))
(/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -2.65e+67) {
tmp = (y / (y + x)) * (1.0 / x);
} else if (x <= -3.5e-161) {
tmp = x * (y / (((y + x) * (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 <= (-2.65d+67)) then
tmp = (y / (y + x)) * (1.0d0 / x)
else if (x <= (-3.5d-161)) then
tmp = x * (y / (((y + x) * (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 <= -2.65e+67) {
tmp = (y / (y + x)) * (1.0 / x);
} else if (x <= -3.5e-161) {
tmp = x * (y / (((y + x) * (y + x)) * (x + 1.0)));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.65e+67: tmp = (y / (y + x)) * (1.0 / x) elif x <= -3.5e-161: tmp = x * (y / (((y + x) * (y + x)) * (x + 1.0))) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.65e+67) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / x)); elseif (x <= -3.5e-161) tmp = Float64(x * Float64(y / Float64(Float64(Float64(y + x) * 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 <= -2.65e+67) tmp = (y / (y + x)) * (1.0 / x); elseif (x <= -3.5e-161) tmp = x * (y / (((y + x) * (y + x)) * (x + 1.0))); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.65e+67], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.5e-161], N[(x * N[(y / N[(N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x + 1.0), $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.65 \cdot 10^{+67}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-161}:\\
\;\;\;\;x \cdot \frac{y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.65e67Initial program 63.9%
*-commutative63.9%
associate-*l*63.9%
times-frac91.6%
+-commutative91.6%
distribute-lft-in91.6%
*-rgt-identity91.6%
pow291.6%
Applied egg-rr91.6%
Taylor expanded in x around inf 80.3%
if -2.65e67 < x < -3.5000000000000002e-161Initial program 84.4%
associate-/l*92.4%
associate-+l+92.4%
Simplified92.4%
Taylor expanded in y around 0 72.2%
+-commutative72.2%
Simplified72.2%
if -3.5000000000000002e-161 < x Initial program 71.4%
associate-/l*80.8%
associate-+l+80.8%
Simplified80.8%
Taylor expanded in x around 0 76.6%
+-commutative76.6%
Simplified76.6%
*-un-lft-identity76.6%
associate-*l*76.7%
times-frac89.1%
+-commutative89.1%
+-commutative89.1%
Applied egg-rr89.1%
associate-*l/89.1%
*-lft-identity89.1%
associate-/r*89.2%
Simplified89.2%
Taylor expanded in x around 0 57.4%
associate-/r*58.8%
Simplified58.8%
Final simplification65.3%
(FPCore (x y) :precision binary64 (if (<= x -0.000165) (* (/ y (+ y x)) (/ 1.0 (+ x 1.0))) (* (/ y (+ y 1.0)) (/ (/ x (+ y x)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -0.000165) {
tmp = (y / (y + x)) * (1.0 / (x + 1.0));
} else {
tmp = (y / (y + 1.0)) * ((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 (x <= (-0.000165d0)) then
tmp = (y / (y + x)) * (1.0d0 / (x + 1.0d0))
else
tmp = (y / (y + 1.0d0)) * ((x / (y + x)) / (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.000165) {
tmp = (y / (y + x)) * (1.0 / (x + 1.0));
} else {
tmp = (y / (y + 1.0)) * ((x / (y + x)) / (y + x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.000165: tmp = (y / (y + x)) * (1.0 / (x + 1.0)) else: tmp = (y / (y + 1.0)) * ((x / (y + x)) / (y + x)) return tmp
function code(x, y) tmp = 0.0 if (x <= -0.000165) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(x + 1.0))); else tmp = Float64(Float64(y / Float64(y + 1.0)) * Float64(Float64(x / Float64(y + x)) / Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.000165) tmp = (y / (y + x)) * (1.0 / (x + 1.0)); else tmp = (y / (y + 1.0)) * ((x / (y + x)) / (y + x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.000165], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.000165:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y + 1} \cdot \frac{\frac{x}{y + x}}{y + x}\\
\end{array}
\end{array}
if x < -1.65e-4Initial program 70.4%
*-commutative70.4%
associate-*l*70.4%
times-frac92.3%
+-commutative92.3%
distribute-lft-in92.3%
*-rgt-identity92.3%
pow292.3%
Applied egg-rr92.3%
clear-num92.2%
inv-pow92.2%
+-commutative92.2%
associate-+l+92.2%
+-commutative92.2%
Applied egg-rr92.2%
unpow-192.2%
associate-+r+92.2%
*-rgt-identity92.2%
unpow292.2%
distribute-lft-in92.2%
+-commutative92.2%
associate-+l+92.2%
Simplified92.2%
Taylor expanded in y around 0 77.8%
if -1.65e-4 < x Initial program 73.3%
associate-/l*83.2%
associate-+l+83.2%
Simplified83.2%
Taylor expanded in x around 0 79.7%
+-commutative79.7%
Simplified79.7%
associate-*r/66.4%
associate-*l*66.4%
associate-/r*64.4%
*-commutative64.4%
+-commutative64.4%
+-commutative64.4%
Applied egg-rr64.4%
associate-/l*84.2%
*-commutative84.2%
times-frac84.5%
Simplified84.5%
Final simplification82.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))))
(if (<= x -0.0027)
(* t_0 (/ 1.0 (+ x 1.0)))
(* x (/ (/ t_0 (+ y 1.0)) (+ y x))))))
double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -0.0027) {
tmp = t_0 * (1.0 / (x + 1.0));
} else {
tmp = x * ((t_0 / (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) :: t_0
real(8) :: tmp
t_0 = y / (y + x)
if (x <= (-0.0027d0)) then
tmp = t_0 * (1.0d0 / (x + 1.0d0))
else
tmp = x * ((t_0 / (y + 1.0d0)) / (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (y + x);
double tmp;
if (x <= -0.0027) {
tmp = t_0 * (1.0 / (x + 1.0));
} else {
tmp = x * ((t_0 / (y + 1.0)) / (y + x));
}
return tmp;
}
def code(x, y): t_0 = y / (y + x) tmp = 0 if x <= -0.0027: tmp = t_0 * (1.0 / (x + 1.0)) else: tmp = x * ((t_0 / (y + 1.0)) / (y + x)) return tmp
function code(x, y) t_0 = Float64(y / Float64(y + x)) tmp = 0.0 if (x <= -0.0027) tmp = Float64(t_0 * Float64(1.0 / Float64(x + 1.0))); else tmp = Float64(x * Float64(Float64(t_0 / Float64(y + 1.0)) / Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (y + x); tmp = 0.0; if (x <= -0.0027) tmp = t_0 * (1.0 / (x + 1.0)); else tmp = x * ((t_0 / (y + 1.0)) / (y + x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0027], N[(t$95$0 * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(t$95$0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;x \leq -0.0027:\\
\;\;\;\;t\_0 \cdot \frac{1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{t\_0}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -0.0027000000000000001Initial program 70.4%
*-commutative70.4%
associate-*l*70.4%
times-frac92.3%
+-commutative92.3%
distribute-lft-in92.3%
*-rgt-identity92.3%
pow292.3%
Applied egg-rr92.3%
clear-num92.2%
inv-pow92.2%
+-commutative92.2%
associate-+l+92.2%
+-commutative92.2%
Applied egg-rr92.2%
unpow-192.2%
associate-+r+92.2%
*-rgt-identity92.2%
unpow292.2%
distribute-lft-in92.2%
+-commutative92.2%
associate-+l+92.2%
Simplified92.2%
Taylor expanded in y around 0 77.8%
if -0.0027000000000000001 < x Initial program 73.3%
associate-/l*83.2%
associate-+l+83.2%
Simplified83.2%
Taylor expanded in x around 0 79.7%
+-commutative79.7%
Simplified79.7%
*-un-lft-identity79.7%
associate-*l*79.7%
times-frac90.9%
+-commutative90.9%
+-commutative90.9%
Applied egg-rr90.9%
associate-*l/90.9%
*-lft-identity90.9%
associate-/r*91.0%
Simplified91.0%
Final simplification87.7%
(FPCore (x y) :precision binary64 (if (<= x -2.05e-182) (* (/ y (+ y x)) (/ 1.0 (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -2.05e-182) {
tmp = (y / (y + x)) * (1.0 / (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 <= (-2.05d-182)) then
tmp = (y / (y + x)) * (1.0d0 / (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 <= -2.05e-182) {
tmp = (y / (y + x)) * (1.0 / (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.05e-182: tmp = (y / (y + x)) * (1.0 / (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.05e-182) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / 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 <= -2.05e-182) tmp = (y / (y + x)) * (1.0 / (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.05e-182], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / 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 -2.05 \cdot 10^{-182}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.0500000000000001e-182Initial program 73.4%
*-commutative73.4%
associate-*l*73.4%
times-frac95.0%
+-commutative95.0%
distribute-lft-in95.0%
*-rgt-identity95.0%
pow295.0%
Applied egg-rr95.0%
clear-num94.0%
inv-pow94.0%
+-commutative94.0%
associate-+l+94.0%
+-commutative94.0%
Applied egg-rr94.0%
unpow-194.0%
associate-+r+94.0%
*-rgt-identity94.0%
unpow294.0%
distribute-lft-in94.0%
+-commutative94.0%
associate-+l+94.0%
Simplified94.0%
Taylor expanded in y around 0 65.3%
if -2.0500000000000001e-182 < x Initial program 72.1%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 77.4%
+-commutative77.4%
Simplified77.4%
*-un-lft-identity77.4%
associate-*l*77.5%
times-frac88.9%
+-commutative88.9%
+-commutative88.9%
Applied egg-rr88.9%
associate-*l/88.9%
*-lft-identity88.9%
associate-/r*89.0%
Simplified89.0%
Taylor expanded in x around 0 57.8%
associate-/r*59.2%
Simplified59.2%
Final simplification61.6%
(FPCore (x y) :precision binary64 (if (<= x -2.05e-182) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -2.05e-182) {
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 <= (-2.05d-182)) 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 <= -2.05e-182) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.05e-182: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.05e-182) 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 <= -2.05e-182) tmp = (y / x) / (x + 1.0); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.05e-182], 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 -2.05 \cdot 10^{-182}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.0500000000000001e-182Initial program 73.4%
Taylor expanded in y around 0 64.0%
associate-/r*64.9%
+-commutative64.9%
Simplified64.9%
if -2.0500000000000001e-182 < x Initial program 72.1%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 77.4%
+-commutative77.4%
Simplified77.4%
*-un-lft-identity77.4%
associate-*l*77.5%
times-frac88.9%
+-commutative88.9%
+-commutative88.9%
Applied egg-rr88.9%
associate-*l/88.9%
*-lft-identity88.9%
associate-/r*89.0%
Simplified89.0%
Taylor expanded in x around 0 57.8%
associate-/r*59.2%
Simplified59.2%
Final simplification61.4%
(FPCore (x y) :precision binary64 (if (<= x -2.05e-182) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -2.05e-182) {
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 <= (-2.05d-182)) 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 <= -2.05e-182) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.05e-182: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.05e-182) 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 <= -2.05e-182) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.05e-182], 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 -2.05 \cdot 10^{-182}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.0500000000000001e-182Initial program 73.4%
Taylor expanded in y around 0 64.0%
if -2.0500000000000001e-182 < x Initial program 72.1%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 77.4%
+-commutative77.4%
Simplified77.4%
*-un-lft-identity77.4%
associate-*l*77.5%
times-frac88.9%
+-commutative88.9%
+-commutative88.9%
Applied egg-rr88.9%
associate-*l/88.9%
*-lft-identity88.9%
associate-/r*89.0%
Simplified89.0%
Taylor expanded in x around 0 57.8%
associate-/r*59.2%
Simplified59.2%
Final simplification61.1%
(FPCore (x y) :precision binary64 (if (<= x -2.05e-182) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -2.05e-182) {
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 <= (-2.05d-182)) 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 <= -2.05e-182) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.05e-182: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.05e-182) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.05e-182) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.05e-182], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{-182}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -2.0500000000000001e-182Initial program 73.4%
Taylor expanded in y around 0 64.0%
if -2.0500000000000001e-182 < x Initial program 72.1%
Taylor expanded in x around 0 57.8%
+-commutative57.8%
Simplified57.8%
Final simplification60.2%
(FPCore (x y) :precision binary64 (if (<= y 2.4e-127) (/ y x) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 2.4e-127) {
tmp = 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 (y <= 2.4d-127) then
tmp = 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 (y <= 2.4e-127) {
tmp = y / x;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.4e-127: tmp = y / x else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.4e-127) tmp = Float64(y / x); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.4e-127) tmp = y / x; else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.4e-127], N[(y / x), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{-127}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 2.39999999999999982e-127Initial program 72.3%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in y around 0 35.1%
if 2.39999999999999982e-127 < y Initial program 73.2%
Taylor expanded in x around 0 54.3%
+-commutative54.3%
Simplified54.3%
(FPCore (x y) :precision binary64 (if (<= y 7.2e-128) (/ y x) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 7.2e-128) {
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 <= 7.2d-128) 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 <= 7.2e-128) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 7.2e-128: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 7.2e-128) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 7.2e-128) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 7.2e-128], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.2 \cdot 10^{-128}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 7.20000000000000049e-128Initial program 72.3%
associate-/l*81.7%
associate-+l+81.7%
Simplified81.7%
Taylor expanded in x around 0 76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in y around 0 35.1%
if 7.20000000000000049e-128 < y Initial program 73.2%
associate-/l*84.8%
associate-+l+84.8%
Simplified84.8%
Taylor expanded in x around 0 54.3%
+-commutative54.3%
Simplified54.3%
Taylor expanded in y around 0 26.3%
(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 72.6%
associate-/l*82.8%
associate-+l+82.8%
Simplified82.8%
Taylor expanded in x around 0 49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in y around 0 24.8%
(FPCore (x y) :precision binary64 (- x))
double code(double x, double y) {
return -x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -x
end function
public static double code(double x, double y) {
return -x;
}
def code(x, y): return -x
function code(x, y) return Float64(-x) end
function tmp = code(x, y) tmp = -x; end
code[x_, y_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 72.6%
associate-/l*82.8%
associate-+l+82.8%
Simplified82.8%
Taylor expanded in x around 0 49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in y around 0 14.3%
mul-1-neg14.3%
distribute-lft-neg-out14.3%
*-commutative14.3%
Simplified14.3%
Taylor expanded in y around inf 3.5%
mul-1-neg3.5%
Simplified3.5%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2024111
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))