Average Error: 0.1 → 0.1
Time: 15.5s
Precision: 64
\[1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[1.0 - \left(x \cdot 0.253 + \left(x \cdot x\right) \cdot 0.12\right)\]
1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)
1.0 - \left(x \cdot 0.253 + \left(x \cdot x\right) \cdot 0.12\right)
double f(double x) {
        double r1998049 = 1.0;
        double r1998050 = x;
        double r1998051 = 0.253;
        double r1998052 = 0.12;
        double r1998053 = r1998050 * r1998052;
        double r1998054 = r1998051 + r1998053;
        double r1998055 = r1998050 * r1998054;
        double r1998056 = r1998049 - r1998055;
        return r1998056;
}

double f(double x) {
        double r1998057 = 1.0;
        double r1998058 = x;
        double r1998059 = 0.253;
        double r1998060 = r1998058 * r1998059;
        double r1998061 = r1998058 * r1998058;
        double r1998062 = 0.12;
        double r1998063 = r1998061 * r1998062;
        double r1998064 = r1998060 + r1998063;
        double r1998065 = r1998057 - r1998064;
        return r1998065;
}

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. Using strategy rm
  7. Applied associate-*l*0.1

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

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

Reproduce

herbie shell --seed 2019164 +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)))))