Average Error: 0.2 → 0.1
Time: 20.3s
Precision: 64
\[0.9549296585513720181381813745247200131416 \cdot x - 0.1290061377327979819096270830414141528308 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
\[\mathsf{fma}\left(0.9549296585513720181381813745247200131416, x, -0.1290061377327979819096270830414141528308 \cdot {x}^{3}\right)\]
0.9549296585513720181381813745247200131416 \cdot x - 0.1290061377327979819096270830414141528308 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\mathsf{fma}\left(0.9549296585513720181381813745247200131416, x, -0.1290061377327979819096270830414141528308 \cdot {x}^{3}\right)
double f(double x) {
        double r18733 = 0.954929658551372;
        double r18734 = x;
        double r18735 = r18733 * r18734;
        double r18736 = 0.12900613773279798;
        double r18737 = r18734 * r18734;
        double r18738 = r18737 * r18734;
        double r18739 = r18736 * r18738;
        double r18740 = r18735 - r18739;
        return r18740;
}

double f(double x) {
        double r18741 = 0.954929658551372;
        double r18742 = x;
        double r18743 = 0.12900613773279798;
        double r18744 = 3.0;
        double r18745 = pow(r18742, r18744);
        double r18746 = r18743 * r18745;
        double r18747 = -r18746;
        double r18748 = fma(r18741, r18742, r18747);
        return r18748;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.2

    \[0.9549296585513720181381813745247200131416 \cdot x - 0.1290061377327979819096270830414141528308 \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.9549296585513720181381813745247200131416, x, -0.1290061377327979819096270830414141528308 \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}\]
  4. Simplified0.1

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

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

Reproduce

herbie shell --seed 2019306 +o rules:numerics
(FPCore (x)
  :name "Rosa's Benchmark"
  :precision binary64
  (- (* 0.95492965855137202 x) (* 0.129006137732797982 (* (* x x) x))))