
(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 21 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 (+ 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.9%
times-frac87.9%
associate-+r+87.9%
associate-*l/81.4%
times-frac99.8%
+-commutative99.8%
associate-+r+99.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
(if (<= x -6.2e+157)
(/ (/ (- y) (- (- -1.0 x) y)) (+ x y))
(if (<= x -1.9e+34)
(* (/ x (* (+ x y) (+ x y))) (/ y x))
(if (<= x -2e-97)
(* x (/ y (* (* x x) (+ x (+ 1.0 (* y 3.0))))))
(/ (/ x y) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -6.2e+157) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -2e-97) {
tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.0)))));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-6.2d+157)) then
tmp = (-y / (((-1.0d0) - x) - y)) / (x + y)
else if (x <= (-1.9d+34)) then
tmp = (x / ((x + y) * (x + y))) * (y / x)
else if (x <= (-2d-97)) then
tmp = x * (y / ((x * x) * (x + (1.0d0 + (y * 3.0d0)))))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -6.2e+157) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -2e-97) {
tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.0)))));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -6.2e+157: tmp = (-y / ((-1.0 - x) - y)) / (x + y) elif x <= -1.9e+34: tmp = (x / ((x + y) * (x + y))) * (y / x) elif x <= -2e-97: tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.0))))) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -6.2e+157) tmp = Float64(Float64(Float64(-y) / Float64(Float64(-1.0 - x) - y)) / Float64(x + y)); elseif (x <= -1.9e+34) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / x)); elseif (x <= -2e-97) tmp = Float64(x * Float64(y / Float64(Float64(x * x) * Float64(x + Float64(1.0 + Float64(y * 3.0)))))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -6.2e+157)
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
elseif (x <= -1.9e+34)
tmp = (x / ((x + y) * (x + y))) * (y / x);
elseif (x <= -2e-97)
tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.0)))));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -6.2e+157], N[(N[((-y) / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e+34], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-97], N[(x * N[(y / N[(N[(x * x), $MachinePrecision] * N[(x + N[(1.0 + N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-97}:\\
\;\;\;\;x \cdot \frac{y}{\left(x \cdot x\right) \cdot \left(x + \left(1 + y \cdot 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -6.1999999999999994e157Initial program 53.1%
associate-*r/75.9%
*-commutative75.9%
distribute-rgt1-in1.7%
fma-def75.9%
cube-unmult75.9%
Simplified75.9%
associate-*r/53.1%
fma-udef0.0%
cube-mult0.0%
distribute-rgt1-in53.1%
associate-+r+53.1%
*-commutative53.1%
frac-times75.9%
associate-/r*99.9%
frac-2neg99.9%
frac-times75.9%
+-commutative75.9%
+-commutative75.9%
associate-+r+75.9%
+-commutative75.9%
associate-+l+75.9%
Applied egg-rr75.9%
*-commutative75.9%
*-commutative75.9%
associate-/r*99.9%
distribute-neg-in99.9%
+-commutative99.9%
unsub-neg99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 85.8%
mul-1-neg85.8%
Simplified85.8%
if -6.1999999999999994e157 < x < -1.9000000000000001e34Initial program 56.0%
times-frac95.7%
/-rgt-identity95.7%
associate-/l/95.7%
*-lft-identity95.7%
associate-+l+95.7%
Simplified95.7%
Taylor expanded in x around inf 83.6%
if -1.9000000000000001e34 < x < -2.00000000000000007e-97Initial program 84.8%
associate-*r/96.8%
*-commutative96.8%
distribute-rgt1-in87.4%
fma-def96.8%
cube-unmult96.8%
Simplified96.8%
Taylor expanded in x around inf 66.7%
+-commutative66.7%
cube-mult66.7%
unpow266.7%
distribute-rgt-out66.7%
unpow266.7%
distribute-lft1-in66.7%
metadata-eval66.7%
Simplified66.7%
if -2.00000000000000007e-97 < x Initial program 69.2%
times-frac86.8%
/-rgt-identity86.8%
associate-/l/86.8%
*-lft-identity86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 55.3%
associate-/r*57.7%
+-commutative57.7%
Simplified57.7%
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.2e+157)
(/ (/ (- y) (- (- -1.0 x) y)) (+ x y))
(if (<= x -1.9e+34)
(* (/ x (* (+ x y) (+ x y))) (/ y x))
(if (<= x -1.15e-9)
(* x (/ y (* (* x x) (+ x (+ 1.0 (* y 3.0))))))
(* (/ x (+ x y)) (/ (/ y (+ y 1.0)) (+ x y)))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -6.2e+157) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -1.15e-9) {
tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.0)))));
} else {
tmp = (x / (x + y)) * ((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) :: tmp
if (x <= (-6.2d+157)) then
tmp = (-y / (((-1.0d0) - x) - y)) / (x + y)
else if (x <= (-1.9d+34)) then
tmp = (x / ((x + y) * (x + y))) * (y / x)
else if (x <= (-1.15d-9)) then
tmp = x * (y / ((x * x) * (x + (1.0d0 + (y * 3.0d0)))))
else
tmp = (x / (x + y)) * ((y / (y + 1.0d0)) / (x + y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -6.2e+157) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -1.15e-9) {
tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.0)))));
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -6.2e+157: tmp = (-y / ((-1.0 - x) - y)) / (x + y) elif x <= -1.9e+34: tmp = (x / ((x + y) * (x + y))) * (y / x) elif x <= -1.15e-9: tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.0))))) else: tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -6.2e+157) tmp = Float64(Float64(Float64(-y) / Float64(Float64(-1.0 - x) - y)) / Float64(x + y)); elseif (x <= -1.9e+34) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / x)); elseif (x <= -1.15e-9) tmp = Float64(x * Float64(y / Float64(Float64(x * x) * Float64(x + Float64(1.0 + Float64(y * 3.0)))))); else tmp = Float64(Float64(x / Float64(x + y)) * 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)
tmp = 0.0;
if (x <= -6.2e+157)
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
elseif (x <= -1.9e+34)
tmp = (x / ((x + y) * (x + y))) * (y / x);
elseif (x <= -1.15e-9)
tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.0)))));
else
tmp = (x / (x + y)) * ((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_] := If[LessEqual[x, -6.2e+157], N[(N[((-y) / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e+34], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.15e-9], N[(x * N[(y / N[(N[(x * x), $MachinePrecision] * N[(x + N[(1.0 + N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * 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}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-9}:\\
\;\;\;\;x \cdot \frac{y}{\left(x \cdot x\right) \cdot \left(x + \left(1 + y \cdot 3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -6.1999999999999994e157Initial program 53.1%
associate-*r/75.9%
*-commutative75.9%
distribute-rgt1-in1.7%
fma-def75.9%
cube-unmult75.9%
Simplified75.9%
associate-*r/53.1%
fma-udef0.0%
cube-mult0.0%
distribute-rgt1-in53.1%
associate-+r+53.1%
*-commutative53.1%
frac-times75.9%
associate-/r*99.9%
frac-2neg99.9%
frac-times75.9%
+-commutative75.9%
+-commutative75.9%
associate-+r+75.9%
+-commutative75.9%
associate-+l+75.9%
Applied egg-rr75.9%
*-commutative75.9%
*-commutative75.9%
associate-/r*99.9%
distribute-neg-in99.9%
+-commutative99.9%
unsub-neg99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 85.8%
mul-1-neg85.8%
Simplified85.8%
if -6.1999999999999994e157 < x < -1.9000000000000001e34Initial program 56.0%
times-frac95.7%
/-rgt-identity95.7%
associate-/l/95.7%
*-lft-identity95.7%
associate-+l+95.7%
Simplified95.7%
Taylor expanded in x around inf 83.6%
if -1.9000000000000001e34 < x < -1.15e-9Initial program 84.0%
associate-*r/92.2%
*-commutative92.2%
distribute-rgt1-in83.8%
fma-def92.2%
cube-unmult92.2%
Simplified92.2%
Taylor expanded in x around inf 76.2%
+-commutative76.2%
cube-mult76.2%
unpow276.2%
distribute-rgt-out76.2%
unpow276.2%
distribute-lft1-in76.2%
metadata-eval76.2%
Simplified76.2%
if -1.15e-9 < x Initial program 70.9%
times-frac88.2%
associate-+r+88.2%
associate-*l/79.4%
times-frac99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 83.8%
+-commutative83.8%
Simplified83.8%
Final simplification83.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -3.4e+110)
(/ (/ (- y) (- (- -1.0 x) y)) (+ x y))
(if (<= x -1.02e-16)
(* x (/ y (* (+ x y) (* (+ x y) (+ y (+ x 1.0))))))
(* (/ x (+ x y)) (/ (/ y (+ y 1.0)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -3.4e+110) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (x <= -1.02e-16) {
tmp = x * (y / ((x + y) * ((x + y) * (y + (x + 1.0)))));
} else {
tmp = (x / (x + y)) * ((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) :: tmp
if (x <= (-3.4d+110)) then
tmp = (-y / (((-1.0d0) - x) - y)) / (x + y)
else if (x <= (-1.02d-16)) then
tmp = x * (y / ((x + y) * ((x + y) * (y + (x + 1.0d0)))))
else
tmp = (x / (x + y)) * ((y / (y + 1.0d0)) / (x + y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -3.4e+110) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (x <= -1.02e-16) {
tmp = x * (y / ((x + y) * ((x + y) * (y + (x + 1.0)))));
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -3.4e+110: tmp = (-y / ((-1.0 - x) - y)) / (x + y) elif x <= -1.02e-16: tmp = x * (y / ((x + y) * ((x + y) * (y + (x + 1.0))))) else: tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -3.4e+110) tmp = Float64(Float64(Float64(-y) / Float64(Float64(-1.0 - x) - y)) / Float64(x + y)); elseif (x <= -1.02e-16) tmp = Float64(x * Float64(y / Float64(Float64(x + y) * Float64(Float64(x + y) * Float64(y + Float64(x + 1.0)))))); else tmp = Float64(Float64(x / Float64(x + y)) * 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)
tmp = 0.0;
if (x <= -3.4e+110)
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
elseif (x <= -1.02e-16)
tmp = x * (y / ((x + y) * ((x + y) * (y + (x + 1.0)))));
else
tmp = (x / (x + y)) * ((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_] := If[LessEqual[x, -3.4e+110], N[(N[((-y) / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.02e-16], N[(x * N[(y / N[(N[(x + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * 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}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+110}:\\
\;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\
\mathbf{elif}\;x \leq -1.02 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -3.4000000000000001e110Initial program 47.5%
associate-*r/64.7%
*-commutative64.7%
distribute-rgt1-in9.3%
fma-def64.7%
cube-unmult64.7%
Simplified64.7%
associate-*r/47.5%
fma-udef8.0%
cube-mult8.0%
distribute-rgt1-in47.5%
associate-+r+47.5%
*-commutative47.5%
frac-times79.8%
associate-/r*99.8%
frac-2neg99.8%
frac-times79.9%
+-commutative79.9%
+-commutative79.9%
associate-+r+79.9%
+-commutative79.9%
associate-+l+79.9%
Applied egg-rr79.9%
*-commutative79.9%
*-commutative79.9%
associate-/r*99.8%
distribute-neg-in99.8%
+-commutative99.8%
unsub-neg99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 84.9%
mul-1-neg84.9%
Simplified84.9%
if -3.4000000000000001e110 < x < -1.0200000000000001e-16Initial program 82.3%
associate-*r/91.7%
*-commutative91.7%
distribute-rgt1-in84.6%
fma-def91.8%
cube-unmult91.8%
Simplified91.8%
fma-udef84.6%
cube-mult84.6%
distribute-rgt1-in91.7%
associate-+r+91.7%
*-commutative91.7%
associate-*l*91.7%
+-commutative91.7%
+-commutative91.7%
associate-+r+91.7%
+-commutative91.7%
associate-+l+91.7%
Applied egg-rr91.7%
if -1.0200000000000001e-16 < x Initial program 70.5%
times-frac88.0%
associate-+r+88.0%
associate-*l/79.1%
times-frac99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 83.7%
+-commutative83.7%
Simplified83.7%
Final simplification84.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -6.2e+157)
(/ (/ (- y) (- (- -1.0 x) y)) (+ x y))
(if (<= x -2e-24)
(* (/ x (* (+ x y) (+ x y))) (/ y (+ x (+ y 1.0))))
(* (/ x (+ x y)) (/ (/ y (+ y 1.0)) (+ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -6.2e+157) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (x <= -2e-24) {
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) * ((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) :: tmp
if (x <= (-6.2d+157)) then
tmp = (-y / (((-1.0d0) - x) - y)) / (x + y)
else if (x <= (-2d-24)) then
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0d0)))
else
tmp = (x / (x + y)) * ((y / (y + 1.0d0)) / (x + y))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -6.2e+157) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (x <= -2e-24) {
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -6.2e+157: tmp = (-y / ((-1.0 - x) - y)) / (x + y) elif x <= -2e-24: tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0))) else: tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -6.2e+157) tmp = Float64(Float64(Float64(-y) / Float64(Float64(-1.0 - x) - y)) / Float64(x + y)); elseif (x <= -2e-24) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(x + y)) * 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)
tmp = 0.0;
if (x <= -6.2e+157)
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
elseif (x <= -2e-24)
tmp = (x / ((x + y) * (x + y))) * (y / (x + (y + 1.0)));
else
tmp = (x / (x + y)) * ((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_] := If[LessEqual[x, -6.2e+157], N[(N[((-y) / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-24], 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[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * 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}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{y + 1}}{x + y}\\
\end{array}
\end{array}
if x < -6.1999999999999994e157Initial program 53.1%
associate-*r/75.9%
*-commutative75.9%
distribute-rgt1-in1.7%
fma-def75.9%
cube-unmult75.9%
Simplified75.9%
associate-*r/53.1%
fma-udef0.0%
cube-mult0.0%
distribute-rgt1-in53.1%
associate-+r+53.1%
*-commutative53.1%
frac-times75.9%
associate-/r*99.9%
frac-2neg99.9%
frac-times75.9%
+-commutative75.9%
+-commutative75.9%
associate-+r+75.9%
+-commutative75.9%
associate-+l+75.9%
Applied egg-rr75.9%
*-commutative75.9%
*-commutative75.9%
associate-/r*99.9%
distribute-neg-in99.9%
+-commutative99.9%
unsub-neg99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 85.8%
mul-1-neg85.8%
Simplified85.8%
if -6.1999999999999994e157 < x < -1.99999999999999985e-24Initial program 70.1%
times-frac97.3%
/-rgt-identity97.3%
associate-/l/97.3%
*-lft-identity97.3%
associate-+l+97.3%
Simplified97.3%
if -1.99999999999999985e-24 < x Initial program 70.0%
times-frac87.8%
associate-+r+87.8%
associate-*l/78.7%
times-frac99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 83.5%
+-commutative83.5%
Simplified83.5%
Final simplification86.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= y 2.3e-167)
(/ (/ (- y) (- (- -1.0 x) y)) (+ x y))
(if (<= y 1.12e+140)
(* (/ x (* (+ x y) (+ x y))) (/ y (+ y 1.0)))
(* (/ x (+ x y)) (/ 1.0 (+ x y))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 2.3e-167) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (y <= 1.12e+140) {
tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0));
} else {
tmp = (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) :: tmp
if (y <= 2.3d-167) then
tmp = (-y / (((-1.0d0) - x) - y)) / (x + y)
else if (y <= 1.12d+140) then
tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0d0))
else
tmp = (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 tmp;
if (y <= 2.3e-167) {
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
} else if (y <= 1.12e+140) {
tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0));
} else {
tmp = (x / (x + y)) * (1.0 / (x + y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 2.3e-167: tmp = (-y / ((-1.0 - x) - y)) / (x + y) elif y <= 1.12e+140: tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0)) else: tmp = (x / (x + y)) * (1.0 / (x + y)) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 2.3e-167) tmp = Float64(Float64(Float64(-y) / Float64(Float64(-1.0 - x) - y)) / Float64(x + y)); elseif (y <= 1.12e+140) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / Float64(y + 1.0))); else tmp = Float64(Float64(x / Float64(x + y)) * Float64(1.0 / Float64(x + y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 2.3e-167)
tmp = (-y / ((-1.0 - x) - y)) / (x + y);
elseif (y <= 1.12e+140)
tmp = (x / ((x + y) * (x + y))) * (y / (y + 1.0));
else
tmp = (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_] := If[LessEqual[y, 2.3e-167], N[(N[((-y) / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e+140], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-167}:\\
\;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+140}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{x + y}\\
\end{array}
\end{array}
if y < 2.3000000000000001e-167Initial program 63.2%
associate-*r/77.8%
*-commutative77.8%
distribute-rgt1-in52.9%
fma-def77.8%
cube-unmult77.8%
Simplified77.8%
associate-*r/63.2%
fma-udef44.3%
cube-mult44.2%
distribute-rgt1-in63.2%
associate-+r+63.2%
*-commutative63.2%
frac-times85.2%
associate-/r*99.8%
frac-2neg99.8%
frac-times93.3%
+-commutative93.3%
+-commutative93.3%
associate-+r+93.3%
+-commutative93.3%
associate-+l+93.3%
Applied egg-rr93.3%
*-commutative93.3%
*-commutative93.3%
associate-/r*99.8%
distribute-neg-in99.8%
+-commutative99.8%
unsub-neg99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 61.1%
mul-1-neg61.1%
Simplified61.1%
if 2.3000000000000001e-167 < y < 1.1199999999999999e140Initial program 79.6%
times-frac95.2%
/-rgt-identity95.2%
associate-/l/95.2%
*-lft-identity95.2%
associate-+l+95.2%
Simplified95.2%
Taylor expanded in x around 0 74.9%
+-commutative74.9%
Simplified74.9%
if 1.1199999999999999e140 < y Initial program 68.1%
times-frac86.6%
associate-+r+86.6%
associate-*l/86.6%
times-frac100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 90.1%
Final simplification68.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ (- y) (- (- -1.0 x) y)) (+ x y))))
(if (<= x -6.5e+157)
t_0
(if (<= x -1.9e+34)
(* (/ x (* (+ x y) (+ x y))) (/ y x))
(if (<= x -2.2e-97) t_0 (/ (/ x y) (+ y 1.0)))))))assert(x < y);
double code(double x, double y) {
double t_0 = (-y / ((-1.0 - x) - y)) / (x + y);
double tmp;
if (x <= -6.5e+157) {
tmp = t_0;
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -2.2e-97) {
tmp = t_0;
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (-y / (((-1.0d0) - x) - y)) / (x + y)
if (x <= (-6.5d+157)) then
tmp = t_0
else if (x <= (-1.9d+34)) then
tmp = (x / ((x + y) * (x + y))) * (y / x)
else if (x <= (-2.2d-97)) then
tmp = t_0
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double t_0 = (-y / ((-1.0 - x) - y)) / (x + y);
double tmp;
if (x <= -6.5e+157) {
tmp = t_0;
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -2.2e-97) {
tmp = t_0;
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): t_0 = (-y / ((-1.0 - x) - y)) / (x + y) tmp = 0 if x <= -6.5e+157: tmp = t_0 elif x <= -1.9e+34: tmp = (x / ((x + y) * (x + y))) * (y / x) elif x <= -2.2e-97: tmp = t_0 else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) t_0 = Float64(Float64(Float64(-y) / Float64(Float64(-1.0 - x) - y)) / Float64(x + y)) tmp = 0.0 if (x <= -6.5e+157) tmp = t_0; elseif (x <= -1.9e+34) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / x)); elseif (x <= -2.2e-97) tmp = t_0; else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
t_0 = (-y / ((-1.0 - x) - y)) / (x + y);
tmp = 0.0;
if (x <= -6.5e+157)
tmp = t_0;
elseif (x <= -1.9e+34)
tmp = (x / ((x + y) * (x + y))) * (y / x);
elseif (x <= -2.2e-97)
tmp = t_0;
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(N[((-y) / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+157], t$95$0, If[LessEqual[x, -1.9e+34], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-97], t$95$0, N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -6.5e157 or -1.9000000000000001e34 < x < -2.1999999999999999e-97Initial program 69.0%
associate-*r/86.3%
*-commutative86.3%
distribute-rgt1-in44.6%
fma-def86.3%
cube-unmult86.3%
Simplified86.3%
associate-*r/68.9%
fma-udef39.2%
cube-mult39.2%
distribute-rgt1-in69.0%
associate-+r+69.0%
*-commutative69.0%
frac-times87.7%
associate-/r*99.8%
frac-2neg99.8%
frac-times87.9%
+-commutative87.9%
+-commutative87.9%
associate-+r+87.9%
+-commutative87.9%
associate-+l+87.9%
Applied egg-rr87.9%
*-commutative87.9%
*-commutative87.9%
associate-/r*99.8%
distribute-neg-in99.8%
+-commutative99.8%
unsub-neg99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 75.3%
mul-1-neg75.3%
Simplified75.3%
if -6.5e157 < x < -1.9000000000000001e34Initial program 56.0%
times-frac95.7%
/-rgt-identity95.7%
associate-/l/95.7%
*-lft-identity95.7%
associate-+l+95.7%
Simplified95.7%
Taylor expanded in x around inf 83.6%
if -2.1999999999999999e-97 < x Initial program 69.2%
times-frac86.8%
/-rgt-identity86.8%
associate-/l/86.8%
*-lft-identity86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 55.3%
associate-/r*57.7%
+-commutative57.7%
Simplified57.7%
Final simplification64.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -9e+157)
(/ (* y (/ 1.0 x)) (+ y (+ x 1.0)))
(if (<= x -1.9e+34)
(* (/ x (* (+ x y) (+ x y))) (/ y x))
(if (<= x -2.02e-97)
(* (/ y (+ x (+ y 1.0))) (/ 1.0 x))
(/ (/ x y) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -9e+157) {
tmp = (y * (1.0 / x)) / (y + (x + 1.0));
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -2.02e-97) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-9d+157)) then
tmp = (y * (1.0d0 / x)) / (y + (x + 1.0d0))
else if (x <= (-1.9d+34)) then
tmp = (x / ((x + y) * (x + y))) * (y / x)
else if (x <= (-2.02d-97)) then
tmp = (y / (x + (y + 1.0d0))) * (1.0d0 / x)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -9e+157) {
tmp = (y * (1.0 / x)) / (y + (x + 1.0));
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -2.02e-97) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -9e+157: tmp = (y * (1.0 / x)) / (y + (x + 1.0)) elif x <= -1.9e+34: tmp = (x / ((x + y) * (x + y))) * (y / x) elif x <= -2.02e-97: tmp = (y / (x + (y + 1.0))) * (1.0 / x) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -9e+157) tmp = Float64(Float64(y * Float64(1.0 / x)) / Float64(y + Float64(x + 1.0))); elseif (x <= -1.9e+34) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / x)); elseif (x <= -2.02e-97) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(1.0 / x)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -9e+157)
tmp = (y * (1.0 / x)) / (y + (x + 1.0));
elseif (x <= -1.9e+34)
tmp = (x / ((x + y) * (x + y))) * (y / x);
elseif (x <= -2.02e-97)
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -9e+157], N[(N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e+34], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.02e-97], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+157}:\\
\;\;\;\;\frac{y \cdot \frac{1}{x}}{y + \left(x + 1\right)}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -2.02 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -8.9999999999999997e157Initial program 54.8%
Taylor expanded in x around inf 54.8%
unpow254.8%
Simplified54.8%
expm1-log1p-u54.8%
expm1-udef54.8%
times-frac78.0%
pow178.0%
pow278.0%
pow-div78.0%
metadata-eval78.0%
+-commutative78.0%
associate-+r+78.0%
Applied egg-rr78.0%
expm1-def88.1%
expm1-log1p88.1%
unpow-188.1%
associate-*r/88.1%
Simplified88.1%
if -8.9999999999999997e157 < x < -1.9000000000000001e34Initial program 53.7%
times-frac92.2%
/-rgt-identity92.2%
associate-/l/92.2%
*-lft-identity92.2%
associate-+l+92.2%
Simplified92.2%
Taylor expanded in x around inf 80.6%
if -1.9000000000000001e34 < x < -2.0200000000000001e-97Initial program 84.8%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around inf 63.7%
if -2.0200000000000001e-97 < x Initial program 69.2%
times-frac86.8%
/-rgt-identity86.8%
associate-/l/86.8%
*-lft-identity86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 55.3%
associate-/r*57.7%
+-commutative57.7%
Simplified57.7%
Final simplification64.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -1.2e+158)
(* (/ x (+ x y)) (/ (/ y x) (+ x y)))
(if (<= x -1.9e+34)
(* (/ x (* (+ x y) (+ x y))) (/ y x))
(if (<= x -2.2e-97)
(* (/ y (+ x (+ y 1.0))) (/ 1.0 x))
(/ (/ x y) (+ y 1.0))))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -1.2e+158) {
tmp = (x / (x + y)) * ((y / x) / (x + y));
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -2.2e-97) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.2d+158)) then
tmp = (x / (x + y)) * ((y / x) / (x + y))
else if (x <= (-1.9d+34)) then
tmp = (x / ((x + y) * (x + y))) * (y / x)
else if (x <= (-2.2d-97)) then
tmp = (y / (x + (y + 1.0d0))) * (1.0d0 / x)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -1.2e+158) {
tmp = (x / (x + y)) * ((y / x) / (x + y));
} else if (x <= -1.9e+34) {
tmp = (x / ((x + y) * (x + y))) * (y / x);
} else if (x <= -2.2e-97) {
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -1.2e+158: tmp = (x / (x + y)) * ((y / x) / (x + y)) elif x <= -1.9e+34: tmp = (x / ((x + y) * (x + y))) * (y / x) elif x <= -2.2e-97: tmp = (y / (x + (y + 1.0))) * (1.0 / x) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -1.2e+158) tmp = Float64(Float64(x / Float64(x + y)) * Float64(Float64(y / x) / Float64(x + y))); elseif (x <= -1.9e+34) tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / x)); elseif (x <= -2.2e-97) tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(1.0 / x)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -1.2e+158)
tmp = (x / (x + y)) * ((y / x) / (x + y));
elseif (x <= -1.9e+34)
tmp = (x / ((x + y) * (x + y))) * (y / x);
elseif (x <= -2.2e-97)
tmp = (y / (x + (y + 1.0))) * (1.0 / x);
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -1.2e+158], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e+34], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-97], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+158}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.20000000000000004e158Initial program 54.8%
times-frac78.0%
associate-+r+78.0%
associate-*l/78.0%
times-frac99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 88.3%
if -1.20000000000000004e158 < x < -1.9000000000000001e34Initial program 53.7%
times-frac92.2%
/-rgt-identity92.2%
associate-/l/92.2%
*-lft-identity92.2%
associate-+l+92.2%
Simplified92.2%
Taylor expanded in x around inf 80.6%
if -1.9000000000000001e34 < x < -2.1999999999999999e-97Initial program 84.8%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around inf 63.7%
if -2.1999999999999999e-97 < x Initial program 69.2%
times-frac86.8%
/-rgt-identity86.8%
associate-/l/86.8%
*-lft-identity86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 55.3%
associate-/r*57.7%
+-commutative57.7%
Simplified57.7%
Final simplification64.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.2e-97) (/ (* y (/ 1.0 x)) (+ y (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.2e-97) {
tmp = (y * (1.0 / x)) / (y + (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.2d-97)) then
tmp = (y * (1.0d0 / x)) / (y + (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.2e-97) {
tmp = (y * (1.0 / x)) / (y + (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.2e-97: tmp = (y * (1.0 / x)) / (y + (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.2e-97) tmp = Float64(Float64(y * Float64(1.0 / x)) / Float64(y + Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.2e-97)
tmp = (y * (1.0 / x)) / (y + (x + 1.0));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.2e-97], N[(N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;\frac{y \cdot \frac{1}{x}}{y + \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.1999999999999999e-97Initial program 65.4%
Taylor expanded in x around inf 52.2%
unpow252.2%
Simplified52.2%
expm1-log1p-u51.9%
expm1-udef29.0%
times-frac40.8%
pow140.8%
pow240.8%
pow-div40.8%
metadata-eval40.8%
+-commutative40.8%
associate-+r+40.8%
Applied egg-rr40.8%
expm1-def73.3%
expm1-log1p73.6%
unpow-173.6%
associate-*r/73.7%
Simplified73.7%
if -2.1999999999999999e-97 < x Initial program 69.2%
times-frac86.8%
/-rgt-identity86.8%
associate-/l/86.8%
*-lft-identity86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 55.3%
associate-/r*57.7%
+-commutative57.7%
Simplified57.7%
Final simplification63.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -180000000000.0) (/ y (* x x)) (if (or (<= x -8e-203) (not (<= x 2.2e-241))) (/ x (* y y)) (/ x y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -180000000000.0) {
tmp = y / (x * x);
} else if ((x <= -8e-203) || !(x <= 2.2e-241)) {
tmp = x / (y * y);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-180000000000.0d0)) then
tmp = y / (x * x)
else if ((x <= (-8d-203)) .or. (.not. (x <= 2.2d-241))) then
tmp = x / (y * y)
else
tmp = x / y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -180000000000.0) {
tmp = y / (x * x);
} else if ((x <= -8e-203) || !(x <= 2.2e-241)) {
tmp = x / (y * y);
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -180000000000.0: tmp = y / (x * x) elif (x <= -8e-203) or not (x <= 2.2e-241): tmp = x / (y * y) else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -180000000000.0) tmp = Float64(y / Float64(x * x)); elseif ((x <= -8e-203) || !(x <= 2.2e-241)) tmp = Float64(x / Float64(y * y)); else tmp = Float64(x / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -180000000000.0)
tmp = y / (x * x);
elseif ((x <= -8e-203) || ~((x <= 2.2e-241)))
tmp = x / (y * y);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -180000000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -8e-203], N[Not[LessEqual[x, 2.2e-241]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -180000000000:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-203} \lor \neg \left(x \leq 2.2 \cdot 10^{-241}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1.8e11Initial program 57.0%
associate-*r/72.7%
*-commutative72.7%
distribute-rgt1-in32.3%
fma-def72.7%
cube-unmult72.7%
Simplified72.7%
Taylor expanded in x around inf 72.0%
unpow272.0%
Simplified72.0%
if -1.8e11 < x < -8.0000000000000003e-203 or 2.1999999999999999e-241 < x Initial program 73.8%
associate-*r/86.4%
*-commutative86.4%
distribute-rgt1-in74.8%
fma-def86.4%
cube-unmult86.5%
Simplified86.5%
Taylor expanded in y around inf 35.7%
unpow235.7%
Simplified35.7%
if -8.0000000000000003e-203 < x < 2.1999999999999999e-241Initial program 61.3%
times-frac77.7%
/-rgt-identity77.7%
associate-/l/77.7%
*-lft-identity77.7%
associate-+l+77.7%
Simplified77.7%
Taylor expanded in x around 0 89.3%
associate-/r*89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in y around 0 86.6%
Final simplification51.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
:precision binary64
(if (<= x -15200000000.0)
(/ y (* x x))
(if (<= x -1.45e-201)
(/ x (* y y))
(if (<= x 1.65e-240) (/ x y) (/ (/ x y) y)))))assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -15200000000.0) {
tmp = y / (x * x);
} else if (x <= -1.45e-201) {
tmp = x / (y * y);
} else if (x <= 1.65e-240) {
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 <= (-15200000000.0d0)) then
tmp = y / (x * x)
else if (x <= (-1.45d-201)) then
tmp = x / (y * y)
else if (x <= 1.65d-240) 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 <= -15200000000.0) {
tmp = y / (x * x);
} else if (x <= -1.45e-201) {
tmp = x / (y * y);
} else if (x <= 1.65e-240) {
tmp = x / y;
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -15200000000.0: tmp = y / (x * x) elif x <= -1.45e-201: tmp = x / (y * y) elif x <= 1.65e-240: tmp = x / y else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -15200000000.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -1.45e-201) tmp = Float64(x / Float64(y * y)); elseif (x <= 1.65e-240) tmp = Float64(x / y); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -15200000000.0)
tmp = y / (x * x);
elseif (x <= -1.45e-201)
tmp = x / (y * y);
elseif (x <= 1.65e-240)
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, -15200000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.45e-201], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e-240], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -15200000000:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-201}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-240}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.52e10Initial program 57.0%
associate-*r/72.7%
*-commutative72.7%
distribute-rgt1-in32.3%
fma-def72.7%
cube-unmult72.7%
Simplified72.7%
Taylor expanded in x around inf 72.0%
unpow272.0%
Simplified72.0%
if -1.52e10 < x < -1.4500000000000001e-201Initial program 82.8%
associate-*r/95.4%
*-commutative95.4%
distribute-rgt1-in84.6%
fma-def95.5%
cube-unmult95.5%
Simplified95.5%
Taylor expanded in y around inf 40.5%
unpow240.5%
Simplified40.5%
if -1.4500000000000001e-201 < x < 1.6500000000000001e-240Initial program 62.4%
times-frac78.3%
/-rgt-identity78.3%
associate-/l/78.3%
*-lft-identity78.3%
associate-+l+78.3%
Simplified78.3%
Taylor expanded in x around 0 89.6%
associate-/r*89.6%
+-commutative89.6%
Simplified89.6%
Taylor expanded in y around 0 87.0%
if 1.6500000000000001e-240 < x Initial program 69.8%
associate-*r/82.5%
*-commutative82.5%
distribute-rgt1-in70.5%
fma-def82.5%
cube-unmult82.5%
Simplified82.5%
associate-*r/69.8%
fma-udef60.6%
cube-mult60.6%
distribute-rgt1-in69.8%
associate-+r+69.8%
*-commutative69.8%
frac-times88.8%
associate-/r*99.8%
frac-2neg99.8%
frac-times91.5%
+-commutative91.5%
+-commutative91.5%
associate-+r+91.5%
+-commutative91.5%
associate-+l+91.5%
Applied egg-rr91.5%
*-commutative91.5%
*-commutative91.5%
associate-/r*99.8%
distribute-neg-in99.8%
+-commutative99.8%
unsub-neg99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 34.0%
unpow234.0%
associate-/r*37.6%
Simplified37.6%
Final simplification53.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -11600000000.0) (/ y (* x x)) (if (<= x 2.1e+16) (/ x (+ y (* y y))) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -11600000000.0) {
tmp = y / (x * x);
} else if (x <= 2.1e+16) {
tmp = x / (y + (y * 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 <= (-11600000000.0d0)) then
tmp = y / (x * x)
else if (x <= 2.1d+16) then
tmp = x / (y + (y * 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 <= -11600000000.0) {
tmp = y / (x * x);
} else if (x <= 2.1e+16) {
tmp = x / (y + (y * y));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -11600000000.0: tmp = y / (x * x) elif x <= 2.1e+16: tmp = x / (y + (y * y)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -11600000000.0) tmp = Float64(y / Float64(x * x)); elseif (x <= 2.1e+16) tmp = Float64(x / Float64(y + Float64(y * y))); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -11600000000.0)
tmp = y / (x * x);
elseif (x <= 2.1e+16)
tmp = x / (y + (y * 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, -11600000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+16], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -11600000000:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+16}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -1.16e10Initial program 57.0%
associate-*r/72.7%
*-commutative72.7%
distribute-rgt1-in32.3%
fma-def72.7%
cube-unmult72.7%
Simplified72.7%
Taylor expanded in x around inf 72.0%
unpow272.0%
Simplified72.0%
if -1.16e10 < x < 2.1e16Initial program 76.2%
times-frac89.8%
/-rgt-identity89.8%
associate-/l/89.8%
*-lft-identity89.8%
associate-+l+89.8%
Simplified89.8%
Taylor expanded in x around 0 70.3%
distribute-lft-in70.3%
*-rgt-identity70.3%
Simplified70.3%
if 2.1e16 < x Initial program 62.2%
associate-*r/76.2%
*-commutative76.2%
distribute-rgt1-in69.6%
fma-def76.2%
cube-unmult76.2%
Simplified76.2%
associate-*r/62.2%
fma-udef60.4%
cube-mult60.4%
distribute-rgt1-in62.2%
associate-+r+62.2%
*-commutative62.2%
frac-times85.6%
associate-/r*99.8%
frac-2neg99.8%
frac-times85.6%
+-commutative85.6%
+-commutative85.6%
associate-+r+85.6%
+-commutative85.6%
associate-+l+85.6%
Applied egg-rr85.6%
*-commutative85.6%
*-commutative85.6%
associate-/r*99.7%
distribute-neg-in99.7%
+-commutative99.7%
unsub-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 19.5%
unpow219.5%
associate-/r*25.6%
Simplified25.6%
Final simplification59.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.2e-97) (/ y (* x (+ x 1.0))) (if (<= x 1.55e+17) (/ x (+ y (* y y))) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.2e-97) {
tmp = y / (x * (x + 1.0));
} else if (x <= 1.55e+17) {
tmp = x / (y + (y * 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 <= (-2.2d-97)) then
tmp = y / (x * (x + 1.0d0))
else if (x <= 1.55d+17) then
tmp = x / (y + (y * 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 <= -2.2e-97) {
tmp = y / (x * (x + 1.0));
} else if (x <= 1.55e+17) {
tmp = x / (y + (y * y));
} else {
tmp = (x / y) / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.2e-97: tmp = y / (x * (x + 1.0)) elif x <= 1.55e+17: tmp = x / (y + (y * y)) else: tmp = (x / y) / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.2e-97) tmp = Float64(y / Float64(x * Float64(x + 1.0))); elseif (x <= 1.55e+17) tmp = Float64(x / Float64(y + Float64(y * y))); else tmp = Float64(Float64(x / y) / y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.2e-97)
tmp = y / (x * (x + 1.0));
elseif (x <= 1.55e+17)
tmp = x / (y + (y * 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, -2.2e-97], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.55e+17], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -2.1999999999999999e-97Initial program 65.4%
times-frac89.9%
/-rgt-identity89.9%
associate-/l/89.9%
*-lft-identity89.9%
associate-+l+89.9%
Simplified89.9%
Taylor expanded in y around 0 69.9%
if -2.1999999999999999e-97 < x < 1.55e17Initial program 73.5%
times-frac87.6%
/-rgt-identity87.6%
associate-/l/87.6%
*-lft-identity87.6%
associate-+l+87.6%
Simplified87.6%
Taylor expanded in x around 0 77.3%
distribute-lft-in77.3%
*-rgt-identity77.3%
Simplified77.3%
if 1.55e17 < x Initial program 62.2%
associate-*r/76.2%
*-commutative76.2%
distribute-rgt1-in69.6%
fma-def76.2%
cube-unmult76.2%
Simplified76.2%
associate-*r/62.2%
fma-udef60.4%
cube-mult60.4%
distribute-rgt1-in62.2%
associate-+r+62.2%
*-commutative62.2%
frac-times85.6%
associate-/r*99.8%
frac-2neg99.8%
frac-times85.6%
+-commutative85.6%
+-commutative85.6%
associate-+r+85.6%
+-commutative85.6%
associate-+l+85.6%
Applied egg-rr85.6%
*-commutative85.6%
*-commutative85.6%
associate-/r*99.7%
distribute-neg-in99.7%
+-commutative99.7%
unsub-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 19.5%
unpow219.5%
associate-/r*25.6%
Simplified25.6%
Final simplification61.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -9.4e+14) (/ (/ y x) (+ x y)) (if (<= x -2.2e-97) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -9.4e+14) {
tmp = (y / x) / (x + y);
} else if (x <= -2.2e-97) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-9.4d+14)) then
tmp = (y / x) / (x + y)
else if (x <= (-2.2d-97)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -9.4e+14) {
tmp = (y / x) / (x + y);
} else if (x <= -2.2e-97) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -9.4e+14: tmp = (y / x) / (x + y) elif x <= -2.2e-97: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -9.4e+14) tmp = Float64(Float64(y / x) / Float64(x + y)); elseif (x <= -2.2e-97) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -9.4e+14)
tmp = (y / x) / (x + y);
elseif (x <= -2.2e-97)
tmp = y / (x * (x + 1.0));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -9.4e+14], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-97], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -9.4e14Initial program 56.4%
associate-*r/72.3%
*-commutative72.3%
distribute-rgt1-in31.3%
fma-def72.3%
cube-unmult72.3%
Simplified72.3%
associate-*r/56.4%
fma-udef29.4%
cube-mult29.4%
distribute-rgt1-in56.4%
associate-+r+56.4%
*-commutative56.4%
frac-times86.0%
associate-/r*99.6%
frac-2neg99.6%
frac-times86.1%
+-commutative86.1%
+-commutative86.1%
associate-+r+86.1%
+-commutative86.1%
associate-+l+86.1%
Applied egg-rr86.1%
*-commutative86.1%
*-commutative86.1%
associate-/r*99.7%
distribute-neg-in99.7%
+-commutative99.7%
unsub-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 77.1%
if -9.4e14 < x < -2.1999999999999999e-97Initial program 88.3%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in y around 0 64.8%
if -2.1999999999999999e-97 < x Initial program 69.2%
times-frac86.8%
/-rgt-identity86.8%
associate-/l/86.8%
*-lft-identity86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 55.3%
associate-/r*57.7%
+-commutative57.7%
Simplified57.7%
Final simplification63.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.2e-97) (/ (/ y (+ x 1.0)) (+ x y)) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.2e-97) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.2d-97)) then
tmp = (y / (x + 1.0d0)) / (x + y)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.2e-97) {
tmp = (y / (x + 1.0)) / (x + y);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.2e-97: tmp = (y / (x + 1.0)) / (x + y) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.2e-97) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.2e-97)
tmp = (y / (x + 1.0)) / (x + y);
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.2e-97], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.1999999999999999e-97Initial program 65.4%
associate-*r/80.0%
*-commutative80.0%
distribute-rgt1-in48.4%
fma-def80.0%
cube-unmult80.1%
Simplified80.1%
associate-*r/65.4%
fma-udef43.8%
cube-mult43.8%
distribute-rgt1-in65.4%
associate-+r+65.4%
*-commutative65.4%
frac-times89.9%
associate-/r*99.6%
frac-2neg99.6%
frac-times90.0%
+-commutative90.0%
+-commutative90.0%
associate-+r+90.0%
+-commutative90.0%
associate-+l+90.0%
Applied egg-rr90.0%
*-commutative90.0%
*-commutative90.0%
associate-/r*99.7%
distribute-neg-in99.7%
+-commutative99.7%
unsub-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 73.7%
+-commutative73.7%
Simplified73.7%
if -2.1999999999999999e-97 < x Initial program 69.2%
times-frac86.8%
/-rgt-identity86.8%
associate-/l/86.8%
*-lft-identity86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 55.3%
associate-/r*57.7%
+-commutative57.7%
Simplified57.7%
Final simplification63.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -2.2e-97) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -2.2e-97) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.2d-97)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y) {
double tmp;
if (x <= -2.2e-97) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -2.2e-97: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -2.2e-97) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2.2e-97)
tmp = y / (x * (x + 1.0));
else
tmp = (x / y) / (y + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := If[LessEqual[x, -2.2e-97], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -2.1999999999999999e-97Initial program 65.4%
times-frac89.9%
/-rgt-identity89.9%
associate-/l/89.9%
*-lft-identity89.9%
associate-+l+89.9%
Simplified89.9%
Taylor expanded in y around 0 69.9%
if -2.1999999999999999e-97 < x Initial program 69.2%
times-frac86.8%
/-rgt-identity86.8%
associate-/l/86.8%
*-lft-identity86.8%
associate-+l+86.8%
Simplified86.8%
Taylor expanded in x around 0 55.3%
associate-/r*57.7%
+-commutative57.7%
Simplified57.7%
Final simplification61.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= y 0.76) (- (/ x y) x) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
double tmp;
if (y <= 0.76) {
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) :: tmp
if (y <= 0.76d0) 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 tmp;
if (y <= 0.76) {
tmp = (x / y) - x;
} else {
tmp = x / (y * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if y <= 0.76: tmp = (x / y) - x else: tmp = x / (y * y) return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (y <= 0.76) 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)
tmp = 0.0;
if (y <= 0.76)
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_] := If[LessEqual[y, 0.76], 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}
\mathbf{if}\;y \leq 0.76:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 0.76000000000000001Initial program 66.4%
times-frac87.7%
/-rgt-identity87.7%
associate-/l/87.7%
*-lft-identity87.7%
associate-+l+87.7%
Simplified87.7%
Taylor expanded in x around 0 37.6%
associate-/r*40.2%
+-commutative40.2%
Simplified40.2%
Taylor expanded in y around 0 16.8%
mul-1-neg16.8%
unsub-neg16.8%
Simplified16.8%
if 0.76000000000000001 < y Initial program 72.3%
associate-*r/85.4%
*-commutative85.4%
distribute-rgt1-in79.8%
fma-def85.4%
cube-unmult85.4%
Simplified85.4%
Taylor expanded in y around inf 67.5%
unpow267.5%
Simplified67.5%
Final simplification29.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (if (<= x -0.96) (/ 0.3333333333333333 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
double tmp;
if (x <= -0.96) {
tmp = 0.3333333333333333 / 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 <= (-0.96d0)) then
tmp = 0.3333333333333333d0 / 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 <= -0.96) {
tmp = 0.3333333333333333 / x;
} else {
tmp = x / y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y): tmp = 0 if x <= -0.96: tmp = 0.3333333333333333 / x else: tmp = x / y return tmp
x, y = sort([x, y]) function code(x, y) tmp = 0.0 if (x <= -0.96) tmp = Float64(0.3333333333333333 / 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 <= -0.96)
tmp = 0.3333333333333333 / 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, -0.96], N[(0.3333333333333333 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.96:\\
\;\;\;\;\frac{0.3333333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -0.95999999999999996Initial program 59.0%
associate-*r/73.9%
*-commutative73.9%
distribute-rgt1-in35.4%
fma-def73.9%
cube-unmult73.9%
Simplified73.9%
Taylor expanded in x around inf 44.0%
+-commutative44.0%
cube-mult44.0%
unpow244.0%
distribute-rgt-out69.6%
unpow269.6%
distribute-lft1-in69.6%
metadata-eval69.6%
Simplified69.6%
Taylor expanded in y around inf 6.5%
if -0.95999999999999996 < x Initial program 71.1%
times-frac88.2%
/-rgt-identity88.2%
associate-/l/88.2%
*-lft-identity88.2%
associate-+l+88.2%
Simplified88.2%
Taylor expanded in x around 0 54.2%
associate-/r*56.3%
+-commutative56.3%
Simplified56.3%
Taylor expanded in y around 0 36.5%
Final simplification28.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 (/ 0.3333333333333333 x))
assert(x < y);
double code(double x, double y) {
return 0.3333333333333333 / 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.3333333333333333d0 / x
end function
assert x < y;
public static double code(double x, double y) {
return 0.3333333333333333 / x;
}
[x, y] = sort([x, y]) def code(x, y): return 0.3333333333333333 / x
x, y = sort([x, y]) function code(x, y) return Float64(0.3333333333333333 / x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 0.3333333333333333 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := N[(0.3333333333333333 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{0.3333333333333333}{x}
\end{array}
Initial program 67.9%
associate-*r/81.8%
*-commutative81.8%
distribute-rgt1-in62.6%
fma-def81.8%
cube-unmult81.8%
Simplified81.8%
Taylor expanded in x around inf 39.4%
+-commutative39.4%
cube-mult39.4%
unpow239.4%
distribute-rgt-out48.2%
unpow248.2%
distribute-lft1-in48.2%
metadata-eval48.2%
Simplified48.2%
Taylor expanded in y around inf 4.4%
Final simplification4.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y) :precision binary64 1.0)
assert(x < y);
double code(double x, double y) {
return 1.0;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
assert x < y;
public static double code(double x, double y) {
return 1.0;
}
[x, y] = sort([x, y]) def code(x, y): return 1.0
x, y = sort([x, y]) function code(x, y) return 1.0 end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
tmp = 1.0;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_] := 1.0
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
1
\end{array}
Initial program 67.9%
times-frac87.9%
associate-+r+87.9%
associate-*l/81.4%
times-frac99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 48.2%
+-commutative48.2%
Simplified48.2%
Taylor expanded in y around 0 3.4%
Final simplification3.4%
(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 2023238
(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))))