Average Error: 0.0 → 0.0
Time: 6.7s
Precision: 64
\[x \cdot \left(1.0 - x \cdot 0.5\right)\]
\[\left(1.0 - x \cdot 0.5\right) \cdot x\]
x \cdot \left(1.0 - x \cdot 0.5\right)
\left(1.0 - x \cdot 0.5\right) \cdot x
double f(double x) {
        double r1849286 = x;
        double r1849287 = 1.0;
        double r1849288 = 0.5;
        double r1849289 = r1849286 * r1849288;
        double r1849290 = r1849287 - r1849289;
        double r1849291 = r1849286 * r1849290;
        return r1849291;
}

double f(double x) {
        double r1849292 = 1.0;
        double r1849293 = x;
        double r1849294 = 0.5;
        double r1849295 = r1849293 * r1849294;
        double r1849296 = r1849292 - r1849295;
        double r1849297 = r1849296 * r1849293;
        return r1849297;
}

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.0 - x \cdot 0.5\right)\]
  2. Final simplification0.0

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

Reproduce

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