Average Error: 0.0 → 0.0
Time: 1.2s
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 r651659 = x;
        double r651660 = 1.0;
        double r651661 = 0.5;
        double r651662 = r651659 * r651661;
        double r651663 = r651660 - r651662;
        double r651664 = r651659 * r651663;
        return r651664;
}

double f(double x) {
        double r651665 = 1.0;
        double r651666 = x;
        double r651667 = 0.5;
        double r651668 = r651666 * r651667;
        double r651669 = r651665 - r651668;
        double r651670 = r651669 * r651666;
        return r651670;
}

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