Average Error: 15.1 → 0.0
Time: 1.9s
Precision: binary64
\[\]
\[\]
double code(double x) {
	return ((double) (x / ((double) (((double) (x * x)) + 1.0))));
}
double code(double x) {
	double VAR;
	if (((x <= -16524538.364294972) || !(x <= 42822.353765390435))) {
		VAR = ((double) (((double) (1.0 / ((double) pow(x, 5.0)))) + ((double) (((double) (1.0 / x)) - ((double) (1.0 / ((double) pow(x, 3.0))))))));
	} else {
		VAR = ((double) (((double) (x / ((double) (((double) pow(x, 4.0)) - ((double) (1.0 * 1.0)))))) * ((double) (((double) (x * x)) - 1.0))));
	}
	return VAR;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original15.1
Target0.1
Herbie0.0
\[\]

Derivation

  1. Split input into 2 regimes
  2. if x < -16524538.364294972 or 42822.353765390435 < x

    1. Initial program 30.5

      \[\]
    2. Taylor expanded around inf 0.0

      \[\leadsto \]
    3. Simplified0.0

      \[\leadsto \]

    if -16524538.364294972 < x < 42822.353765390435

    1. Initial program 0.0

      \[\]
    2. Using strategy rm
    3. Applied flip-+0.0

      \[\leadsto \]
    4. Applied associate-/r/0.0

      \[\leadsto \]
    5. Simplified0.0

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \]

Reproduce

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

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

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