Average Error: 4.3 → 0.0
Time: 24.7s
Precision: 64
\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
\[e^{\log \left(\mathsf{hypot}\left(1, {e}^{\left(\frac{x}{2}\right)}\right)\right)}\]
\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}
e^{\log \left(\mathsf{hypot}\left(1, {e}^{\left(\frac{x}{2}\right)}\right)\right)}
double f(double x) {
        double r926755 = 2.0;
        double r926756 = x;
        double r926757 = r926755 * r926756;
        double r926758 = exp(r926757);
        double r926759 = 1.0;
        double r926760 = r926758 - r926759;
        double r926761 = exp(r926756);
        double r926762 = r926761 - r926759;
        double r926763 = r926760 / r926762;
        double r926764 = sqrt(r926763);
        return r926764;
}

double f(double x) {
        double r926765 = 1.0;
        double r926766 = exp(1.0);
        double r926767 = x;
        double r926768 = 2.0;
        double r926769 = r926767 / r926768;
        double r926770 = pow(r926766, r926769);
        double r926771 = hypot(r926765, r926770);
        double r926772 = log(r926771);
        double r926773 = exp(r926772);
        return r926773;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 4.3

    \[\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-log0.1

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

    \[\leadsto e^{\log \left(\sqrt{1 + \color{blue}{\sqrt{e^{x}} \cdot \sqrt{e^{x}}}}\right)}\]
  7. Applied *-un-lft-identity0.1

    \[\leadsto e^{\log \left(\sqrt{\color{blue}{1 \cdot 1} + \sqrt{e^{x}} \cdot \sqrt{e^{x}}}\right)}\]
  8. Applied hypot-def0.1

    \[\leadsto e^{\log \color{blue}{\left(\mathsf{hypot}\left(1, \sqrt{e^{x}}\right)\right)}}\]
  9. Using strategy rm
  10. Applied *-un-lft-identity0.1

    \[\leadsto e^{\log \left(\mathsf{hypot}\left(1, \sqrt{e^{\color{blue}{1 \cdot x}}}\right)\right)}\]
  11. Applied exp-prod0.1

    \[\leadsto e^{\log \left(\mathsf{hypot}\left(1, \sqrt{\color{blue}{{\left(e^{1}\right)}^{x}}}\right)\right)}\]
  12. Applied sqrt-pow10.0

    \[\leadsto e^{\log \left(\mathsf{hypot}\left(1, \color{blue}{{\left(e^{1}\right)}^{\left(\frac{x}{2}\right)}}\right)\right)}\]
  13. Final simplification0.0

    \[\leadsto e^{\log \left(\mathsf{hypot}\left(1, {e}^{\left(\frac{x}{2}\right)}\right)\right)}\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x)
  :name "sqrtexp (problem 3.4.4)"
  (sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1))))