Average Error: 14.8 → 14.7
Time: 2.6s
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

Original14.8
Target0.1
Herbie14.7
\[\frac{1}{x + \frac{1}{x}}\]

Derivation

  1. Initial program 14.8

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

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

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

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

Reproduce

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

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

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