Average Error: 0.1 → 0.1
Time: 17.2s
Precision: 64
\[0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
\[\mathsf{fma}\left(0.954929658551372, x, {x}^{3} \cdot \left(-0.12900613773279798\right)\right)\]
0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\mathsf{fma}\left(0.954929658551372, x, {x}^{3} \cdot \left(-0.12900613773279798\right)\right)
double f(double x) {
        double r743659 = 0.954929658551372;
        double r743660 = x;
        double r743661 = r743659 * r743660;
        double r743662 = 0.12900613773279798;
        double r743663 = r743660 * r743660;
        double r743664 = r743663 * r743660;
        double r743665 = r743662 * r743664;
        double r743666 = r743661 - r743665;
        return r743666;
}

double f(double x) {
        double r743667 = 0.954929658551372;
        double r743668 = x;
        double r743669 = 3.0;
        double r743670 = pow(r743668, r743669);
        double r743671 = 0.12900613773279798;
        double r743672 = -r743671;
        double r743673 = r743670 * r743672;
        double r743674 = fma(r743667, r743668, r743673);
        return r743674;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
  2. Using strategy rm
  3. Applied fma-neg0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(0.954929658551372, x, -0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}\]
  4. Using strategy rm
  5. Applied pow10.1

    \[\leadsto \mathsf{fma}\left(0.954929658551372, x, -0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{{x}^{1}}\right)\right)\]
  6. Applied pow10.1

    \[\leadsto \mathsf{fma}\left(0.954929658551372, x, -0.12900613773279798 \cdot \left(\left(x \cdot \color{blue}{{x}^{1}}\right) \cdot {x}^{1}\right)\right)\]
  7. Applied pow10.1

    \[\leadsto \mathsf{fma}\left(0.954929658551372, x, -0.12900613773279798 \cdot \left(\left(\color{blue}{{x}^{1}} \cdot {x}^{1}\right) \cdot {x}^{1}\right)\right)\]
  8. Applied pow-prod-up0.1

    \[\leadsto \mathsf{fma}\left(0.954929658551372, x, -0.12900613773279798 \cdot \left(\color{blue}{{x}^{\left(1 + 1\right)}} \cdot {x}^{1}\right)\right)\]
  9. Applied pow-prod-up0.1

    \[\leadsto \mathsf{fma}\left(0.954929658551372, x, -0.12900613773279798 \cdot \color{blue}{{x}^{\left(\left(1 + 1\right) + 1\right)}}\right)\]
  10. Simplified0.1

    \[\leadsto \mathsf{fma}\left(0.954929658551372, x, -0.12900613773279798 \cdot {x}^{\color{blue}{3}}\right)\]
  11. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(0.954929658551372, x, {x}^{3} \cdot \left(-0.12900613773279798\right)\right)\]

Reproduce

herbie shell --seed 2019138 +o rules:numerics
(FPCore (x)
  :name "Rosa's Benchmark"
  (- (* 0.954929658551372 x) (* 0.12900613773279798 (* (* x x) x))))