Average Error: 0.2 → 0.1
Time: 2.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, \left(-0.1290061377327979819096270830414141528308\right) \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, \left(-0.1290061377327979819096270830414141528308\right) \cdot {x}^{3}\right)
double f(double x) {
        double r21394 = 0.954929658551372;
        double r21395 = x;
        double r21396 = r21394 * r21395;
        double r21397 = 0.12900613773279798;
        double r21398 = r21395 * r21395;
        double r21399 = r21398 * r21395;
        double r21400 = r21397 * r21399;
        double r21401 = r21396 - r21400;
        return r21401;
}

double f(double x) {
        double r21402 = 0.954929658551372;
        double r21403 = x;
        double r21404 = 0.12900613773279798;
        double r21405 = -r21404;
        double r21406 = 3.0;
        double r21407 = pow(r21403, r21406);
        double r21408 = r21405 * r21407;
        double r21409 = fma(r21402, r21403, r21408);
        return r21409;
}

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.2

    \[\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}{\left(-0.1290061377327979819096270830414141528308\right) \cdot {x}^{3}}\right)\]
  5. Final simplification0.1

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

Reproduce

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