Average Error: 0.1 → 0.1
Time: 2.0s
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 r18206 = 0.954929658551372;
        double r18207 = x;
        double r18208 = r18206 * r18207;
        double r18209 = 0.12900613773279798;
        double r18210 = r18207 * r18207;
        double r18211 = r18210 * r18207;
        double r18212 = r18209 * r18211;
        double r18213 = r18208 - r18212;
        return r18213;
}

double f(double x) {
        double r18214 = 0.954929658551372;
        double r18215 = x;
        double r18216 = 0.12900613773279798;
        double r18217 = -r18216;
        double r18218 = 3.0;
        double r18219 = pow(r18215, r18218);
        double r18220 = r18217 * r18219;
        double r18221 = fma(r18214, r18215, r18220);
        return r18221;
}

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

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

Reproduce

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