Average Error: 16.3 → 0.3
Time: 788.0ms
Precision: binary64
\[\left(\frac{1}{x} - 3 \cdot x\right) + \left(x \cdot x\right) \cdot \frac{1}{x}\]
\[\left(x \cdot 1 + \frac{1}{x}\right) - 3 \cdot x\]
\left(\frac{1}{x} - 3 \cdot x\right) + \left(x \cdot x\right) \cdot \frac{1}{x}
\left(x \cdot 1 + \frac{1}{x}\right) - 3 \cdot x
double code(double x) {
	return ((double) (((double) (((double) (1.0 / x)) - ((double) (3.0 * x)))) + ((double) (((double) (x * x)) * ((double) (1.0 / x))))));
}
double code(double x) {
	return ((double) (((double) (((double) (x * 1.0)) + ((double) (1.0 / x)))) - ((double) (3.0 * x))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 16.3

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

    \[\leadsto \color{blue}{\left(x \cdot 1 + \frac{1}{x}\right) - 3 \cdot x}\]
  3. Final simplification0.3

    \[\leadsto \left(x \cdot 1 + \frac{1}{x}\right) - 3 \cdot x\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x)
  :name "(+ (- (/ 1 x) (* 3 x)) (* (* x x) (/ 1 x)))"
  :precision binary64
  (+ (- (/ 1.0 x) (* 3.0 x)) (* (* x x) (/ 1.0 x))))