Average Error: 0.0 → 0.0
Time: 3.1s
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 r2385409 = x;
        double r2385410 = 1.0;
        double r2385411 = 0.5;
        double r2385412 = r2385409 * r2385411;
        double r2385413 = r2385410 - r2385412;
        double r2385414 = r2385409 * r2385413;
        return r2385414;
}

double f(double x) {
        double r2385415 = 1.0;
        double r2385416 = x;
        double r2385417 = 0.5;
        double r2385418 = r2385416 * r2385417;
        double r2385419 = r2385415 - r2385418;
        double r2385420 = r2385419 * r2385416;
        return r2385420;
}

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 2019174 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, B"
  (* x (- 1.0 (* x 0.5))))