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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 15.1

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

    \[\leadsto \frac{x}{\color{blue}{\sqrt{x \cdot x + 1} \cdot \sqrt{x \cdot x + 1}}}\]
  4. Applied *-un-lft-identity_binary64_66015.1

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{\sqrt{x \cdot x + 1} \cdot \sqrt{x \cdot x + 1}}\]
  5. Applied times-frac_binary64_65515.0

    \[\leadsto \color{blue}{\frac{1}{\sqrt{x \cdot x + 1}} \cdot \frac{x}{\sqrt{x \cdot x + 1}}}\]
  6. Final simplification15.0

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

Reproduce

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

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

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