Average Error: 0.0 → 0.0
Time: 8.5s
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 r54985 = x;
        double r54986 = 1.0;
        double r54987 = 0.5;
        double r54988 = r54985 * r54987;
        double r54989 = r54986 - r54988;
        double r54990 = r54985 * r54989;
        return r54990;
}

double f(double x) {
        double r54991 = x;
        double r54992 = 1.0;
        double r54993 = r54991 * r54992;
        double r54994 = 0.5;
        double r54995 = r54994 * r54991;
        double r54996 = r54995 * r54991;
        double r54997 = r54993 - r54996;
        return r54997;
}

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

    \[\leadsto \color{blue}{\left(1 - x \cdot 0.5\right) \cdot x}\]
  3. Using strategy rm
  4. Applied flip3--7.3

    \[\leadsto \color{blue}{\frac{{1}^{3} - {\left(x \cdot 0.5\right)}^{3}}{1 \cdot 1 + \left(\left(x \cdot 0.5\right) \cdot \left(x \cdot 0.5\right) + 1 \cdot \left(x \cdot 0.5\right)\right)}} \cdot x\]
  5. Applied associate-*l/10.9

    \[\leadsto \color{blue}{\frac{\left({1}^{3} - {\left(x \cdot 0.5\right)}^{3}\right) \cdot x}{1 \cdot 1 + \left(\left(x \cdot 0.5\right) \cdot \left(x \cdot 0.5\right) + 1 \cdot \left(x \cdot 0.5\right)\right)}}\]
  6. Simplified10.9

    \[\leadsto \frac{\color{blue}{x \cdot \left({1}^{3} - {\left(0.5 \cdot x\right)}^{3}\right)}}{1 \cdot 1 + \left(\left(x \cdot 0.5\right) \cdot \left(x \cdot 0.5\right) + 1 \cdot \left(x \cdot 0.5\right)\right)}\]
  7. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{1 \cdot x - 0.5 \cdot {x}^{2}}\]
  8. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019195 
(FPCore (x)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, B"
  (* x (- 1.0 (* x 0.5))))