Average Error: 0.0 → 0.0
Time: 2.8s
Precision: 64
\[x \cdot \left(1 - x \cdot 0.5\right)\]
\[1 \cdot x + \left(-x \cdot 0.5\right) \cdot x\]
x \cdot \left(1 - x \cdot 0.5\right)
1 \cdot x + \left(-x \cdot 0.5\right) \cdot x
double f(double x) {
        double r35847 = x;
        double r35848 = 1.0;
        double r35849 = 0.5;
        double r35850 = r35847 * r35849;
        double r35851 = r35848 - r35850;
        double r35852 = r35847 * r35851;
        return r35852;
}

double f(double x) {
        double r35853 = 1.0;
        double r35854 = x;
        double r35855 = r35853 * r35854;
        double r35856 = 0.5;
        double r35857 = r35854 * r35856;
        double r35858 = -r35857;
        double r35859 = r35858 * r35854;
        double r35860 = r35855 + r35859;
        return r35860;
}

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

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

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

Reproduce

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