Average Error: 0.1 → 0.2
Time: 17.0s
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 r5036876 = 1.0;
        double r5036877 = x;
        double r5036878 = 0.253;
        double r5036879 = 0.12;
        double r5036880 = r5036877 * r5036879;
        double r5036881 = r5036878 + r5036880;
        double r5036882 = r5036877 * r5036881;
        double r5036883 = r5036876 - r5036882;
        return r5036883;
}

double f(double x) {
        double r5036884 = 1.0;
        double r5036885 = x;
        double r5036886 = 0.253;
        double r5036887 = r5036885 * r5036886;
        double r5036888 = r5036885 * r5036885;
        double r5036889 = 0.12;
        double r5036890 = r5036888 * r5036889;
        double r5036891 = r5036887 + r5036890;
        double r5036892 = r5036884 - r5036891;
        return r5036892;
}

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)))))