Average Error: 0.1 → 0.1
Time: 20.1s
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 r2814813 = 1.0;
        double r2814814 = x;
        double r2814815 = 0.253;
        double r2814816 = 0.12;
        double r2814817 = r2814814 * r2814816;
        double r2814818 = r2814815 + r2814817;
        double r2814819 = r2814814 * r2814818;
        double r2814820 = r2814813 - r2814819;
        return r2814820;
}

double f(double x) {
        double r2814821 = 1.0;
        double r2814822 = 0.253;
        double r2814823 = x;
        double r2814824 = r2814822 * r2814823;
        double r2814825 = 0.12;
        double r2814826 = r2814825 * r2814823;
        double r2814827 = r2814826 * r2814823;
        double r2814828 = r2814824 + r2814827;
        double r2814829 = r2814821 - r2814828;
        return r2814829;
}

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