Average Error: 0.0 → 0.0
Time: 7.6s
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 r2875230 = x;
        double r2875231 = 1.0;
        double r2875232 = 0.5;
        double r2875233 = r2875230 * r2875232;
        double r2875234 = r2875231 - r2875233;
        double r2875235 = r2875230 * r2875234;
        return r2875235;
}

double f(double x) {
        double r2875236 = x;
        double r2875237 = 1.0;
        double r2875238 = r2875236 * r2875237;
        double r2875239 = 0.5;
        double r2875240 = r2875239 * r2875236;
        double r2875241 = -r2875240;
        double r2875242 = r2875241 * r2875236;
        double r2875243 = r2875238 + r2875242;
        return r2875243;
}

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