Average Error: 0.0 → 0.0
Time: 4.1s
Precision: 64
\[x \cdot \left(1 - x \cdot 0.5\right)\]
\[x \cdot \left(1 - 0.5 \cdot x\right)\]
x \cdot \left(1 - x \cdot 0.5\right)
x \cdot \left(1 - 0.5 \cdot x\right)
double f(double x) {
        double r41290 = x;
        double r41291 = 1.0;
        double r41292 = 0.5;
        double r41293 = r41290 * r41292;
        double r41294 = r41291 - r41293;
        double r41295 = r41290 * r41294;
        return r41295;
}

double f(double x) {
        double r41296 = x;
        double r41297 = 1.0;
        double r41298 = 0.5;
        double r41299 = r41298 * r41296;
        double r41300 = r41297 - r41299;
        double r41301 = r41296 * r41300;
        return r41301;
}

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. Simplified0.0

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

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

Reproduce

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