Average Error: 0.0 → 0.0
Time: 6.7s
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 r1991019 = x;
        double r1991020 = 1.0;
        double r1991021 = 0.5;
        double r1991022 = r1991019 * r1991021;
        double r1991023 = r1991020 - r1991022;
        double r1991024 = r1991019 * r1991023;
        return r1991024;
}

double f(double x) {
        double r1991025 = x;
        double r1991026 = 1.0;
        double r1991027 = r1991025 * r1991026;
        double r1991028 = 0.5;
        double r1991029 = r1991028 * r1991025;
        double r1991030 = -r1991029;
        double r1991031 = r1991030 * r1991025;
        double r1991032 = r1991027 + r1991031;
        return r1991032;
}

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