Average Error: 7.9 → 5.5
Time: 4.0s
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\]
\[\frac{{\left(\log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)}^{3} + {\left(\mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)\right)}^{3}}{\mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1} \cdot {x0}^{\frac{2}{3}}\right) + \log \left(\sqrt{e^{x0}}\right) \cdot \log \left(\sqrt{e^{x0}}\right)}\]
\frac{x0}{1 - x1} - x0
\frac{{\left(\log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)}^{3} + {\left(\mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)\right)}^{3}}{\mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1} \cdot {x0}^{\frac{2}{3}}\right) + \log \left(\sqrt{e^{x0}}\right) \cdot \log \left(\sqrt{e^{x0}}\right)}
double f(double x0, double x1) {
        double r189469 = x0;
        double r189470 = 1.0;
        double r189471 = x1;
        double r189472 = r189470 - r189471;
        double r189473 = r189469 / r189472;
        double r189474 = r189473 - r189469;
        return r189474;
}

double f(double x0, double x1) {
        double r189475 = 1.0;
        double r189476 = x0;
        double r189477 = exp(r189476);
        double r189478 = sqrt(r189477);
        double r189479 = r189475 / r189478;
        double r189480 = log(r189479);
        double r189481 = 3.0;
        double r189482 = pow(r189480, r189481);
        double r189483 = cbrt(r189476);
        double r189484 = 1.0;
        double r189485 = x1;
        double r189486 = r189484 - r189485;
        double r189487 = r189483 / r189486;
        double r189488 = 0.6666666666666666;
        double r189489 = pow(r189476, r189488);
        double r189490 = fma(r189487, r189489, r189480);
        double r189491 = pow(r189490, r189481);
        double r189492 = r189482 + r189491;
        double r189493 = r189487 * r189489;
        double r189494 = r189490 * r189493;
        double r189495 = log(r189478);
        double r189496 = r189495 * r189495;
        double r189497 = r189494 + r189496;
        double r189498 = r189492 / r189497;
        return r189498;
}

Error

Bits error versus x0

Bits error versus x1

Target

Original7.9
Target0.3
Herbie5.5
\[\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-log-exp7.8

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

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

    \[\leadsto \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)\]
  12. Applied *-un-lft-identity7.3

    \[\leadsto \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)\]
  13. Applied unpow-prod-down7.3

    \[\leadsto \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)\]
  14. Applied times-frac6.9

    \[\leadsto \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)}\]
  15. Applied log-prod7.0

    \[\leadsto \color{blue}{\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)}\]
  16. Simplified7.0

    \[\leadsto \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)\]
  17. Simplified6.4

    \[\leadsto \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)}\]
  18. Using strategy rm
  19. Applied flip3-+5.5

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

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

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

Reproduce

herbie shell --seed 2019354 +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))