Average Error: 0.2 → 0.0
Time: 14.1s
Precision: binary64
\[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}\]
\[\frac{x + -1}{\frac{1 + \left(x + 4 \cdot \sqrt{x}\right)}{6}}\]
\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}
\frac{x + -1}{\frac{1 + \left(x + 4 \cdot \sqrt{x}\right)}{6}}
(FPCore (x)
 :precision binary64
 (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))
(FPCore (x)
 :precision binary64
 (/ (+ x -1.0) (/ (+ 1.0 (+ x (* 4.0 (sqrt x)))) 6.0)))
double code(double x) {
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
}
double code(double x) {
	return (x + -1.0) / ((1.0 + (x + (4.0 * sqrt(x)))) / 6.0);
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.2
Target0.0
Herbie0.0
\[\frac{6}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}\]

Derivation

  1. Initial program 0.2

    \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2021176 
(FPCore (x)
  :name "Data.Approximate.Numerics:blog from approximate-0.2.2.1"
  :precision binary64

  :herbie-target
  (/ 6.0 (/ (+ (+ x 1.0) (* 4.0 (sqrt x))) (- x 1.0)))

  (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))