Average Error: 7.9 → 6.4
Time: 3.9s
Precision: 64
\[x0 = 1.854999999999999982236431605997495353222 \land x1 = 2.090000000000000115064208161541614572343 \cdot 10^{-4} \lor x0 = 2.984999999999999875655021241982467472553 \land x1 = 0.01859999999999999847899445626353553961962\]
\[\frac{x0}{1 - x1} - x0\]
\[e^{\log \left(\log \left(\frac{1}{\sqrt{e^{x0}}}\right) + \mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)\right)}\]
\frac{x0}{1 - x1} - x0
e^{\log \left(\log \left(\frac{1}{\sqrt{e^{x0}}}\right) + \mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)\right)}
double f(double x0, double x1) {
        double r159864 = x0;
        double r159865 = 1.0;
        double r159866 = x1;
        double r159867 = r159865 - r159866;
        double r159868 = r159864 / r159867;
        double r159869 = r159868 - r159864;
        return r159869;
}

double f(double x0, double x1) {
        double r159870 = 1.0;
        double r159871 = x0;
        double r159872 = exp(r159871);
        double r159873 = sqrt(r159872);
        double r159874 = r159870 / r159873;
        double r159875 = log(r159874);
        double r159876 = cbrt(r159871);
        double r159877 = 1.0;
        double r159878 = x1;
        double r159879 = r159877 - r159878;
        double r159880 = r159876 / r159879;
        double r159881 = 0.6666666666666666;
        double r159882 = pow(r159871, r159881);
        double r159883 = fma(r159880, r159882, r159875);
        double r159884 = r159875 + r159883;
        double r159885 = log(r159884);
        double r159886 = exp(r159885);
        return r159886;
}

Error

Bits error versus x0

Bits error versus x1

Target

Original7.9
Target0.3
Herbie6.4
\[\frac{x0 \cdot x1}{1 - x1}\]

Derivation

  1. Initial program 7.9

    \[\frac{x0}{1 - x1} - x0\]
  2. Using strategy rm
  3. Applied *-un-lft-identity7.9

    \[\leadsto \frac{x0}{\color{blue}{1 \cdot \left(1 - x1\right)}} - x0\]
  4. Applied add-cube-cbrt7.9

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \sqrt[3]{x0}}}{1 \cdot \left(1 - x1\right)} - x0\]
  5. Applied times-frac8.2

    \[\leadsto \color{blue}{\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{1} \cdot \frac{\sqrt[3]{x0}}{1 - x1}} - x0\]
  6. Applied fma-neg6.9

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{1}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\]
  7. Using strategy rm
  8. Applied add-exp-log6.9

    \[\leadsto \color{blue}{e^{\log \left(\mathsf{fma}\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{1}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)\right)}}\]
  9. Using strategy rm
  10. Applied add-log-exp7.8

    \[\leadsto e^{\log \color{blue}{\left(\log \left(e^{\mathsf{fma}\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{1}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\right)\right)}}\]
  11. Simplified6.7

    \[\leadsto e^{\log \left(\log \color{blue}{\left(\frac{{\left(e^{{x0}^{\frac{2}{3}}}\right)}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{e^{x0}}\right)}\right)}\]
  12. Using strategy rm
  13. Applied add-sqr-sqrt7.2

    \[\leadsto e^{\log \left(\log \left(\frac{{\left(e^{{x0}^{\frac{2}{3}}}\right)}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{\color{blue}{\sqrt{e^{x0}} \cdot \sqrt{e^{x0}}}}\right)\right)}\]
  14. Applied *-un-lft-identity7.2

    \[\leadsto e^{\log \left(\log \left(\frac{{\color{blue}{\left(1 \cdot e^{{x0}^{\frac{2}{3}}}\right)}}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{\sqrt{e^{x0}} \cdot \sqrt{e^{x0}}}\right)\right)}\]
  15. Applied unpow-prod-down7.2

    \[\leadsto e^{\log \left(\log \left(\frac{\color{blue}{{1}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)} \cdot {\left(e^{{x0}^{\frac{2}{3}}}\right)}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}}{\sqrt{e^{x0}} \cdot \sqrt{e^{x0}}}\right)\right)}\]
  16. Applied times-frac6.8

    \[\leadsto e^{\log \left(\log \color{blue}{\left(\frac{{1}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{\sqrt{e^{x0}}} \cdot \frac{{\left(e^{{x0}^{\frac{2}{3}}}\right)}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{\sqrt{e^{x0}}}\right)}\right)}\]
  17. Applied log-prod7.0

    \[\leadsto e^{\log \color{blue}{\left(\log \left(\frac{{1}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{\sqrt{e^{x0}}}\right) + \log \left(\frac{{\left(e^{{x0}^{\frac{2}{3}}}\right)}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{\sqrt{e^{x0}}}\right)\right)}}\]
  18. Simplified7.0

    \[\leadsto e^{\log \left(\color{blue}{\log \left(\frac{1}{\sqrt{e^{x0}}}\right)} + \log \left(\frac{{\left(e^{{x0}^{\frac{2}{3}}}\right)}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{\sqrt{e^{x0}}}\right)\right)}\]
  19. Simplified6.4

    \[\leadsto e^{\log \left(\log \left(\frac{1}{\sqrt{e^{x0}}}\right) + \color{blue}{\mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)}\right)}\]
  20. Final simplification6.4

    \[\leadsto e^{\log \left(\log \left(\frac{1}{\sqrt{e^{x0}}}\right) + \mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)\right)}\]

Reproduce

herbie shell --seed 2019353 +o rules:numerics
(FPCore (x0 x1)
  :name "(- (/ x0 (- 1 x1)) x0)"
  :precision binary64
  :pre (or (and (== x0 1.855) (== x1 0.000209)) (and (== x0 2.985) (== x1 0.0186)))

  :herbie-target
  (/ (* x0 x1) (- 1 x1))

  (- (/ x0 (- 1 x1)) x0))