Average Error: 30.9 → 0
Time: 3.1s
Precision: 64
\[\left(1 + {x}^{2}\right) - {x}^{2}\]
\[1\]
\left(1 + {x}^{2}\right) - {x}^{2}
1
double f(double x) {
        double r26344885 = 1.0;
        double r26344886 = x;
        double r26344887 = 2.0;
        double r26344888 = pow(r26344886, r26344887);
        double r26344889 = r26344885 + r26344888;
        double r26344890 = r26344889 - r26344888;
        return r26344890;
}

double f(double __attribute__((unused)) x) {
        double r26344891 = 1.0;
        return r26344891;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.9

    \[\left(1 + {x}^{2}\right) - {x}^{2}\]
  2. Simplified0

    \[\leadsto \color{blue}{1}\]
  3. Final simplification0

    \[\leadsto 1\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "1+x^2 - x^2"
  (- (+ 1.0 (pow x 2.0)) (pow x 2.0)))