Average Error: 0.1 → 0.1
Time: 2.2s
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 r20049 = 0.954929658551372;
        double r20050 = x;
        double r20051 = r20049 * r20050;
        double r20052 = 0.12900613773279798;
        double r20053 = r20050 * r20050;
        double r20054 = r20053 * r20050;
        double r20055 = r20052 * r20054;
        double r20056 = r20051 - r20055;
        return r20056;
}

double f(double x) {
        double r20057 = 0.954929658551372;
        double r20058 = x;
        double r20059 = 0.12900613773279798;
        double r20060 = -r20059;
        double r20061 = r20060 * r20058;
        double r20062 = r20058 * r20058;
        double r20063 = r20061 * r20062;
        double r20064 = fma(r20057, r20058, r20063);
        return r20064;
}

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 2020024 +o rules:numerics
(FPCore (x)
  :name "Rosa's Benchmark"
  :precision binary64
  (- (* 0.954929658551372 x) (* 0.12900613773279798 (* (* x x) x))))