Average Error: 0.1 → 0.1
Time: 13.5s
Precision: 64
\[0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)\]
\[\mathsf{fma}\left(0.95492965855137202, x, -{x}^{3} \cdot 0.129006137732797982\right) + \left(0.129006137732797982 - 0.129006137732797982\right) \cdot {x}^{3}\]
0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\mathsf{fma}\left(0.95492965855137202, x, -{x}^{3} \cdot 0.129006137732797982\right) + \left(0.129006137732797982 - 0.129006137732797982\right) \cdot {x}^{3}
double f(double x) {
        double r19601 = 0.954929658551372;
        double r19602 = x;
        double r19603 = r19601 * r19602;
        double r19604 = 0.12900613773279798;
        double r19605 = r19602 * r19602;
        double r19606 = r19605 * r19602;
        double r19607 = r19604 * r19606;
        double r19608 = r19603 - r19607;
        return r19608;
}

double f(double x) {
        double r19609 = 0.954929658551372;
        double r19610 = x;
        double r19611 = 3.0;
        double r19612 = pow(r19610, r19611);
        double r19613 = 0.12900613773279798;
        double r19614 = r19612 * r19613;
        double r19615 = -r19614;
        double r19616 = fma(r19609, r19610, r19615);
        double r19617 = r19613 - r19613;
        double r19618 = r19617 * r19612;
        double r19619 = r19616 + r19618;
        return r19619;
}

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. Simplified0.1

    \[\leadsto \color{blue}{0.95492965855137202 \cdot x - 0.129006137732797982 \cdot {x}^{3}}\]
  3. Using strategy rm
  4. Applied prod-diff0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(0.95492965855137202, x, -{x}^{3} \cdot 0.129006137732797982\right) + \mathsf{fma}\left(-{x}^{3}, 0.129006137732797982, {x}^{3} \cdot 0.129006137732797982\right)}\]
  5. Simplified0.1

    \[\leadsto \mathsf{fma}\left(0.95492965855137202, x, -{x}^{3} \cdot 0.129006137732797982\right) + \color{blue}{\left(0.129006137732797982 - 0.129006137732797982\right) \cdot {x}^{3}}\]
  6. Final simplification0.1

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

Reproduce

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