Average Error: 0.0 → 0.0
Time: 1.0s
Precision: 64
\[x \cdot \left(1 - x \cdot 0.5\right)\]
\[x \cdot 1 + x \cdot \left(-x \cdot 0.5\right)\]
x \cdot \left(1 - x \cdot 0.5\right)
x \cdot 1 + x \cdot \left(-x \cdot 0.5\right)
double f(double x) {
        double r66607 = x;
        double r66608 = 1.0;
        double r66609 = 0.5;
        double r66610 = r66607 * r66609;
        double r66611 = r66608 - r66610;
        double r66612 = r66607 * r66611;
        return r66612;
}

double f(double x) {
        double r66613 = x;
        double r66614 = 1.0;
        double r66615 = r66613 * r66614;
        double r66616 = 0.5;
        double r66617 = r66613 * r66616;
        double r66618 = -r66617;
        double r66619 = r66613 * r66618;
        double r66620 = r66615 + r66619;
        return r66620;
}

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 + x \cdot \left(-x \cdot 0.5\right)\]

Reproduce

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