Average Error: 4.3 → 0.0
Time: 24.4s
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 r1039877 = 2.0;
        double r1039878 = x;
        double r1039879 = r1039877 * r1039878;
        double r1039880 = exp(r1039879);
        double r1039881 = 1.0;
        double r1039882 = r1039880 - r1039881;
        double r1039883 = exp(r1039878);
        double r1039884 = r1039883 - r1039881;
        double r1039885 = r1039882 / r1039884;
        double r1039886 = sqrt(r1039885);
        return r1039886;
}

double f(double x) {
        double r1039887 = 1.0;
        double r1039888 = exp(1.0);
        double r1039889 = x;
        double r1039890 = 2.0;
        double r1039891 = r1039889 / r1039890;
        double r1039892 = pow(r1039888, r1039891);
        double r1039893 = hypot(r1039887, r1039892);
        double r1039894 = log(r1039893);
        double r1039895 = exp(r1039894);
        return r1039895;
}

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))))