Average Error: 0.1 → 0.1
Time: 37.0s
Precision: 64
\[0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
\[\mathsf{fma}\left(1, 0.954929658551372, 0.12900613773279798 \cdot \left(x \cdot \left(-x\right)\right)\right) \cdot x + x \cdot \mathsf{fma}\left(x \cdot \left(-x\right), 0.12900613773279798, \left(x \cdot x\right) \cdot 0.12900613773279798\right)\]
0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\mathsf{fma}\left(1, 0.954929658551372, 0.12900613773279798 \cdot \left(x \cdot \left(-x\right)\right)\right) \cdot x + x \cdot \mathsf{fma}\left(x \cdot \left(-x\right), 0.12900613773279798, \left(x \cdot x\right) \cdot 0.12900613773279798\right)
double f(double x) {
        double r1030462 = 0.954929658551372;
        double r1030463 = x;
        double r1030464 = r1030462 * r1030463;
        double r1030465 = 0.12900613773279798;
        double r1030466 = r1030463 * r1030463;
        double r1030467 = r1030466 * r1030463;
        double r1030468 = r1030465 * r1030467;
        double r1030469 = r1030464 - r1030468;
        return r1030469;
}

double f(double x) {
        double r1030470 = 1.0;
        double r1030471 = 0.954929658551372;
        double r1030472 = 0.12900613773279798;
        double r1030473 = x;
        double r1030474 = -r1030473;
        double r1030475 = r1030473 * r1030474;
        double r1030476 = r1030472 * r1030475;
        double r1030477 = fma(r1030470, r1030471, r1030476);
        double r1030478 = r1030477 * r1030473;
        double r1030479 = r1030473 * r1030473;
        double r1030480 = r1030479 * r1030472;
        double r1030481 = fma(r1030475, r1030472, r1030480);
        double r1030482 = r1030473 * r1030481;
        double r1030483 = r1030478 + r1030482;
        return r1030483;
}

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. Simplified0.1

    \[\leadsto \color{blue}{x \cdot \left(0.954929658551372 - \left(0.12900613773279798 \cdot x\right) \cdot x\right)}\]
  3. Using strategy rm
  4. Applied associate-*l*0.1

    \[\leadsto x \cdot \left(0.954929658551372 - \color{blue}{0.12900613773279798 \cdot \left(x \cdot x\right)}\right)\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.1

    \[\leadsto x \cdot \left(\color{blue}{1 \cdot 0.954929658551372} - 0.12900613773279798 \cdot \left(x \cdot x\right)\right)\]
  7. Applied prod-diff0.1

    \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(1, 0.954929658551372, -\left(x \cdot x\right) \cdot 0.12900613773279798\right) + \mathsf{fma}\left(-x \cdot x, 0.12900613773279798, \left(x \cdot x\right) \cdot 0.12900613773279798\right)\right)}\]
  8. Applied distribute-lft-in0.1

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

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

Reproduce

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