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)\]
\[\left(0.95492965855137202 \cdot x - 0.129006137732797982 \cdot {x}^{3}\right) + {x}^{3} \cdot \left(\left(-0.129006137732797982\right) + 0.129006137732797982\right)\]
0.95492965855137202 \cdot x - 0.129006137732797982 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\left(0.95492965855137202 \cdot x - 0.129006137732797982 \cdot {x}^{3}\right) + {x}^{3} \cdot \left(\left(-0.129006137732797982\right) + 0.129006137732797982\right)
double f(double x) {
        double r27141 = 0.954929658551372;
        double r27142 = x;
        double r27143 = r27141 * r27142;
        double r27144 = 0.12900613773279798;
        double r27145 = r27142 * r27142;
        double r27146 = r27145 * r27142;
        double r27147 = r27144 * r27146;
        double r27148 = r27143 - r27147;
        return r27148;
}

double f(double x) {
        double r27149 = 0.954929658551372;
        double r27150 = x;
        double r27151 = r27149 * r27150;
        double r27152 = 0.12900613773279798;
        double r27153 = 3.0;
        double r27154 = pow(r27150, r27153);
        double r27155 = r27152 * r27154;
        double r27156 = r27151 - r27155;
        double r27157 = -r27152;
        double r27158 = r27157 + r27152;
        double r27159 = r27154 * r27158;
        double r27160 = r27156 + r27159;
        return r27160;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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 prod-diff0.1

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

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

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

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

Reproduce

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