1.0 - \log \left(1.0 - \frac{x - y}{1.0 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1.0 - y} \le 0.9998974867815034:\\
\;\;\;\;1.0 - \log \left(1.0 - \frac{\frac{x - y}{\sqrt[3]{1.0 - y} \cdot \sqrt[3]{1.0 - y}}}{\sqrt[3]{1.0 - y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1.0 - \log \left(\left(\frac{1.0}{y} \cdot \frac{x}{y} - \frac{1.0}{y}\right) + \frac{x}{y}\right)\\
\end{array}double f(double x, double y) {
double r17115849 = 1.0;
double r17115850 = x;
double r17115851 = y;
double r17115852 = r17115850 - r17115851;
double r17115853 = r17115849 - r17115851;
double r17115854 = r17115852 / r17115853;
double r17115855 = r17115849 - r17115854;
double r17115856 = log(r17115855);
double r17115857 = r17115849 - r17115856;
return r17115857;
}
double f(double x, double y) {
double r17115858 = x;
double r17115859 = y;
double r17115860 = r17115858 - r17115859;
double r17115861 = 1.0;
double r17115862 = r17115861 - r17115859;
double r17115863 = r17115860 / r17115862;
double r17115864 = 0.9998974867815034;
bool r17115865 = r17115863 <= r17115864;
double r17115866 = cbrt(r17115862);
double r17115867 = r17115866 * r17115866;
double r17115868 = r17115860 / r17115867;
double r17115869 = r17115868 / r17115866;
double r17115870 = r17115861 - r17115869;
double r17115871 = log(r17115870);
double r17115872 = r17115861 - r17115871;
double r17115873 = r17115861 / r17115859;
double r17115874 = r17115858 / r17115859;
double r17115875 = r17115873 * r17115874;
double r17115876 = r17115875 - r17115873;
double r17115877 = r17115876 + r17115874;
double r17115878 = log(r17115877);
double r17115879 = r17115861 - r17115878;
double r17115880 = r17115865 ? r17115872 : r17115879;
return r17115880;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.9998974867815034Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied associate-/r*0.1
if 0.9998974867815034 < (/ (- x y) (- 1.0 y)) Initial program 61.9
rmApplied add-cube-cbrt56.8
Applied associate-/r*56.8
Taylor expanded around inf 0.4
Simplified0.4
Final simplification0.2
herbie shell --seed 2019165
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:herbie-target
(if (< y -81284752.61947241) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1.0) (- 1.0 (/ (- x y) (- 1.0 y))))) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y)))))))
(- 1.0 (log (- 1.0 (/ (- x y) (- 1.0 y))))))