Average Error: 0.0 → 0
Time: 4.9s
Precision: 64
\[x \cdot \left(1 - x \cdot 0.5\right)\]
\[\mathsf{fma}\left(0.5 \cdot x, x, \left(-x\right) \cdot 1\right) \cdot \sqrt[3]{-1}\]
x \cdot \left(1 - x \cdot 0.5\right)
\mathsf{fma}\left(0.5 \cdot x, x, \left(-x\right) \cdot 1\right) \cdot \sqrt[3]{-1}
double f(double x) {
        double r48575 = x;
        double r48576 = 1.0;
        double r48577 = 0.5;
        double r48578 = r48575 * r48577;
        double r48579 = r48576 - r48578;
        double r48580 = r48575 * r48579;
        return r48580;
}

double f(double x) {
        double r48581 = 0.5;
        double r48582 = x;
        double r48583 = r48581 * r48582;
        double r48584 = -r48582;
        double r48585 = 1.0;
        double r48586 = r48584 * r48585;
        double r48587 = fma(r48583, r48582, r48586);
        double r48588 = -1.0;
        double r48589 = cbrt(r48588);
        double r48590 = r48587 * r48589;
        return r48590;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[x \cdot \left(1 - x \cdot 0.5\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, -0.5, 1\right) \cdot x}\]
  3. Using strategy rm
  4. Applied add-cbrt-cube32.9

    \[\leadsto \mathsf{fma}\left(x, -0.5, 1\right) \cdot \color{blue}{\sqrt[3]{\left(x \cdot x\right) \cdot x}}\]
  5. Applied add-cbrt-cube33.0

    \[\leadsto \color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(x, -0.5, 1\right) \cdot \mathsf{fma}\left(x, -0.5, 1\right)\right) \cdot \mathsf{fma}\left(x, -0.5, 1\right)}} \cdot \sqrt[3]{\left(x \cdot x\right) \cdot x}\]
  6. Applied cbrt-unprod40.1

    \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\mathsf{fma}\left(x, -0.5, 1\right) \cdot \mathsf{fma}\left(x, -0.5, 1\right)\right) \cdot \mathsf{fma}\left(x, -0.5, 1\right)\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)}}\]
  7. Simplified40.1

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\mathsf{fma}\left(-0.5, x, 1\right) \cdot x\right)}^{3}}}\]
  8. Taylor expanded around -inf 0.0

    \[\leadsto \color{blue}{0.5 \cdot \left({x}^{2} \cdot \sqrt[3]{-1}\right) - 1 \cdot \left(x \cdot \sqrt[3]{-1}\right)}\]
  9. Simplified0

    \[\leadsto \color{blue}{\sqrt[3]{-1} \cdot \mathsf{fma}\left(0.5 \cdot x, x, \left(-x\right) \cdot 1\right)}\]
  10. Final simplification0

    \[\leadsto \mathsf{fma}\left(0.5 \cdot x, x, \left(-x\right) \cdot 1\right) \cdot \sqrt[3]{-1}\]

Reproduce

herbie shell --seed 2019194 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, B"
  (* x (- 1.0 (* x 0.5))))