Average Error: 0.2 → 0.1
Time: 2.1s
Precision: 64
\[0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
\[\mathsf{fma}\left(0.95492965855137202, x, \left(\left(-0.129006137732797982\right) \cdot x\right) \cdot \left(x \cdot x\right)\right)\]
0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\mathsf{fma}\left(0.95492965855137202, x, \left(\left(-0.129006137732797982\right) \cdot x\right) \cdot \left(x \cdot x\right)\right)
double f(double x) {
        double r29504 = 0.954929658551372;
        double r29505 = x;
        double r29506 = r29504 * r29505;
        double r29507 = 0.12900613773279798;
        double r29508 = r29505 * r29505;
        double r29509 = r29508 * r29505;
        double r29510 = r29507 * r29509;
        double r29511 = r29506 - r29510;
        return r29511;
}

double f(double x) {
        double r29512 = 0.954929658551372;
        double r29513 = x;
        double r29514 = 0.12900613773279798;
        double r29515 = -r29514;
        double r29516 = r29515 * r29513;
        double r29517 = r29513 * r29513;
        double r29518 = r29516 * r29517;
        double r29519 = fma(r29512, r29513, r29518);
        return r29519;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.2

    \[0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
  2. Using strategy rm
  3. Applied fma-neg0.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(0.95492965855137202, x, -0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}\]
  4. Simplified0.1

    \[\leadsto \mathsf{fma}\left(0.95492965855137202, x, \color{blue}{\left(-0.129006137732797982\right) \cdot {x}^{3}}\right)\]
  5. Using strategy rm
  6. Applied cube-mult0.2

    \[\leadsto \mathsf{fma}\left(0.95492965855137202, x, \left(-0.129006137732797982\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot x\right)\right)}\right)\]
  7. Applied associate-*r*0.1

    \[\leadsto \mathsf{fma}\left(0.95492965855137202, x, \color{blue}{\left(\left(-0.129006137732797982\right) \cdot x\right) \cdot \left(x \cdot x\right)}\right)\]
  8. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(0.95492965855137202, x, \left(\left(-0.129006137732797982\right) \cdot x\right) \cdot \left(x \cdot x\right)\right)\]

Reproduce

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