Average Error: 40.9 → 0.1
Time: 10.6s
Precision: binary64
\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
\[e^{\log \left(\sqrt{e^{x} + 1}\right)}\]
\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}
e^{\log \left(\sqrt{e^{x} + 1}\right)}
(FPCore (x)
 :precision binary64
 (sqrt (/ (- (exp (* 2.0 x)) 1.0) (- (exp x) 1.0))))
(FPCore (x) :precision binary64 (exp (log (sqrt (+ (exp x) 1.0)))))
double code(double x) {
	return sqrt((exp(2.0 * x) - 1.0) / (exp(x) - 1.0));
}
double code(double x) {
	return exp(log(sqrt(exp(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 40.9

    \[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\sqrt{1 + e^{x}}}\]
  3. Using strategy rm
  4. Applied add-exp-log_binary640.1

    \[\leadsto \color{blue}{e^{\log \left(\sqrt{1 + e^{x}}\right)}}\]
  5. Simplified0.1

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

    \[\leadsto e^{\log \left(\sqrt{e^{x} + 1}\right)}\]

Reproduce

herbie shell --seed 2021050 
(FPCore (x)
  :name "sqrtexp (problem 3.4.4)"
  :precision binary64
  (sqrt (/ (- (exp (* 2.0 x)) 1.0) (- (exp x) 1.0))))