Average Error: 15.0 → 14.9
Time: 5.7s
Precision: binary64
\[\frac{x}{x \cdot x + 1}\]
\[\frac{\frac{x}{\sqrt{x \cdot x + 1}}}{\sqrt{x \cdot x + 1}}\]
\frac{x}{x \cdot x + 1}
\frac{\frac{x}{\sqrt{x \cdot x + 1}}}{\sqrt{x \cdot x + 1}}
(FPCore (x) :precision binary64 (/ x (+ (* x x) 1.0)))
(FPCore (x)
 :precision binary64
 (/ (/ x (sqrt (+ (* x x) 1.0))) (sqrt (+ (* x x) 1.0))))
double code(double x) {
	return x / ((x * x) + 1.0);
}
double code(double x) {
	return (x / sqrt((x * x) + 1.0)) / sqrt((x * x) + 1.0);
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original15.0
Target0.1
Herbie14.9
\[\frac{1}{x + \frac{1}{x}}\]

Derivation

  1. Initial program 15.0

    \[\frac{x}{x \cdot x + 1}\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt_binary64_176215.0

    \[\leadsto \frac{x}{\color{blue}{\sqrt{x \cdot x + 1} \cdot \sqrt{x \cdot x + 1}}}\]
  4. Applied associate-/r*_binary64_184014.9

    \[\leadsto \color{blue}{\frac{\frac{x}{\sqrt{x \cdot x + 1}}}{\sqrt{x \cdot x + 1}}}\]
  5. Final simplification14.9

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

Reproduce

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

  :herbie-target
  (/ 1.0 (+ x (/ 1.0 x)))

  (/ x (+ (* x x) 1.0)))