Average Error: 0.1 → 0.1
Time: 2.6s
Precision: 64
\[0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
\[\mathsf{fma}\left(0.95492965855137202, x, \left(\left(-0.129006137732797982\right) \cdot x\right) \cdot \left(x \cdot x\right)\right)\]
0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\mathsf{fma}\left(0.95492965855137202, x, \left(\left(-0.129006137732797982\right) \cdot x\right) \cdot \left(x \cdot x\right)\right)
double f(double x) {
        double r26057 = 0.954929658551372;
        double r26058 = x;
        double r26059 = r26057 * r26058;
        double r26060 = 0.12900613773279798;
        double r26061 = r26058 * r26058;
        double r26062 = r26061 * r26058;
        double r26063 = r26060 * r26062;
        double r26064 = r26059 - r26063;
        return r26064;
}

double f(double x) {
        double r26065 = 0.954929658551372;
        double r26066 = x;
        double r26067 = 0.12900613773279798;
        double r26068 = -r26067;
        double r26069 = r26068 * r26066;
        double r26070 = r26066 * r26066;
        double r26071 = r26069 * r26070;
        double r26072 = fma(r26065, r26066, r26071);
        return r26072;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[0.95492965855137202 \cdot x - 0.129006137732797982 \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.95492965855137202, x, -0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}\]
  4. Simplified0.1

    \[\leadsto \mathsf{fma}\left(0.95492965855137202, x, \color{blue}{\left(-0.129006137732797982\right) \cdot {x}^{3}}\right)\]
  5. Using strategy rm
  6. Applied cube-mult0.1

    \[\leadsto \mathsf{fma}\left(0.95492965855137202, x, \left(-0.129006137732797982\right) \cdot \color{blue}{\left(x \cdot \left(x \cdot x\right)\right)}\right)\]
  7. Applied associate-*r*0.1

    \[\leadsto \mathsf{fma}\left(0.95492965855137202, x, \color{blue}{\left(\left(-0.129006137732797982\right) \cdot x\right) \cdot \left(x \cdot x\right)}\right)\]
  8. Final simplification0.1

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

Reproduce

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