Average Error: 0.2 → 0.2
Time: 2.4s
Precision: binary64
\[\frac{x}{1 + \sqrt{x + 1}} \]
\[\frac{x}{1 + \sqrt{1 + x}} \]
(FPCore (x) :precision binary64 (/ x (+ 1.0 (sqrt (+ x 1.0)))))
(FPCore (x) :precision binary64 (/ x (+ 1.0 (sqrt (+ 1.0 x)))))
double code(double x) {
	return x / (1.0 + sqrt((x + 1.0)));
}
double code(double x) {
	return x / (1.0 + sqrt((1.0 + x)));
}
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
    code = x / (1.0d0 + sqrt((1.0d0 + x)))
end function
public static double code(double x) {
	return x / (1.0 + Math.sqrt((x + 1.0)));
}
public static double code(double x) {
	return x / (1.0 + Math.sqrt((1.0 + x)));
}
def code(x):
	return x / (1.0 + math.sqrt((x + 1.0)))
def code(x):
	return x / (1.0 + math.sqrt((1.0 + x)))
function code(x)
	return Float64(x / Float64(1.0 + sqrt(Float64(x + 1.0))))
end
function code(x)
	return Float64(x / Float64(1.0 + sqrt(Float64(1.0 + x))))
end
function tmp = code(x)
	tmp = x / (1.0 + sqrt((x + 1.0)));
end
function tmp = code(x)
	tmp = x / (1.0 + sqrt((1.0 + x)));
end
code[x_] := N[(x / N[(1.0 + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := N[(x / N[(1.0 + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x}{1 + \sqrt{x + 1}}
\frac{x}{1 + \sqrt{1 + x}}

Error

Bits error versus x

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 *-un-lft-identity_binary640.2

    \[\leadsto \frac{x}{\color{blue}{1 \cdot \left(1 + \sqrt{x + 1}\right)}} \]
  3. Applied add-sqr-sqrt_binary6422.0

    \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{1 \cdot \left(1 + \sqrt{x + 1}\right)} \]
  4. Applied times-frac_binary6422.0

    \[\leadsto \color{blue}{\frac{\sqrt{x}}{1} \cdot \frac{\sqrt{x}}{1 + \sqrt{x + 1}}} \]
  5. Simplified22.0

    \[\leadsto \color{blue}{\sqrt{x}} \cdot \frac{\sqrt{x}}{1 + \sqrt{x + 1}} \]
  6. Applied *-un-lft-identity_binary6422.0

    \[\leadsto \sqrt{\color{blue}{1 \cdot x}} \cdot \frac{\sqrt{x}}{1 + \sqrt{x + 1}} \]
  7. Applied sqrt-prod_binary6422.0

    \[\leadsto \color{blue}{\left(\sqrt{1} \cdot \sqrt{x}\right)} \cdot \frac{\sqrt{x}}{1 + \sqrt{x + 1}} \]
  8. Applied associate-*l*_binary6422.0

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

    \[\leadsto \sqrt{1} \cdot \color{blue}{\frac{x}{1 + \sqrt{x + 1}}} \]
  10. Final simplification0.2

    \[\leadsto \frac{x}{1 + \sqrt{1 + x}} \]

Reproduce

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