Average Error: 7.9 → 6.0
Time: 27.2s
Precision: 64
Internal Precision: 128
\[\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}\]

Error

Bits error versus x0

Bits error versus x1

Target

Original7.9
Target0.2
Herbie6.0
\[\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 *-un-lft-identity8.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)}}\]
    14. 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)}}\]
    15. 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)}\]
    16. Using strategy rm
    17. 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)}}\]
    18. 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.5

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

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

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

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

      \[\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.1

      \[\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.0

    \[\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 2019091 +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))