Average Error: 0.0 → 0.0
Time: 3.6s
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 r19277 = x;
        double r19278 = 1.0;
        double r19279 = 0.5;
        double r19280 = r19277 * r19279;
        double r19281 = r19278 - r19280;
        double r19282 = r19277 * r19281;
        return r19282;
}

double f(double x) {
        double r19283 = 1.0;
        double r19284 = x;
        double r19285 = 0.5;
        double r19286 = r19284 * r19285;
        double r19287 = r19283 - r19286;
        double r19288 = r19287 * r19284;
        return r19288;
}

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-lft-in0.0

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

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

Reproduce

herbie shell --seed 2019291 
(FPCore (x)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, B"
  :precision binary64
  (* x (- 1 (* x 0.5))))