Average Error: 41.6 → 0.1
Time: 3.7s
Precision: binary64
\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}} \]
\[\sqrt{\log \left(e \cdot e^{e^{x}}\right)} \]
\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}
\sqrt{\log \left(e \cdot e^{e^{x}}\right)}
(FPCore (x)
 :precision binary64
 (sqrt (/ (- (exp (* 2.0 x)) 1.0) (- (exp x) 1.0))))
(FPCore (x) :precision binary64 (sqrt (log (* E (exp (exp x))))))
double code(double x) {
	return sqrt((exp(2.0 * x) - 1.0) / (exp(x) - 1.0));
}
double code(double x) {
	return sqrt(log(((double) M_E) * exp(exp(x))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 41.6

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

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

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

    \[\leadsto \sqrt{\color{blue}{\log \left(e^{1}\right)} + \log \left(e^{e^{x}}\right)} \]
  6. Applied sum-log_binary640.1

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

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

Reproduce

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