1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -109794463.93071939051151275634765625 \lor \neg \left(y \le 24629234.9915754683315753936767578125\right):\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \frac{\frac{x - y}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}}}{\sqrt[3]{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r363927 = 1.0;
double r363928 = x;
double r363929 = y;
double r363930 = r363928 - r363929;
double r363931 = r363927 - r363929;
double r363932 = r363930 / r363931;
double r363933 = r363927 - r363932;
double r363934 = log(r363933);
double r363935 = r363927 - r363934;
return r363935;
}
double f(double x, double y) {
double r363936 = y;
double r363937 = -109794463.93071939;
bool r363938 = r363936 <= r363937;
double r363939 = 24629234.99157547;
bool r363940 = r363936 <= r363939;
double r363941 = !r363940;
bool r363942 = r363938 || r363941;
double r363943 = 1.0;
double r363944 = x;
double r363945 = 2.0;
double r363946 = pow(r363936, r363945);
double r363947 = r363944 / r363946;
double r363948 = 1.0;
double r363949 = r363948 / r363936;
double r363950 = r363947 - r363949;
double r363951 = r363943 * r363950;
double r363952 = r363944 / r363936;
double r363953 = r363951 + r363952;
double r363954 = log(r363953);
double r363955 = r363943 - r363954;
double r363956 = r363944 - r363936;
double r363957 = r363943 - r363936;
double r363958 = cbrt(r363957);
double r363959 = r363958 * r363958;
double r363960 = r363956 / r363959;
double r363961 = r363960 / r363958;
double r363962 = r363943 - r363961;
double r363963 = log(r363962);
double r363964 = r363943 - r363963;
double r363965 = r363942 ? r363955 : r363964;
return r363965;
}




Bits error versus x




Bits error versus y
Results
| Original | 17.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -109794463.93071939 or 24629234.99157547 < y Initial program 46.1
Taylor expanded around inf 0.1
Simplified0.1
if -109794463.93071939 < y < 24629234.99157547Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied associate-/r*0.1
Final simplification0.1
herbie shell --seed 2019291
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< y -81284752.619472414) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y))))) (if (< y 3.0094271212461764e25) (log (/ (exp 1) (- 1 (/ (- x y) (- 1 y))))) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y)))))))
(- 1 (log (- 1 (/ (- x y) (- 1 y))))))