Average Error: 0.2 → 0.0
Time: 2.7s
Precision: binary64
\[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}\]
\[\log \left({\left(e^{6}\right)}^{\left(\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}\right)}\right)\]
\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}
\log \left({\left(e^{6}\right)}^{\left(\frac{x - 1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}\right)}\right)
double code(double x) {
	return ((double) (((double) (6.0 * ((double) (x - 1.0)))) / ((double) (((double) (x + 1.0)) + ((double) (4.0 * ((double) sqrt(x))))))));
}
double code(double x) {
	return ((double) log(((double) pow(((double) exp(6.0)), ((double) (((double) (x - 1.0)) / ((double) (((double) (x + 1.0)) + ((double) (4.0 * ((double) 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.1
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 div-inv0.3

    \[\leadsto \color{blue}{\left(6 \cdot \left(x - 1\right)\right) \cdot \frac{1}{\left(x + 1\right) + 4 \cdot \sqrt{x}}}\]
  4. Using strategy rm
  5. Applied add-log-exp0.3

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

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

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

Reproduce

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