Average Error: 0.0 → 0.0
Time: 4.9s
Precision: 64
\[x \cdot \left(1 - x \cdot 0.5\right)\]
\[1 \cdot x + \left(-x \cdot 0.5\right) \cdot x\]
x \cdot \left(1 - x \cdot 0.5\right)
1 \cdot x + \left(-x \cdot 0.5\right) \cdot x
double f(double x) {
        double r37273 = x;
        double r37274 = 1.0;
        double r37275 = 0.5;
        double r37276 = r37273 * r37275;
        double r37277 = r37274 - r37276;
        double r37278 = r37273 * r37277;
        return r37278;
}

double f(double x) {
        double r37279 = 1.0;
        double r37280 = x;
        double r37281 = r37279 * r37280;
        double r37282 = 0.5;
        double r37283 = r37280 * r37282;
        double r37284 = -r37283;
        double r37285 = r37284 * r37280;
        double r37286 = r37281 + r37285;
        return r37286;
}

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

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

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

Reproduce

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