?

Average Error: 41.5 → 0.1
Time: 5.5s
Precision: binary64
Cost: 19520

?

\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}} \]
\[\sqrt{\frac{\mathsf{expm1}\left(x + x\right)}{\mathsf{expm1}\left(x\right)}} \]
(FPCore (x)
 :precision binary64
 (sqrt (/ (- (exp (* 2.0 x)) 1.0) (- (exp x) 1.0))))
(FPCore (x) :precision binary64 (sqrt (/ (expm1 (+ x x)) (expm1 x))))
double code(double x) {
	return sqrt(((exp((2.0 * x)) - 1.0) / (exp(x) - 1.0)));
}
double code(double x) {
	return sqrt((expm1((x + x)) / expm1(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.sqrt((Math.expm1((x + x)) / Math.expm1(x)));
}
def code(x):
	return math.sqrt(((math.exp((2.0 * x)) - 1.0) / (math.exp(x) - 1.0)))
def code(x):
	return math.sqrt((math.expm1((x + x)) / math.expm1(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 sqrt(Float64(expm1(Float64(x + x)) / expm1(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[N[(N[(Exp[N[(x + x), $MachinePrecision]] - 1), $MachinePrecision] / N[(Exp[x] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}
\sqrt{\frac{\mathsf{expm1}\left(x + x\right)}{\mathsf{expm1}\left(x\right)}}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 41.5

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

    \[\leadsto \color{blue}{\sqrt{\frac{\mathsf{expm1}\left(x + x\right)}{\mathsf{expm1}\left(x\right)}}} \]
    Proof

    [Start]41.5

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

    expm1-def [=>]41.7

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

    count-2 [<=]41.7

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

    expm1-def [=>]0.1

    \[ \sqrt{\frac{\mathsf{expm1}\left(x + x\right)}{\color{blue}{\mathsf{expm1}\left(x\right)}}} \]
  3. Final simplification0.1

    \[\leadsto \sqrt{\frac{\mathsf{expm1}\left(x + x\right)}{\mathsf{expm1}\left(x\right)}} \]

Alternatives

Alternative 1
Error0.0
Cost12992
\[\sqrt{1 + e^{x}} \]
Alternative 2
Error17.5
Cost6464
\[\sqrt{2} \]

Error

Reproduce?

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