Average Error: 0 → 0
Time: 2.8s
Precision: 64
\[1 + \frac{1}{2} \cdot x\]
\[1 + \frac{1}{2} \cdot x\]
1 + \frac{1}{2} \cdot x
1 + \frac{1}{2} \cdot x
double f(double x) {
        double r1339233 = 1.0;
        double r1339234 = 2.0;
        double r1339235 = r1339233 / r1339234;
        double r1339236 = x;
        double r1339237 = r1339235 * r1339236;
        double r1339238 = r1339233 + r1339237;
        return r1339238;
}

double f(double x) {
        double r1339239 = 1.0;
        double r1339240 = 2.0;
        double r1339241 = r1339239 / r1339240;
        double r1339242 = x;
        double r1339243 = r1339241 * r1339242;
        double r1339244 = r1339239 + r1339243;
        return r1339244;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0

    \[1 + \frac{1}{2} \cdot x\]
  2. Final simplification0

    \[\leadsto 1 + \frac{1}{2} \cdot x\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "1+1/2*x"
  :precision binary64
  (+ 1 (* (/ 1 2) x)))