
(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 23 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}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ (/ (/ y (+ 1.0 (/ y x))) (+ x (+ y 1.0))) (+ y x)))
assert(x < y);
double code(double x, double y) {
return ((y / (1.0 + (y / x))) / (x + (y + 1.0))) / (y + x);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (1.0d0 + (y / x))) / (x + (y + 1.0d0))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
return ((y / (1.0 + (y / x))) / (x + (y + 1.0))) / (y + x);
}
[x, y] = sort([x, y]) def code(x, y): return ((y / (1.0 + (y / x))) / (x + (y + 1.0))) / (y + x)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(Float64(y / Float64(1.0 + Float64(y / x))) / Float64(x + Float64(y + 1.0))) / Float64(y + x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = ((y / (1.0 + (y / x))) / (x + (y + 1.0))) / (y + x);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(N[(y / N[(1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{\frac{y}{1 + \frac{y}{x}}}{x + \left(y + 1\right)}}{y + x}
\end{array}
Initial program 70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
*-commutative70.3%
distribute-rgt1-in58.4%
fma-define70.3%
+-commutative70.3%
+-commutative70.3%
cube-unmult70.3%
+-commutative70.3%
Simplified70.3%
*-commutative70.3%
fma-define58.5%
cube-mult58.4%
distribute-rgt1-in70.3%
*-commutative70.3%
associate-*l*70.3%
times-frac93.6%
associate-+r+93.6%
Applied egg-rr93.6%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around inf 99.7%
associate-*l/99.8%
associate-*r/99.8%
associate-/r*99.7%
*-inverses99.7%
associate-*r/99.7%
*-rgt-identity99.7%
+-commutative99.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ y x))) (t_1 (+ x (+ y 1.0))))
(if (<= y -4.2e-70)
(/ (/ y t_1) (+ y x))
(if (<= y 7e+28)
(* t_0 (/ x (* (+ y x) (+ 1.0 x))))
(if (<= y 2e+155)
(* t_0 (/ x (* y t_1)))
(* (/ x (+ y x)) (/ 1.0 y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = y / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= -4.2e-70) {
tmp = (y / t_1) / (y + x);
} else if (y <= 7e+28) {
tmp = t_0 * (x / ((y + x) * (1.0 + x)));
} else if (y <= 2e+155) {
tmp = t_0 * (x / (y * t_1));
} else {
tmp = (x / (y + x)) * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y / (y + x)
t_1 = x + (y + 1.0d0)
if (y <= (-4.2d-70)) then
tmp = (y / t_1) / (y + x)
else if (y <= 7d+28) then
tmp = t_0 * (x / ((y + x) * (1.0d0 + x)))
else if (y <= 2d+155) then
tmp = t_0 * (x / (y * t_1))
else
tmp = (x / (y + x)) * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = y / (y + x);
double t_1 = x + (y + 1.0);
double tmp;
if (y <= -4.2e-70) {
tmp = (y / t_1) / (y + x);
} else if (y <= 7e+28) {
tmp = t_0 * (x / ((y + x) * (1.0 + x)));
} else if (y <= 2e+155) {
tmp = t_0 * (x / (y * t_1));
} else {
tmp = (x / (y + x)) * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = y / (y + x) t_1 = x + (y + 1.0) tmp = 0 if y <= -4.2e-70: tmp = (y / t_1) / (y + x) elif y <= 7e+28: tmp = t_0 * (x / ((y + x) * (1.0 + x))) elif y <= 2e+155: tmp = t_0 * (x / (y * t_1)) else: tmp = (x / (y + x)) * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(y / Float64(y + x)) t_1 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= -4.2e-70) tmp = Float64(Float64(y / t_1) / Float64(y + x)); elseif (y <= 7e+28) tmp = Float64(t_0 * Float64(x / Float64(Float64(y + x) * Float64(1.0 + x)))); elseif (y <= 2e+155) tmp = Float64(t_0 * Float64(x / Float64(y * t_1))); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = y / (y + x);
t_1 = x + (y + 1.0);
tmp = 0.0;
if (y <= -4.2e-70)
tmp = (y / t_1) / (y + x);
elseif (y <= 7e+28)
tmp = t_0 * (x / ((y + x) * (1.0 + x)));
elseif (y <= 2e+155)
tmp = t_0 * (x / (y * t_1));
else
tmp = (x / (y + x)) * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.2e-70], N[(N[(y / t$95$1), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+28], N[(t$95$0 * N[(x / N[(N[(y + x), $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+155], N[(t$95$0 * N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
t_1 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{-70}:\\
\;\;\;\;\frac{\frac{y}{t\_1}}{y + x}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+28}:\\
\;\;\;\;t\_0 \cdot \frac{x}{\left(y + x\right) \cdot \left(1 + x\right)}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+155}:\\
\;\;\;\;t\_0 \cdot \frac{x}{y \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < -4.2000000000000002e-70Initial program 75.5%
+-commutative75.5%
+-commutative75.5%
+-commutative75.5%
*-commutative75.5%
distribute-rgt1-in51.5%
fma-define75.5%
+-commutative75.5%
+-commutative75.5%
cube-unmult75.6%
+-commutative75.6%
Simplified75.6%
*-commutative75.6%
fma-define51.6%
cube-mult51.5%
distribute-rgt1-in75.5%
*-commutative75.5%
associate-*l*75.5%
times-frac90.1%
associate-+r+90.1%
Applied egg-rr90.1%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around inf 37.9%
associate-*l/37.9%
un-div-inv37.9%
+-commutative37.9%
Applied egg-rr37.9%
if -4.2000000000000002e-70 < y < 6.9999999999999999e28Initial program 71.9%
+-commutative71.9%
+-commutative71.9%
+-commutative71.9%
*-commutative71.9%
distribute-rgt1-in61.6%
fma-define71.9%
+-commutative71.9%
+-commutative71.9%
cube-unmult71.9%
+-commutative71.9%
Simplified71.9%
*-commutative71.9%
fma-define61.6%
cube-mult61.6%
distribute-rgt1-in71.9%
*-commutative71.9%
associate-*l*71.9%
times-frac99.1%
associate-+r+99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 97.6%
if 6.9999999999999999e28 < y < 2.00000000000000001e155Initial program 60.5%
+-commutative60.5%
+-commutative60.5%
+-commutative60.5%
*-commutative60.5%
distribute-rgt1-in60.3%
fma-define60.5%
+-commutative60.5%
+-commutative60.5%
cube-unmult60.6%
+-commutative60.6%
Simplified60.6%
*-commutative60.6%
fma-define60.3%
cube-mult60.3%
distribute-rgt1-in60.5%
*-commutative60.5%
associate-*l*60.5%
times-frac89.3%
associate-+r+89.3%
Applied egg-rr89.3%
Taylor expanded in x around 0 70.9%
if 2.00000000000000001e155 < y Initial program 61.5%
+-commutative61.5%
+-commutative61.5%
+-commutative61.5%
*-commutative61.5%
distribute-rgt1-in61.5%
fma-define61.5%
+-commutative61.5%
+-commutative61.5%
cube-unmult61.5%
+-commutative61.5%
Simplified61.5%
fma-define61.5%
cube-mult61.5%
distribute-rgt1-in61.5%
*-commutative61.5%
associate-*l*61.5%
times-frac86.5%
associate-+r+86.5%
Applied egg-rr86.5%
Taylor expanded in y around inf 92.3%
Final simplification76.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= y -8500.0)
(/ 1.0 (/ (+ y x) (/ y x)))
(if (<= y 2e+155)
(* t_0 (/ y (* (+ y x) (+ x (+ y 1.0)))))
(* t_0 (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (y <= -8500.0) {
tmp = 1.0 / ((y + x) / (y / x));
} else if (y <= 2e+155) {
tmp = t_0 * (y / ((y + x) * (x + (y + 1.0))));
} else {
tmp = t_0 * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y + x)
if (y <= (-8500.0d0)) then
tmp = 1.0d0 / ((y + x) / (y / x))
else if (y <= 2d+155) then
tmp = t_0 * (y / ((y + x) * (x + (y + 1.0d0))))
else
tmp = t_0 * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (y <= -8500.0) {
tmp = 1.0 / ((y + x) / (y / x));
} else if (y <= 2e+155) {
tmp = t_0 * (y / ((y + x) * (x + (y + 1.0))));
} else {
tmp = t_0 * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + x) tmp = 0 if y <= -8500.0: tmp = 1.0 / ((y + x) / (y / x)) elif y <= 2e+155: tmp = t_0 * (y / ((y + x) * (x + (y + 1.0)))) else: tmp = t_0 * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (y <= -8500.0) tmp = Float64(1.0 / Float64(Float64(y + x) / Float64(y / x))); elseif (y <= 2e+155) tmp = Float64(t_0 * Float64(y / Float64(Float64(y + x) * Float64(x + Float64(y + 1.0))))); else tmp = Float64(t_0 * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + x);
tmp = 0.0;
if (y <= -8500.0)
tmp = 1.0 / ((y + x) / (y / x));
elseif (y <= 2e+155)
tmp = t_0 * (y / ((y + x) * (x + (y + 1.0))));
else
tmp = t_0 * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8500.0], N[(1.0 / N[(N[(y + x), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+155], N[(t$95$0 * N[(y / N[(N[(y + x), $MachinePrecision] * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;y \leq -8500:\\
\;\;\;\;\frac{1}{\frac{y + x}{\frac{y}{x}}}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+155}:\\
\;\;\;\;t\_0 \cdot \frac{y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < -8500Initial program 71.2%
+-commutative71.2%
+-commutative71.2%
+-commutative71.2%
*-commutative71.2%
distribute-rgt1-in44.9%
fma-define71.2%
+-commutative71.2%
+-commutative71.2%
cube-unmult71.3%
+-commutative71.3%
Simplified71.3%
*-commutative71.3%
fma-define45.0%
cube-mult44.9%
distribute-rgt1-in71.2%
*-commutative71.2%
associate-*l*71.2%
times-frac87.1%
associate-+r+87.1%
Applied egg-rr87.1%
Taylor expanded in x around inf 23.3%
associate-*l/23.2%
clear-num23.2%
div-inv23.2%
Applied egg-rr23.2%
if -8500 < y < 2.00000000000000001e155Initial program 71.9%
+-commutative71.9%
+-commutative71.9%
+-commutative71.9%
*-commutative71.9%
distribute-rgt1-in62.6%
fma-define71.9%
+-commutative71.9%
+-commutative71.9%
cube-unmult71.9%
+-commutative71.9%
Simplified71.9%
fma-define62.6%
cube-mult62.6%
distribute-rgt1-in71.9%
*-commutative71.9%
associate-*l*71.9%
times-frac97.6%
associate-+r+97.6%
Applied egg-rr97.6%
if 2.00000000000000001e155 < y Initial program 61.5%
+-commutative61.5%
+-commutative61.5%
+-commutative61.5%
*-commutative61.5%
distribute-rgt1-in61.5%
fma-define61.5%
+-commutative61.5%
+-commutative61.5%
cube-unmult61.5%
+-commutative61.5%
Simplified61.5%
fma-define61.5%
cube-mult61.5%
distribute-rgt1-in61.5%
*-commutative61.5%
associate-*l*61.5%
times-frac86.5%
associate-+r+86.5%
Applied egg-rr86.5%
Taylor expanded in y around inf 92.3%
Final simplification80.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))) (t_1 (/ x (+ y x))))
(if (<= y 9e-14)
(/ t_1 (* (/ (+ y x) y) (+ 1.0 x)))
(if (<= y 1.2e+111)
(* x (/ y (* t_0 (* (+ y x) (+ y x)))))
(* (/ t_1 t_0) (/ y y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double t_1 = x / (y + x);
double tmp;
if (y <= 9e-14) {
tmp = t_1 / (((y + x) / y) * (1.0 + x));
} else if (y <= 1.2e+111) {
tmp = x * (y / (t_0 * ((y + x) * (y + x))));
} else {
tmp = (t_1 / t_0) * (y / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x + (y + 1.0d0)
t_1 = x / (y + x)
if (y <= 9d-14) then
tmp = t_1 / (((y + x) / y) * (1.0d0 + x))
else if (y <= 1.2d+111) then
tmp = x * (y / (t_0 * ((y + x) * (y + x))))
else
tmp = (t_1 / t_0) * (y / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double t_1 = x / (y + x);
double tmp;
if (y <= 9e-14) {
tmp = t_1 / (((y + x) / y) * (1.0 + x));
} else if (y <= 1.2e+111) {
tmp = x * (y / (t_0 * ((y + x) * (y + x))));
} else {
tmp = (t_1 / t_0) * (y / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) t_1 = x / (y + x) tmp = 0 if y <= 9e-14: tmp = t_1 / (((y + x) / y) * (1.0 + x)) elif y <= 1.2e+111: tmp = x * (y / (t_0 * ((y + x) * (y + x)))) else: tmp = (t_1 / t_0) * (y / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) t_1 = Float64(x / Float64(y + x)) tmp = 0.0 if (y <= 9e-14) tmp = Float64(t_1 / Float64(Float64(Float64(y + x) / y) * Float64(1.0 + x))); elseif (y <= 1.2e+111) tmp = Float64(x * Float64(y / Float64(t_0 * Float64(Float64(y + x) * Float64(y + x))))); else tmp = Float64(Float64(t_1 / t_0) * Float64(y / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
t_1 = x / (y + x);
tmp = 0.0;
if (y <= 9e-14)
tmp = t_1 / (((y + x) / y) * (1.0 + x));
elseif (y <= 1.2e+111)
tmp = x * (y / (t_0 * ((y + x) * (y + x))));
else
tmp = (t_1 / t_0) * (y / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9e-14], N[(t$95$1 / N[(N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+111], N[(x * N[(y / N[(t$95$0 * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 / t$95$0), $MachinePrecision] * N[(y / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
t_1 := \frac{x}{y + x}\\
\mathbf{if}\;y \leq 9 \cdot 10^{-14}:\\
\;\;\;\;\frac{t\_1}{\frac{y + x}{y} \cdot \left(1 + x\right)}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+111}:\\
\;\;\;\;x \cdot \frac{y}{t\_0 \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{t\_0} \cdot \frac{y}{y}\\
\end{array}
\end{array}
if y < 8.9999999999999995e-14Initial program 73.6%
+-commutative73.6%
+-commutative73.6%
+-commutative73.6%
*-commutative73.6%
distribute-rgt1-in57.1%
fma-define73.5%
+-commutative73.5%
+-commutative73.5%
cube-unmult73.6%
+-commutative73.6%
Simplified73.6%
*-commutative73.6%
fma-define57.2%
cube-mult57.1%
distribute-rgt1-in73.6%
*-commutative73.6%
associate-*l*73.5%
times-frac95.9%
associate-+r+95.9%
Applied egg-rr95.9%
Taylor expanded in y around 0 82.6%
clear-num82.5%
frac-times78.6%
*-un-lft-identity78.6%
Applied egg-rr78.6%
associate-/l/82.6%
associate-/r*82.5%
associate-/r*82.5%
*-commutative82.5%
Simplified82.5%
if 8.9999999999999995e-14 < y < 1.20000000000000003e111Initial program 70.3%
associate-/l*77.8%
associate-+l+77.8%
Simplified77.8%
if 1.20000000000000003e111 < y Initial program 57.2%
+-commutative57.2%
+-commutative57.2%
+-commutative57.2%
*-commutative57.2%
distribute-rgt1-in57.2%
fma-define57.2%
+-commutative57.2%
+-commutative57.2%
cube-unmult57.2%
+-commutative57.2%
Simplified57.2%
*-commutative57.2%
fma-define57.2%
cube-mult57.2%
distribute-rgt1-in57.2%
*-commutative57.2%
associate-*l*57.2%
times-frac87.4%
associate-+r+87.4%
Applied egg-rr87.4%
associate-/r*99.9%
div-inv99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in x around 0 84.2%
Final simplification82.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))))
(if (<= y 5.7e+26)
(/ t_0 (* (/ (+ y x) y) (+ 1.0 x)))
(if (<= y 2e+155)
(* (/ y (+ y x)) (/ x (* y (+ x (+ y 1.0)))))
(* t_0 (/ 1.0 y))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (y <= 5.7e+26) {
tmp = t_0 / (((y + x) / y) * (1.0 + x));
} else if (y <= 2e+155) {
tmp = (y / (y + x)) * (x / (y * (x + (y + 1.0))));
} else {
tmp = t_0 * (1.0 / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y + x)
if (y <= 5.7d+26) then
tmp = t_0 / (((y + x) / y) * (1.0d0 + x))
else if (y <= 2d+155) then
tmp = (y / (y + x)) * (x / (y * (x + (y + 1.0d0))))
else
tmp = t_0 * (1.0d0 / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (y + x);
double tmp;
if (y <= 5.7e+26) {
tmp = t_0 / (((y + x) / y) * (1.0 + x));
} else if (y <= 2e+155) {
tmp = (y / (y + x)) * (x / (y * (x + (y + 1.0))));
} else {
tmp = t_0 * (1.0 / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (y + x) tmp = 0 if y <= 5.7e+26: tmp = t_0 / (((y + x) / y) * (1.0 + x)) elif y <= 2e+155: tmp = (y / (y + x)) * (x / (y * (x + (y + 1.0)))) else: tmp = t_0 * (1.0 / y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(y + x)) tmp = 0.0 if (y <= 5.7e+26) tmp = Float64(t_0 / Float64(Float64(Float64(y + x) / y) * Float64(1.0 + x))); elseif (y <= 2e+155) tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(y * Float64(x + Float64(y + 1.0))))); else tmp = Float64(t_0 * Float64(1.0 / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (y + x);
tmp = 0.0;
if (y <= 5.7e+26)
tmp = t_0 / (((y + x) / y) * (1.0 + x));
elseif (y <= 2e+155)
tmp = (y / (y + x)) * (x / (y * (x + (y + 1.0))));
else
tmp = t_0 * (1.0 / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.7e+26], N[(t$95$0 / N[(N[(N[(y + x), $MachinePrecision] / y), $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+155], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;y \leq 5.7 \cdot 10^{+26}:\\
\;\;\;\;\frac{t\_0}{\frac{y + x}{y} \cdot \left(1 + x\right)}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+155}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{y \cdot \left(x + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{1}{y}\\
\end{array}
\end{array}
if y < 5.7000000000000003e26Initial program 73.3%
+-commutative73.3%
+-commutative73.3%
+-commutative73.3%
*-commutative73.3%
distribute-rgt1-in57.6%
fma-define73.3%
+-commutative73.3%
+-commutative73.3%
cube-unmult73.3%
+-commutative73.3%
Simplified73.3%
*-commutative73.3%
fma-define57.7%
cube-mult57.6%
distribute-rgt1-in73.3%
*-commutative73.3%
associate-*l*73.3%
times-frac95.6%
associate-+r+95.6%
Applied egg-rr95.6%
Taylor expanded in y around 0 82.0%
clear-num82.0%
frac-times77.7%
*-un-lft-identity77.7%
Applied egg-rr77.7%
associate-/l/82.0%
associate-/r*82.4%
associate-/r*82.4%
*-commutative82.4%
Simplified82.4%
if 5.7000000000000003e26 < y < 2.00000000000000001e155Initial program 60.5%
+-commutative60.5%
+-commutative60.5%
+-commutative60.5%
*-commutative60.5%
distribute-rgt1-in60.3%
fma-define60.5%
+-commutative60.5%
+-commutative60.5%
cube-unmult60.6%
+-commutative60.6%
Simplified60.6%
*-commutative60.6%
fma-define60.3%
cube-mult60.3%
distribute-rgt1-in60.5%
*-commutative60.5%
associate-*l*60.5%
times-frac89.3%
associate-+r+89.3%
Applied egg-rr89.3%
Taylor expanded in x around 0 70.9%
if 2.00000000000000001e155 < y Initial program 61.5%
+-commutative61.5%
+-commutative61.5%
+-commutative61.5%
*-commutative61.5%
distribute-rgt1-in61.5%
fma-define61.5%
+-commutative61.5%
+-commutative61.5%
cube-unmult61.5%
+-commutative61.5%
Simplified61.5%
fma-define61.5%
cube-mult61.5%
distribute-rgt1-in61.5%
*-commutative61.5%
associate-*l*61.5%
times-frac86.5%
associate-+r+86.5%
Applied egg-rr86.5%
Taylor expanded in y around inf 92.3%
Final simplification82.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -3.4)
(* (/ y x) (/ 1.0 x))
(if (or (<= x -1.35e-116) (not (<= x 2.6e-101)))
(* (/ 1.0 y) (/ x y))
(/ x y))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = (y / x) * (1.0 / x);
} else if ((x <= -1.35e-116) || !(x <= 2.6e-101)) {
tmp = (1.0 / y) * (x / y);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.4d0)) then
tmp = (y / x) * (1.0d0 / x)
else if ((x <= (-1.35d-116)) .or. (.not. (x <= 2.6d-101))) then
tmp = (1.0d0 / y) * (x / y)
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = (y / x) * (1.0 / x);
} else if ((x <= -1.35e-116) || !(x <= 2.6e-101)) {
tmp = (1.0 / y) * (x / y);
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4: tmp = (y / x) * (1.0 / x) elif (x <= -1.35e-116) or not (x <= 2.6e-101): tmp = (1.0 / y) * (x / y) else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif ((x <= -1.35e-116) || !(x <= 2.6e-101)) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.4)
tmp = (y / x) * (1.0 / x);
elseif ((x <= -1.35e-116) || ~((x <= 2.6e-101)))
tmp = (1.0 / y) * (x / y);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.4], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.35e-116], N[Not[LessEqual[x, 2.6e-101]], $MachinePrecision]], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-116} \lor \neg \left(x \leq 2.6 \cdot 10^{-101}\right):\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -3.39999999999999991Initial program 61.6%
+-commutative61.6%
+-commutative61.6%
+-commutative61.6%
*-commutative61.6%
distribute-rgt1-in33.2%
fma-define61.6%
+-commutative61.6%
+-commutative61.6%
cube-unmult61.6%
+-commutative61.6%
Simplified61.6%
*-commutative61.6%
fma-define33.2%
cube-mult33.2%
distribute-rgt1-in61.6%
*-commutative61.6%
associate-*l*61.6%
times-frac86.3%
associate-+r+86.3%
Applied egg-rr86.3%
Taylor expanded in x around inf 78.0%
Taylor expanded in y around 0 77.7%
if -3.39999999999999991 < x < -1.35e-116 or 2.6000000000000001e-101 < x Initial program 76.3%
associate-/l*85.3%
associate-+l+85.3%
Simplified85.3%
Taylor expanded in x around 0 36.4%
Taylor expanded in y around inf 34.1%
associate-/r*35.2%
div-inv35.1%
Applied egg-rr35.1%
if -1.35e-116 < x < 2.6000000000000001e-101Initial program 68.6%
+-commutative68.6%
+-commutative68.6%
+-commutative68.6%
*-commutative68.6%
distribute-rgt1-in57.7%
fma-define68.6%
+-commutative68.6%
+-commutative68.6%
cube-unmult68.6%
+-commutative68.6%
Simplified68.6%
*-commutative68.6%
fma-define57.7%
cube-mult57.7%
distribute-rgt1-in68.6%
*-commutative68.6%
associate-*l*68.6%
times-frac99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 87.9%
Taylor expanded in x around 0 66.2%
Final simplification55.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -3.4)
(/ y (* x x))
(if (or (<= x -6.2e-116) (not (<= x 1.4e-101)))
(* (/ 1.0 y) (/ x y))
(/ x y))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = y / (x * x);
} else if ((x <= -6.2e-116) || !(x <= 1.4e-101)) {
tmp = (1.0 / y) * (x / y);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.4d0)) then
tmp = y / (x * x)
else if ((x <= (-6.2d-116)) .or. (.not. (x <= 1.4d-101))) then
tmp = (1.0d0 / y) * (x / y)
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = y / (x * x);
} else if ((x <= -6.2e-116) || !(x <= 1.4e-101)) {
tmp = (1.0 / y) * (x / y);
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4: tmp = y / (x * x) elif (x <= -6.2e-116) or not (x <= 1.4e-101): tmp = (1.0 / y) * (x / y) else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4) tmp = Float64(y / Float64(x * x)); elseif ((x <= -6.2e-116) || !(x <= 1.4e-101)) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.4)
tmp = y / (x * x);
elseif ((x <= -6.2e-116) || ~((x <= 1.4e-101)))
tmp = (1.0 / y) * (x / y);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.4], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -6.2e-116], N[Not[LessEqual[x, 1.4e-101]], $MachinePrecision]], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-116} \lor \neg \left(x \leq 1.4 \cdot 10^{-101}\right):\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -3.39999999999999991Initial program 61.6%
+-commutative61.6%
+-commutative61.6%
+-commutative61.6%
*-commutative61.6%
distribute-rgt1-in33.2%
fma-define61.6%
+-commutative61.6%
+-commutative61.6%
cube-unmult61.6%
+-commutative61.6%
Simplified61.6%
*-commutative61.6%
fma-define33.2%
cube-mult33.2%
distribute-rgt1-in61.6%
*-commutative61.6%
associate-*l*61.6%
times-frac86.3%
associate-+r+86.3%
Applied egg-rr86.3%
Taylor expanded in x around inf 78.0%
frac-times81.0%
*-rgt-identity81.0%
Applied egg-rr81.0%
Taylor expanded in x around inf 72.9%
if -3.39999999999999991 < x < -6.20000000000000036e-116 or 1.39999999999999995e-101 < x Initial program 76.3%
associate-/l*85.3%
associate-+l+85.3%
Simplified85.3%
Taylor expanded in x around 0 36.4%
Taylor expanded in y around inf 34.1%
associate-/r*35.2%
div-inv35.1%
Applied egg-rr35.1%
if -6.20000000000000036e-116 < x < 1.39999999999999995e-101Initial program 68.6%
+-commutative68.6%
+-commutative68.6%
+-commutative68.6%
*-commutative68.6%
distribute-rgt1-in57.7%
fma-define68.6%
+-commutative68.6%
+-commutative68.6%
cube-unmult68.6%
+-commutative68.6%
Simplified68.6%
*-commutative68.6%
fma-define57.7%
cube-mult57.7%
distribute-rgt1-in68.6%
*-commutative68.6%
associate-*l*68.6%
times-frac99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 87.9%
Taylor expanded in x around 0 66.2%
Final simplification54.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -2.1e+156)
(* (/ y x) (/ 1.0 x))
(if (<= x -3.4)
(/ y (* x (+ y x)))
(if (<= x 2.1e-68) (/ x (* y (+ y 1.0))) (* (/ 1.0 y) (/ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.1e+156) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.4) {
tmp = y / (x * (y + x));
} else if (x <= 2.1e-68) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.1d+156)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-3.4d0)) then
tmp = y / (x * (y + x))
else if (x <= 2.1d-68) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (1.0d0 / y) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.1e+156) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.4) {
tmp = y / (x * (y + x));
} else if (x <= 2.1e-68) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.1e+156: tmp = (y / x) * (1.0 / x) elif x <= -3.4: tmp = y / (x * (y + x)) elif x <= 2.1e-68: tmp = x / (y * (y + 1.0)) else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.1e+156) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -3.4) tmp = Float64(y / Float64(x * Float64(y + x))); elseif (x <= 2.1e-68) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(1.0 / y) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.1e+156)
tmp = (y / x) * (1.0 / x);
elseif (x <= -3.4)
tmp = y / (x * (y + x));
elseif (x <= 2.1e-68)
tmp = x / (y * (y + 1.0));
else
tmp = (1.0 / y) * (x / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.1e+156], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.4], N[(y / N[(x * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e-68], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+156}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -3.4:\\
\;\;\;\;\frac{y}{x \cdot \left(y + x\right)}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -2.09999999999999981e156Initial program 56.8%
+-commutative56.8%
+-commutative56.8%
+-commutative56.8%
*-commutative56.8%
distribute-rgt1-in0.0%
fma-define56.8%
+-commutative56.8%
+-commutative56.8%
cube-unmult56.8%
+-commutative56.8%
Simplified56.8%
*-commutative56.8%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in56.8%
*-commutative56.8%
associate-*l*56.8%
times-frac76.3%
associate-+r+76.3%
Applied egg-rr76.3%
Taylor expanded in x around inf 87.6%
Taylor expanded in y around 0 87.5%
if -2.09999999999999981e156 < x < -3.39999999999999991Initial program 65.4%
+-commutative65.4%
+-commutative65.4%
+-commutative65.4%
*-commutative65.4%
distribute-rgt1-in59.5%
fma-define65.4%
+-commutative65.4%
+-commutative65.4%
cube-unmult65.5%
+-commutative65.5%
Simplified65.5%
*-commutative65.5%
fma-define59.6%
cube-mult59.5%
distribute-rgt1-in65.4%
*-commutative65.4%
associate-*l*65.4%
times-frac94.1%
associate-+r+94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 70.3%
frac-times84.8%
*-rgt-identity84.8%
Applied egg-rr84.8%
if -3.39999999999999991 < x < 2.10000000000000008e-68Initial program 74.5%
associate-/l*85.5%
associate-+l+85.5%
Simplified85.5%
Taylor expanded in x around 0 75.5%
if 2.10000000000000008e-68 < x Initial program 70.7%
associate-/l*80.2%
associate-+l+80.2%
Simplified80.2%
Taylor expanded in x around 0 21.6%
Taylor expanded in y around inf 21.3%
associate-/r*22.9%
div-inv22.9%
Applied egg-rr22.9%
Final simplification62.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -3.4)
(* (/ y x) (/ 1.0 x))
(if (<= x -5e-114)
(/ 1.0 (* y (/ y x)))
(if (<= x 1.35e-101) (/ x y) (* (/ 1.0 y) (/ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -5e-114) {
tmp = 1.0 / (y * (y / x));
} else if (x <= 1.35e-101) {
tmp = x / y;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.4d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-5d-114)) then
tmp = 1.0d0 / (y * (y / x))
else if (x <= 1.35d-101) then
tmp = x / y
else
tmp = (1.0d0 / y) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -5e-114) {
tmp = 1.0 / (y * (y / x));
} else if (x <= 1.35e-101) {
tmp = x / y;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4: tmp = (y / x) * (1.0 / x) elif x <= -5e-114: tmp = 1.0 / (y * (y / x)) elif x <= 1.35e-101: tmp = x / y else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -5e-114) tmp = Float64(1.0 / Float64(y * Float64(y / x))); elseif (x <= 1.35e-101) tmp = Float64(x / y); else tmp = Float64(Float64(1.0 / y) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.4)
tmp = (y / x) * (1.0 / x);
elseif (x <= -5e-114)
tmp = 1.0 / (y * (y / x));
elseif (x <= 1.35e-101)
tmp = x / y;
else
tmp = (1.0 / y) * (x / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.4], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-114], N[(1.0 / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e-101], N[(x / y), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-114}:\\
\;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -3.39999999999999991Initial program 61.6%
+-commutative61.6%
+-commutative61.6%
+-commutative61.6%
*-commutative61.6%
distribute-rgt1-in33.2%
fma-define61.6%
+-commutative61.6%
+-commutative61.6%
cube-unmult61.6%
+-commutative61.6%
Simplified61.6%
*-commutative61.6%
fma-define33.2%
cube-mult33.2%
distribute-rgt1-in61.6%
*-commutative61.6%
associate-*l*61.6%
times-frac86.3%
associate-+r+86.3%
Applied egg-rr86.3%
Taylor expanded in x around inf 78.0%
Taylor expanded in y around 0 77.7%
if -3.39999999999999991 < x < -4.99999999999999989e-114Initial program 93.2%
associate-/l*96.3%
associate-+l+96.3%
Simplified96.3%
Taylor expanded in x around 0 70.9%
associate-/r*70.8%
+-commutative70.8%
Simplified70.8%
associate-/l/70.9%
*-commutative70.9%
+-commutative70.9%
div-inv71.0%
clear-num71.0%
+-commutative71.0%
*-un-lft-identity71.0%
times-frac70.9%
/-rgt-identity70.9%
Applied egg-rr70.9%
Taylor expanded in y around inf 63.6%
if -4.99999999999999989e-114 < x < 1.3500000000000001e-101Initial program 68.6%
+-commutative68.6%
+-commutative68.6%
+-commutative68.6%
*-commutative68.6%
distribute-rgt1-in57.7%
fma-define68.6%
+-commutative68.6%
+-commutative68.6%
cube-unmult68.6%
+-commutative68.6%
Simplified68.6%
*-commutative68.6%
fma-define57.7%
cube-mult57.7%
distribute-rgt1-in68.6%
*-commutative68.6%
associate-*l*68.6%
times-frac99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 87.9%
Taylor expanded in x around 0 66.2%
if 1.3500000000000001e-101 < x Initial program 69.8%
associate-/l*81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around 0 23.1%
Taylor expanded in y around inf 22.8%
associate-/r*24.3%
div-inv24.3%
Applied egg-rr24.3%
Final simplification55.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= x -1.7e+157)
(* (/ y (+ y x)) (/ 1.0 t_0))
(if (<= x -2.1e-131) (/ y (* (+ y x) t_0)) (/ (/ x (+ y 1.0)) y)))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.7e+157) {
tmp = (y / (y + x)) * (1.0 / t_0);
} else if (x <= -2.1e-131) {
tmp = y / ((y + x) * t_0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (x <= (-1.7d+157)) then
tmp = (y / (y + x)) * (1.0d0 / t_0)
else if (x <= (-2.1d-131)) then
tmp = y / ((y + x) * t_0)
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.7e+157) {
tmp = (y / (y + x)) * (1.0 / t_0);
} else if (x <= -2.1e-131) {
tmp = y / ((y + x) * t_0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if x <= -1.7e+157: tmp = (y / (y + x)) * (1.0 / t_0) elif x <= -2.1e-131: tmp = y / ((y + x) * t_0) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -1.7e+157) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / t_0)); elseif (x <= -2.1e-131) tmp = Float64(y / Float64(Float64(y + x) * t_0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (x <= -1.7e+157)
tmp = (y / (y + x)) * (1.0 / t_0);
elseif (x <= -2.1e-131)
tmp = y / ((y + x) * t_0);
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e+157], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.1e-131], N[(y / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+157}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{t\_0}\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-131}:\\
\;\;\;\;\frac{y}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -1.6999999999999999e157Initial program 56.8%
+-commutative56.8%
+-commutative56.8%
+-commutative56.8%
*-commutative56.8%
distribute-rgt1-in0.0%
fma-define56.8%
+-commutative56.8%
+-commutative56.8%
cube-unmult56.8%
+-commutative56.8%
Simplified56.8%
*-commutative56.8%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in56.8%
*-commutative56.8%
associate-*l*56.8%
times-frac76.3%
associate-+r+76.3%
Applied egg-rr76.3%
associate-/r*99.9%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in x around inf 88.3%
if -1.6999999999999999e157 < x < -2.09999999999999997e-131Initial program 76.8%
+-commutative76.8%
+-commutative76.8%
+-commutative76.8%
*-commutative76.8%
distribute-rgt1-in69.4%
fma-define76.7%
+-commutative76.7%
+-commutative76.7%
cube-unmult76.8%
+-commutative76.8%
Simplified76.8%
fma-define69.5%
cube-mult69.4%
distribute-rgt1-in76.8%
*-commutative76.8%
associate-*l*76.7%
times-frac97.1%
associate-+r+97.1%
Applied egg-rr97.1%
Taylor expanded in x around inf 75.7%
if -2.09999999999999997e-131 < x Initial program 69.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in x around 0 51.9%
*-un-lft-identity51.9%
+-commutative51.9%
*-commutative51.9%
times-frac52.7%
Applied egg-rr52.7%
associate-*r/52.7%
associate-*l/52.7%
*-commutative52.7%
*-rgt-identity52.7%
Simplified52.7%
Final simplification62.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= x -1.45e+154)
(/ (/ y t_0) (+ y x))
(if (<= x -8.2e-131) (/ y (* (+ y x) t_0)) (/ (/ x (+ y 1.0)) y)))))assert(x < y);
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.45e+154) {
tmp = (y / t_0) / (y + x);
} else if (x <= -8.2e-131) {
tmp = y / ((y + x) * t_0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y + 1.0d0)
if (x <= (-1.45d+154)) then
tmp = (y / t_0) / (y + x)
else if (x <= (-8.2d-131)) then
tmp = y / ((y + x) * t_0)
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (x <= -1.45e+154) {
tmp = (y / t_0) / (y + x);
} else if (x <= -8.2e-131) {
tmp = y / ((y + x) * t_0);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if x <= -1.45e+154: tmp = (y / t_0) / (y + x) elif x <= -8.2e-131: tmp = y / ((y + x) * t_0) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (x <= -1.45e+154) tmp = Float64(Float64(y / t_0) / Float64(y + x)); elseif (x <= -8.2e-131) tmp = Float64(y / Float64(Float64(y + x) * t_0)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x + (y + 1.0);
tmp = 0.0;
if (x <= -1.45e+154)
tmp = (y / t_0) / (y + x);
elseif (x <= -8.2e-131)
tmp = y / ((y + x) * t_0);
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+154], N[(N[(y / t$95$0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.2e-131], N[(y / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{t\_0}}{y + x}\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{-131}:\\
\;\;\;\;\frac{y}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -1.4499999999999999e154Initial program 56.8%
+-commutative56.8%
+-commutative56.8%
+-commutative56.8%
*-commutative56.8%
distribute-rgt1-in0.0%
fma-define56.8%
+-commutative56.8%
+-commutative56.8%
cube-unmult56.8%
+-commutative56.8%
Simplified56.8%
*-commutative56.8%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in56.8%
*-commutative56.8%
associate-*l*56.8%
times-frac76.3%
associate-+r+76.3%
Applied egg-rr76.3%
associate-/r*99.9%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in x around inf 88.3%
associate-*l/88.4%
un-div-inv88.4%
+-commutative88.4%
Applied egg-rr88.4%
if -1.4499999999999999e154 < x < -8.2000000000000004e-131Initial program 76.8%
+-commutative76.8%
+-commutative76.8%
+-commutative76.8%
*-commutative76.8%
distribute-rgt1-in69.4%
fma-define76.7%
+-commutative76.7%
+-commutative76.7%
cube-unmult76.8%
+-commutative76.8%
Simplified76.8%
fma-define69.5%
cube-mult69.4%
distribute-rgt1-in76.8%
*-commutative76.8%
associate-*l*76.7%
times-frac97.1%
associate-+r+97.1%
Applied egg-rr97.1%
Taylor expanded in x around inf 75.7%
if -8.2000000000000004e-131 < x Initial program 69.8%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in x around 0 51.9%
*-un-lft-identity51.9%
+-commutative51.9%
*-commutative51.9%
times-frac52.7%
Applied egg-rr52.7%
associate-*r/52.7%
associate-*l/52.7%
*-commutative52.7%
*-rgt-identity52.7%
Simplified52.7%
Final simplification62.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.4) (/ y (* x x)) (if (or (<= x -9.4e-116) (not (<= x 2.9e-101))) (/ x (* y y)) (/ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = y / (x * x);
} else if ((x <= -9.4e-116) || !(x <= 2.9e-101)) {
tmp = x / (y * y);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.4d0)) then
tmp = y / (x * x)
else if ((x <= (-9.4d-116)) .or. (.not. (x <= 2.9d-101))) then
tmp = x / (y * y)
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = y / (x * x);
} else if ((x <= -9.4e-116) || !(x <= 2.9e-101)) {
tmp = x / (y * y);
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4: tmp = y / (x * x) elif (x <= -9.4e-116) or not (x <= 2.9e-101): tmp = x / (y * y) else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4) tmp = Float64(y / Float64(x * x)); elseif ((x <= -9.4e-116) || !(x <= 2.9e-101)) tmp = Float64(x / Float64(y * y)); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.4)
tmp = y / (x * x);
elseif ((x <= -9.4e-116) || ~((x <= 2.9e-101)))
tmp = x / (y * y);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.4], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -9.4e-116], N[Not[LessEqual[x, 2.9e-101]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -9.4 \cdot 10^{-116} \lor \neg \left(x \leq 2.9 \cdot 10^{-101}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -3.39999999999999991Initial program 61.6%
+-commutative61.6%
+-commutative61.6%
+-commutative61.6%
*-commutative61.6%
distribute-rgt1-in33.2%
fma-define61.6%
+-commutative61.6%
+-commutative61.6%
cube-unmult61.6%
+-commutative61.6%
Simplified61.6%
*-commutative61.6%
fma-define33.2%
cube-mult33.2%
distribute-rgt1-in61.6%
*-commutative61.6%
associate-*l*61.6%
times-frac86.3%
associate-+r+86.3%
Applied egg-rr86.3%
Taylor expanded in x around inf 78.0%
frac-times81.0%
*-rgt-identity81.0%
Applied egg-rr81.0%
Taylor expanded in x around inf 72.9%
if -3.39999999999999991 < x < -9.39999999999999989e-116 or 2.9e-101 < x Initial program 76.3%
associate-/l*85.3%
associate-+l+85.3%
Simplified85.3%
Taylor expanded in x around 0 36.4%
Taylor expanded in y around inf 34.1%
if -9.39999999999999989e-116 < x < 2.9e-101Initial program 68.6%
+-commutative68.6%
+-commutative68.6%
+-commutative68.6%
*-commutative68.6%
distribute-rgt1-in57.7%
fma-define68.6%
+-commutative68.6%
+-commutative68.6%
cube-unmult68.6%
+-commutative68.6%
Simplified68.6%
*-commutative68.6%
fma-define57.7%
cube-mult57.7%
distribute-rgt1-in68.6%
*-commutative68.6%
associate-*l*68.6%
times-frac99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 87.9%
Taylor expanded in x around 0 66.2%
Final simplification53.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.4e+161) (* (/ y x) (/ 1.0 x)) (if (<= x -3.4) (/ y (* x (+ y x))) (/ (/ x (+ y 1.0)) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.4e+161) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.4) {
tmp = y / (x * (y + x));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.4d+161)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-3.4d0)) then
tmp = y / (x * (y + x))
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.4e+161) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.4) {
tmp = y / (x * (y + x));
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.4e+161: tmp = (y / x) * (1.0 / x) elif x <= -3.4: tmp = y / (x * (y + x)) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.4e+161) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -3.4) tmp = Float64(y / Float64(x * Float64(y + x))); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.4e+161)
tmp = (y / x) * (1.0 / x);
elseif (x <= -3.4)
tmp = y / (x * (y + x));
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.4e+161], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.4], N[(y / N[(x * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+161}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -3.4:\\
\;\;\;\;\frac{y}{x \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -1.4000000000000001e161Initial program 56.8%
+-commutative56.8%
+-commutative56.8%
+-commutative56.8%
*-commutative56.8%
distribute-rgt1-in0.0%
fma-define56.8%
+-commutative56.8%
+-commutative56.8%
cube-unmult56.8%
+-commutative56.8%
Simplified56.8%
*-commutative56.8%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in56.8%
*-commutative56.8%
associate-*l*56.8%
times-frac76.3%
associate-+r+76.3%
Applied egg-rr76.3%
Taylor expanded in x around inf 87.6%
Taylor expanded in y around 0 87.5%
if -1.4000000000000001e161 < x < -3.39999999999999991Initial program 65.4%
+-commutative65.4%
+-commutative65.4%
+-commutative65.4%
*-commutative65.4%
distribute-rgt1-in59.5%
fma-define65.4%
+-commutative65.4%
+-commutative65.4%
cube-unmult65.5%
+-commutative65.5%
Simplified65.5%
*-commutative65.5%
fma-define59.6%
cube-mult59.5%
distribute-rgt1-in65.4%
*-commutative65.4%
associate-*l*65.4%
times-frac94.1%
associate-+r+94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 70.3%
frac-times84.8%
*-rgt-identity84.8%
Applied egg-rr84.8%
if -3.39999999999999991 < x Initial program 73.0%
associate-/l*83.4%
associate-+l+83.4%
Simplified83.4%
Taylor expanded in x around 0 54.2%
*-un-lft-identity54.2%
+-commutative54.2%
*-commutative54.2%
times-frac54.8%
Applied egg-rr54.8%
associate-*r/54.8%
associate-*l/54.8%
*-commutative54.8%
*-rgt-identity54.8%
Simplified54.8%
Final simplification62.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3e+157) (* (/ y x) (/ 1.0 x)) (if (<= x -3.4) (/ y (* x (+ y x))) (/ (/ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3e+157) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.4) {
tmp = y / (x * (y + x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3d+157)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-3.4d0)) then
tmp = y / (x * (y + x))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3e+157) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.4) {
tmp = y / (x * (y + x));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3e+157: tmp = (y / x) * (1.0 / x) elif x <= -3.4: tmp = y / (x * (y + x)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3e+157) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -3.4) tmp = Float64(y / Float64(x * Float64(y + x))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3e+157)
tmp = (y / x) * (1.0 / x);
elseif (x <= -3.4)
tmp = y / (x * (y + x));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3e+157], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.4], N[(y / N[(x * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+157}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -3.4:\\
\;\;\;\;\frac{y}{x \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -3.0000000000000001e157Initial program 56.8%
+-commutative56.8%
+-commutative56.8%
+-commutative56.8%
*-commutative56.8%
distribute-rgt1-in0.0%
fma-define56.8%
+-commutative56.8%
+-commutative56.8%
cube-unmult56.8%
+-commutative56.8%
Simplified56.8%
*-commutative56.8%
fma-define0.0%
cube-mult0.0%
distribute-rgt1-in56.8%
*-commutative56.8%
associate-*l*56.8%
times-frac76.3%
associate-+r+76.3%
Applied egg-rr76.3%
Taylor expanded in x around inf 87.6%
Taylor expanded in y around 0 87.5%
if -3.0000000000000001e157 < x < -3.39999999999999991Initial program 65.4%
+-commutative65.4%
+-commutative65.4%
+-commutative65.4%
*-commutative65.4%
distribute-rgt1-in59.5%
fma-define65.4%
+-commutative65.4%
+-commutative65.4%
cube-unmult65.5%
+-commutative65.5%
Simplified65.5%
*-commutative65.5%
fma-define59.6%
cube-mult59.5%
distribute-rgt1-in65.4%
*-commutative65.4%
associate-*l*65.4%
times-frac94.1%
associate-+r+94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 70.3%
frac-times84.8%
*-rgt-identity84.8%
Applied egg-rr84.8%
if -3.39999999999999991 < x Initial program 73.0%
associate-/l*83.4%
associate-+l+83.4%
Simplified83.4%
Taylor expanded in x around 0 54.2%
associate-/r*54.8%
+-commutative54.8%
Simplified54.8%
Final simplification62.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -3.4) (* (/ y x) (/ 1.0 x)) (if (<= x 2.1e-68) (/ x (* y (+ y 1.0))) (* (/ 1.0 y) (/ x y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = (y / x) * (1.0 / x);
} else if (x <= 2.1e-68) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.4d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= 2.1d-68) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (1.0d0 / y) * (x / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.4) {
tmp = (y / x) * (1.0 / x);
} else if (x <= 2.1e-68) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4: tmp = (y / x) * (1.0 / x) elif x <= 2.1e-68: tmp = x / (y * (y + 1.0)) else: tmp = (1.0 / y) * (x / y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= 2.1e-68) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(1.0 / y) * Float64(x / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -3.4)
tmp = (y / x) * (1.0 / x);
elseif (x <= 2.1e-68)
tmp = x / (y * (y + 1.0));
else
tmp = (1.0 / y) * (x / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -3.4], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e-68], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -3.39999999999999991Initial program 61.6%
+-commutative61.6%
+-commutative61.6%
+-commutative61.6%
*-commutative61.6%
distribute-rgt1-in33.2%
fma-define61.6%
+-commutative61.6%
+-commutative61.6%
cube-unmult61.6%
+-commutative61.6%
Simplified61.6%
*-commutative61.6%
fma-define33.2%
cube-mult33.2%
distribute-rgt1-in61.6%
*-commutative61.6%
associate-*l*61.6%
times-frac86.3%
associate-+r+86.3%
Applied egg-rr86.3%
Taylor expanded in x around inf 78.0%
Taylor expanded in y around 0 77.7%
if -3.39999999999999991 < x < 2.10000000000000008e-68Initial program 74.5%
associate-/l*85.5%
associate-+l+85.5%
Simplified85.5%
Taylor expanded in x around 0 75.5%
if 2.10000000000000008e-68 < x Initial program 70.7%
associate-/l*80.2%
associate-+l+80.2%
Simplified80.2%
Taylor expanded in x around 0 21.6%
Taylor expanded in y around inf 21.3%
associate-/r*22.9%
div-inv22.9%
Applied egg-rr22.9%
Final simplification60.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (/ y (+ y x)) (/ (/ x (+ y x)) (+ x (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0d0)))
end function
assert x < y;
public static double code(double x, double y) {
return (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)));
}
[x, y] = sort([x, y]) def code(x, y): return (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(x + Float64(y + 1.0)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (y / (y + x)) * ((x / (y + x)) / (x + (y + 1.0)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{x + \left(y + 1\right)}
\end{array}
Initial program 70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
*-commutative70.3%
distribute-rgt1-in58.4%
fma-define70.3%
+-commutative70.3%
+-commutative70.3%
cube-unmult70.3%
+-commutative70.3%
Simplified70.3%
*-commutative70.3%
fma-define58.5%
cube-mult58.4%
distribute-rgt1-in70.3%
*-commutative70.3%
associate-*l*70.3%
times-frac93.6%
associate-+r+93.6%
Applied egg-rr93.6%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -4.8e-5) (/ (/ y (+ x (+ y 1.0))) (+ y x)) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -4.8e-5) {
tmp = (y / (x + (y + 1.0))) / (y + x);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.8d-5)) then
tmp = (y / (x + (y + 1.0d0))) / (y + x)
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -4.8e-5) {
tmp = (y / (x + (y + 1.0))) / (y + x);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -4.8e-5: tmp = (y / (x + (y + 1.0))) / (y + x) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -4.8e-5) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4.8e-5)
tmp = (y / (x + (y + 1.0))) / (y + x);
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -4.8e-5], 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] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -4.8000000000000001e-5Initial program 63.4%
+-commutative63.4%
+-commutative63.4%
+-commutative63.4%
*-commutative63.4%
distribute-rgt1-in36.3%
fma-define63.3%
+-commutative63.3%
+-commutative63.3%
cube-unmult63.4%
+-commutative63.4%
Simplified63.4%
*-commutative63.4%
fma-define36.3%
cube-mult36.3%
distribute-rgt1-in63.4%
*-commutative63.4%
associate-*l*63.3%
times-frac86.9%
associate-+r+86.9%
Applied egg-rr86.9%
associate-/r*99.7%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in x around inf 77.2%
associate-*l/77.2%
un-div-inv77.3%
+-commutative77.3%
Applied egg-rr77.3%
if -4.8000000000000001e-5 < x Initial program 72.6%
associate-/l*83.2%
associate-+l+83.2%
Simplified83.2%
Taylor expanded in x around 0 54.0%
*-un-lft-identity54.0%
+-commutative54.0%
*-commutative54.0%
times-frac54.6%
Applied egg-rr54.6%
associate-*r/54.6%
associate-*l/54.6%
*-commutative54.6%
*-rgt-identity54.6%
Simplified54.6%
Final simplification60.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 6e-142) (/ (/ y x) (+ 1.0 x)) (* (/ x (+ y x)) (/ 1.0 (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 6e-142) {
tmp = (y / x) / (1.0 + x);
} else {
tmp = (x / (y + x)) * (1.0 / (y + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6d-142) then
tmp = (y / x) / (1.0d0 + x)
else
tmp = (x / (y + x)) * (1.0d0 / (y + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 6e-142) {
tmp = (y / x) / (1.0 + x);
} else {
tmp = (x / (y + x)) * (1.0 / (y + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 6e-142: tmp = (y / x) / (1.0 + x) else: tmp = (x / (y + x)) * (1.0 / (y + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 6e-142) tmp = Float64(Float64(y / x) / Float64(1.0 + x)); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / Float64(y + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 6e-142)
tmp = (y / x) / (1.0 + x);
else
tmp = (x / (y + x)) * (1.0 / (y + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 6e-142], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-142}:\\
\;\;\;\;\frac{\frac{y}{x}}{1 + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y + 1}\\
\end{array}
\end{array}
if y < 6.0000000000000002e-142Initial program 71.7%
+-commutative71.7%
+-commutative71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt1-in55.6%
fma-define71.7%
+-commutative71.7%
+-commutative71.7%
cube-unmult71.8%
+-commutative71.8%
Simplified71.8%
fma-define55.7%
cube-mult55.6%
distribute-rgt1-in71.7%
*-commutative71.7%
associate-*l*71.7%
times-frac95.2%
associate-+r+95.2%
Applied egg-rr95.2%
Taylor expanded in y around 0 60.1%
associate-/r*61.7%
+-commutative61.7%
Simplified61.7%
if 6.0000000000000002e-142 < y Initial program 68.0%
+-commutative68.0%
+-commutative68.0%
+-commutative68.0%
*-commutative68.0%
distribute-rgt1-in62.9%
fma-define68.0%
+-commutative68.0%
+-commutative68.0%
cube-unmult68.0%
+-commutative68.0%
Simplified68.0%
fma-define62.9%
cube-mult62.9%
distribute-rgt1-in68.0%
*-commutative68.0%
associate-*l*68.0%
times-frac91.3%
associate-+r+91.3%
Applied egg-rr91.3%
Taylor expanded in x around 0 62.3%
+-commutative62.3%
Simplified62.3%
Final simplification61.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.25e-14) (/ (/ y x) (+ 1.0 x)) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.25e-14) {
tmp = (y / x) / (1.0 + x);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.25d-14)) then
tmp = (y / x) / (1.0d0 + x)
else
tmp = (x / (y + 1.0d0)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.25e-14) {
tmp = (y / x) / (1.0 + x);
} else {
tmp = (x / (y + 1.0)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.25e-14: tmp = (y / x) / (1.0 + x) else: tmp = (x / (y + 1.0)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.25e-14) tmp = Float64(Float64(y / x) / Float64(1.0 + x)); else tmp = Float64(Float64(x / Float64(y + 1.0)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.25e-14)
tmp = (y / x) / (1.0 + x);
else
tmp = (x / (y + 1.0)) / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.25e-14], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{y}{x}}{1 + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\
\end{array}
\end{array}
if x < -1.25e-14Initial program 64.1%
+-commutative64.1%
+-commutative64.1%
+-commutative64.1%
*-commutative64.1%
distribute-rgt1-in38.6%
fma-define64.1%
+-commutative64.1%
+-commutative64.1%
cube-unmult64.1%
+-commutative64.1%
Simplified64.1%
fma-define38.7%
cube-mult38.6%
distribute-rgt1-in64.1%
*-commutative64.1%
associate-*l*64.1%
times-frac87.8%
associate-+r+87.8%
Applied egg-rr87.8%
Taylor expanded in y around 0 70.2%
associate-/r*74.6%
+-commutative74.6%
Simplified74.6%
if -1.25e-14 < x Initial program 72.5%
associate-/l*83.3%
associate-+l+83.3%
Simplified83.3%
Taylor expanded in x around 0 54.2%
*-un-lft-identity54.2%
+-commutative54.2%
*-commutative54.2%
times-frac54.9%
Applied egg-rr54.9%
associate-*r/54.9%
associate-*l/54.9%
*-commutative54.9%
*-rgt-identity54.9%
Simplified54.9%
Final simplification60.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.0d0) then
tmp = x / y
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= 1.0) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 1.0: tmp = x / y else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 1.0) tmp = Float64(x / y); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.0)
tmp = x / y;
else
tmp = x / (y * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 1Initial program 73.7%
+-commutative73.7%
+-commutative73.7%
+-commutative73.7%
*-commutative73.7%
distribute-rgt1-in57.3%
fma-define73.7%
+-commutative73.7%
+-commutative73.7%
cube-unmult73.7%
+-commutative73.7%
Simplified73.7%
*-commutative73.7%
fma-define57.4%
cube-mult57.3%
distribute-rgt1-in73.7%
*-commutative73.7%
associate-*l*73.7%
times-frac95.9%
associate-+r+95.9%
Applied egg-rr95.9%
Taylor expanded in y around 0 82.7%
Taylor expanded in x around 0 22.1%
if 1 < y Initial program 61.4%
associate-/l*81.1%
associate-+l+81.1%
Simplified81.1%
Taylor expanded in x around 0 67.0%
Taylor expanded in y around inf 66.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ x y))
assert(x < y);
double code(double x, double y) {
return x / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
assert x < y;
public static double code(double x, double y) {
return x / y;
}
[x, y] = sort([x, y]) def code(x, y): return x / y
x, y = sort([x, y]) function code(x, y) return Float64(x / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = x / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y}
\end{array}
Initial program 70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
*-commutative70.3%
distribute-rgt1-in58.4%
fma-define70.3%
+-commutative70.3%
+-commutative70.3%
cube-unmult70.3%
+-commutative70.3%
Simplified70.3%
*-commutative70.3%
fma-define58.5%
cube-mult58.4%
distribute-rgt1-in70.3%
*-commutative70.3%
associate-*l*70.3%
times-frac93.6%
associate-+r+93.6%
Applied egg-rr93.6%
Taylor expanded in y around 0 79.1%
Taylor expanded in x around 0 27.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 1.0 y))
assert(x < y);
double code(double x, double y) {
return 1.0 / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / y
end function
assert x < y;
public static double code(double x, double y) {
return 1.0 / y;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0 / y
x, y = sort([x, y]) function code(x, y) return Float64(1.0 / y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0 / y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{y}
\end{array}
Initial program 70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
*-commutative70.3%
distribute-rgt1-in58.4%
fma-define70.3%
+-commutative70.3%
+-commutative70.3%
cube-unmult70.3%
+-commutative70.3%
Simplified70.3%
*-commutative70.3%
fma-define58.5%
cube-mult58.4%
distribute-rgt1-in70.3%
*-commutative70.3%
associate-*l*70.3%
times-frac93.6%
associate-+r+93.6%
Applied egg-rr93.6%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in x around inf 54.2%
Taylor expanded in y around inf 4.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 1.0)
assert(x < y);
double code(double x, double y) {
return 1.0;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
assert x < y;
public static double code(double x, double y) {
return 1.0;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0
x, y = sort([x, y]) function code(x, y) return 1.0 end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := 1.0
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
1
\end{array}
Initial program 70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
*-commutative70.3%
distribute-rgt1-in58.4%
fma-define70.3%
+-commutative70.3%
+-commutative70.3%
cube-unmult70.3%
+-commutative70.3%
Simplified70.3%
fma-define58.5%
cube-mult58.4%
distribute-rgt1-in70.3%
*-commutative70.3%
associate-*l*70.3%
times-frac93.7%
associate-+r+93.7%
Applied egg-rr93.7%
Taylor expanded in y around 0 50.6%
Taylor expanded in x around 0 3.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 2024172
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))