Average Error: 0.0 → 0.0
Time: 6.1s
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 r2674175 = x;
        double r2674176 = 1.0;
        double r2674177 = 0.5;
        double r2674178 = r2674175 * r2674177;
        double r2674179 = r2674176 - r2674178;
        double r2674180 = r2674175 * r2674179;
        return r2674180;
}

double f(double x) {
        double r2674181 = x;
        double r2674182 = 1.0;
        double r2674183 = r2674181 * r2674182;
        double r2674184 = 0.5;
        double r2674185 = r2674184 * r2674181;
        double r2674186 = -r2674185;
        double r2674187 = r2674186 * r2674181;
        double r2674188 = r2674183 + r2674187;
        return r2674188;
}

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