Average Error: 0.0 → 0.0
Time: 3.4s
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 r69832 = x;
        double r69833 = 1.0;
        double r69834 = 0.5;
        double r69835 = r69832 * r69834;
        double r69836 = r69833 - r69835;
        double r69837 = r69832 * r69836;
        return r69837;
}

double f(double x) {
        double r69838 = x;
        double r69839 = 1.0;
        double r69840 = 0.5;
        double r69841 = r69840 * r69838;
        double r69842 = r69839 - r69841;
        double r69843 = r69838 * r69842;
        return r69843;
}

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