Average Error: 4.3 → 0.0
Time: 21.7s
Precision: 64
\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
\[\mathsf{hypot}\left(\left({e}^{\left(\frac{x}{2}\right)}\right), 1\right)\]
\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}
\mathsf{hypot}\left(\left({e}^{\left(\frac{x}{2}\right)}\right), 1\right)
double f(double x) {
        double r478718 = 2.0;
        double r478719 = x;
        double r478720 = r478718 * r478719;
        double r478721 = exp(r478720);
        double r478722 = 1.0;
        double r478723 = r478721 - r478722;
        double r478724 = exp(r478719);
        double r478725 = r478724 - r478722;
        double r478726 = r478723 / r478725;
        double r478727 = sqrt(r478726);
        return r478727;
}

double f(double x) {
        double r478728 = exp(1.0);
        double r478729 = x;
        double r478730 = 2.0;
        double r478731 = r478729 / r478730;
        double r478732 = pow(r478728, r478731);
        double r478733 = 1.0;
        double r478734 = hypot(r478732, r478733);
        return r478734;
}

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.0

    \[\leadsto \color{blue}{\sqrt{e^{x} + 1}}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.0

    \[\leadsto \sqrt{e^{x} + \color{blue}{1 \cdot 1}}\]
  5. Applied add-sqr-sqrt0.1

    \[\leadsto \sqrt{\color{blue}{\sqrt{e^{x}} \cdot \sqrt{e^{x}}} + 1 \cdot 1}\]
  6. Applied hypot-def0.0

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

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

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

    \[\leadsto \mathsf{hypot}\left(\color{blue}{\left({\left(e^{1}\right)}^{\left(\frac{x}{2}\right)}\right)}, 1\right)\]
  11. Simplified0.0

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

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

Reproduce

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