Average Error: 0.0 → 0.0
Time: 6.1s
Precision: 64
\[x \cdot \left(1 - x \cdot 0.5\right)\]
\[1 \cdot x + \left(-x \cdot 0.5\right) \cdot x\]
x \cdot \left(1 - x \cdot 0.5\right)
1 \cdot x + \left(-x \cdot 0.5\right) \cdot x
double f(double x) {
        double r6072330 = x;
        double r6072331 = 1.0;
        double r6072332 = 0.5;
        double r6072333 = r6072330 * r6072332;
        double r6072334 = r6072331 - r6072333;
        double r6072335 = r6072330 * r6072334;
        return r6072335;
}

double f(double x) {
        double r6072336 = 1.0;
        double r6072337 = x;
        double r6072338 = r6072336 * r6072337;
        double r6072339 = 0.5;
        double r6072340 = r6072337 * r6072339;
        double r6072341 = -r6072340;
        double r6072342 = r6072341 * r6072337;
        double r6072343 = r6072338 + r6072342;
        return r6072343;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[x \cdot \left(1 - x \cdot 0.5\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto x \cdot \color{blue}{\left(1 + \left(-x \cdot 0.5\right)\right)}\]
  4. Applied distribute-rgt-in0.0

    \[\leadsto \color{blue}{1 \cdot x + \left(-x \cdot 0.5\right) \cdot x}\]
  5. Final simplification0.0

    \[\leadsto 1 \cdot x + \left(-x \cdot 0.5\right) \cdot x\]

Reproduce

herbie shell --seed 2019173 
(FPCore (x)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, B"
  (* x (- 1.0 (* x 0.5))))