Average Error: 0.0 → 0.0
Time: 3.5s
Precision: 64
\[x \cdot \left(1 - x \cdot 0.5\right)\]
\[\left(1 - x \cdot 0.5\right) \cdot x\]
x \cdot \left(1 - x \cdot 0.5\right)
\left(1 - x \cdot 0.5\right) \cdot x
double f(double x) {
        double r2440574 = x;
        double r2440575 = 1.0;
        double r2440576 = 0.5;
        double r2440577 = r2440574 * r2440576;
        double r2440578 = r2440575 - r2440577;
        double r2440579 = r2440574 * r2440578;
        return r2440579;
}

double f(double x) {
        double r2440580 = 1.0;
        double r2440581 = x;
        double r2440582 = 0.5;
        double r2440583 = r2440581 * r2440582;
        double r2440584 = r2440580 - r2440583;
        double r2440585 = r2440584 * r2440581;
        return r2440585;
}

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. Final simplification0.0

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

Reproduce

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