Average Error: 0.1 → 0.1
Time: 10.8s
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(-0.12900613773279798\right) \cdot x\right) \cdot \left(x \cdot x\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(-0.12900613773279798\right) \cdot x\right) \cdot \left(x \cdot x\right)\right)
double f(double x) {
        double r400966 = 0.954929658551372;
        double r400967 = x;
        double r400968 = r400966 * r400967;
        double r400969 = 0.12900613773279798;
        double r400970 = r400967 * r400967;
        double r400971 = r400970 * r400967;
        double r400972 = r400969 * r400971;
        double r400973 = r400968 - r400972;
        return r400973;
}

double f(double x) {
        double r400974 = 0.954929658551372;
        double r400975 = x;
        double r400976 = 0.12900613773279798;
        double r400977 = -r400976;
        double r400978 = r400977 * r400975;
        double r400979 = r400975 * r400975;
        double r400980 = r400978 * r400979;
        double r400981 = fma(r400974, r400975, r400980);
        return r400981;
}

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

    \[\leadsto 0.954929658551372 \cdot x - 0.12900613773279798 \cdot \color{blue}{{x}^{3}}\]
  4. Using strategy rm
  5. Applied fma-neg0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(0.954929658551372, x, -0.12900613773279798 \cdot {x}^{3}\right)}\]
  6. Simplified0.1

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

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

Reproduce

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