Average Error: 7.8 → 7.2
Time: 29.9s
Precision: 64
\[x0 = 1.855 \land x1 = 0.000209 \lor x0 = 2.985 \land x1 = 0.0186\]
\[\frac{x0}{1 - x1} - x0\]
\[{\left({e}^{\left(\sqrt[3]{\log \left(\mathsf{fma}\left(\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right), \left(\frac{\sqrt[3]{x0}}{1 - x1}\right), \left(-x0\right)\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{fma}\left(\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right), \left(\frac{\sqrt[3]{x0}}{1 - x1}\right), \left(-x0\right)\right)\right)}\right)}\right)}^{\left(\sqrt[3]{\log \left(\mathsf{fma}\left(\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right), \left(\frac{\sqrt[3]{x0}}{1 - x1}\right), \left(-x0\right)\right)\right)}\right)}\]
\frac{x0}{1 - x1} - x0
{\left({e}^{\left(\sqrt[3]{\log \left(\mathsf{fma}\left(\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right), \left(\frac{\sqrt[3]{x0}}{1 - x1}\right), \left(-x0\right)\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{fma}\left(\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right), \left(\frac{\sqrt[3]{x0}}{1 - x1}\right), \left(-x0\right)\right)\right)}\right)}\right)}^{\left(\sqrt[3]{\log \left(\mathsf{fma}\left(\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right), \left(\frac{\sqrt[3]{x0}}{1 - x1}\right), \left(-x0\right)\right)\right)}\right)}
double f(double x0, double x1) {
        double r20081091 = x0;
        double r20081092 = 1.0;
        double r20081093 = x1;
        double r20081094 = r20081092 - r20081093;
        double r20081095 = r20081091 / r20081094;
        double r20081096 = r20081095 - r20081091;
        return r20081096;
}

double f(double x0, double x1) {
        double r20081097 = exp(1.0);
        double r20081098 = x0;
        double r20081099 = cbrt(r20081098);
        double r20081100 = r20081099 * r20081099;
        double r20081101 = 1.0;
        double r20081102 = x1;
        double r20081103 = r20081101 - r20081102;
        double r20081104 = r20081099 / r20081103;
        double r20081105 = -r20081098;
        double r20081106 = fma(r20081100, r20081104, r20081105);
        double r20081107 = log(r20081106);
        double r20081108 = cbrt(r20081107);
        double r20081109 = r20081108 * r20081108;
        double r20081110 = pow(r20081097, r20081109);
        double r20081111 = pow(r20081110, r20081108);
        return r20081111;
}

Error

Bits error versus x0

Bits error versus x1

Target

Original7.8
Target0.3
Herbie7.2
\[\frac{x0 \cdot x1}{1 - x1}\]

Derivation

  1. Initial program 7.8

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

    \[\leadsto \frac{x0}{1 - \color{blue}{1 \cdot x1}} - x0\]
  4. Applied *-un-lft-identity7.8

    \[\leadsto \frac{x0}{\color{blue}{1 \cdot 1} - 1 \cdot x1} - x0\]
  5. Applied distribute-lft-out--7.8

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

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

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

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

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

    \[\leadsto \color{blue}{e^{\log \left(\mathsf{fma}\left(\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right), \left(\frac{\sqrt[3]{x0}}{1 - x1}\right), \left(-x0\right)\right)\right)}}\]
  12. Using strategy rm
  13. Applied *-un-lft-identity6.9

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019120 +o rules:numerics
(FPCore (x0 x1)
  :name "(- (/ x0 (- 1 x1)) x0)"
  :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))