Average Error: 30.7 → 30.7
Time: 1.5s
Precision: binary64
\[\frac{{x}^{2} + 1}{x} - x\]
\[\frac{{x}^{2} + 1}{x} - x\]
\frac{{x}^{2} + 1}{x} - x
\frac{{x}^{2} + 1}{x} - x
double code(double x) {
	return ((double) (((double) (((double) (((double) pow(x, 2.0)) + 1.0)) / x)) - x));
}
double code(double x) {
	return ((double) (((double) (((double) (((double) pow(x, 2.0)) + 1.0)) / x)) - x));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.7

    \[\frac{{x}^{2} + 1}{x} - x\]
  2. Final simplification30.7

    \[\leadsto \frac{{x}^{2} + 1}{x} - x\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x)
  :name "(- (/ (+ (pow x 2) 1) x) x)"
  :precision binary64
  (- (/ (+ (pow x 2.0) 1.0) x) x))