Average Error: 0.0 → 0.0
Time: 7.1s
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 r1550855 = x;
        double r1550856 = 1.0;
        double r1550857 = 0.5;
        double r1550858 = r1550855 * r1550857;
        double r1550859 = r1550856 - r1550858;
        double r1550860 = r1550855 * r1550859;
        return r1550860;
}

double f(double x) {
        double r1550861 = 1.0;
        double r1550862 = x;
        double r1550863 = 0.5;
        double r1550864 = r1550862 * r1550863;
        double r1550865 = r1550861 - r1550864;
        double r1550866 = r1550865 * r1550862;
        return r1550866;
}

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