Average Error: 7.8 → 6.9
Time: 12.7s
Precision: 64
\[x0 = 1.854999999999999982236431605997495353222 \land x1 = 2.090000000000000115064208161541614572343 \cdot 10^{-4} \lor x0 = 2.984999999999999875655021241982467472553 \land x1 = 0.01859999999999999847899445626353553961962\]
\[\frac{x0}{1 - x1} - x0\]
\[\mathsf{fma}\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)\]
\frac{x0}{1 - x1} - x0
\mathsf{fma}\left(\sqrt[3]{x0} \cdot \sqrt[3]{x0}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)
double f(double x0, double x1) {
        double r96161 = x0;
        double r96162 = 1.0;
        double r96163 = x1;
        double r96164 = r96162 - r96163;
        double r96165 = r96161 / r96164;
        double r96166 = r96165 - r96161;
        return r96166;
}

double f(double x0, double x1) {
        double r96167 = x0;
        double r96168 = cbrt(r96167);
        double r96169 = r96168 * r96168;
        double r96170 = 1.0;
        double r96171 = x1;
        double r96172 = r96170 - r96171;
        double r96173 = r96168 / r96172;
        double r96174 = -r96167;
        double r96175 = fma(r96169, r96173, r96174);
        return r96175;
}

Error

Bits error versus x0

Bits error versus x1

Target

Original7.8
Target0.3
Herbie6.9
\[\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}{\color{blue}{1 \cdot \left(1 - x1\right)}} - x0\]
  4. 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\]
  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. Final simplification6.9

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

Reproduce

herbie shell --seed 2019304 +o rules:numerics
(FPCore (x0 x1)
  :name "(- (/ x0 (- 1 x1)) x0)"
  :precision binary64
  :pre (or (and (== x0 1.855) (== x1 2.09000000000000012e-4)) (and (== x0 2.98499999999999988) (== x1 0.018599999999999998)))

  :herbie-target
  (/ (* x0 x1) (- 1 x1))

  (- (/ x0 (- 1 x1)) x0))