?

Average Error: 0.2 → 0.2
Time: 10.2s
Precision: binary64
Cost: 20416

?

\[\frac{x}{1 + \sqrt{x + 1}} \]
\[\begin{array}{l} t_0 := 1 + \sqrt{1 + x}\\ \frac{x}{\frac{t_0 \cdot t_0}{t_0}} \end{array} \]
(FPCore (x) :precision binary64 (/ x (+ 1.0 (sqrt (+ x 1.0)))))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (+ 1.0 (sqrt (+ 1.0 x))))) (/ x (/ (* t_0 t_0) t_0))))
double code(double x) {
	return x / (1.0 + sqrt((x + 1.0)));
}
double code(double x) {
	double t_0 = 1.0 + sqrt((1.0 + x));
	return x / ((t_0 * t_0) / t_0);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = x / (1.0d0 + sqrt((x + 1.0d0)))
end function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    t_0 = 1.0d0 + sqrt((1.0d0 + x))
    code = x / ((t_0 * t_0) / t_0)
end function
public static double code(double x) {
	return x / (1.0 + Math.sqrt((x + 1.0)));
}
public static double code(double x) {
	double t_0 = 1.0 + Math.sqrt((1.0 + x));
	return x / ((t_0 * t_0) / t_0);
}
def code(x):
	return x / (1.0 + math.sqrt((x + 1.0)))
def code(x):
	t_0 = 1.0 + math.sqrt((1.0 + x))
	return x / ((t_0 * t_0) / t_0)
function code(x)
	return Float64(x / Float64(1.0 + sqrt(Float64(x + 1.0))))
end
function code(x)
	t_0 = Float64(1.0 + sqrt(Float64(1.0 + x)))
	return Float64(x / Float64(Float64(t_0 * t_0) / t_0))
end
function tmp = code(x)
	tmp = x / (1.0 + sqrt((x + 1.0)));
end
function tmp = code(x)
	t_0 = 1.0 + sqrt((1.0 + x));
	tmp = x / ((t_0 * t_0) / t_0);
end
code[x_] := N[(x / N[(1.0 + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(1.0 + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(x / N[(N[(t$95$0 * t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\frac{x}{1 + \sqrt{x + 1}}
\begin{array}{l}
t_0 := 1 + \sqrt{1 + x}\\
\frac{x}{\frac{t_0 \cdot t_0}{t_0}}
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.2

    \[\frac{x}{1 + \sqrt{x + 1}} \]
  2. Applied egg-rr0.2

    \[\leadsto \color{blue}{\frac{1}{1 + \sqrt{x + 1}} \cdot x} \]
  3. Applied egg-rr0.2

    \[\leadsto \color{blue}{\frac{x}{\frac{\left(1 + \sqrt{1 + x}\right) \cdot \left(1 + \sqrt{1 + x}\right)}{1 + \sqrt{1 + x}}}} \]
  4. Final simplification0.2

    \[\leadsto \frac{x}{\frac{\left(1 + \sqrt{1 + x}\right) \cdot \left(1 + \sqrt{1 + x}\right)}{1 + \sqrt{1 + x}}} \]

Alternatives

Alternative 1
Error0.2
Cost6848
\[\frac{x}{1 + \sqrt{x + 1}} \]
Alternative 2
Error20.9
Cost448
\[\frac{1}{0.5 + \frac{2}{x}} \]
Alternative 3
Error20.8
Cost448
\[\frac{x + x}{x + 4} \]
Alternative 4
Error21.3
Cost192
\[0.5 \cdot x \]
Alternative 5
Error60.9
Cost64
\[2 \]

Error

Reproduce?

herbie shell --seed 2023075 
(FPCore (x)
  :name "Numeric.Log:$clog1p from log-domain-0.10.2.1, B"
  :precision binary64
  (/ x (+ 1.0 (sqrt (+ x 1.0)))))