Average Error: 0.1 → 0.1
Time: 22.1s
Precision: 64
\[0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
\[\mathsf{fma}\left(0.954929658551372, x, \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(-0.12900613773279798\right)\right)\right)\]
0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\mathsf{fma}\left(0.954929658551372, x, \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(-0.12900613773279798\right)\right)\right)
double f(double x) {
        double r839416 = 0.954929658551372;
        double r839417 = x;
        double r839418 = r839416 * r839417;
        double r839419 = 0.12900613773279798;
        double r839420 = r839417 * r839417;
        double r839421 = r839420 * r839417;
        double r839422 = r839419 * r839421;
        double r839423 = r839418 - r839422;
        return r839423;
}

double f(double x) {
        double r839424 = 0.954929658551372;
        double r839425 = x;
        double r839426 = r839425 * r839425;
        double r839427 = r839426 * r839425;
        double r839428 = 0.12900613773279798;
        double r839429 = -r839428;
        double r839430 = r839427 * r839429;
        double r839431 = fma(r839424, r839425, r839430);
        return r839431;
}

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, \left(-0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right)}\]
  4. Final simplification0.1

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

Reproduce

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