Average Error: 0.2 → 0.1
Time: 13.3s
Precision: 64
\[0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
\[\left(0.954929658551372 - \left(0.12900613773279798 \cdot x\right) \cdot x\right) \cdot x + \mathsf{fma}\left(-x, 0.12900613773279798 \cdot x, \left(0.12900613773279798 \cdot x\right) \cdot x\right) \cdot x\]
0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\left(0.954929658551372 - \left(0.12900613773279798 \cdot x\right) \cdot x\right) \cdot x + \mathsf{fma}\left(-x, 0.12900613773279798 \cdot x, \left(0.12900613773279798 \cdot x\right) \cdot x\right) \cdot x
double f(double x) {
        double r364811 = 0.954929658551372;
        double r364812 = x;
        double r364813 = r364811 * r364812;
        double r364814 = 0.12900613773279798;
        double r364815 = r364812 * r364812;
        double r364816 = r364815 * r364812;
        double r364817 = r364814 * r364816;
        double r364818 = r364813 - r364817;
        return r364818;
}

double f(double x) {
        double r364819 = 0.954929658551372;
        double r364820 = 0.12900613773279798;
        double r364821 = x;
        double r364822 = r364820 * r364821;
        double r364823 = r364822 * r364821;
        double r364824 = r364819 - r364823;
        double r364825 = r364824 * r364821;
        double r364826 = -r364821;
        double r364827 = fma(r364826, r364822, r364823);
        double r364828 = r364827 * r364821;
        double r364829 = r364825 + r364828;
        return r364829;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.2

    \[0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
  2. Simplified0.1

    \[\leadsto \color{blue}{x \cdot \left(0.954929658551372 - \left(0.12900613773279798 \cdot x\right) \cdot x\right)}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.1

    \[\leadsto x \cdot \left(\color{blue}{1 \cdot 0.954929658551372} - \left(0.12900613773279798 \cdot x\right) \cdot x\right)\]
  5. Applied prod-diff0.1

    \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(1, 0.954929658551372, -x \cdot \left(0.12900613773279798 \cdot x\right)\right) + \mathsf{fma}\left(-x, 0.12900613773279798 \cdot x, x \cdot \left(0.12900613773279798 \cdot x\right)\right)\right)}\]
  6. Applied distribute-rgt-in0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(1, 0.954929658551372, -x \cdot \left(0.12900613773279798 \cdot x\right)\right) \cdot x + \mathsf{fma}\left(-x, 0.12900613773279798 \cdot x, x \cdot \left(0.12900613773279798 \cdot x\right)\right) \cdot x}\]
  7. Simplified0.1

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

    \[\leadsto \left(0.954929658551372 - \left(0.12900613773279798 \cdot x\right) \cdot x\right) \cdot x + \mathsf{fma}\left(-x, 0.12900613773279798 \cdot x, \left(0.12900613773279798 \cdot x\right) \cdot x\right) \cdot x\]

Reproduce

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