Average Error: 7.9 → 6.1
Time: 32.4s
Precision: 64
\[x0 = 1.855 \land x1 = 0.000209 \lor x0 = 2.985 \land x1 = 0.0186\]
\[\frac{x0}{1 - x1} - x0\]
\[\begin{array}{l} \mathbf{if}\;x1 \le 0.00021208908081054686:\\ \;\;\;\;{\left({e}^{\left(\sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)} \cdot \sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right)}\right)}^{\left(\sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;(\left(\frac{\sqrt{x0}}{\sqrt{x1} + 1}\right) \cdot \left(\frac{\sqrt{x0}}{1 - \sqrt{x1}}\right) + \left(-x0\right))_*\\ \end{array}\]
\frac{x0}{1 - x1} - x0
\begin{array}{l}
\mathbf{if}\;x1 \le 0.00021208908081054686:\\
\;\;\;\;{\left({e}^{\left(\sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)} \cdot \sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right)}\right)}^{\left(\sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right)}\\

\mathbf{else}:\\
\;\;\;\;(\left(\frac{\sqrt{x0}}{\sqrt{x1} + 1}\right) \cdot \left(\frac{\sqrt{x0}}{1 - \sqrt{x1}}\right) + \left(-x0\right))_*\\

\end{array}
double f(double x0, double x1) {
        double r19436830 = x0;
        double r19436831 = 1.0;
        double r19436832 = x1;
        double r19436833 = r19436831 - r19436832;
        double r19436834 = r19436830 / r19436833;
        double r19436835 = r19436834 - r19436830;
        return r19436835;
}

double f(double x0, double x1) {
        double r19436836 = x1;
        double r19436837 = 0.00021208908081054686;
        bool r19436838 = r19436836 <= r19436837;
        double r19436839 = exp(1.0);
        double r19436840 = x0;
        double r19436841 = cbrt(r19436840);
        double r19436842 = r19436841 * r19436841;
        double r19436843 = 1.0;
        double r19436844 = r19436843 - r19436836;
        double r19436845 = r19436841 / r19436844;
        double r19436846 = -r19436840;
        double r19436847 = fma(r19436842, r19436845, r19436846);
        double r19436848 = log(r19436847);
        double r19436849 = cbrt(r19436848);
        double r19436850 = r19436849 * r19436849;
        double r19436851 = pow(r19436839, r19436850);
        double r19436852 = pow(r19436851, r19436849);
        double r19436853 = sqrt(r19436840);
        double r19436854 = sqrt(r19436836);
        double r19436855 = r19436854 + r19436843;
        double r19436856 = r19436853 / r19436855;
        double r19436857 = r19436843 - r19436854;
        double r19436858 = r19436853 / r19436857;
        double r19436859 = fma(r19436856, r19436858, r19436846);
        double r19436860 = r19436838 ? r19436852 : r19436859;
        return r19436860;
}

Error

Bits error versus x0

Bits error versus x1

Target

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

Derivation

  1. Split input into 2 regimes
  2. if x1 < 0.00021208908081054686

    1. Initial program 11.2

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

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

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

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

      \[\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-frac10.9

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

      \[\leadsto \color{blue}{(\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{1}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*}\]
    9. Simplified8.9

      \[\leadsto (\color{blue}{\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right)} \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\]
    10. Using strategy rm
    11. Applied add-exp-log8.9

      \[\leadsto \color{blue}{e^{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}}\]
    12. Using strategy rm
    13. Applied pow18.9

      \[\leadsto e^{\log \color{blue}{\left({\left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}^{1}\right)}}\]
    14. Applied log-pow8.9

      \[\leadsto e^{\color{blue}{1 \cdot \log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}}\]
    15. Applied exp-prod8.9

      \[\leadsto \color{blue}{{\left(e^{1}\right)}^{\left(\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)\right)}}\]
    16. Simplified8.9

      \[\leadsto {\color{blue}{e}}^{\left(\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)\right)}\]
    17. Using strategy rm
    18. Applied add-cube-cbrt8.9

      \[\leadsto {e}^{\color{blue}{\left(\left(\sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)} \cdot \sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right) \cdot \sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right)}}\]
    19. Applied pow-unpow8.9

      \[\leadsto \color{blue}{{\left({e}^{\left(\sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)} \cdot \sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right)}\right)}^{\left(\sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right)}}\]

    if 0.00021208908081054686 < x1

    1. Initial program 4.6

      \[\frac{x0}{1 - x1} - x0\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt4.6

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

      \[\leadsto \frac{x0}{\color{blue}{1 \cdot 1} - \sqrt{x1} \cdot \sqrt{x1}} - x0\]
    5. Applied difference-of-squares4.6

      \[\leadsto \frac{x0}{\color{blue}{\left(1 + \sqrt{x1}\right) \cdot \left(1 - \sqrt{x1}\right)}} - x0\]
    6. Applied add-sqr-sqrt4.6

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

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

      \[\leadsto \color{blue}{(\left(\frac{\sqrt{x0}}{1 + \sqrt{x1}}\right) \cdot \left(\frac{\sqrt{x0}}{1 - \sqrt{x1}}\right) + \left(-x0\right))_*}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification6.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x1 \le 0.00021208908081054686:\\ \;\;\;\;{\left({e}^{\left(\sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)} \cdot \sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right)}\right)}^{\left(\sqrt[3]{\log \left((\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1}\right) + \left(-x0\right))_*\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;(\left(\frac{\sqrt{x0}}{\sqrt{x1} + 1}\right) \cdot \left(\frac{\sqrt{x0}}{1 - \sqrt{x1}}\right) + \left(-x0\right))_*\\ \end{array}\]

Reproduce

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