Average Error: 0.0 → 0.0
Time: 4.5s
Precision: 64
\[x \cdot \left(1.0 - x \cdot 0.5\right)\]
\[x \cdot 1.0 + \left(-0.5 \cdot x\right) \cdot x\]
x \cdot \left(1.0 - x \cdot 0.5\right)
x \cdot 1.0 + \left(-0.5 \cdot x\right) \cdot x
double f(double x) {
        double r3343070 = x;
        double r3343071 = 1.0;
        double r3343072 = 0.5;
        double r3343073 = r3343070 * r3343072;
        double r3343074 = r3343071 - r3343073;
        double r3343075 = r3343070 * r3343074;
        return r3343075;
}

double f(double x) {
        double r3343076 = x;
        double r3343077 = 1.0;
        double r3343078 = r3343076 * r3343077;
        double r3343079 = 0.5;
        double r3343080 = r3343079 * r3343076;
        double r3343081 = -r3343080;
        double r3343082 = r3343081 * r3343076;
        double r3343083 = r3343078 + r3343082;
        return r3343083;
}

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. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto x \cdot \color{blue}{\left(1.0 + \left(-x \cdot 0.5\right)\right)}\]
  4. Applied distribute-lft-in0.0

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

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

Reproduce

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