Average Error: 0.0 → 0.0
Time: 7.2s
Precision: 64
\[x \cdot \left(1 - x \cdot 0.5\right)\]
\[x \cdot 1 + \left(-0.5 \cdot x\right) \cdot x\]
x \cdot \left(1 - x \cdot 0.5\right)
x \cdot 1 + \left(-0.5 \cdot x\right) \cdot x
double f(double x) {
        double r1205485 = x;
        double r1205486 = 1.0;
        double r1205487 = 0.5;
        double r1205488 = r1205485 * r1205487;
        double r1205489 = r1205486 - r1205488;
        double r1205490 = r1205485 * r1205489;
        return r1205490;
}

double f(double x) {
        double r1205491 = x;
        double r1205492 = 1.0;
        double r1205493 = r1205491 * r1205492;
        double r1205494 = 0.5;
        double r1205495 = r1205494 * r1205491;
        double r1205496 = -r1205495;
        double r1205497 = r1205496 * r1205491;
        double r1205498 = r1205493 + r1205497;
        return r1205498;
}

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

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, B"
  (* x (- 1.0 (* x 0.5))))