?

Average Error: 0.1 → 0.0
Time: 8.5s
Precision: binary64
Cost: 33984

?

$0 \leq x \land x \leq 1000$
$\frac{1}{\sqrt{x + 1} + \sqrt{x}}$
$\begin{array}{l} t_0 := \frac{1}{{\left(1 + x\right)}^{1.5} + {x}^{1.5}}\\ t_0 \cdot \left(x - \sqrt{x + x \cdot x}\right) + \left(1 + x\right) \cdot t_0 \end{array}$
(FPCore (x) :precision binary64 (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))))
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (+ (pow (+ 1.0 x) 1.5) (pow x 1.5)))))
(+ (* t_0 (- x (sqrt (+ x (* x x))))) (* (+ 1.0 x) t_0))))
double code(double x) {
return 1.0 / (sqrt((x + 1.0)) + sqrt(x));
}

double code(double x) {
double t_0 = 1.0 / (pow((1.0 + x), 1.5) + pow(x, 1.5));
return (t_0 * (x - sqrt((x + (x * x))))) + ((1.0 + x) * t_0);
}

real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))
end function

real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = 1.0d0 / (((1.0d0 + x) ** 1.5d0) + (x ** 1.5d0))
code = (t_0 * (x - sqrt((x + (x * x))))) + ((1.0d0 + x) * t_0)
end function

public static double code(double x) {
return 1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x));
}

public static double code(double x) {
double t_0 = 1.0 / (Math.pow((1.0 + x), 1.5) + Math.pow(x, 1.5));
return (t_0 * (x - Math.sqrt((x + (x * x))))) + ((1.0 + x) * t_0);
}

def code(x):
return 1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))

def code(x):
t_0 = 1.0 / (math.pow((1.0 + x), 1.5) + math.pow(x, 1.5))
return (t_0 * (x - math.sqrt((x + (x * x))))) + ((1.0 + x) * t_0)

function code(x)
return Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x)))
end

function code(x)
t_0 = Float64(1.0 / Float64((Float64(1.0 + x) ^ 1.5) + (x ^ 1.5)))
return Float64(Float64(t_0 * Float64(x - sqrt(Float64(x + Float64(x * x))))) + Float64(Float64(1.0 + x) * t_0))
end

function tmp = code(x)
tmp = 1.0 / (sqrt((x + 1.0)) + sqrt(x));
end

function tmp = code(x)
t_0 = 1.0 / (((1.0 + x) ^ 1.5) + (x ^ 1.5));
tmp = (t_0 * (x - sqrt((x + (x * x))))) + ((1.0 + x) * t_0);
end

code[x_] := N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]],$MachinePrecision] + N[Sqrt[x], $MachinePrecision]),$MachinePrecision]), $MachinePrecision]  code[x_] := Block[{t$95$0 = N[(1.0 / N[(N[Power[N[(1.0 + x),$MachinePrecision], 1.5], $MachinePrecision] + N[Power[x, 1.5],$MachinePrecision]), $MachinePrecision]),$MachinePrecision]}, N[(N[(t$95$0 * N[(x - N[Sqrt[N[(x + N[(x * x), $MachinePrecision]),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + x),$MachinePrecision] * t$95$0), $MachinePrecision]),$MachinePrecision]]

\frac{1}{\sqrt{x + 1} + \sqrt{x}}

\begin{array}{l}
t_0 := \frac{1}{{\left(1 + x\right)}^{1.5} + {x}^{1.5}}\\
t_0 \cdot \left(x - \sqrt{x + x \cdot x}\right) + \left(1 + x\right) \cdot t_0
\end{array}


Try it out?

Results

 In Out
Enter valid numbers for all inputs

Derivation?

1. Initial program 0.1

$\frac{1}{\sqrt{x + 1} + \sqrt{x}}$
2. Applied egg-rr0.0

$\leadsto \color{blue}{\frac{1}{{\left(1 + x\right)}^{1.5} + {x}^{1.5}} \cdot \left(x - \sqrt{x + x \cdot x}\right) + \frac{1}{{\left(1 + x\right)}^{1.5} + {x}^{1.5}} \cdot \left(1 + x\right)}$
3. Final simplification0.0

$\leadsto \frac{1}{{\left(1 + x\right)}^{1.5} + {x}^{1.5}} \cdot \left(x - \sqrt{x + x \cdot x}\right) + \left(1 + x\right) \cdot \frac{1}{{\left(1 + x\right)}^{1.5} + {x}^{1.5}}$

Alternatives

Alternative 1
Error0.1
Cost13248
$\frac{1}{\sqrt{x} + \sqrt{1 + x}}$
Alternative 2
Error0.1
Cost13120
$\sqrt{1 + x} - \sqrt{x}$
Alternative 3
Error1.2
Cost7104
$\frac{1}{\frac{-1 + \left(x \cdot -0.5 - \sqrt{x}\right)}{-1}}$
Alternative 4
Error1.2
Cost6976
$\frac{1}{\sqrt{x} + \left(1 + x \cdot 0.5\right)}$
Alternative 5
Error1.3
Cost6848
$\left(1 + x \cdot 0.5\right) - \sqrt{x}$
Alternative 6
Error3.3
Cost64
$1$

Reproduce?

herbie shell --seed 1
(FPCore (x)
:name "1/(sqrt(x + 1) + sqrt(x))"
:precision binary64
:pre (and (<= 0.0 x) (<= x 1000.0))
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))))