Average Error: 40.4 → 0.0
Time: 4.3s
Precision: binary64
\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}} \]
\[\sqrt{e^{\mathsf{log1p}\left(e^{x}\right)}} \]
(FPCore (x)
 :precision binary64
 (sqrt (/ (- (exp (* 2.0 x)) 1.0) (- (exp x) 1.0))))
(FPCore (x) :precision binary64 (sqrt (exp (log1p (exp x)))))
double code(double x) {
	return sqrt(((exp((2.0 * x)) - 1.0) / (exp(x) - 1.0)));
}
double code(double x) {
	return sqrt(exp(log1p(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.sqrt(Math.exp(Math.log1p(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.sqrt(math.exp(math.log1p(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 sqrt(exp(log1p(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[N[Exp[N[Log[1 + N[Exp[x], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}
\sqrt{e^{\mathsf{log1p}\left(e^{x}\right)}}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 40.4

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

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

    \[\leadsto \sqrt{\color{blue}{e^{\mathsf{log1p}\left(e^{x}\right)}}} \]
  4. Final simplification0.0

    \[\leadsto \sqrt{e^{\mathsf{log1p}\left(e^{x}\right)}} \]

Reproduce

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