Average Error: 0.0 → 0.0
Time: 24.0s
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 r2434712 = x;
        double r2434713 = 1.0;
        double r2434714 = 0.5;
        double r2434715 = r2434712 * r2434714;
        double r2434716 = r2434713 - r2434715;
        double r2434717 = r2434712 * r2434716;
        return r2434717;
}

double f(double x) {
        double r2434718 = 1.0;
        double r2434719 = x;
        double r2434720 = 0.5;
        double r2434721 = r2434719 * r2434720;
        double r2434722 = r2434718 - r2434721;
        double r2434723 = r2434722 * r2434719;
        return r2434723;
}

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