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

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. Using strategy rm
  3. Applied *-un-lft-identity_binary640.2

    \[\leadsto \frac{6 \cdot \left(x - 1\right)}{\color{blue}{1 \cdot \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}}\]
  4. Applied times-frac_binary640.0

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

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

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

Reproduce

herbie shell --seed 2020224 
(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)))))