1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -125230047.9964575469493865966796875 \lor \neg \left(y \le 3758135.54599315486848354339599609375\right):\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(1, \frac{x}{{y}^{2}} - \frac{1}{y}, \frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \left(\log \left(\sqrt{1 - \frac{x - y}{1 - y}}\right) + \log \left(\sqrt{\left(\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1} - \frac{\mathsf{fma}\left(1, 1, \mathsf{fma}\left(y, y, 1 \cdot y\right)\right) \cdot \left(x - y\right)}{{1}^{3} - {y}^{3}}\right) + \mathsf{fma}\left(1, 1, \mathsf{fma}\left(y, y, 1 \cdot y\right)\right) \cdot \left(\left(-\frac{x - y}{{1}^{3} - {y}^{3}}\right) + \frac{x - y}{{1}^{3} - {y}^{3}}\right)}\right)\right)\\
\end{array}double f(double x, double y) {
double r327899 = 1.0;
double r327900 = x;
double r327901 = y;
double r327902 = r327900 - r327901;
double r327903 = r327899 - r327901;
double r327904 = r327902 / r327903;
double r327905 = r327899 - r327904;
double r327906 = log(r327905);
double r327907 = r327899 - r327906;
return r327907;
}
double f(double x, double y) {
double r327908 = y;
double r327909 = -125230047.99645755;
bool r327910 = r327908 <= r327909;
double r327911 = 3758135.545993155;
bool r327912 = r327908 <= r327911;
double r327913 = !r327912;
bool r327914 = r327910 || r327913;
double r327915 = 1.0;
double r327916 = x;
double r327917 = 2.0;
double r327918 = pow(r327908, r327917);
double r327919 = r327916 / r327918;
double r327920 = 1.0;
double r327921 = r327920 / r327908;
double r327922 = r327919 - r327921;
double r327923 = r327916 / r327908;
double r327924 = fma(r327915, r327922, r327923);
double r327925 = log(r327924);
double r327926 = r327915 - r327925;
double r327927 = r327916 - r327908;
double r327928 = r327915 - r327908;
double r327929 = r327927 / r327928;
double r327930 = r327915 - r327929;
double r327931 = sqrt(r327930);
double r327932 = log(r327931);
double r327933 = cbrt(r327915);
double r327934 = r327933 * r327933;
double r327935 = r327934 * r327933;
double r327936 = r327915 * r327908;
double r327937 = fma(r327908, r327908, r327936);
double r327938 = fma(r327915, r327915, r327937);
double r327939 = r327938 * r327927;
double r327940 = 3.0;
double r327941 = pow(r327915, r327940);
double r327942 = pow(r327908, r327940);
double r327943 = r327941 - r327942;
double r327944 = r327939 / r327943;
double r327945 = r327935 - r327944;
double r327946 = r327927 / r327943;
double r327947 = -r327946;
double r327948 = r327947 + r327946;
double r327949 = r327938 * r327948;
double r327950 = r327945 + r327949;
double r327951 = sqrt(r327950);
double r327952 = log(r327951);
double r327953 = r327932 + r327952;
double r327954 = r327915 - r327953;
double r327955 = r327914 ? r327926 : r327954;
return r327955;
}




Bits error versus x




Bits error versus y
| Original | 18.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -125230047.99645755 or 3758135.545993155 < y Initial program 47.9
Taylor expanded around inf 0.1
Simplified0.1
if -125230047.99645755 < y < 3758135.545993155Initial program 0.1
rmApplied add-sqr-sqrt0.1
Applied log-prod0.1
rmApplied flip3--0.1
Applied associate-/r/0.1
Applied add-cube-cbrt0.1
Applied prod-diff0.1
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019356 +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))))))