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

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

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