Average Error: 7.9 → 7.2
Time: 28.5s
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 r3582864 = x0;
        double r3582865 = 1.0;
        double r3582866 = x1;
        double r3582867 = r3582865 - r3582866;
        double r3582868 = r3582864 / r3582867;
        double r3582869 = r3582868 - r3582864;
        return r3582869;
}

double f(double x0, double x1) {
        double r3582870 = exp(1.0);
        double r3582871 = x0;
        double r3582872 = cbrt(r3582871);
        double r3582873 = r3582872 * r3582872;
        double r3582874 = 1.0;
        double r3582875 = x1;
        double r3582876 = r3582874 - r3582875;
        double r3582877 = r3582872 / r3582876;
        double r3582878 = -r3582871;
        double r3582879 = fma(r3582873, r3582877, r3582878);
        double r3582880 = log(r3582879);
        double r3582881 = cbrt(r3582880);
        double r3582882 = r3582881 * r3582881;
        double r3582883 = pow(r3582870, r3582882);
        double r3582884 = pow(r3582883, r3582881);
        return r3582884;
}

Error

Bits error versus x0

Bits error versus x1

Target

Original7.9
Target0.2
Herbie7.2
\[\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-neg7.0

    \[\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)}\]
  7. Simplified7.0

    \[\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)\]
  8. Using strategy rm
  9. Applied add-exp-log7.0

    \[\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)}}\]
  10. Using strategy rm
  11. Applied *-un-lft-identity7.0

    \[\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)}}\]
  12. 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)}}\]
  13. 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)}\]
  14. Using strategy rm
  15. Applied add-cube-cbrt7.2

    \[\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)}}\]
  16. 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)}}\]
  17. 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 2019124 +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))