Average Error: 0.1 → 0.2
Time: 16.4s
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 r4760870 = 1.0;
        double r4760871 = x;
        double r4760872 = 0.253;
        double r4760873 = 0.12;
        double r4760874 = r4760871 * r4760873;
        double r4760875 = r4760872 + r4760874;
        double r4760876 = r4760871 * r4760875;
        double r4760877 = r4760870 - r4760876;
        return r4760877;
}

double f(double x) {
        double r4760878 = 1.0;
        double r4760879 = x;
        double r4760880 = 0.253;
        double r4760881 = r4760879 * r4760880;
        double r4760882 = r4760879 * r4760879;
        double r4760883 = 0.12;
        double r4760884 = r4760882 * r4760883;
        double r4760885 = r4760881 + r4760884;
        double r4760886 = r4760878 - r4760885;
        return r4760886;
}

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. Using strategy rm
  3. Applied distribute-rgt-in0.1

    \[\leadsto 1.0 - \color{blue}{\left(0.253 \cdot x + \left(x \cdot 0.12\right) \cdot x\right)}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.2

    \[\leadsto 1.0 - \left(0.253 \cdot x + \color{blue}{\sqrt{\left(x \cdot 0.12\right) \cdot x} \cdot \sqrt{\left(x \cdot 0.12\right) \cdot x}}\right)\]
  6. Taylor expanded around 0 0.2

    \[\leadsto 1.0 - \left(0.253 \cdot x + \color{blue}{{x}^{2} \cdot {\left(\sqrt{0.12}\right)}^{2}}\right)\]
  7. Simplified0.2

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

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

Reproduce

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