Average Error: 32.1 → 0.0
Time: 3.5s
Precision: binary64
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left(x + \sqrt{\sqrt{x + 1}} \cdot \left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{x - 1}\right)\right)\]
\log \left(x + \sqrt{x \cdot x - 1}\right)
\log \left(x + \sqrt{\sqrt{x + 1}} \cdot \left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{x - 1}\right)\right)
(FPCore (x) :precision binary64 (log (+ x (sqrt (- (* x x) 1.0)))))
(FPCore (x)
 :precision binary64
 (log
  (+
   x
   (* (sqrt (sqrt (+ x 1.0))) (* (sqrt (sqrt (+ x 1.0))) (sqrt (- x 1.0)))))))
double code(double x) {
	return log(x + sqrt((x * x) - 1.0));
}
double code(double x) {
	return log(x + (sqrt(sqrt(x + 1.0)) * (sqrt(sqrt(x + 1.0)) * sqrt(x - 1.0))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.1

    \[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
  2. Using strategy rm
  3. Applied difference-of-sqr-1_binary64_108132.1

    \[\leadsto \log \left(x + \sqrt{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}}\right)\]
  4. Applied sqrt-prod_binary64_11270.0

    \[\leadsto \log \left(x + \color{blue}{\sqrt{x + 1} \cdot \sqrt{x - 1}}\right)\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt_binary64_11330.0

    \[\leadsto \log \left(x + \color{blue}{\left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{\sqrt{x + 1}}\right)} \cdot \sqrt{x - 1}\right)\]
  7. Applied associate-*l*_binary64_10520.0

    \[\leadsto \log \left(x + \color{blue}{\sqrt{\sqrt{x + 1}} \cdot \left(\sqrt{\sqrt{x + 1}} \cdot \sqrt{x - 1}\right)}\right)\]
  8. Simplified0.0

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

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

Reproduce

herbie shell --seed 2020280 
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  :precision binary64
  (log (+ x (sqrt (- (* x x) 1.0)))))