Average Error: 0.1 → 0.1
Time: 15.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(-{x}^{3}\right) \cdot 0.129006137732797982\right)\]
0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\mathsf{fma}\left(0.95492965855137202, x, \left(-{x}^{3}\right) \cdot 0.129006137732797982\right)
double f(double x) {
        double r17536 = 0.954929658551372;
        double r17537 = x;
        double r17538 = r17536 * r17537;
        double r17539 = 0.12900613773279798;
        double r17540 = r17537 * r17537;
        double r17541 = r17540 * r17537;
        double r17542 = r17539 * r17541;
        double r17543 = r17538 - r17542;
        return r17543;
}

double f(double x) {
        double r17544 = 0.954929658551372;
        double r17545 = x;
        double r17546 = 3.0;
        double r17547 = pow(r17545, r17546);
        double r17548 = -r17547;
        double r17549 = 0.12900613773279798;
        double r17550 = r17548 * r17549;
        double r17551 = fma(r17544, r17545, r17550);
        return r17551;
}

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

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

Reproduce

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