Average Error: 0.1 → 0.1
Time: 18.6s
Precision: 64
\[1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[1.0 - \left(0.253 \cdot x + \left(0.12 \cdot x\right) \cdot x\right)\]
1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)
1.0 - \left(0.253 \cdot x + \left(0.12 \cdot x\right) \cdot x\right)
double f(double x) {
        double r4139707 = 1.0;
        double r4139708 = x;
        double r4139709 = 0.253;
        double r4139710 = 0.12;
        double r4139711 = r4139708 * r4139710;
        double r4139712 = r4139709 + r4139711;
        double r4139713 = r4139708 * r4139712;
        double r4139714 = r4139707 - r4139713;
        return r4139714;
}

double f(double x) {
        double r4139715 = 1.0;
        double r4139716 = 0.253;
        double r4139717 = x;
        double r4139718 = r4139716 * r4139717;
        double r4139719 = 0.12;
        double r4139720 = r4139719 * r4139717;
        double r4139721 = r4139720 * r4139717;
        double r4139722 = r4139718 + r4139721;
        double r4139723 = r4139715 - r4139722;
        return r4139723;
}

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-lft-in0.1

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

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

Reproduce

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