
(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 28 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 (/ (* x (/ (/ y (+ x (+ y 1.0))) (+ x y))) (+ x y)))
assert(x < y);
double code(double x, double y) {
return (x * ((y / (x + (y + 1.0))) / (x + y))) / (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 / (x + (y + 1.0d0))) / (x + y))) / (x + y)
end function
assert x < y;
public static double code(double x, double y) {
return (x * ((y / (x + (y + 1.0))) / (x + y))) / (x + y);
}
[x, y] = sort([x, y]) def code(x, y): return (x * ((y / (x + (y + 1.0))) / (x + y))) / (x + y)
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x * Float64(Float64(y / Float64(x + Float64(y + 1.0))) / Float64(x + y))) / Float64(x + y)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x * ((y / (x + (y + 1.0))) / (x + y))) / (x + y);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(x * N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}}{x + y}
\end{array}
Initial program 67.4%
times-frac84.4%
associate-+r+84.4%
associate-*l/78.3%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.7%
clear-num99.7%
frac-times98.9%
metadata-eval98.9%
div-inv98.9%
associate-/r*99.7%
Applied egg-rr99.7%
associate-/l/98.9%
div-inv98.9%
clear-num98.9%
associate-*l/98.9%
*-un-lft-identity98.9%
+-commutative98.9%
+-commutative98.9%
+-commutative98.9%
associate-+l+98.9%
+-commutative98.9%
Applied egg-rr98.9%
associate-/r/99.7%
associate-*l/99.8%
*-lft-identity99.8%
+-commutative99.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
(let* ((t_0 (/ x (* (+ x y) (+ x y)))) (t_1 (/ x (+ x y))))
(if (<= x -1.6e+162)
(* t_1 (/ (/ y x) (+ x y)))
(if (<= x -4.2)
(* (/ y x) t_0)
(if (<= x -1.2e-164)
(* t_0 (/ y (+ y 1.0)))
(if (<= x 1.62e-211)
(* t_1 (/ y (+ x y)))
(/ t_1 (+ x (+ y (+ x 1.0))))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / ((x + y) * (x + y));
double t_1 = x / (x + y);
double tmp;
if (x <= -1.6e+162) {
tmp = t_1 * ((y / x) / (x + y));
} else if (x <= -4.2) {
tmp = (y / x) * t_0;
} else if (x <= -1.2e-164) {
tmp = t_0 * (y / (y + 1.0));
} else if (x <= 1.62e-211) {
tmp = t_1 * (y / (x + y));
} else {
tmp = t_1 / (x + (y + (x + 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / ((x + y) * (x + y))
t_1 = x / (x + y)
if (x <= (-1.6d+162)) then
tmp = t_1 * ((y / x) / (x + y))
else if (x <= (-4.2d0)) then
tmp = (y / x) * t_0
else if (x <= (-1.2d-164)) then
tmp = t_0 * (y / (y + 1.0d0))
else if (x <= 1.62d-211) then
tmp = t_1 * (y / (x + y))
else
tmp = t_1 / (x + (y + (x + 1.0d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / ((x + y) * (x + y));
double t_1 = x / (x + y);
double tmp;
if (x <= -1.6e+162) {
tmp = t_1 * ((y / x) / (x + y));
} else if (x <= -4.2) {
tmp = (y / x) * t_0;
} else if (x <= -1.2e-164) {
tmp = t_0 * (y / (y + 1.0));
} else if (x <= 1.62e-211) {
tmp = t_1 * (y / (x + y));
} else {
tmp = t_1 / (x + (y + (x + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / ((x + y) * (x + y)) t_1 = x / (x + y) tmp = 0 if x <= -1.6e+162: tmp = t_1 * ((y / x) / (x + y)) elif x <= -4.2: tmp = (y / x) * t_0 elif x <= -1.2e-164: tmp = t_0 * (y / (y + 1.0)) elif x <= 1.62e-211: tmp = t_1 * (y / (x + y)) else: tmp = t_1 / (x + (y + (x + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(Float64(x + y) * Float64(x + y))) t_1 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -1.6e+162) tmp = Float64(t_1 * Float64(Float64(y / x) / Float64(x + y))); elseif (x <= -4.2) tmp = Float64(Float64(y / x) * t_0); elseif (x <= -1.2e-164) tmp = Float64(t_0 * Float64(y / Float64(y + 1.0))); elseif (x <= 1.62e-211) tmp = Float64(t_1 * Float64(y / Float64(x + y))); else tmp = Float64(t_1 / Float64(x + Float64(y + Float64(x + 1.0)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / ((x + y) * (x + y));
t_1 = x / (x + y);
tmp = 0.0;
if (x <= -1.6e+162)
tmp = t_1 * ((y / x) / (x + y));
elseif (x <= -4.2)
tmp = (y / x) * t_0;
elseif (x <= -1.2e-164)
tmp = t_0 * (y / (y + 1.0));
elseif (x <= 1.62e-211)
tmp = t_1 * (y / (x + y));
else
tmp = t_1 / (x + (y + (x + 1.0)));
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[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+162], N[(t$95$1 * N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.2], N[(N[(y / x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, -1.2e-164], N[(t$95$0 * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.62e-211], N[(t$95$1 * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(x + N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
t_1 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+162}:\\
\;\;\;\;t_1 \cdot \frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -4.2:\\
\;\;\;\;\frac{y}{x} \cdot t_0\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-164}:\\
\;\;\;\;t_0 \cdot \frac{y}{y + 1}\\
\mathbf{elif}\;x \leq 1.62 \cdot 10^{-211}:\\
\;\;\;\;t_1 \cdot \frac{y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{x + \left(y + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if x < -1.6000000000000001e162Initial program 57.8%
times-frac71.6%
associate-+r+71.6%
associate-*l/71.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 87.2%
if -1.6000000000000001e162 < x < -4.20000000000000018Initial program 69.5%
times-frac92.7%
/-rgt-identity92.7%
associate-/l/92.7%
*-lft-identity92.7%
associate-+l+92.7%
Simplified92.7%
Taylor expanded in x around inf 88.1%
if -4.20000000000000018 < x < -1.19999999999999992e-164Initial program 87.5%
times-frac99.7%
/-rgt-identity99.7%
associate-/l/99.7%
*-lft-identity99.7%
associate-+l+99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
Simplified99.7%
if -1.19999999999999992e-164 < x < 1.61999999999999999e-211Initial program 53.3%
times-frac69.0%
associate-+r+69.0%
associate-*l/53.3%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 98.1%
if 1.61999999999999999e-211 < x Initial program 73.2%
associate-*r/81.4%
*-commutative81.4%
distribute-rgt1-in72.2%
fma-def81.4%
cube-unmult81.4%
Simplified81.4%
associate-*r/73.2%
fma-udef66.1%
cube-mult66.1%
distribute-rgt1-in73.2%
associate-+r+73.2%
*-commutative73.2%
frac-times91.2%
*-commutative91.2%
clear-num91.2%
associate-/r*99.7%
frac-times99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in y around -inf 49.1%
mul-1-neg49.1%
unsub-neg49.1%
neg-mul-149.1%
unsub-neg49.1%
distribute-lft-in49.1%
metadata-eval49.1%
neg-mul-149.1%
unsub-neg49.1%
Simplified49.1%
associate--r-49.1%
Applied egg-rr49.1%
Final simplification76.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= x -1.8e+162)
(* t_0 (/ (/ y x) (+ x y)))
(if (<= x -2e-16)
(* (/ x (* (+ x y) (+ x y))) (/ y (+ x (+ y 1.0))))
(* t_0 (/ (/ y (+ y 1.0)) (+ x y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.8e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -2e-16) {
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0)));
} else {
tmp = t_0 * ((y / (y + 1.0)) / (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) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (x <= (-1.8d+162)) then
tmp = t_0 * ((y / x) / (x + y))
else if (x <= (-2d-16)) then
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0d0)))
else
tmp = t_0 * ((y / (y + 1.0d0)) / (x + y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.8e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -2e-16) {
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0)));
} else {
tmp = t_0 * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if x <= -1.8e+162: tmp = t_0 * ((y / x) / (x + y)) elif x <= -2e-16: tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0))) else: tmp = t_0 * ((y / (y + 1.0)) / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -1.8e+162) tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(x + y))); elseif (x <= -2e-16) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / Float64(x + Float64(y + 1.0)))); else tmp = Float64(t_0 * Float64(Float64(y / Float64(y + 1.0)) / Float64(x + y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (x <= -1.8e+162)
tmp = t_0 * ((y / x) / (x + y));
elseif (x <= -2e-16)
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0)));
else
tmp = t_0 * ((y / (y + 1.0)) / (x + 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[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.8e+162], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-16], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{+162}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -1.79999999999999997e162Initial program 57.8%
times-frac71.6%
associate-+r+71.6%
associate-*l/71.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 87.2%
if -1.79999999999999997e162 < x < -2e-16Initial program 70.3%
times-frac92.9%
/-rgt-identity92.9%
associate-/l/92.9%
*-lft-identity92.9%
associate-+l+92.9%
Simplified92.9%
if -2e-16 < x Initial program 68.8%
times-frac85.3%
associate-+r+85.3%
associate-*l/76.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 84.1%
+-commutative84.1%
Simplified84.1%
Final simplification85.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= x -1.05e+62)
(/ (/ y (+ x (+ y 1.0))) x)
(if (<= x -3.75e+56)
(* (/ 1.0 y) (/ x y))
(if (<= x -9e-14)
(/ (/ y (+ x 1.0)) (+ x y))
(if (<= x 2.75e-211) (* t_0 (/ y (+ x y))) (/ t_0 (+ y 1.0))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.05e+62) {
tmp = (y / (x + (y + 1.0))) / x;
} else if (x <= -3.75e+56) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -9e-14) {
tmp = (y / (x + 1.0)) / (x + y);
} else if (x <= 2.75e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (x <= (-1.05d+62)) then
tmp = (y / (x + (y + 1.0d0))) / x
else if (x <= (-3.75d+56)) then
tmp = (1.0d0 / y) * (x / y)
else if (x <= (-9d-14)) then
tmp = (y / (x + 1.0d0)) / (x + y)
else if (x <= 2.75d-211) then
tmp = t_0 * (y / (x + y))
else
tmp = t_0 / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.05e+62) {
tmp = (y / (x + (y + 1.0))) / x;
} else if (x <= -3.75e+56) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -9e-14) {
tmp = (y / (x + 1.0)) / (x + y);
} else if (x <= 2.75e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = t_0 / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if x <= -1.05e+62: tmp = (y / (x + (y + 1.0))) / x elif x <= -3.75e+56: tmp = (1.0 / y) * (x / y) elif x <= -9e-14: tmp = (y / (x + 1.0)) / (x + y) elif x <= 2.75e-211: tmp = t_0 * (y / (x + y)) else: tmp = t_0 / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -1.05e+62) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / x); elseif (x <= -3.75e+56) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); elseif (x <= -9e-14) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); elseif (x <= 2.75e-211) tmp = Float64(t_0 * Float64(y / Float64(x + y))); else tmp = Float64(t_0 / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (x <= -1.05e+62)
tmp = (y / (x + (y + 1.0))) / x;
elseif (x <= -3.75e+56)
tmp = (1.0 / y) * (x / y);
elseif (x <= -9e-14)
tmp = (y / (x + 1.0)) / (x + y);
elseif (x <= 2.75e-211)
tmp = t_0 * (y / (x + y));
else
tmp = t_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_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+62], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -3.75e+56], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9e-14], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.75e-211], N[(t$95$0 * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x}\\
\mathbf{elif}\;x \leq -3.75 \cdot 10^{+56}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{-211}:\\
\;\;\;\;t_0 \cdot \frac{y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y + 1}\\
\end{array}
\end{array}
if x < -1.05e62Initial program 61.0%
times-frac79.9%
/-rgt-identity79.9%
associate-/l/79.9%
*-lft-identity79.9%
associate-+l+79.9%
Simplified79.9%
Taylor expanded in x around inf 84.1%
associate-*l/84.2%
*-un-lft-identity84.2%
Applied egg-rr84.2%
if -1.05e62 < x < -3.75e56Initial program 7.9%
associate-*r/7.9%
*-commutative7.9%
distribute-rgt1-in7.9%
fma-def7.9%
cube-unmult7.9%
Simplified7.9%
Taylor expanded in y around inf 7.9%
unpow27.9%
Simplified7.9%
*-un-lft-identity7.9%
times-frac100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -3.75e56 < x < -8.9999999999999995e-14Initial program 83.8%
times-frac99.6%
associate-+r+99.6%
associate-*l/99.6%
times-frac99.6%
+-commutative99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
Applied egg-rr99.6%
div-inv99.7%
clear-num99.7%
frac-times99.7%
metadata-eval99.7%
div-inv99.7%
associate-/r*99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 59.6%
+-commutative59.6%
Simplified59.6%
if -8.9999999999999995e-14 < x < 2.74999999999999987e-211Initial program 62.5%
times-frac77.1%
associate-+r+77.1%
associate-*l/62.5%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 94.2%
if 2.74999999999999987e-211 < x Initial program 73.9%
associate-*r/82.2%
*-commutative82.2%
distribute-rgt1-in72.9%
fma-def82.2%
cube-unmult82.2%
Simplified82.2%
associate-*r/74.0%
fma-udef66.8%
cube-mult66.8%
distribute-rgt1-in73.9%
associate-+r+73.9%
*-commutative73.9%
frac-times92.1%
*-commutative92.1%
clear-num92.1%
associate-/r*99.7%
frac-times99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in x around 0 47.5%
+-commutative47.5%
Simplified47.5%
Final simplification72.1%
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 1.0))) (+ x y))) (t_1 (/ x (+ x y))))
(if (<= x -3e+62)
t_0
(if (<= x -6.2e+54)
(* (/ 1.0 y) (/ x y))
(if (<= x -7e-14)
t_0
(if (<= x 2.45e-211) (* t_1 (/ y (+ x y))) (/ t_1 (+ y 1.0))))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / (y + (x + 1.0))) / (x + y);
double t_1 = x / (x + y);
double tmp;
if (x <= -3e+62) {
tmp = t_0;
} else if (x <= -6.2e+54) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -7e-14) {
tmp = t_0;
} else if (x <= 2.45e-211) {
tmp = t_1 * (y / (x + y));
} else {
tmp = t_1 / (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (y / (y + (x + 1.0d0))) / (x + y)
t_1 = x / (x + y)
if (x <= (-3d+62)) then
tmp = t_0
else if (x <= (-6.2d+54)) then
tmp = (1.0d0 / y) * (x / y)
else if (x <= (-7d-14)) then
tmp = t_0
else if (x <= 2.45d-211) then
tmp = t_1 * (y / (x + y))
else
tmp = t_1 / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / (y + (x + 1.0))) / (x + y);
double t_1 = x / (x + y);
double tmp;
if (x <= -3e+62) {
tmp = t_0;
} else if (x <= -6.2e+54) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -7e-14) {
tmp = t_0;
} else if (x <= 2.45e-211) {
tmp = t_1 * (y / (x + y));
} else {
tmp = t_1 / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / (y + (x + 1.0))) / (x + y) t_1 = x / (x + y) tmp = 0 if x <= -3e+62: tmp = t_0 elif x <= -6.2e+54: tmp = (1.0 / y) * (x / y) elif x <= -7e-14: tmp = t_0 elif x <= 2.45e-211: tmp = t_1 * (y / (x + y)) else: tmp = t_1 / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(x + y)) t_1 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -3e+62) tmp = t_0; elseif (x <= -6.2e+54) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); elseif (x <= -7e-14) tmp = t_0; elseif (x <= 2.45e-211) tmp = Float64(t_1 * Float64(y / Float64(x + y))); else tmp = Float64(t_1 / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / (y + (x + 1.0))) / (x + y);
t_1 = x / (x + y);
tmp = 0.0;
if (x <= -3e+62)
tmp = t_0;
elseif (x <= -6.2e+54)
tmp = (1.0 / y) * (x / y);
elseif (x <= -7e-14)
tmp = t_0;
elseif (x <= 2.45e-211)
tmp = t_1 * (y / (x + y));
else
tmp = t_1 / (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_] := Block[{t$95$0 = N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+62], t$95$0, If[LessEqual[x, -6.2e+54], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7e-14], t$95$0, If[LessEqual[x, 2.45e-211], N[(t$95$1 * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{y + \left(x + 1\right)}}{x + y}\\
t_1 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -3 \cdot 10^{+62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-14}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.45 \cdot 10^{-211}:\\
\;\;\;\;t_1 \cdot \frac{y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{y + 1}\\
\end{array}
\end{array}
if x < -3e62 or -6.1999999999999999e54 < x < -7.0000000000000005e-14Initial program 64.7%
times-frac83.1%
associate-+r+83.1%
associate-*l/83.2%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 80.7%
if -3e62 < x < -6.1999999999999999e54Initial program 7.9%
associate-*r/7.9%
*-commutative7.9%
distribute-rgt1-in7.9%
fma-def7.9%
cube-unmult7.9%
Simplified7.9%
Taylor expanded in y around inf 7.9%
unpow27.9%
Simplified7.9%
*-un-lft-identity7.9%
times-frac100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -7.0000000000000005e-14 < x < 2.45000000000000016e-211Initial program 62.5%
times-frac77.1%
associate-+r+77.1%
associate-*l/62.5%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 94.2%
if 2.45000000000000016e-211 < x Initial program 73.9%
associate-*r/82.2%
*-commutative82.2%
distribute-rgt1-in72.9%
fma-def82.2%
cube-unmult82.2%
Simplified82.2%
associate-*r/74.0%
fma-udef66.8%
cube-mult66.8%
distribute-rgt1-in73.9%
associate-+r+73.9%
*-commutative73.9%
frac-times92.1%
*-commutative92.1%
clear-num92.1%
associate-/r*99.7%
frac-times99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in x around 0 47.5%
+-commutative47.5%
Simplified47.5%
Final simplification72.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= x -1.6e+162)
(* t_0 (/ (/ y x) (+ x y)))
(if (<= x -9e-10)
(* (/ y x) (/ x (* (+ x y) (+ x y))))
(if (<= x 2.9e-211)
(* t_0 (/ y (+ x y)))
(/ (/ x (+ x (+ x (+ y 1.0)))) (+ x y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.6e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -9e-10) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else if (x <= 2.9e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = (x / (x + (x + (y + 1.0)))) / (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) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (x <= (-1.6d+162)) then
tmp = t_0 * ((y / x) / (x + y))
else if (x <= (-9d-10)) then
tmp = (y / x) * (x / ((x + y) * (x + y)))
else if (x <= 2.9d-211) then
tmp = t_0 * (y / (x + y))
else
tmp = (x / (x + (x + (y + 1.0d0)))) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.6e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -9e-10) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else if (x <= 2.9e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = (x / (x + (x + (y + 1.0)))) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if x <= -1.6e+162: tmp = t_0 * ((y / x) / (x + y)) elif x <= -9e-10: tmp = (y / x) * (x / ((x + y) * (x + y))) elif x <= 2.9e-211: tmp = t_0 * (y / (x + y)) else: tmp = (x / (x + (x + (y + 1.0)))) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -1.6e+162) tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(x + y))); elseif (x <= -9e-10) tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(x + y) * Float64(x + y)))); elseif (x <= 2.9e-211) tmp = Float64(t_0 * Float64(y / Float64(x + y))); else tmp = Float64(Float64(x / Float64(x + Float64(x + Float64(y + 1.0)))) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (x <= -1.6e+162)
tmp = t_0 * ((y / x) / (x + y));
elseif (x <= -9e-10)
tmp = (y / x) * (x / ((x + y) * (x + y)));
elseif (x <= 2.9e-211)
tmp = t_0 * (y / (x + y));
else
tmp = (x / (x + (x + (y + 1.0)))) / (x + 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[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+162], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9e-10], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e-211], N[(t$95$0 * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+162}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-10}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-211}:\\
\;\;\;\;t_0 \cdot \frac{y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + \left(x + \left(y + 1\right)\right)}}{x + y}\\
\end{array}
\end{array}
if x < -1.6000000000000001e162Initial program 57.8%
times-frac71.6%
associate-+r+71.6%
associate-*l/71.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 87.2%
if -1.6000000000000001e162 < x < -8.9999999999999999e-10Initial program 69.5%
times-frac92.7%
/-rgt-identity92.7%
associate-/l/92.7%
*-lft-identity92.7%
associate-+l+92.7%
Simplified92.7%
Taylor expanded in x around inf 88.1%
if -8.9999999999999999e-10 < x < 2.90000000000000014e-211Initial program 63.0%
times-frac77.4%
associate-+r+77.4%
associate-*l/63.0%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 93.1%
if 2.90000000000000014e-211 < x Initial program 73.9%
associate-*r/82.2%
*-commutative82.2%
distribute-rgt1-in72.9%
fma-def82.2%
cube-unmult82.2%
Simplified82.2%
associate-*r/74.0%
fma-udef66.8%
cube-mult66.8%
distribute-rgt1-in73.9%
associate-+r+73.9%
*-commutative73.9%
frac-times92.1%
*-commutative92.1%
clear-num92.1%
associate-/r*99.7%
frac-times99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in y around -inf 49.5%
mul-1-neg49.5%
unsub-neg49.5%
neg-mul-149.5%
unsub-neg49.5%
distribute-lft-in49.5%
metadata-eval49.5%
neg-mul-149.5%
unsub-neg49.5%
Simplified49.5%
expm1-log1p-u49.5%
expm1-udef52.4%
associate-/l/52.4%
associate--l-52.4%
+-commutative52.4%
Applied egg-rr52.4%
expm1-def66.3%
expm1-log1p66.3%
associate-/r*49.5%
associate--r+49.5%
associate-+l-49.5%
+-commutative49.5%
associate--r-49.5%
Simplified49.5%
Final simplification74.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= x -1.75e+162)
(* t_0 (/ (/ y x) (+ x y)))
(if (<= x -1.7e-14)
(* (/ y x) (/ x (* (+ x y) (+ x y))))
(if (<= x 1.68e-211)
(* t_0 (/ y (+ x y)))
(/ t_0 (+ x (+ y (+ x 1.0)))))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.75e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -1.7e-14) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else if (x <= 1.68e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = t_0 / (x + (y + (x + 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) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (x <= (-1.75d+162)) then
tmp = t_0 * ((y / x) / (x + y))
else if (x <= (-1.7d-14)) then
tmp = (y / x) * (x / ((x + y) * (x + y)))
else if (x <= 1.68d-211) then
tmp = t_0 * (y / (x + y))
else
tmp = t_0 / (x + (y + (x + 1.0d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.75e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -1.7e-14) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else if (x <= 1.68e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = t_0 / (x + (y + (x + 1.0)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if x <= -1.75e+162: tmp = t_0 * ((y / x) / (x + y)) elif x <= -1.7e-14: tmp = (y / x) * (x / ((x + y) * (x + y))) elif x <= 1.68e-211: tmp = t_0 * (y / (x + y)) else: tmp = t_0 / (x + (y + (x + 1.0))) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -1.75e+162) tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(x + y))); elseif (x <= -1.7e-14) tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(x + y) * Float64(x + y)))); elseif (x <= 1.68e-211) tmp = Float64(t_0 * Float64(y / Float64(x + y))); else tmp = Float64(t_0 / Float64(x + Float64(y + Float64(x + 1.0)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (x <= -1.75e+162)
tmp = t_0 * ((y / x) / (x + y));
elseif (x <= -1.7e-14)
tmp = (y / x) * (x / ((x + y) * (x + y)));
elseif (x <= 1.68e-211)
tmp = t_0 * (y / (x + y));
else
tmp = t_0 / (x + (y + (x + 1.0)));
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[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e+162], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-14], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.68e-211], N[(t$95$0 * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(x + N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{+162}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;x \leq 1.68 \cdot 10^{-211}:\\
\;\;\;\;t_0 \cdot \frac{y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{x + \left(y + \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if x < -1.75000000000000009e162Initial program 57.8%
times-frac71.6%
associate-+r+71.6%
associate-*l/71.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 87.2%
if -1.75000000000000009e162 < x < -1.70000000000000001e-14Initial program 70.3%
times-frac92.9%
/-rgt-identity92.9%
associate-/l/92.9%
*-lft-identity92.9%
associate-+l+92.9%
Simplified92.9%
Taylor expanded in x around inf 88.4%
if -1.70000000000000001e-14 < x < 1.68e-211Initial program 63.3%
times-frac78.1%
associate-+r+78.1%
associate-*l/63.3%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 94.1%
if 1.68e-211 < x Initial program 73.2%
associate-*r/81.4%
*-commutative81.4%
distribute-rgt1-in72.2%
fma-def81.4%
cube-unmult81.4%
Simplified81.4%
associate-*r/73.2%
fma-udef66.1%
cube-mult66.1%
distribute-rgt1-in73.2%
associate-+r+73.2%
*-commutative73.2%
frac-times91.2%
*-commutative91.2%
clear-num91.2%
associate-/r*99.7%
frac-times99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in y around -inf 49.1%
mul-1-neg49.1%
unsub-neg49.1%
neg-mul-149.1%
unsub-neg49.1%
distribute-lft-in49.1%
metadata-eval49.1%
neg-mul-149.1%
unsub-neg49.1%
Simplified49.1%
associate--r-49.1%
Applied egg-rr49.1%
Final simplification74.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= x -1.62e+162)
(* t_0 (/ (/ y x) (+ x y)))
(if (<= x -205.0)
(* (/ y x) (/ x (* (+ x y) (+ x y))))
(* t_0 (/ (/ y (+ y 1.0)) (+ x y)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.62e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -205.0) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else {
tmp = t_0 * ((y / (y + 1.0)) / (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) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (x <= (-1.62d+162)) then
tmp = t_0 * ((y / x) / (x + y))
else if (x <= (-205.0d0)) then
tmp = (y / x) * (x / ((x + y) * (x + y)))
else
tmp = t_0 * ((y / (y + 1.0d0)) / (x + y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.62e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -205.0) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else {
tmp = t_0 * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if x <= -1.62e+162: tmp = t_0 * ((y / x) / (x + y)) elif x <= -205.0: tmp = (y / x) * (x / ((x + y) * (x + y))) else: tmp = t_0 * ((y / (y + 1.0)) / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -1.62e+162) tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(x + y))); elseif (x <= -205.0) tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(x + y) * Float64(x + y)))); else tmp = Float64(t_0 * Float64(Float64(y / Float64(y + 1.0)) / Float64(x + y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (x <= -1.62e+162)
tmp = t_0 * ((y / x) / (x + y));
elseif (x <= -205.0)
tmp = (y / x) * (x / ((x + y) * (x + y)));
else
tmp = t_0 * ((y / (y + 1.0)) / (x + 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[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.62e+162], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -205.0], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -1.62 \cdot 10^{+162}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -205:\\
\;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -1.62000000000000005e162Initial program 57.8%
times-frac71.6%
associate-+r+71.6%
associate-*l/71.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 87.2%
if -1.62000000000000005e162 < x < -205Initial program 69.5%
times-frac92.7%
/-rgt-identity92.7%
associate-/l/92.7%
*-lft-identity92.7%
associate-+l+92.7%
Simplified92.7%
Taylor expanded in x around inf 88.1%
if -205 < x Initial program 68.9%
times-frac85.4%
associate-+r+85.4%
associate-*l/76.8%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 84.2%
+-commutative84.2%
Simplified84.2%
Final simplification85.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -6.5e+62)
(* (/ y x) (/ 1.0 x))
(if (<= x -3.05e+53)
(* (/ 1.0 y) (/ x y))
(if (<= x -1.2e-21)
(/ y (* x (+ x 1.0)))
(if (or (<= x -6.8e-36) (not (<= x -2.45e-147)))
(/ x (+ y (* y y)))
(- (/ y x) y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -6.5e+62) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.05e+53) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.2e-21) {
tmp = y / (x * (x + 1.0));
} else if ((x <= -6.8e-36) || !(x <= -2.45e-147)) {
tmp = x / (y + (y * y));
} else {
tmp = (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 <= (-6.5d+62)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-3.05d+53)) then
tmp = (1.0d0 / y) * (x / y)
else if (x <= (-1.2d-21)) then
tmp = y / (x * (x + 1.0d0))
else if ((x <= (-6.8d-36)) .or. (.not. (x <= (-2.45d-147)))) then
tmp = x / (y + (y * y))
else
tmp = (y / x) - y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -6.5e+62) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -3.05e+53) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.2e-21) {
tmp = y / (x * (x + 1.0));
} else if ((x <= -6.8e-36) || !(x <= -2.45e-147)) {
tmp = x / (y + (y * y));
} else {
tmp = (y / x) - y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -6.5e+62: tmp = (y / x) * (1.0 / x) elif x <= -3.05e+53: tmp = (1.0 / y) * (x / y) elif x <= -1.2e-21: tmp = y / (x * (x + 1.0)) elif (x <= -6.8e-36) or not (x <= -2.45e-147): tmp = x / (y + (y * y)) else: tmp = (y / x) - y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -6.5e+62) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -3.05e+53) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); elseif (x <= -1.2e-21) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif ((x <= -6.8e-36) || !(x <= -2.45e-147)) tmp = Float64(x / Float64(y + Float64(y * y))); else tmp = Float64(Float64(y / x) - y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -6.5e+62)
tmp = (y / x) * (1.0 / x);
elseif (x <= -3.05e+53)
tmp = (1.0 / y) * (x / y);
elseif (x <= -1.2e-21)
tmp = y / (x * (x + 1.0));
elseif ((x <= -6.8e-36) || ~((x <= -2.45e-147)))
tmp = x / (y + (y * y));
else
tmp = (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, -6.5e+62], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.05e+53], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.2e-21], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -6.8e-36], N[Not[LessEqual[x, -2.45e-147]], $MachinePrecision]], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+62}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -3.05 \cdot 10^{+53}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-36} \lor \neg \left(x \leq -2.45 \cdot 10^{-147}\right):\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} - y\\
\end{array}
\end{array}
if x < -6.5000000000000003e62Initial program 61.0%
times-frac79.9%
/-rgt-identity79.9%
associate-/l/79.9%
*-lft-identity79.9%
associate-+l+79.9%
Simplified79.9%
Taylor expanded in x around inf 84.1%
Taylor expanded in x around inf 83.8%
if -6.5000000000000003e62 < x < -3.0500000000000001e53Initial program 7.9%
associate-*r/7.9%
*-commutative7.9%
distribute-rgt1-in7.9%
fma-def7.9%
cube-unmult7.9%
Simplified7.9%
Taylor expanded in y around inf 7.9%
unpow27.9%
Simplified7.9%
*-un-lft-identity7.9%
times-frac100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -3.0500000000000001e53 < x < -1.2e-21Initial program 83.8%
times-frac99.6%
/-rgt-identity99.6%
associate-/l/99.6%
*-lft-identity99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 59.1%
if -1.2e-21 < x < -6.8000000000000005e-36 or -2.45000000000000002e-147 < x Initial program 66.8%
times-frac83.5%
/-rgt-identity83.5%
associate-/l/83.5%
*-lft-identity83.5%
associate-+l+83.5%
Simplified83.5%
Taylor expanded in x around 0 58.1%
distribute-rgt-in58.1%
*-lft-identity58.1%
Simplified58.1%
if -6.8000000000000005e-36 < x < -2.45000000000000002e-147Initial program 84.4%
Taylor expanded in y around 0 41.1%
*-commutative41.1%
unpow241.1%
+-commutative41.1%
Simplified41.1%
Taylor expanded in x around 0 56.6%
neg-mul-156.6%
unsub-neg56.6%
Simplified56.6%
Final simplification64.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ y x) (/ 1.0 x))) (t_1 (* (/ 1.0 y) (/ x y))))
(if (<= x -9e+61)
t_0
(if (<= x -3.3e+53)
t_1
(if (<= x -1.0)
t_0
(if (<= x -2.05e-156)
(- (/ y x) y)
(if (<= x 2.2e-182) (/ x y) t_1)))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / x) * (1.0 / x);
double t_1 = (1.0 / y) * (x / y);
double tmp;
if (x <= -9e+61) {
tmp = t_0;
} else if (x <= -3.3e+53) {
tmp = t_1;
} else if (x <= -1.0) {
tmp = t_0;
} else if (x <= -2.05e-156) {
tmp = (y / x) - y;
} else if (x <= 2.2e-182) {
tmp = x / y;
} else {
tmp = t_1;
}
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 / x) * (1.0d0 / x)
t_1 = (1.0d0 / y) * (x / y)
if (x <= (-9d+61)) then
tmp = t_0
else if (x <= (-3.3d+53)) then
tmp = t_1
else if (x <= (-1.0d0)) then
tmp = t_0
else if (x <= (-2.05d-156)) then
tmp = (y / x) - y
else if (x <= 2.2d-182) then
tmp = x / y
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / x) * (1.0 / x);
double t_1 = (1.0 / y) * (x / y);
double tmp;
if (x <= -9e+61) {
tmp = t_0;
} else if (x <= -3.3e+53) {
tmp = t_1;
} else if (x <= -1.0) {
tmp = t_0;
} else if (x <= -2.05e-156) {
tmp = (y / x) - y;
} else if (x <= 2.2e-182) {
tmp = x / y;
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / x) * (1.0 / x) t_1 = (1.0 / y) * (x / y) tmp = 0 if x <= -9e+61: tmp = t_0 elif x <= -3.3e+53: tmp = t_1 elif x <= -1.0: tmp = t_0 elif x <= -2.05e-156: tmp = (y / x) - y elif x <= 2.2e-182: tmp = x / y else: tmp = t_1 return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / x) * Float64(1.0 / x)) t_1 = Float64(Float64(1.0 / y) * Float64(x / y)) tmp = 0.0 if (x <= -9e+61) tmp = t_0; elseif (x <= -3.3e+53) tmp = t_1; elseif (x <= -1.0) tmp = t_0; elseif (x <= -2.05e-156) tmp = Float64(Float64(y / x) - y); elseif (x <= 2.2e-182) tmp = Float64(x / y); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / x) * (1.0 / x);
t_1 = (1.0 / y) * (x / y);
tmp = 0.0;
if (x <= -9e+61)
tmp = t_0;
elseif (x <= -3.3e+53)
tmp = t_1;
elseif (x <= -1.0)
tmp = t_0;
elseif (x <= -2.05e-156)
tmp = (y / x) - y;
elseif (x <= 2.2e-182)
tmp = x / y;
else
tmp = t_1;
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[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e+61], t$95$0, If[LessEqual[x, -3.3e+53], t$95$1, If[LessEqual[x, -1.0], t$95$0, If[LessEqual[x, -2.05e-156], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 2.2e-182], N[(x / y), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x} \cdot \frac{1}{x}\\
t_1 := \frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{if}\;x \leq -9 \cdot 10^{+61}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.05 \cdot 10^{-156}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-182}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -9e61 or -3.3000000000000002e53 < x < -1Initial program 64.2%
times-frac82.9%
/-rgt-identity82.9%
associate-/l/82.9%
*-lft-identity82.9%
associate-+l+82.9%
Simplified82.9%
Taylor expanded in x around inf 81.2%
Taylor expanded in x around inf 79.9%
if -9e61 < x < -3.3000000000000002e53 or 2.2e-182 < x Initial program 71.3%
associate-*r/80.2%
*-commutative80.2%
distribute-rgt1-in71.3%
fma-def80.2%
cube-unmult80.2%
Simplified80.2%
Taylor expanded in y around inf 34.6%
unpow234.6%
Simplified34.6%
*-un-lft-identity34.6%
times-frac38.9%
inv-pow38.9%
Applied egg-rr38.9%
unpow-138.9%
Simplified38.9%
if -1 < x < -2.0500000000000001e-156Initial program 86.5%
Taylor expanded in y around 0 39.4%
*-commutative39.4%
unpow239.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around 0 53.0%
neg-mul-153.0%
unsub-neg53.0%
Simplified53.0%
if -2.0500000000000001e-156 < x < 2.2e-182Initial program 58.7%
times-frac72.0%
/-rgt-identity72.0%
associate-/l/72.0%
*-lft-identity72.0%
associate-+l+72.0%
Simplified72.0%
Taylor expanded in x around 0 83.9%
distribute-rgt-in83.9%
*-lft-identity83.9%
Simplified83.9%
Taylor expanded in y around 0 78.2%
Final simplification62.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= x -1.6e+162)
(/ (/ y (+ y (+ x 1.0))) (+ x y))
(if (<= x -5.5e-8)
(* (/ y x) (/ x (* (+ x y) (+ x y))))
(if (<= x 1.82e-211) (* t_0 (/ y (+ x y))) (/ t_0 (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.6e+162) {
tmp = (y / (y + (x + 1.0))) / (x + y);
} else if (x <= -5.5e-8) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else if (x <= 1.82e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (x <= (-1.6d+162)) then
tmp = (y / (y + (x + 1.0d0))) / (x + y)
else if (x <= (-5.5d-8)) then
tmp = (y / x) * (x / ((x + y) * (x + y)))
else if (x <= 1.82d-211) then
tmp = t_0 * (y / (x + y))
else
tmp = t_0 / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.6e+162) {
tmp = (y / (y + (x + 1.0))) / (x + y);
} else if (x <= -5.5e-8) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else if (x <= 1.82e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = t_0 / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if x <= -1.6e+162: tmp = (y / (y + (x + 1.0))) / (x + y) elif x <= -5.5e-8: tmp = (y / x) * (x / ((x + y) * (x + y))) elif x <= 1.82e-211: tmp = t_0 * (y / (x + y)) else: tmp = t_0 / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -1.6e+162) tmp = Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(x + y)); elseif (x <= -5.5e-8) tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(x + y) * Float64(x + y)))); elseif (x <= 1.82e-211) tmp = Float64(t_0 * Float64(y / Float64(x + y))); else tmp = Float64(t_0 / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (x <= -1.6e+162)
tmp = (y / (y + (x + 1.0))) / (x + y);
elseif (x <= -5.5e-8)
tmp = (y / x) * (x / ((x + y) * (x + y)));
elseif (x <= 1.82e-211)
tmp = t_0 * (y / (x + y));
else
tmp = t_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_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+162], N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e-8], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.82e-211], N[(t$95$0 * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+162}:\\
\;\;\;\;\frac{\frac{y}{y + \left(x + 1\right)}}{x + y}\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-8}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;x \leq 1.82 \cdot 10^{-211}:\\
\;\;\;\;t_0 \cdot \frac{y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y + 1}\\
\end{array}
\end{array}
if x < -1.6000000000000001e162Initial program 57.8%
times-frac71.6%
associate-+r+71.6%
associate-*l/71.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 87.2%
if -1.6000000000000001e162 < x < -5.5000000000000003e-8Initial program 69.5%
times-frac92.7%
/-rgt-identity92.7%
associate-/l/92.7%
*-lft-identity92.7%
associate-+l+92.7%
Simplified92.7%
Taylor expanded in x around inf 88.1%
if -5.5000000000000003e-8 < x < 1.82e-211Initial program 63.7%
times-frac78.3%
associate-+r+78.3%
associate-*l/63.7%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 93.1%
if 1.82e-211 < x Initial program 73.2%
associate-*r/81.4%
*-commutative81.4%
distribute-rgt1-in72.2%
fma-def81.4%
cube-unmult81.4%
Simplified81.4%
associate-*r/73.2%
fma-udef66.1%
cube-mult66.1%
distribute-rgt1-in73.2%
associate-+r+73.2%
*-commutative73.2%
frac-times91.2%
*-commutative91.2%
clear-num91.2%
associate-/r*99.7%
frac-times99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in x around 0 47.0%
+-commutative47.0%
Simplified47.0%
Final simplification73.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= x -1.76e+162)
(* t_0 (/ (/ y x) (+ x y)))
(if (<= x -0.07)
(* (/ y x) (/ x (* (+ x y) (+ x y))))
(if (<= x 2.25e-211) (* t_0 (/ y (+ x y))) (/ t_0 (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.76e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -0.07) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else if (x <= 2.25e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = x / (x + y)
if (x <= (-1.76d+162)) then
tmp = t_0 * ((y / x) / (x + y))
else if (x <= (-0.07d0)) then
tmp = (y / x) * (x / ((x + y) * (x + y)))
else if (x <= 2.25d-211) then
tmp = t_0 * (y / (x + y))
else
tmp = t_0 / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -1.76e+162) {
tmp = t_0 * ((y / x) / (x + y));
} else if (x <= -0.07) {
tmp = (y / x) * (x / ((x + y) * (x + y)));
} else if (x <= 2.25e-211) {
tmp = t_0 * (y / (x + y));
} else {
tmp = t_0 / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = x / (x + y) tmp = 0 if x <= -1.76e+162: tmp = t_0 * ((y / x) / (x + y)) elif x <= -0.07: tmp = (y / x) * (x / ((x + y) * (x + y))) elif x <= 2.25e-211: tmp = t_0 * (y / (x + y)) else: tmp = t_0 / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -1.76e+162) tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(x + y))); elseif (x <= -0.07) tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(x + y) * Float64(x + y)))); elseif (x <= 2.25e-211) tmp = Float64(t_0 * Float64(y / Float64(x + y))); else tmp = Float64(t_0 / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = x / (x + y);
tmp = 0.0;
if (x <= -1.76e+162)
tmp = t_0 * ((y / x) / (x + y));
elseif (x <= -0.07)
tmp = (y / x) * (x / ((x + y) * (x + y)));
elseif (x <= 2.25e-211)
tmp = t_0 * (y / (x + y));
else
tmp = t_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_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.76e+162], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -0.07], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.25e-211], N[(t$95$0 * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -1.76 \cdot 10^{+162}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -0.07:\\
\;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-211}:\\
\;\;\;\;t_0 \cdot \frac{y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y + 1}\\
\end{array}
\end{array}
if x < -1.76e162Initial program 57.8%
times-frac71.6%
associate-+r+71.6%
associate-*l/71.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 87.2%
if -1.76e162 < x < -0.070000000000000007Initial program 69.5%
times-frac92.7%
/-rgt-identity92.7%
associate-/l/92.7%
*-lft-identity92.7%
associate-+l+92.7%
Simplified92.7%
Taylor expanded in x around inf 88.1%
if -0.070000000000000007 < x < 2.2499999999999999e-211Initial program 63.0%
times-frac77.4%
associate-+r+77.4%
associate-*l/63.0%
times-frac100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 93.1%
if 2.2499999999999999e-211 < x Initial program 73.9%
associate-*r/82.2%
*-commutative82.2%
distribute-rgt1-in72.9%
fma-def82.2%
cube-unmult82.2%
Simplified82.2%
associate-*r/74.0%
fma-udef66.8%
cube-mult66.8%
distribute-rgt1-in73.9%
associate-+r+73.9%
*-commutative73.9%
frac-times92.1%
*-commutative92.1%
clear-num92.1%
associate-/r*99.7%
frac-times99.0%
*-un-lft-identity99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Applied egg-rr99.0%
Taylor expanded in x around 0 47.5%
+-commutative47.5%
Simplified47.5%
Final simplification73.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (* (/ x (+ x y)) (/ (/ y (+ y (+ x 1.0))) (+ x y))))
assert(x < y);
double code(double x, double y) {
return (x / (x + y)) * ((y / (y + (x + 1.0))) / (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 / (x + y)) * ((y / (y + (x + 1.0d0))) / (x + y))
end function
assert x < y;
public static double code(double x, double y) {
return (x / (x + y)) * ((y / (y + (x + 1.0))) / (x + y));
}
[x, y] = sort([x, y]) def code(x, y): return (x / (x + y)) * ((y / (y + (x + 1.0))) / (x + y))
x, y = sort([x, y]) function code(x, y) return Float64(Float64(x / Float64(x + y)) * Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(x + y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = (x / (x + y)) * ((y / (y + (x + 1.0))) / (x + y));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{x + y} \cdot \frac{\frac{y}{y + \left(x + 1\right)}}{x + y}
\end{array}
Initial program 67.4%
times-frac84.4%
associate-+r+84.4%
associate-*l/78.3%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (/ y x) (/ 1.0 x))))
(if (<= x -3.8e+62)
t_0
(if (<= x -2.1e+57)
(* (/ 1.0 y) (/ x y))
(if (<= x -1.0)
t_0
(if (<= x -1.26e-146) (- (/ y x) y) (/ x (+ y (* y y)))))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / x) * (1.0 / x);
double tmp;
if (x <= -3.8e+62) {
tmp = t_0;
} else if (x <= -2.1e+57) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.0) {
tmp = t_0;
} else if (x <= -1.26e-146) {
tmp = (y / x) - y;
} else {
tmp = x / (y + (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) :: tmp
t_0 = (y / x) * (1.0d0 / x)
if (x <= (-3.8d+62)) then
tmp = t_0
else if (x <= (-2.1d+57)) then
tmp = (1.0d0 / y) * (x / y)
else if (x <= (-1.0d0)) then
tmp = t_0
else if (x <= (-1.26d-146)) then
tmp = (y / x) - y
else
tmp = x / (y + (y * y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / x) * (1.0 / x);
double tmp;
if (x <= -3.8e+62) {
tmp = t_0;
} else if (x <= -2.1e+57) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.0) {
tmp = t_0;
} else if (x <= -1.26e-146) {
tmp = (y / x) - y;
} else {
tmp = x / (y + (y * y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / x) * (1.0 / x) tmp = 0 if x <= -3.8e+62: tmp = t_0 elif x <= -2.1e+57: tmp = (1.0 / y) * (x / y) elif x <= -1.0: tmp = t_0 elif x <= -1.26e-146: tmp = (y / x) - y else: tmp = x / (y + (y * y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / x) * Float64(1.0 / x)) tmp = 0.0 if (x <= -3.8e+62) tmp = t_0; elseif (x <= -2.1e+57) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); elseif (x <= -1.0) tmp = t_0; elseif (x <= -1.26e-146) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / Float64(y + Float64(y * y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / x) * (1.0 / x);
tmp = 0.0;
if (x <= -3.8e+62)
tmp = t_0;
elseif (x <= -2.1e+57)
tmp = (1.0 / y) * (x / y);
elseif (x <= -1.0)
tmp = t_0;
elseif (x <= -1.26e-146)
tmp = (y / x) - y;
else
tmp = x / (y + (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[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+62], t$95$0, If[LessEqual[x, -2.1e+57], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.0], t$95$0, If[LessEqual[x, -1.26e-146], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{+57}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{-146}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\end{array}
\end{array}
if x < -3.79999999999999984e62 or -2.09999999999999991e57 < x < -1Initial program 64.2%
times-frac82.9%
/-rgt-identity82.9%
associate-/l/82.9%
*-lft-identity82.9%
associate-+l+82.9%
Simplified82.9%
Taylor expanded in x around inf 81.2%
Taylor expanded in x around inf 79.9%
if -3.79999999999999984e62 < x < -2.09999999999999991e57Initial program 7.9%
associate-*r/7.9%
*-commutative7.9%
distribute-rgt1-in7.9%
fma-def7.9%
cube-unmult7.9%
Simplified7.9%
Taylor expanded in y around inf 7.9%
unpow27.9%
Simplified7.9%
*-un-lft-identity7.9%
times-frac100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -1 < x < -1.2599999999999999e-146Initial program 85.8%
Taylor expanded in y around 0 40.9%
*-commutative40.9%
unpow240.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in x around 0 55.1%
neg-mul-155.1%
unsub-neg55.1%
Simplified55.1%
if -1.2599999999999999e-146 < x Initial program 66.6%
times-frac83.4%
/-rgt-identity83.4%
associate-/l/83.4%
*-lft-identity83.4%
associate-+l+83.4%
Simplified83.4%
Taylor expanded in x around 0 58.4%
distribute-rgt-in58.4%
*-lft-identity58.4%
Simplified58.4%
Final simplification64.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -8.2e+62)
(/ (/ y x) (+ x y))
(if (<= x -2.4e+57)
(* (/ 1.0 y) (/ x y))
(if (<= x -1.26e-146)
(/ (/ y x) (+ x 1.0))
(/ (/ x (+ x y)) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -8.2e+62) {
tmp = (y / x) / (x + y);
} else if (x <= -2.4e+57) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (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 <= (-8.2d+62)) then
tmp = (y / x) / (x + y)
else if (x <= (-2.4d+57)) then
tmp = (1.0d0 / y) * (x / y)
else if (x <= (-1.26d-146)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / (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 <= -8.2e+62) {
tmp = (y / x) / (x + y);
} else if (x <= -2.4e+57) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -8.2e+62: tmp = (y / x) / (x + y) elif x <= -2.4e+57: tmp = (1.0 / y) * (x / y) elif x <= -1.26e-146: tmp = (y / x) / (x + 1.0) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -8.2e+62) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -2.4e+57) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); elseif (x <= -1.26e-146) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / 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 <= -8.2e+62)
tmp = (y / x) / (x + y);
elseif (x <= -2.4e+57)
tmp = (1.0 / y) * (x / y);
elseif (x <= -1.26e-146)
tmp = (y / x) / (x + 1.0);
else
tmp = (x / (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, -8.2e+62], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.4e+57], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.26e-146], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{+57}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{-146}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -8.19999999999999967e62Initial program 61.0%
times-frac79.9%
associate-+r+79.9%
associate-*l/80.0%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.8%
clear-num99.7%
frac-times97.4%
metadata-eval97.4%
div-inv97.4%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 84.2%
if -8.19999999999999967e62 < x < -2.40000000000000005e57Initial program 7.9%
associate-*r/7.9%
*-commutative7.9%
distribute-rgt1-in7.9%
fma-def7.9%
cube-unmult7.9%
Simplified7.9%
Taylor expanded in y around inf 7.9%
unpow27.9%
Simplified7.9%
*-un-lft-identity7.9%
times-frac100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -2.40000000000000005e57 < x < -1.2599999999999999e-146Initial program 84.7%
times-frac99.6%
associate-+r+99.6%
associate-*l/90.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.6%
clear-num99.6%
frac-times99.7%
metadata-eval99.7%
div-inv99.8%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 58.1%
*-commutative58.1%
distribute-lft-in58.1%
*-rgt-identity58.1%
Simplified58.1%
*-un-lft-identity58.1%
distribute-rgt1-in58.1%
times-frac58.2%
Applied egg-rr58.2%
associate-*l/58.1%
*-lft-identity58.1%
Simplified58.1%
if -1.2599999999999999e-146 < x Initial program 66.6%
associate-*r/77.4%
*-commutative77.4%
distribute-rgt1-in66.6%
fma-def77.3%
cube-unmult77.4%
Simplified77.4%
associate-*r/66.6%
fma-udef57.2%
cube-mult57.2%
distribute-rgt1-in66.6%
associate-+r+66.6%
*-commutative66.6%
frac-times83.4%
*-commutative83.4%
clear-num83.4%
associate-/r*99.7%
frac-times99.4%
*-un-lft-identity99.4%
+-commutative99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in x around 0 60.7%
+-commutative60.7%
Simplified60.7%
Final simplification66.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.1e+63)
(/ (/ y x) (+ x y))
(if (<= x -1.3e+56)
(* (/ 1.0 y) (/ x y))
(if (<= x -1.26e-146)
(/ (/ y (+ x 1.0)) (+ x y))
(/ (/ x (+ x y)) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.1e+63) {
tmp = (y / x) / (x + y);
} else if (x <= -1.3e+56) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (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 <= (-1.1d+63)) then
tmp = (y / x) / (x + y)
else if (x <= (-1.3d+56)) then
tmp = (1.0d0 / y) * (x / y)
else if (x <= (-1.26d-146)) then
tmp = (y / (x + 1.0d0)) / (x + y)
else
tmp = (x / (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 <= -1.1e+63) {
tmp = (y / x) / (x + y);
} else if (x <= -1.3e+56) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.1e+63: tmp = (y / x) / (x + y) elif x <= -1.3e+56: tmp = (1.0 / y) * (x / y) elif x <= -1.26e-146: tmp = (y / (x + 1.0)) / (x + y) else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.1e+63) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -1.3e+56) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); elseif (x <= -1.26e-146) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); else tmp = Float64(Float64(x / 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 <= -1.1e+63)
tmp = (y / x) / (x + y);
elseif (x <= -1.3e+56)
tmp = (1.0 / y) * (x / y);
elseif (x <= -1.26e-146)
tmp = (y / (x + 1.0)) / (x + y);
else
tmp = (x / (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, -1.1e+63], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.3e+56], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.26e-146], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+63}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{+56}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{-146}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.0999999999999999e63Initial program 61.0%
times-frac79.9%
associate-+r+79.9%
associate-*l/80.0%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.8%
clear-num99.7%
frac-times97.4%
metadata-eval97.4%
div-inv97.4%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 84.2%
if -1.0999999999999999e63 < x < -1.30000000000000005e56Initial program 7.9%
associate-*r/7.9%
*-commutative7.9%
distribute-rgt1-in7.9%
fma-def7.9%
cube-unmult7.9%
Simplified7.9%
Taylor expanded in y around inf 7.9%
unpow27.9%
Simplified7.9%
*-un-lft-identity7.9%
times-frac100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -1.30000000000000005e56 < x < -1.2599999999999999e-146Initial program 84.7%
times-frac99.6%
associate-+r+99.6%
associate-*l/90.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.6%
clear-num99.6%
frac-times99.7%
metadata-eval99.7%
div-inv99.8%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 58.6%
+-commutative58.6%
Simplified58.6%
if -1.2599999999999999e-146 < x Initial program 66.6%
associate-*r/77.4%
*-commutative77.4%
distribute-rgt1-in66.6%
fma-def77.3%
cube-unmult77.4%
Simplified77.4%
associate-*r/66.6%
fma-udef57.2%
cube-mult57.2%
distribute-rgt1-in66.6%
associate-+r+66.6%
*-commutative66.6%
frac-times83.4%
*-commutative83.4%
clear-num83.4%
associate-/r*99.7%
frac-times99.4%
*-un-lft-identity99.4%
+-commutative99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in x around 0 60.7%
+-commutative60.7%
Simplified60.7%
Final simplification66.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ y (+ x (+ y 1.0))) x)))
(if (<= x -7.8e+62)
t_0
(if (<= x -2.2e+53)
(* (/ 1.0 y) (/ x y))
(if (<= x -1.26e-146) t_0 (/ (/ x (+ x y)) (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / (x + (y + 1.0))) / x;
double tmp;
if (x <= -7.8e+62) {
tmp = t_0;
} else if (x <= -2.2e+53) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = t_0;
} else {
tmp = (x / (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) :: t_0
real(8) :: tmp
t_0 = (y / (x + (y + 1.0d0))) / x
if (x <= (-7.8d+62)) then
tmp = t_0
else if (x <= (-2.2d+53)) then
tmp = (1.0d0 / y) * (x / y)
else if (x <= (-1.26d-146)) then
tmp = t_0
else
tmp = (x / (x + y)) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / (x + (y + 1.0))) / x;
double tmp;
if (x <= -7.8e+62) {
tmp = t_0;
} else if (x <= -2.2e+53) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = t_0;
} else {
tmp = (x / (x + y)) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / (x + (y + 1.0))) / x tmp = 0 if x <= -7.8e+62: tmp = t_0 elif x <= -2.2e+53: tmp = (1.0 / y) * (x / y) elif x <= -1.26e-146: tmp = t_0 else: tmp = (x / (x + y)) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / x) tmp = 0.0 if (x <= -7.8e+62) tmp = t_0; elseif (x <= -2.2e+53) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); elseif (x <= -1.26e-146) tmp = t_0; else tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / (x + (y + 1.0))) / x;
tmp = 0.0;
if (x <= -7.8e+62)
tmp = t_0;
elseif (x <= -2.2e+53)
tmp = (1.0 / y) * (x / y);
elseif (x <= -1.26e-146)
tmp = t_0;
else
tmp = (x / (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_] := Block[{t$95$0 = N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[x, -7.8e+62], t$95$0, If[LessEqual[x, -2.2e+53], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.26e-146], t$95$0, N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x + \left(y + 1\right)}}{x}\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{+53}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{-146}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\
\end{array}
\end{array}
if x < -7.8e62 or -2.19999999999999999e53 < x < -1.2599999999999999e-146Initial program 69.2%
times-frac86.7%
/-rgt-identity86.7%
associate-/l/86.7%
*-lft-identity86.7%
associate-+l+86.7%
Simplified86.7%
Taylor expanded in x around inf 75.1%
associate-*l/75.2%
*-un-lft-identity75.2%
Applied egg-rr75.2%
if -7.8e62 < x < -2.19999999999999999e53Initial program 7.9%
associate-*r/7.9%
*-commutative7.9%
distribute-rgt1-in7.9%
fma-def7.9%
cube-unmult7.9%
Simplified7.9%
Taylor expanded in y around inf 7.9%
unpow27.9%
Simplified7.9%
*-un-lft-identity7.9%
times-frac100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -1.2599999999999999e-146 < x Initial program 66.6%
associate-*r/77.4%
*-commutative77.4%
distribute-rgt1-in66.6%
fma-def77.3%
cube-unmult77.4%
Simplified77.4%
associate-*r/66.6%
fma-udef57.2%
cube-mult57.2%
distribute-rgt1-in66.6%
associate-+r+66.6%
*-commutative66.6%
frac-times83.4%
*-commutative83.4%
clear-num83.4%
associate-/r*99.7%
frac-times99.4%
*-un-lft-identity99.4%
+-commutative99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in x around 0 60.7%
+-commutative60.7%
Simplified60.7%
Final simplification66.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (/ y x) y)))
(if (<= y 3.2e-272)
t_0
(if (<= y 6.4e-207)
(/ x y)
(if (<= y 5.2e-168)
t_0
(if (<= y 0.75) (- (/ x y) x) (/ x (* y y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / x) - y;
double tmp;
if (y <= 3.2e-272) {
tmp = t_0;
} else if (y <= 6.4e-207) {
tmp = x / y;
} else if (y <= 5.2e-168) {
tmp = t_0;
} else if (y <= 0.75) {
tmp = (x / y) - x;
} 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) :: t_0
real(8) :: tmp
t_0 = (y / x) - y
if (y <= 3.2d-272) then
tmp = t_0
else if (y <= 6.4d-207) then
tmp = x / y
else if (y <= 5.2d-168) then
tmp = t_0
else if (y <= 0.75d0) then
tmp = (x / y) - x
else
tmp = x / (y * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / x) - y;
double tmp;
if (y <= 3.2e-272) {
tmp = t_0;
} else if (y <= 6.4e-207) {
tmp = x / y;
} else if (y <= 5.2e-168) {
tmp = t_0;
} else if (y <= 0.75) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / x) - y tmp = 0 if y <= 3.2e-272: tmp = t_0 elif y <= 6.4e-207: tmp = x / y elif y <= 5.2e-168: tmp = t_0 elif y <= 0.75: tmp = (x / y) - x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / x) - y) tmp = 0.0 if (y <= 3.2e-272) tmp = t_0; elseif (y <= 6.4e-207) tmp = Float64(x / y); elseif (y <= 5.2e-168) tmp = t_0; elseif (y <= 0.75) tmp = Float64(Float64(x / y) - x); else tmp = Float64(x / Float64(y * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / x) - y;
tmp = 0.0;
if (y <= 3.2e-272)
tmp = t_0;
elseif (y <= 6.4e-207)
tmp = x / y;
elseif (y <= 5.2e-168)
tmp = t_0;
elseif (y <= 0.75)
tmp = (x / y) - x;
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_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[y, 3.2e-272], t$95$0, If[LessEqual[y, 6.4e-207], N[(x / y), $MachinePrecision], If[LessEqual[y, 5.2e-168], t$95$0, If[LessEqual[y, 0.75], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x} - y\\
\mathbf{if}\;y \leq 3.2 \cdot 10^{-272}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-207}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-168}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 3.2e-272 or 6.4000000000000006e-207 < y < 5.2000000000000002e-168Initial program 69.6%
Taylor expanded in y around 0 41.6%
*-commutative41.6%
unpow241.6%
+-commutative41.6%
Simplified41.6%
Taylor expanded in x around 0 18.2%
neg-mul-118.2%
unsub-neg18.2%
Simplified18.2%
if 3.2e-272 < y < 6.4000000000000006e-207Initial program 40.7%
times-frac60.7%
/-rgt-identity60.7%
associate-/l/60.7%
*-lft-identity60.7%
associate-+l+60.7%
Simplified60.7%
Taylor expanded in x around 0 18.5%
distribute-rgt-in18.5%
*-lft-identity18.5%
Simplified18.5%
Taylor expanded in y around 0 18.5%
if 5.2000000000000002e-168 < y < 0.75Initial program 85.4%
times-frac96.8%
/-rgt-identity96.8%
associate-/l/96.8%
*-lft-identity96.8%
associate-+l+96.8%
Simplified96.8%
Taylor expanded in x around 0 37.3%
distribute-rgt-in37.3%
*-lft-identity37.3%
Simplified37.3%
Taylor expanded in y around 0 37.3%
neg-mul-137.3%
unsub-neg37.3%
Simplified37.3%
if 0.75 < y Initial program 56.2%
associate-*r/69.8%
*-commutative69.8%
distribute-rgt1-in63.2%
fma-def69.8%
cube-unmult69.8%
Simplified69.8%
Taylor expanded in y around inf 62.2%
unpow262.2%
Simplified62.2%
Final simplification31.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -5.5e-157)
(- (/ y x) y)
(if (<= x 1.35e-179) (/ x y) (* x (/ 1.0 (* y y)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -5.5e-157) {
tmp = (y / x) - y;
} else if (x <= 1.35e-179) {
tmp = x / y;
} else {
tmp = x * (1.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) :: tmp
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-5.5d-157)) then
tmp = (y / x) - y
else if (x <= 1.35d-179) then
tmp = x / y
else
tmp = x * (1.0d0 / (y * y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -5.5e-157) {
tmp = (y / x) - y;
} else if (x <= 1.35e-179) {
tmp = x / y;
} else {
tmp = x * (1.0 / (y * y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -5.5e-157: tmp = (y / x) - y elif x <= 1.35e-179: tmp = x / y else: tmp = x * (1.0 / (y * y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -5.5e-157) tmp = Float64(Float64(y / x) - y); elseif (x <= 1.35e-179) tmp = Float64(x / y); else tmp = Float64(x * Float64(1.0 / Float64(y * y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = y / (x * x);
elseif (x <= -5.5e-157)
tmp = (y / x) - y;
elseif (x <= 1.35e-179)
tmp = x / y;
else
tmp = x * (1.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_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e-157], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.35e-179], N[(x / y), $MachinePrecision], N[(x * N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-157}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-179}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{y \cdot y}\\
\end{array}
\end{array}
if x < -1Initial program 63.5%
associate-*r/72.5%
*-commutative72.5%
distribute-rgt1-in32.7%
fma-def72.5%
cube-unmult72.5%
Simplified72.5%
Taylor expanded in x around inf 71.1%
unpow271.1%
Simplified71.1%
if -1 < x < -5.4999999999999998e-157Initial program 87.0%
Taylor expanded in y around 0 37.9%
*-commutative37.9%
unpow237.9%
+-commutative37.9%
Simplified37.9%
Taylor expanded in x around 0 50.8%
neg-mul-150.8%
unsub-neg50.8%
Simplified50.8%
if -5.4999999999999998e-157 < x < 1.34999999999999994e-179Initial program 58.1%
times-frac71.6%
/-rgt-identity71.6%
associate-/l/71.6%
*-lft-identity71.6%
associate-+l+71.6%
Simplified71.6%
Taylor expanded in x around 0 83.7%
distribute-rgt-in83.7%
*-lft-identity83.7%
Simplified83.7%
Taylor expanded in y around 0 77.9%
if 1.34999999999999994e-179 < x Initial program 72.0%
associate-*r/81.0%
*-commutative81.0%
distribute-rgt1-in72.0%
fma-def80.9%
cube-unmult80.9%
Simplified80.9%
Taylor expanded in y around inf 34.9%
unpow234.9%
Simplified34.9%
Final simplification58.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(* (/ y x) (/ 1.0 x))
(if (<= x -1.9e-156)
(- (/ y x) y)
(if (<= x 1.12e-182) (/ x y) (* x (/ 1.0 (* y y)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -1.9e-156) {
tmp = (y / x) - y;
} else if (x <= 1.12e-182) {
tmp = x / y;
} else {
tmp = x * (1.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) :: tmp
if (x <= (-1.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (x <= (-1.9d-156)) then
tmp = (y / x) - y
else if (x <= 1.12d-182) then
tmp = x / y
else
tmp = x * (1.0d0 / (y * y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) * (1.0 / x);
} else if (x <= -1.9e-156) {
tmp = (y / x) - y;
} else if (x <= 1.12e-182) {
tmp = x / y;
} else {
tmp = x * (1.0 / (y * y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) * (1.0 / x) elif x <= -1.9e-156: tmp = (y / x) - y elif x <= 1.12e-182: tmp = x / y else: tmp = x * (1.0 / (y * y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (x <= -1.9e-156) tmp = Float64(Float64(y / x) - y); elseif (x <= 1.12e-182) tmp = Float64(x / y); else tmp = Float64(x * Float64(1.0 / Float64(y * y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.0)
tmp = (y / x) * (1.0 / x);
elseif (x <= -1.9e-156)
tmp = (y / x) - y;
elseif (x <= 1.12e-182)
tmp = x / y;
else
tmp = x * (1.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_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e-156], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.12e-182], N[(x / y), $MachinePrecision], N[(x * N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-156}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{-182}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{y \cdot y}\\
\end{array}
\end{array}
if x < -1Initial program 63.5%
times-frac81.8%
/-rgt-identity81.8%
associate-/l/81.8%
*-lft-identity81.8%
associate-+l+81.8%
Simplified81.8%
Taylor expanded in x around inf 80.2%
Taylor expanded in x around inf 78.8%
if -1 < x < -1.90000000000000004e-156Initial program 87.0%
Taylor expanded in y around 0 37.9%
*-commutative37.9%
unpow237.9%
+-commutative37.9%
Simplified37.9%
Taylor expanded in x around 0 50.8%
neg-mul-150.8%
unsub-neg50.8%
Simplified50.8%
if -1.90000000000000004e-156 < x < 1.11999999999999994e-182Initial program 58.1%
times-frac71.6%
/-rgt-identity71.6%
associate-/l/71.6%
*-lft-identity71.6%
associate-+l+71.6%
Simplified71.6%
Taylor expanded in x around 0 83.7%
distribute-rgt-in83.7%
*-lft-identity83.7%
Simplified83.7%
Taylor expanded in y around 0 77.9%
if 1.11999999999999994e-182 < x Initial program 72.0%
associate-*r/81.0%
*-commutative81.0%
distribute-rgt1-in72.0%
fma-def80.9%
cube-unmult80.9%
Simplified80.9%
Taylor expanded in y around inf 34.9%
unpow234.9%
Simplified34.9%
Final simplification60.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ y x) (+ x 1.0))))
(if (<= x -8.6e+61)
t_0
(if (<= x -1.3e+56)
(* (/ 1.0 y) (/ x y))
(if (<= x -1.26e-146) t_0 (/ x (+ y (* y y))))))))assert(x < y);
double code(double x, double y) {
double t_0 = (y / x) / (x + 1.0);
double tmp;
if (x <= -8.6e+61) {
tmp = t_0;
} else if (x <= -1.3e+56) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = t_0;
} else {
tmp = x / (y + (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) :: tmp
t_0 = (y / x) / (x + 1.0d0)
if (x <= (-8.6d+61)) then
tmp = t_0
else if (x <= (-1.3d+56)) then
tmp = (1.0d0 / y) * (x / y)
else if (x <= (-1.26d-146)) then
tmp = t_0
else
tmp = x / (y + (y * y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (y / x) / (x + 1.0);
double tmp;
if (x <= -8.6e+61) {
tmp = t_0;
} else if (x <= -1.3e+56) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = t_0;
} else {
tmp = x / (y + (y * y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (y / x) / (x + 1.0) tmp = 0 if x <= -8.6e+61: tmp = t_0 elif x <= -1.3e+56: tmp = (1.0 / y) * (x / y) elif x <= -1.26e-146: tmp = t_0 else: tmp = x / (y + (y * y)) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(y / x) / Float64(x + 1.0)) tmp = 0.0 if (x <= -8.6e+61) tmp = t_0; elseif (x <= -1.3e+56) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); elseif (x <= -1.26e-146) tmp = t_0; else tmp = Float64(x / Float64(y + Float64(y * y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (y / x) / (x + 1.0);
tmp = 0.0;
if (x <= -8.6e+61)
tmp = t_0;
elseif (x <= -1.3e+56)
tmp = (1.0 / y) * (x / y);
elseif (x <= -1.26e-146)
tmp = t_0;
else
tmp = x / (y + (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[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.6e+61], t$95$0, If[LessEqual[x, -1.3e+56], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.26e-146], t$95$0, N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x}}{x + 1}\\
\mathbf{if}\;x \leq -8.6 \cdot 10^{+61}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{+56}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{-146}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\end{array}
\end{array}
if x < -8.6000000000000003e61 or -1.30000000000000005e56 < x < -1.2599999999999999e-146Initial program 69.2%
times-frac86.7%
associate-+r+86.7%
associate-*l/83.6%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.7%
clear-num99.7%
frac-times98.2%
metadata-eval98.2%
div-inv98.2%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 68.9%
*-commutative68.9%
distribute-lft-in68.9%
*-rgt-identity68.9%
Simplified68.9%
*-un-lft-identity68.9%
distribute-rgt1-in68.9%
times-frac74.9%
Applied egg-rr74.9%
associate-*l/74.9%
*-lft-identity74.9%
Simplified74.9%
if -8.6000000000000003e61 < x < -1.30000000000000005e56Initial program 7.9%
associate-*r/7.9%
*-commutative7.9%
distribute-rgt1-in7.9%
fma-def7.9%
cube-unmult7.9%
Simplified7.9%
Taylor expanded in y around inf 7.9%
unpow27.9%
Simplified7.9%
*-un-lft-identity7.9%
times-frac100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -1.2599999999999999e-146 < x Initial program 66.6%
times-frac83.4%
/-rgt-identity83.4%
associate-/l/83.4%
*-lft-identity83.4%
associate-+l+83.4%
Simplified83.4%
Taylor expanded in x around 0 58.4%
distribute-rgt-in58.4%
*-lft-identity58.4%
Simplified58.4%
Final simplification64.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -6.5e+62)
(/ (/ y x) (+ x y))
(if (<= x -5.4e+55)
(* (/ 1.0 y) (/ x y))
(if (<= x -1.26e-146) (/ (/ y x) (+ x 1.0)) (/ x (+ y (* y y)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -6.5e+62) {
tmp = (y / x) / (x + y);
} else if (x <= -5.4e+55) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = x / (y + (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 (x <= (-6.5d+62)) then
tmp = (y / x) / (x + y)
else if (x <= (-5.4d+55)) then
tmp = (1.0d0 / y) * (x / y)
else if (x <= (-1.26d-146)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = x / (y + (y * y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -6.5e+62) {
tmp = (y / x) / (x + y);
} else if (x <= -5.4e+55) {
tmp = (1.0 / y) * (x / y);
} else if (x <= -1.26e-146) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = x / (y + (y * y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -6.5e+62: tmp = (y / x) / (x + y) elif x <= -5.4e+55: tmp = (1.0 / y) * (x / y) elif x <= -1.26e-146: tmp = (y / x) / (x + 1.0) else: tmp = x / (y + (y * y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -6.5e+62) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -5.4e+55) tmp = Float64(Float64(1.0 / y) * Float64(x / y)); elseif (x <= -1.26e-146) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(x / Float64(y + Float64(y * y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -6.5e+62)
tmp = (y / x) / (x + y);
elseif (x <= -5.4e+55)
tmp = (1.0 / y) * (x / y);
elseif (x <= -1.26e-146)
tmp = (y / x) / (x + 1.0);
else
tmp = x / (y + (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[x, -6.5e+62], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.4e+55], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.26e-146], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{+55}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{-146}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\end{array}
\end{array}
if x < -6.5000000000000003e62Initial program 61.0%
times-frac79.9%
associate-+r+79.9%
associate-*l/80.0%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.8%
clear-num99.7%
frac-times97.4%
metadata-eval97.4%
div-inv97.4%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 84.2%
if -6.5000000000000003e62 < x < -5.39999999999999954e55Initial program 7.9%
associate-*r/7.9%
*-commutative7.9%
distribute-rgt1-in7.9%
fma-def7.9%
cube-unmult7.9%
Simplified7.9%
Taylor expanded in y around inf 7.9%
unpow27.9%
Simplified7.9%
*-un-lft-identity7.9%
times-frac100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -5.39999999999999954e55 < x < -1.2599999999999999e-146Initial program 84.7%
times-frac99.6%
associate-+r+99.6%
associate-*l/90.4%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
div-inv99.6%
clear-num99.6%
frac-times99.7%
metadata-eval99.7%
div-inv99.8%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 58.1%
*-commutative58.1%
distribute-lft-in58.1%
*-rgt-identity58.1%
Simplified58.1%
*-un-lft-identity58.1%
distribute-rgt1-in58.1%
times-frac58.2%
Applied egg-rr58.2%
associate-*l/58.1%
*-lft-identity58.1%
Simplified58.1%
if -1.2599999999999999e-146 < x Initial program 66.6%
times-frac83.4%
/-rgt-identity83.4%
associate-/l/83.4%
*-lft-identity83.4%
associate-+l+83.4%
Simplified83.4%
Taylor expanded in x around 0 58.4%
distribute-rgt-in58.4%
*-lft-identity58.4%
Simplified58.4%
Final simplification64.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -1.7e-157)
(- (/ y x) y)
(if (<= x 3e-180) (/ x y) (/ x (* y y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -1.7e-157) {
tmp = (y / x) - y;
} else if (x <= 3e-180) {
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 (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-1.7d-157)) then
tmp = (y / x) - y
else if (x <= 3d-180) 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 (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -1.7e-157) {
tmp = (y / x) - y;
} else if (x <= 3e-180) {
tmp = x / y;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -1.7e-157: tmp = (y / x) - y elif x <= 3e-180: tmp = x / y else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -1.7e-157) tmp = Float64(Float64(y / x) - y); elseif (x <= 3e-180) 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 (x <= -1.0)
tmp = y / (x * x);
elseif (x <= -1.7e-157)
tmp = (y / x) - y;
elseif (x <= 3e-180)
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[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-157], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 3e-180], 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}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-157}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-180}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if x < -1Initial program 63.5%
associate-*r/72.5%
*-commutative72.5%
distribute-rgt1-in32.7%
fma-def72.5%
cube-unmult72.5%
Simplified72.5%
Taylor expanded in x around inf 71.1%
unpow271.1%
Simplified71.1%
if -1 < x < -1.69999999999999989e-157Initial program 87.0%
Taylor expanded in y around 0 37.9%
*-commutative37.9%
unpow237.9%
+-commutative37.9%
Simplified37.9%
Taylor expanded in x around 0 50.8%
neg-mul-150.8%
unsub-neg50.8%
Simplified50.8%
if -1.69999999999999989e-157 < x < 3.0000000000000001e-180Initial program 58.1%
times-frac71.6%
/-rgt-identity71.6%
associate-/l/71.6%
*-lft-identity71.6%
associate-+l+71.6%
Simplified71.6%
Taylor expanded in x around 0 83.7%
distribute-rgt-in83.7%
*-lft-identity83.7%
Simplified83.7%
Taylor expanded in y around 0 77.9%
if 3.0000000000000001e-180 < x Initial program 72.0%
associate-*r/81.0%
*-commutative81.0%
distribute-rgt1-in72.0%
fma-def80.9%
cube-unmult80.9%
Simplified80.9%
Taylor expanded in y around inf 34.9%
unpow234.9%
Simplified34.9%
Final simplification58.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -580.0) (* (/ y x) (/ 1.0 x)) (if (<= y 47000000.0) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ x y)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -580.0) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 47000000.0) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / 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 (y <= (-580.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 47000000.0d0) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (x + y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -580.0) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 47000000.0) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (x + y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -580.0: tmp = (y / x) * (1.0 / x) elif y <= 47000000.0: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (x + y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -580.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 47000000.0) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(x + y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -580.0)
tmp = (y / x) * (1.0 / x);
elseif (y <= 47000000.0)
tmp = y / (x * (x + 1.0));
else
tmp = (x / 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[y, -580.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 47000000.0], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -580:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 47000000:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + y}\\
\end{array}
\end{array}
if y < -580Initial program 65.5%
times-frac84.4%
/-rgt-identity84.4%
associate-/l/84.4%
*-lft-identity84.4%
associate-+l+84.4%
Simplified84.4%
Taylor expanded in x around inf 30.9%
Taylor expanded in x around inf 29.9%
if -580 < y < 4.7e7Initial program 73.5%
times-frac86.2%
/-rgt-identity86.2%
associate-/l/86.2%
*-lft-identity86.2%
associate-+l+86.2%
Simplified86.2%
Taylor expanded in y around 0 72.7%
if 4.7e7 < y Initial program 54.7%
times-frac80.0%
associate-+r+80.0%
associate-*l/80.1%
times-frac99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
div-inv99.6%
clear-num99.6%
frac-times98.9%
metadata-eval98.9%
div-inv98.9%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 72.4%
Final simplification62.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y -1150.0) (* (/ y x) (/ 1.0 x)) (if (<= y 43000000.0) (/ y (* x (+ x 1.0))) (/ (/ x (+ x y)) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= -1150.0) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 43000000.0) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (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 <= (-1150.0d0)) then
tmp = (y / x) * (1.0d0 / x)
else if (y <= 43000000.0d0) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / (x + y)) / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (y <= -1150.0) {
tmp = (y / x) * (1.0 / x);
} else if (y <= 43000000.0) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (x + y)) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= -1150.0: tmp = (y / x) * (1.0 / x) elif y <= 43000000.0: tmp = y / (x * (x + 1.0)) else: tmp = (x / (x + y)) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= -1150.0) tmp = Float64(Float64(y / x) * Float64(1.0 / x)); elseif (y <= 43000000.0) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(x + y)) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= -1150.0)
tmp = (y / x) * (1.0 / x);
elseif (y <= 43000000.0)
tmp = y / (x * (x + 1.0));
else
tmp = (x / (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, -1150.0], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 43000000.0], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1150:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 43000000:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\
\end{array}
\end{array}
if y < -1150Initial program 65.5%
times-frac84.4%
/-rgt-identity84.4%
associate-/l/84.4%
*-lft-identity84.4%
associate-+l+84.4%
Simplified84.4%
Taylor expanded in x around inf 30.9%
Taylor expanded in x around inf 29.9%
if -1150 < y < 4.3e7Initial program 73.5%
times-frac86.2%
/-rgt-identity86.2%
associate-/l/86.2%
*-lft-identity86.2%
associate-+l+86.2%
Simplified86.2%
Taylor expanded in y around 0 72.7%
if 4.3e7 < y Initial program 54.7%
associate-*r/68.8%
*-commutative68.8%
distribute-rgt1-in63.7%
fma-def68.8%
cube-unmult68.8%
Simplified68.8%
associate-*r/54.7%
fma-udef52.8%
cube-mult52.8%
distribute-rgt1-in54.7%
associate-+r+54.7%
*-commutative54.7%
frac-times80.0%
*-commutative80.0%
clear-num80.1%
associate-/r*99.7%
frac-times98.9%
*-un-lft-identity98.9%
+-commutative98.9%
+-commutative98.9%
associate-+l+98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in y around -inf 73.5%
mul-1-neg73.5%
unsub-neg73.5%
neg-mul-173.5%
unsub-neg73.5%
distribute-lft-in73.5%
metadata-eval73.5%
neg-mul-173.5%
unsub-neg73.5%
Simplified73.5%
Taylor expanded in y around inf 72.4%
Final simplification62.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.4e-156) (- (/ y x) y) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.4e-156) {
tmp = (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 <= (-1.4d-156)) then
tmp = (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 <= -1.4e-156) {
tmp = (y / x) - y;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.4e-156: tmp = (y / x) - y else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.4e-156) tmp = Float64(Float64(y / 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 <= -1.4e-156)
tmp = (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, -1.4e-156], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-156}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1.4000000000000001e-156Initial program 69.2%
Taylor expanded in y around 0 53.8%
*-commutative53.8%
unpow253.8%
+-commutative53.8%
Simplified53.8%
Taylor expanded in x around 0 15.0%
neg-mul-115.0%
unsub-neg15.0%
Simplified15.0%
if -1.4000000000000001e-156 < x Initial program 66.2%
times-frac83.2%
/-rgt-identity83.2%
associate-/l/83.2%
*-lft-identity83.2%
associate-+l+83.2%
Simplified83.2%
Taylor expanded in x around 0 57.8%
distribute-rgt-in57.8%
*-lft-identity57.8%
Simplified57.8%
Taylor expanded in y around 0 40.7%
Final simplification30.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -1.9) (/ 0.5 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.9) {
tmp = 0.5 / x;
} 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 <= (-1.9d0)) then
tmp = 0.5d0 / x
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 <= -1.9) {
tmp = 0.5 / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.9: tmp = 0.5 / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.9) tmp = Float64(0.5 / x); 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 <= -1.9)
tmp = 0.5 / x;
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, -1.9], N[(0.5 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9:\\
\;\;\;\;\frac{0.5}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1.8999999999999999Initial program 63.5%
associate-*r/72.5%
*-commutative72.5%
distribute-rgt1-in32.7%
fma-def72.5%
cube-unmult72.5%
Simplified72.5%
associate-*r/63.5%
fma-udef31.9%
cube-mult31.9%
distribute-rgt1-in63.5%
associate-+r+63.5%
*-commutative63.5%
frac-times81.8%
*-commutative81.8%
clear-num81.9%
associate-/r*99.7%
frac-times97.8%
*-un-lft-identity97.8%
+-commutative97.8%
+-commutative97.8%
associate-+l+97.8%
+-commutative97.8%
Applied egg-rr97.8%
Taylor expanded in y around -inf 23.6%
mul-1-neg23.6%
unsub-neg23.6%
neg-mul-123.6%
unsub-neg23.6%
distribute-lft-in23.6%
metadata-eval23.6%
neg-mul-123.6%
unsub-neg23.6%
Simplified23.6%
Taylor expanded in x around inf 5.7%
if -1.8999999999999999 < x Initial program 68.9%
times-frac85.4%
/-rgt-identity85.4%
associate-/l/85.4%
*-lft-identity85.4%
associate-+l+85.4%
Simplified85.4%
Taylor expanded in x around 0 57.1%
distribute-rgt-in57.1%
*-lft-identity57.1%
Simplified57.1%
Taylor expanded in y around 0 40.2%
Final simplification30.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 0.5 x))
assert(x < y);
double code(double x, double y) {
return 0.5 / 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 = 0.5d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 0.5 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 0.5 / x
x, y = sort([x, y]) function code(x, y) return Float64(0.5 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 0.5 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(0.5 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{0.5}{x}
\end{array}
Initial program 67.4%
associate-*r/77.9%
*-commutative77.9%
distribute-rgt1-in58.4%
fma-def77.9%
cube-unmult77.9%
Simplified77.9%
associate-*r/67.4%
fma-udef51.2%
cube-mult51.2%
distribute-rgt1-in67.4%
associate-+r+67.4%
*-commutative67.4%
frac-times84.4%
*-commutative84.4%
clear-num84.4%
associate-/r*99.7%
frac-times98.9%
*-un-lft-identity98.9%
+-commutative98.9%
+-commutative98.9%
associate-+l+98.9%
+-commutative98.9%
Applied egg-rr98.9%
Taylor expanded in y around -inf 49.7%
mul-1-neg49.7%
unsub-neg49.7%
neg-mul-149.7%
unsub-neg49.7%
distribute-lft-in49.7%
metadata-eval49.7%
neg-mul-149.7%
unsub-neg49.7%
Simplified49.7%
Taylor expanded in x around inf 4.3%
Final simplification4.3%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2023224
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))