Average Error: 0.1 → 0.2
Time: 19.9s
Precision: 64
\[1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[\left(1.0 - \left(x \cdot x\right) \cdot 0.12\right) - 0.253 \cdot x\]
1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)
\left(1.0 - \left(x \cdot x\right) \cdot 0.12\right) - 0.253 \cdot x
double f(double x) {
        double r2646063 = 1.0;
        double r2646064 = x;
        double r2646065 = 0.253;
        double r2646066 = 0.12;
        double r2646067 = r2646064 * r2646066;
        double r2646068 = r2646065 + r2646067;
        double r2646069 = r2646064 * r2646068;
        double r2646070 = r2646063 - r2646069;
        return r2646070;
}

double f(double x) {
        double r2646071 = 1.0;
        double r2646072 = x;
        double r2646073 = r2646072 * r2646072;
        double r2646074 = 0.12;
        double r2646075 = r2646073 * r2646074;
        double r2646076 = r2646071 - r2646075;
        double r2646077 = 0.253;
        double r2646078 = r2646077 * r2646072;
        double r2646079 = r2646076 - r2646078;
        return r2646079;
}

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

    \[1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
  2. Simplified0.1

    \[\leadsto \color{blue}{1.0 - x \cdot \mathsf{fma}\left(0.12, x, 0.253\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.1

    \[\leadsto 1.0 - x \cdot \color{blue}{\left(0.12 \cdot x + 0.253\right)}\]
  5. Applied distribute-rgt-in0.1

    \[\leadsto 1.0 - \color{blue}{\left(\left(0.12 \cdot x\right) \cdot x + 0.253 \cdot x\right)}\]
  6. Applied associate--r+0.1

    \[\leadsto \color{blue}{\left(1.0 - \left(0.12 \cdot x\right) \cdot x\right) - 0.253 \cdot x}\]
  7. Using strategy rm
  8. Applied associate-*l*0.2

    \[\leadsto \left(1.0 - \color{blue}{0.12 \cdot \left(x \cdot x\right)}\right) - 0.253 \cdot x\]
  9. Final simplification0.2

    \[\leadsto \left(1.0 - \left(x \cdot x\right) \cdot 0.12\right) - 0.253 \cdot x\]

Reproduce

herbie shell --seed 2019158 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, A"
  (- 1.0 (* x (+ 0.253 (* x 0.12)))))