1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -1864702967354.43042 \lor \neg \left(y \le 28223629.6847505309\right):\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(1, \frac{x}{{y}^{2}}, \frac{x}{y} - 1 \cdot \frac{1}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \frac{1}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}} \cdot \frac{x - y}{\sqrt[3]{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r340165 = 1.0;
double r340166 = x;
double r340167 = y;
double r340168 = r340166 - r340167;
double r340169 = r340165 - r340167;
double r340170 = r340168 / r340169;
double r340171 = r340165 - r340170;
double r340172 = log(r340171);
double r340173 = r340165 - r340172;
return r340173;
}
double f(double x, double y) {
double r340174 = y;
double r340175 = -1864702967354.4304;
bool r340176 = r340174 <= r340175;
double r340177 = 28223629.68475053;
bool r340178 = r340174 <= r340177;
double r340179 = !r340178;
bool r340180 = r340176 || r340179;
double r340181 = 1.0;
double r340182 = x;
double r340183 = 2.0;
double r340184 = pow(r340174, r340183);
double r340185 = r340182 / r340184;
double r340186 = r340182 / r340174;
double r340187 = 1.0;
double r340188 = r340187 / r340174;
double r340189 = r340181 * r340188;
double r340190 = r340186 - r340189;
double r340191 = fma(r340181, r340185, r340190);
double r340192 = log(r340191);
double r340193 = r340181 - r340192;
double r340194 = r340181 - r340174;
double r340195 = cbrt(r340194);
double r340196 = r340195 * r340195;
double r340197 = r340187 / r340196;
double r340198 = r340182 - r340174;
double r340199 = r340198 / r340195;
double r340200 = r340197 * r340199;
double r340201 = r340181 - r340200;
double r340202 = log(r340201);
double r340203 = r340181 - r340202;
double r340204 = r340180 ? r340193 : r340203;
return r340204;
}




Bits error versus x




Bits error versus y
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -1864702967354.4304 or 28223629.68475053 < y Initial program 46.6
rmApplied add-cube-cbrt42.9
Applied *-un-lft-identity42.9
Applied times-frac42.8
Taylor expanded around inf 0.0
Simplified0.0
if -1864702967354.4304 < y < 28223629.68475053Initial program 0.2
rmApplied add-cube-cbrt0.2
Applied *-un-lft-identity0.2
Applied times-frac0.2
Final simplification0.1
herbie shell --seed 2020018 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< y -81284752.61947241) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1) (- 1 (/ (- x y) (- 1 y))))) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y)))))))
(- 1 (log (- 1 (/ (- x y) (- 1 y))))))