Average Error: 0.1 → 0.1
Time: 2.2s
Precision: 64
\[\frac{x \cdot x - 3}{6}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot x \le 6.9815881122695149:\\ \;\;\;\;\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - 3 \cdot 3}{6 \cdot \left(x \cdot x + 3\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{x \cdot x - 3}}{\frac{6}{\sqrt{x \cdot x - 3}}}\\ \end{array}\]
\frac{x \cdot x - 3}{6}
\begin{array}{l}
\mathbf{if}\;x \cdot x \le 6.9815881122695149:\\
\;\;\;\;\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - 3 \cdot 3}{6 \cdot \left(x \cdot x + 3\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{x \cdot x - 3}}{\frac{6}{\sqrt{x \cdot x - 3}}}\\

\end{array}
double code(double x) {
	return ((double) (((double) (((double) (x * x)) - 3.0)) / 6.0));
}
double code(double x) {
	double VAR;
	if ((((double) (x * x)) <= 6.981588112269515)) {
		VAR = ((double) (((double) (((double) (((double) (x * x)) * ((double) (x * x)))) - ((double) (3.0 * 3.0)))) / ((double) (6.0 * ((double) (((double) (x * x)) + 3.0))))));
	} else {
		VAR = ((double) (((double) sqrt(((double) (((double) (x * x)) - 3.0)))) / ((double) (6.0 / ((double) sqrt(((double) (((double) (x * x)) - 3.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 x) < 6.981588112269515

    1. Initial program 0.0

      \[\frac{x \cdot x - 3}{6}\]
    2. Using strategy rm
    3. Applied flip--0.0

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

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

    if 6.981588112269515 < (* x x)

    1. Initial program 0.3

      \[\frac{x \cdot x - 3}{6}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt0.3

      \[\leadsto \frac{\color{blue}{\sqrt{x \cdot x - 3} \cdot \sqrt{x \cdot x - 3}}}{6}\]
    4. Applied associate-/l*0.3

      \[\leadsto \color{blue}{\frac{\sqrt{x \cdot x - 3}}{\frac{6}{\sqrt{x \cdot x - 3}}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

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

Reproduce

herbie shell --seed 2020129 
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, H"
  :precision binary64
  (/ (- (* x x) 3.0) 6.0))