Average Error: 7.9 → 6.9
Time: 1.8m
Precision: 64
\[x0 = 1.855 \land x1 = 2.09000000000000012 \cdot 10^{-4} \lor x0 = 2.98499999999999988 \land x1 = 0.018599999999999998\]
\[\frac{x0}{1 - x1} - x0\]
\[{e}^{\left(2 \cdot \log \left(\sqrt[3]{\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\right)\right)} \cdot {e}^{\left(\log \left(\sqrt[3]{\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\right)\right)}\]
\frac{x0}{1 - x1} - x0
{e}^{\left(2 \cdot \log \left(\sqrt[3]{\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\right)\right)} \cdot {e}^{\left(\log \left(\sqrt[3]{\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\right)\right)}
double f(double x0, double x1) {
        double r305387 = x0;
        double r305388 = 1.0;
        double r305389 = x1;
        double r305390 = r305388 - r305389;
        double r305391 = r305387 / r305390;
        double r305392 = r305391 - r305387;
        return r305392;
}

double f(double x0, double x1) {
        double r305393 = exp(1.0);
        double r305394 = 2.0;
        double r305395 = x0;
        double r305396 = 0.6666666666666666;
        double r305397 = pow(r305395, r305396);
        double r305398 = cbrt(r305395);
        double r305399 = 1.0;
        double r305400 = x1;
        double r305401 = r305399 - r305400;
        double r305402 = r305398 / r305401;
        double r305403 = -r305395;
        double r305404 = fma(r305397, r305402, r305403);
        double r305405 = cbrt(r305404);
        double r305406 = log(r305405);
        double r305407 = r305394 * r305406;
        double r305408 = pow(r305393, r305407);
        double r305409 = pow(r305393, r305406);
        double r305410 = r305408 * r305409;
        return r305410;
}

Error

Bits error versus x0

Bits error versus x1

Target

Original7.9
Target0.3
Herbie6.9
\[\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. Simplified6.9

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

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

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

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

    \[\leadsto {\color{blue}{e}}^{\left(\log \left(\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)\right)\right)}\]
  15. Using strategy rm
  16. Applied add-cube-cbrt6.9

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

    \[\leadsto {e}^{\color{blue}{\left(\log \left(\sqrt[3]{\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)} \cdot \sqrt[3]{\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\right) + \log \left(\sqrt[3]{\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\right)\right)}}\]
  18. Applied unpow-prod-up6.9

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

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

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

Reproduce

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