Average Error: 0.2 → 0.1
Time: 5.7s
Precision: binary64
\[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}\]
\[\log \left({\left(e^{\frac{-1 + x}{\left(x + 1\right) + 4 \cdot \sqrt{x}}}\right)}^{6}\right)\]
\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}
\log \left({\left(e^{\frac{-1 + x}{\left(x + 1\right) + 4 \cdot \sqrt{x}}}\right)}^{6}\right)
(FPCore (x)
 :precision binary64
 (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))
(FPCore (x)
 :precision binary64
 (log (pow (exp (/ (+ -1.0 x) (+ (+ x 1.0) (* 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 log(pow(exp((-1.0 + x) / ((x + 1.0) + (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.1
Herbie0.1
\[\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_binary64_222430.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_binary64_222490.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. Using strategy rm
  7. Applied add-log-exp_binary64_222820.0

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

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

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

Reproduce

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