Average Error: 0.2 → 0.0
Time: 3.5s
Precision: 64
\[\frac{x}{1 + \sqrt{x + 1}}\]
\[\begin{array}{l} \mathbf{if}\;x \le 1.3911727598234371:\\ \;\;\;\;\frac{x}{{1}^{3} + {\left(\sqrt{x + 1}\right)}^{3}} \cdot \left(1 \cdot 1 + \left(\sqrt{x + 1} \cdot \sqrt{x + 1} - 1 \cdot \sqrt{x + 1}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(1 \cdot 1 - x\right) - 1} \cdot \left(1 - \sqrt{x + 1}\right)\\ \end{array}\]
\frac{x}{1 + \sqrt{x + 1}}
\begin{array}{l}
\mathbf{if}\;x \le 1.3911727598234371:\\
\;\;\;\;\frac{x}{{1}^{3} + {\left(\sqrt{x + 1}\right)}^{3}} \cdot \left(1 \cdot 1 + \left(\sqrt{x + 1} \cdot \sqrt{x + 1} - 1 \cdot \sqrt{x + 1}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(1 \cdot 1 - x\right) - 1} \cdot \left(1 - \sqrt{x + 1}\right)\\

\end{array}
double code(double x) {
	return (x / (1.0 + sqrt((x + 1.0))));
}
double code(double x) {
	double VAR;
	if ((x <= 1.3911727598234371)) {
		VAR = ((x / (pow(1.0, 3.0) + pow(sqrt((x + 1.0)), 3.0))) * ((1.0 * 1.0) + ((sqrt((x + 1.0)) * sqrt((x + 1.0))) - (1.0 * sqrt((x + 1.0))))));
	} else {
		VAR = ((x / (((1.0 * 1.0) - x) - 1.0)) * (1.0 - sqrt((x + 1.0))));
	}
	return VAR;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < 1.3911727598234371

    1. Initial program 0.0

      \[\frac{x}{1 + \sqrt{x + 1}}\]
    2. Using strategy rm
    3. Applied flip3-+0.0

      \[\leadsto \frac{x}{\color{blue}{\frac{{1}^{3} + {\left(\sqrt{x + 1}\right)}^{3}}{1 \cdot 1 + \left(\sqrt{x + 1} \cdot \sqrt{x + 1} - 1 \cdot \sqrt{x + 1}\right)}}}\]
    4. Applied associate-/r/0.0

      \[\leadsto \color{blue}{\frac{x}{{1}^{3} + {\left(\sqrt{x + 1}\right)}^{3}} \cdot \left(1 \cdot 1 + \left(\sqrt{x + 1} \cdot \sqrt{x + 1} - 1 \cdot \sqrt{x + 1}\right)\right)}\]

    if 1.3911727598234371 < x

    1. Initial program 0.5

      \[\frac{x}{1 + \sqrt{x + 1}}\]
    2. Using strategy rm
    3. Applied flip-+0.5

      \[\leadsto \frac{x}{\color{blue}{\frac{1 \cdot 1 - \sqrt{x + 1} \cdot \sqrt{x + 1}}{1 - \sqrt{x + 1}}}}\]
    4. Applied associate-/r/0.6

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

      \[\leadsto \color{blue}{\frac{x}{\left(1 \cdot 1 - x\right) - 1}} \cdot \left(1 - \sqrt{x + 1}\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 1.3911727598234371:\\ \;\;\;\;\frac{x}{{1}^{3} + {\left(\sqrt{x + 1}\right)}^{3}} \cdot \left(1 \cdot 1 + \left(\sqrt{x + 1} \cdot \sqrt{x + 1} - 1 \cdot \sqrt{x + 1}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(1 \cdot 1 - x\right) - 1} \cdot \left(1 - \sqrt{x + 1}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020071 +o rules:numerics
(FPCore (x)
  :name "Numeric.Log:$clog1p from log-domain-0.10.2.1, B"
  :precision binary64
  (/ x (+ 1 (sqrt (+ x 1)))))