?

Average Error: 64.81% → 0.05%
Time: 4.7s
Precision: binary64
Cost: 19328

?

\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}} \]
\[\mathsf{hypot}\left(1, \sqrt{e^{x}}\right) \]
(FPCore (x)
 :precision binary64
 (sqrt (/ (- (exp (* 2.0 x)) 1.0) (- (exp x) 1.0))))
(FPCore (x) :precision binary64 (hypot 1.0 (sqrt (exp x))))
double code(double x) {
	return sqrt(((exp((2.0 * x)) - 1.0) / (exp(x) - 1.0)));
}
double code(double x) {
	return hypot(1.0, sqrt(exp(x)));
}
public static double code(double x) {
	return Math.sqrt(((Math.exp((2.0 * x)) - 1.0) / (Math.exp(x) - 1.0)));
}
public static double code(double x) {
	return Math.hypot(1.0, Math.sqrt(Math.exp(x)));
}
def code(x):
	return math.sqrt(((math.exp((2.0 * x)) - 1.0) / (math.exp(x) - 1.0)))
def code(x):
	return math.hypot(1.0, math.sqrt(math.exp(x)))
function code(x)
	return sqrt(Float64(Float64(exp(Float64(2.0 * x)) - 1.0) / Float64(exp(x) - 1.0)))
end
function code(x)
	return hypot(1.0, sqrt(exp(x)))
end
function tmp = code(x)
	tmp = sqrt(((exp((2.0 * x)) - 1.0) / (exp(x) - 1.0)));
end
function tmp = code(x)
	tmp = hypot(1.0, sqrt(exp(x)));
end
code[x_] := N[Sqrt[N[(N[(N[Exp[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision] / N[(N[Exp[x], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[x_] := N[Sqrt[1.0 ^ 2 + N[Sqrt[N[Exp[x], $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]
\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}
\mathsf{hypot}\left(1, \sqrt{e^{x}}\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 64.81

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

    \[\leadsto \color{blue}{\sqrt{1 + e^{x}}} \]
    Proof

    [Start]64.81

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

    *-commutative [=>]64.81

    \[ \sqrt{\frac{e^{\color{blue}{x \cdot 2}} - 1}{e^{x} - 1}} \]

    exp-lft-sqr [=>]64.47

    \[ \sqrt{\frac{\color{blue}{e^{x} \cdot e^{x}} - 1}{e^{x} - 1}} \]

    difference-of-sqr-1 [=>]63.95

    \[ \sqrt{\frac{\color{blue}{\left(e^{x} + 1\right) \cdot \left(e^{x} - 1\right)}}{e^{x} - 1}} \]

    associate-/l* [=>]63.95

    \[ \sqrt{\color{blue}{\frac{e^{x} + 1}{\frac{e^{x} - 1}{e^{x} - 1}}}} \]

    *-inverses [=>]0.05

    \[ \sqrt{\frac{e^{x} + 1}{\color{blue}{1}}} \]

    /-rgt-identity [=>]0.05

    \[ \sqrt{\color{blue}{e^{x} + 1}} \]

    +-commutative [=>]0.05

    \[ \sqrt{\color{blue}{1 + e^{x}}} \]
  3. Applied egg-rr0.05

    \[\leadsto \color{blue}{\mathsf{hypot}\left(1, \sqrt{e^{x}}\right)} \]
  4. Final simplification0.05

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

Alternatives

Alternative 1
Error0.05%
Cost12992
\[\sqrt{1 + e^{x}} \]
Alternative 2
Error27.29%
Cost6464
\[\sqrt{2} \]
Alternative 3
Error85.73%
Cost320
\[1 + x \cdot 0.5 \]
Alternative 4
Error97.08%
Cost192
\[x \cdot 0.5 \]
Alternative 5
Error95.71%
Cost192
\[x \cdot -0.5 \]

Error

Reproduce?

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