Average Error: 0.2 → 0.1
Time: 2.7s
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(-0.129006137732797982\right) \cdot {x}^{3}\right)\]
0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\mathsf{fma}\left(0.95492965855137202, x, \left(-0.129006137732797982\right) \cdot {x}^{3}\right)
double f(double x) {
        double r25326 = 0.954929658551372;
        double r25327 = x;
        double r25328 = r25326 * r25327;
        double r25329 = 0.12900613773279798;
        double r25330 = r25327 * r25327;
        double r25331 = r25330 * r25327;
        double r25332 = r25329 * r25331;
        double r25333 = r25328 - r25332;
        return r25333;
}

double f(double x) {
        double r25334 = 0.954929658551372;
        double r25335 = x;
        double r25336 = 0.12900613773279798;
        double r25337 = -r25336;
        double r25338 = 3.0;
        double r25339 = pow(r25335, r25338);
        double r25340 = r25337 * r25339;
        double r25341 = fma(r25334, r25335, r25340);
        return r25341;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.2

    \[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. Final simplification0.1

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

Reproduce

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