Average Error: 0.0 → 0.0
Time: 6.8s
Precision: 64
\[x \cdot \left(1 - x \cdot 0.5\right)\]
\[x \cdot 1 + \left(-0.5 \cdot {x}^{2}\right)\]
x \cdot \left(1 - x \cdot 0.5\right)
x \cdot 1 + \left(-0.5 \cdot {x}^{2}\right)
double f(double x) {
        double r42779 = x;
        double r42780 = 1.0;
        double r42781 = 0.5;
        double r42782 = r42779 * r42781;
        double r42783 = r42780 - r42782;
        double r42784 = r42779 * r42783;
        return r42784;
}

double f(double x) {
        double r42785 = x;
        double r42786 = 1.0;
        double r42787 = r42785 * r42786;
        double r42788 = 0.5;
        double r42789 = 2.0;
        double r42790 = pow(r42785, r42789);
        double r42791 = r42788 * r42790;
        double r42792 = -r42791;
        double r42793 = r42787 + r42792;
        return r42793;
}

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. Simplified0.0

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

    \[\leadsto x \cdot 1 + \left(-0.5 \cdot {x}^{2}\right)\]

Reproduce

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