Average Error: 0.1 → 0.1
Time: 2.0s
Precision: 64
\[1 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[\left(1 - 0.253 \cdot x\right) - x \cdot \left(x \cdot 0.12\right)\]
1 - x \cdot \left(0.253 + x \cdot 0.12\right)
\left(1 - 0.253 \cdot x\right) - x \cdot \left(x \cdot 0.12\right)
double f(double x) {
        double r72166 = 1.0;
        double r72167 = x;
        double r72168 = 0.253;
        double r72169 = 0.12;
        double r72170 = r72167 * r72169;
        double r72171 = r72168 + r72170;
        double r72172 = r72167 * r72171;
        double r72173 = r72166 - r72172;
        return r72173;
}

double f(double x) {
        double r72174 = 1.0;
        double r72175 = 0.253;
        double r72176 = x;
        double r72177 = r72175 * r72176;
        double r72178 = r72174 - r72177;
        double r72179 = 0.12;
        double r72180 = r72176 * r72179;
        double r72181 = r72176 * r72180;
        double r72182 = r72178 - r72181;
        return r72182;
}

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 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in0.1

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

    \[\leadsto \color{blue}{\left(1 - x \cdot 0.253\right) - x \cdot \left(x \cdot 0.12\right)}\]
  5. Simplified0.1

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

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

Reproduce

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