Data.Approximate.Numerics:blog from approximate-0.2.2.1

Percentage Accurate: 99.7% → 99.7%
Time: 11.2s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \end{array} \]
(FPCore (x)
 :precision binary64
 (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))
double code(double x) {
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (6.0d0 * (x - 1.0d0)) / ((x + 1.0d0) + (4.0d0 * sqrt(x)))
end function
public static double code(double x) {
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * Math.sqrt(x)));
}
def code(x):
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * math.sqrt(x)))
function code(x)
	return Float64(Float64(6.0 * Float64(x - 1.0)) / Float64(Float64(x + 1.0) + Float64(4.0 * sqrt(x))))
end
function tmp = code(x)
	tmp = (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
end
code[x_] := N[(N[(6.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \end{array} \]
(FPCore (x)
 :precision binary64
 (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))
double code(double x) {
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (6.0d0 * (x - 1.0d0)) / ((x + 1.0d0) + (4.0d0 * sqrt(x)))
end function
public static double code(double x) {
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * Math.sqrt(x)));
}
def code(x):
	return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * math.sqrt(x)))
function code(x)
	return Float64(Float64(6.0 * Float64(x - 1.0)) / Float64(Float64(x + 1.0) + Float64(4.0 * sqrt(x))))
end
function tmp = code(x)
	tmp = (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
end
code[x_] := N[(N[(6.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}
\end{array}

Alternative 1: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{6 \cdot x + -6}{\left(x + 1\right) - \frac{-4}{{x}^{-0.5}}} \end{array} \]
(FPCore (x)
 :precision binary64
 (/ (+ (* 6.0 x) -6.0) (- (+ x 1.0) (/ -4.0 (pow x -0.5)))))
double code(double x) {
	return ((6.0 * x) + -6.0) / ((x + 1.0) - (-4.0 / pow(x, -0.5)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = ((6.0d0 * x) + (-6.0d0)) / ((x + 1.0d0) - ((-4.0d0) / (x ** (-0.5d0))))
end function
public static double code(double x) {
	return ((6.0 * x) + -6.0) / ((x + 1.0) - (-4.0 / Math.pow(x, -0.5)));
}
def code(x):
	return ((6.0 * x) + -6.0) / ((x + 1.0) - (-4.0 / math.pow(x, -0.5)))
function code(x)
	return Float64(Float64(Float64(6.0 * x) + -6.0) / Float64(Float64(x + 1.0) - Float64(-4.0 / (x ^ -0.5))))
end
function tmp = code(x)
	tmp = ((6.0 * x) + -6.0) / ((x + 1.0) - (-4.0 / (x ^ -0.5)));
end
code[x_] := N[(N[(N[(6.0 * x), $MachinePrecision] + -6.0), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] - N[(-4.0 / N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{6 \cdot x + -6}{\left(x + 1\right) - \frac{-4}{{x}^{-0.5}}}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
  2. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
    3. distribute-lft-inN/A

      \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
    4. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
    8. associate-+l+N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
    9. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
    10. remove-double-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
    12. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
    13. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
    14. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
    15. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
    16. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
    17. metadata-eval99.8%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. pow1/2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{\frac{1}{2}}\right), -4\right)\right)\right)\right) \]
    2. sqr-powN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {x}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), -4\right)\right)\right)\right) \]
    3. pow-prod-downN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left({\left(x \cdot x\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), -4\right)\right)\right)\right) \]
    4. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(x \cdot x\right), \left(\frac{\frac{1}{2}}{2}\right)\right), -4\right)\right)\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{\frac{1}{2}}{2}\right)\right), -4\right)\right)\right)\right) \]
    6. metadata-eval76.5%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{4}\right), -4\right)\right)\right)\right) \]
  6. Applied egg-rr76.5%

    \[\leadsto \frac{6 \cdot x + -6}{x + \left(1 - \color{blue}{{\left(x \cdot x\right)}^{0.25}} \cdot -4\right)} \]
  7. Step-by-step derivation
    1. unpow-prod-downN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{\frac{1}{4}} \cdot {x}^{\frac{1}{4}}\right), -4\right)\right)\right)\right) \]
    2. pow-prod-upN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{\left(\frac{1}{4} + \frac{1}{4}\right)}\right), -4\right)\right)\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{\frac{1}{2}}\right), -4\right)\right)\right)\right) \]
    4. pow1/2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), -4\right)\right)\right)\right) \]
    5. remove-double-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)}\right), -4\right)\right)\right)\right) \]
    6. sub0-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\mathsf{neg}\left(\left(0 - x\right)\right)}\right), -4\right)\right)\right)\right) \]
    7. flip--N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\mathsf{neg}\left(\frac{0 \cdot 0 - x \cdot x}{0 + x}\right)}\right), -4\right)\right)\right)\right) \]
    8. +-lft-identityN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\mathsf{neg}\left(\frac{0 \cdot 0 - x \cdot x}{x}\right)}\right), -4\right)\right)\right)\right) \]
    9. distribute-neg-fracN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(\left(0 \cdot 0 - x \cdot x\right)\right)}{x}}\right), -4\right)\right)\right)\right) \]
    10. sqrt-divN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(\left(0 \cdot 0 - x \cdot x\right)\right)}}{\sqrt{x}}\right), -4\right)\right)\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(\left(0 - x \cdot x\right)\right)}}{\sqrt{x}}\right), -4\right)\right)\right)\right) \]
    12. sub0-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot x\right)\right)\right)}}{\sqrt{x}}\right), -4\right)\right)\right)\right) \]
    13. remove-double-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\sqrt{x \cdot x}}{\sqrt{x}}\right), -4\right)\right)\right)\right) \]
    14. sqrt-unprodN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\sqrt{x} \cdot \sqrt{x}}{\sqrt{x}}\right), -4\right)\right)\right)\right) \]
    15. rem-square-sqrtN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{x}{\sqrt{x}}\right), -4\right)\right)\right)\right) \]
    16. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(\sqrt{x}\right)\right), -4\right)\right)\right)\right) \]
    17. sqrt-lowering-sqrt.f6499.9%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{sqrt.f64}\left(x\right)\right), -4\right)\right)\right)\right) \]
  8. Applied egg-rr99.9%

    \[\leadsto \frac{6 \cdot x + -6}{x + \left(1 - \color{blue}{\frac{x}{\sqrt{x}}} \cdot -4\right)} \]
  9. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(1 - \frac{x}{\sqrt{x}} \cdot -4\right) + \color{blue}{x}\right)\right) \]
    2. associate-+l-N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \color{blue}{\left(\frac{x}{\sqrt{x}} \cdot -4 - x\right)}\right)\right) \]
    3. fmm-defN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left(\frac{x}{\sqrt{x}}, \color{blue}{-4}, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    4. clear-numN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left(\frac{1}{\frac{\sqrt{x}}{x}}, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    5. associate-/r/N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left(\frac{1}{\sqrt{x}} \cdot x, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    6. inv-powN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left({\left(\sqrt{x}\right)}^{-1} \cdot x, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    7. sqrt-pow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left({x}^{\left(\frac{-1}{2}\right)} \cdot x, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left({x}^{\frac{-1}{2}} \cdot x, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left({x}^{\left(-1 \cdot \frac{1}{2}\right)} \cdot x, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    10. pow-plusN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left({x}^{\left(-1 \cdot \frac{1}{2} + 1\right)}, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left({x}^{\left(\frac{-1}{2} + 1\right)}, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    12. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left({x}^{\frac{1}{2}}, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    13. pow1/2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \mathsf{fma}\left(\sqrt{x}, -4, \mathsf{neg}\left(x\right)\right)\right)\right) \]
    14. fmm-defN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 - \left(\sqrt{x} \cdot -4 - \color{blue}{x}\right)\right)\right) \]
    15. associate-+l-N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(1 - \sqrt{x} \cdot -4\right) + \color{blue}{x}\right)\right) \]
    16. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 - \sqrt{x} \cdot -4\right)}\right)\right) \]
    17. associate-+r-N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + 1\right) - \color{blue}{\sqrt{x} \cdot -4}\right)\right) \]
    18. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{\_.f64}\left(\left(x + 1\right), \color{blue}{\left(\sqrt{x} \cdot -4\right)}\right)\right) \]
    19. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(\color{blue}{\sqrt{x}} \cdot -4\right)\right)\right) \]
  10. Applied egg-rr99.9%

    \[\leadsto \frac{6 \cdot x + -6}{\color{blue}{\left(x + 1\right) - \frac{-4}{{x}^{-0.5}}}} \]
  11. Add Preprocessing

Alternative 2: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + \sqrt{x} \cdot 4\\ \mathbf{if}\;x \leq 3.5:\\ \;\;\;\;\frac{6 \cdot x + -6}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + t\_0}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (+ 1.0 (* (sqrt x) 4.0))))
   (if (<= x 3.5) (/ (+ (* 6.0 x) -6.0) t_0) (* 6.0 (/ x (+ x t_0))))))
double code(double x) {
	double t_0 = 1.0 + (sqrt(x) * 4.0);
	double tmp;
	if (x <= 3.5) {
		tmp = ((6.0 * x) + -6.0) / t_0;
	} else {
		tmp = 6.0 * (x / (x + t_0));
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 + (sqrt(x) * 4.0d0)
    if (x <= 3.5d0) then
        tmp = ((6.0d0 * x) + (-6.0d0)) / t_0
    else
        tmp = 6.0d0 * (x / (x + t_0))
    end if
    code = tmp
end function
public static double code(double x) {
	double t_0 = 1.0 + (Math.sqrt(x) * 4.0);
	double tmp;
	if (x <= 3.5) {
		tmp = ((6.0 * x) + -6.0) / t_0;
	} else {
		tmp = 6.0 * (x / (x + t_0));
	}
	return tmp;
}
def code(x):
	t_0 = 1.0 + (math.sqrt(x) * 4.0)
	tmp = 0
	if x <= 3.5:
		tmp = ((6.0 * x) + -6.0) / t_0
	else:
		tmp = 6.0 * (x / (x + t_0))
	return tmp
function code(x)
	t_0 = Float64(1.0 + Float64(sqrt(x) * 4.0))
	tmp = 0.0
	if (x <= 3.5)
		tmp = Float64(Float64(Float64(6.0 * x) + -6.0) / t_0);
	else
		tmp = Float64(6.0 * Float64(x / Float64(x + t_0)));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = 1.0 + (sqrt(x) * 4.0);
	tmp = 0.0;
	if (x <= 3.5)
		tmp = ((6.0 * x) + -6.0) / t_0;
	else
		tmp = 6.0 * (x / (x + t_0));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(N[Sqrt[x], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3.5], N[(N[(N[(6.0 * x), $MachinePrecision] + -6.0), $MachinePrecision] / t$95$0), $MachinePrecision], N[(6.0 * N[(x / N[(x + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 + \sqrt{x} \cdot 4\\
\mathbf{if}\;x \leq 3.5:\\
\;\;\;\;\frac{6 \cdot x + -6}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x}{x + t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 3.5

    1. Initial program 99.9%

      \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
      3. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
      8. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
      10. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
      16. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
      17. metadata-eval100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \color{blue}{\left(1 - -4 \cdot \sqrt{x}\right)}\right) \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot 4\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{4}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f6497.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), 4\right)\right)\right) \]
    7. Simplified97.5%

      \[\leadsto \frac{6 \cdot x + -6}{\color{blue}{1 + \sqrt{x} \cdot 4}} \]

    if 3.5 < x

    1. Initial program 99.7%

      \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
      3. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
      8. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
      10. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
      16. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
      17. metadata-eval99.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(6 \cdot x\right)}, \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(x \cdot 6\right), \mathsf{+.f64}\left(\color{blue}{x}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
      2. *-lowering-*.f6497.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, 6\right), \mathsf{+.f64}\left(\color{blue}{x}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
    7. Simplified97.7%

      \[\leadsto \frac{\color{blue}{x \cdot 6}}{x + \left(1 - \sqrt{x} \cdot -4\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{6 \cdot x}{\color{blue}{x} + \left(1 - \sqrt{x} \cdot -4\right)} \]
      2. associate-/l*N/A

        \[\leadsto 6 \cdot \color{blue}{\frac{x}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(\frac{x}{x + \left(1 - \sqrt{x} \cdot -4\right)}\right)}\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{\left(1 - \sqrt{x} \cdot -4\right) + \color{blue}{x}}\right)\right) \]
      5. associate-+l-N/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \color{blue}{\left(\sqrt{x} \cdot -4 - x\right)}}\right)\right) \]
      6. fmm-defN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left(\sqrt{x}, \color{blue}{-4}, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      7. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\frac{1}{2}}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\left(\frac{-1}{2} + 1\right)}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\left(-1 \cdot \frac{1}{2} + 1\right)}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      10. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\left(-1 \cdot \frac{1}{2}\right)} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\frac{-1}{2}} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\left(\frac{-1}{2}\right)} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      13. sqrt-pow2N/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({\left(\sqrt{x}\right)}^{-1} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      14. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left(\frac{1}{\sqrt{x}} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      15. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left(\frac{1}{\frac{\sqrt{x}}{x}}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left(\frac{x}{\sqrt{x}}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
      17. fmm-defN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \left(\frac{x}{\sqrt{x}} \cdot -4 - \color{blue}{x}\right)}\right)\right) \]
      18. associate-+l-N/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{\left(1 - \frac{x}{\sqrt{x}} \cdot -4\right) + \color{blue}{x}}\right)\right) \]
      19. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{x + \color{blue}{\left(1 - \frac{x}{\sqrt{x}} \cdot -4\right)}}\right)\right) \]
      20. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(6, \mathsf{/.f64}\left(x, \color{blue}{\left(x + \left(1 - \frac{x}{\sqrt{x}} \cdot -4\right)\right)}\right)\right) \]
    9. Applied egg-rr97.9%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{x + \left(1 + \sqrt{x} \cdot 4\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{x + \left(1 - -4 \cdot \sqrt{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + \left(1 + \sqrt{x} \cdot 4\right)}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x 1.0)
   (/ -6.0 (+ x (- 1.0 (* -4.0 (sqrt x)))))
   (* 6.0 (/ x (+ x (+ 1.0 (* (sqrt x) 4.0)))))))
double code(double x) {
	double tmp;
	if (x <= 1.0) {
		tmp = -6.0 / (x + (1.0 - (-4.0 * sqrt(x))));
	} else {
		tmp = 6.0 * (x / (x + (1.0 + (sqrt(x) * 4.0))));
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 1.0d0) then
        tmp = (-6.0d0) / (x + (1.0d0 - ((-4.0d0) * sqrt(x))))
    else
        tmp = 6.0d0 * (x / (x + (1.0d0 + (sqrt(x) * 4.0d0))))
    end if
    code = tmp
end function
public static double code(double x) {
	double tmp;
	if (x <= 1.0) {
		tmp = -6.0 / (x + (1.0 - (-4.0 * Math.sqrt(x))));
	} else {
		tmp = 6.0 * (x / (x + (1.0 + (Math.sqrt(x) * 4.0))));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= 1.0:
		tmp = -6.0 / (x + (1.0 - (-4.0 * math.sqrt(x))))
	else:
		tmp = 6.0 * (x / (x + (1.0 + (math.sqrt(x) * 4.0))))
	return tmp
function code(x)
	tmp = 0.0
	if (x <= 1.0)
		tmp = Float64(-6.0 / Float64(x + Float64(1.0 - Float64(-4.0 * sqrt(x)))));
	else
		tmp = Float64(6.0 * Float64(x / Float64(x + Float64(1.0 + Float64(sqrt(x) * 4.0)))));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 1.0)
		tmp = -6.0 / (x + (1.0 - (-4.0 * sqrt(x))));
	else
		tmp = 6.0 * (x / (x + (1.0 + (sqrt(x) * 4.0))));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, 1.0], N[(-6.0 / N[(x + N[(1.0 - N[(-4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x / N[(x + N[(1.0 + N[(N[Sqrt[x], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{-6}{x + \left(1 - -4 \cdot \sqrt{x}\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1

    1. Initial program 99.9%

      \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
    2. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
      3. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
      8. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
      10. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
      16. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
      17. metadata-eval100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{-6}, \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. Simplified98.1%

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

      if 1 < x

      1. Initial program 99.7%

        \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
      2. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
        3. distribute-lft-inN/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
        6. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
        8. associate-+l+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
        9. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
        10. remove-double-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
        12. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
        14. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
        16. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
        17. metadata-eval99.7%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
      3. Simplified99.7%

        \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around inf

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(6 \cdot x\right)}, \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\left(x \cdot 6\right), \mathsf{+.f64}\left(\color{blue}{x}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        2. *-lowering-*.f6497.0%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, 6\right), \mathsf{+.f64}\left(\color{blue}{x}, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
      7. Simplified97.0%

        \[\leadsto \frac{\color{blue}{x \cdot 6}}{x + \left(1 - \sqrt{x} \cdot -4\right)} \]
      8. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{6 \cdot x}{\color{blue}{x} + \left(1 - \sqrt{x} \cdot -4\right)} \]
        2. associate-/l*N/A

          \[\leadsto 6 \cdot \color{blue}{\frac{x}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(6, \color{blue}{\left(\frac{x}{x + \left(1 - \sqrt{x} \cdot -4\right)}\right)}\right) \]
        4. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{\left(1 - \sqrt{x} \cdot -4\right) + \color{blue}{x}}\right)\right) \]
        5. associate-+l-N/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \color{blue}{\left(\sqrt{x} \cdot -4 - x\right)}}\right)\right) \]
        6. fmm-defN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left(\sqrt{x}, \color{blue}{-4}, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        7. pow1/2N/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\frac{1}{2}}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        8. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\left(\frac{-1}{2} + 1\right)}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        9. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\left(-1 \cdot \frac{1}{2} + 1\right)}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        10. pow-plusN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\left(-1 \cdot \frac{1}{2}\right)} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        11. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\frac{-1}{2}} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        12. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({x}^{\left(\frac{-1}{2}\right)} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        13. sqrt-pow2N/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left({\left(\sqrt{x}\right)}^{-1} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        14. inv-powN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left(\frac{1}{\sqrt{x}} \cdot x, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        15. associate-/r/N/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left(\frac{1}{\frac{\sqrt{x}}{x}}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        16. clear-numN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \mathsf{fma}\left(\frac{x}{\sqrt{x}}, -4, \mathsf{neg}\left(x\right)\right)}\right)\right) \]
        17. fmm-defN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{1 - \left(\frac{x}{\sqrt{x}} \cdot -4 - \color{blue}{x}\right)}\right)\right) \]
        18. associate-+l-N/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{\left(1 - \frac{x}{\sqrt{x}} \cdot -4\right) + \color{blue}{x}}\right)\right) \]
        19. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(6, \left(\frac{x}{x + \color{blue}{\left(1 - \frac{x}{\sqrt{x}} \cdot -4\right)}}\right)\right) \]
        20. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(6, \mathsf{/.f64}\left(x, \color{blue}{\left(x + \left(1 - \frac{x}{\sqrt{x}} \cdot -4\right)\right)}\right)\right) \]
      9. Applied egg-rr97.3%

        \[\leadsto \color{blue}{6 \cdot \frac{x}{x + \left(1 + \sqrt{x} \cdot 4\right)}} \]
    7. Recombined 2 regimes into one program.
    8. Final simplification97.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{x + \left(1 - -4 \cdot \sqrt{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{x + \left(1 + \sqrt{x} \cdot 4\right)}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 4: 97.9% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{x + \left(1 - -4 \cdot \sqrt{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\ \end{array} \end{array} \]
    (FPCore (x)
     :precision binary64
     (if (<= x 1.0)
       (/ -6.0 (+ x (- 1.0 (* -4.0 (sqrt x)))))
       (/ 6.0 (+ 1.0 (/ 4.0 (sqrt x))))))
    double code(double x) {
    	double tmp;
    	if (x <= 1.0) {
    		tmp = -6.0 / (x + (1.0 - (-4.0 * sqrt(x))));
    	} else {
    		tmp = 6.0 / (1.0 + (4.0 / sqrt(x)));
    	}
    	return tmp;
    }
    
    real(8) function code(x)
        real(8), intent (in) :: x
        real(8) :: tmp
        if (x <= 1.0d0) then
            tmp = (-6.0d0) / (x + (1.0d0 - ((-4.0d0) * sqrt(x))))
        else
            tmp = 6.0d0 / (1.0d0 + (4.0d0 / sqrt(x)))
        end if
        code = tmp
    end function
    
    public static double code(double x) {
    	double tmp;
    	if (x <= 1.0) {
    		tmp = -6.0 / (x + (1.0 - (-4.0 * Math.sqrt(x))));
    	} else {
    		tmp = 6.0 / (1.0 + (4.0 / Math.sqrt(x)));
    	}
    	return tmp;
    }
    
    def code(x):
    	tmp = 0
    	if x <= 1.0:
    		tmp = -6.0 / (x + (1.0 - (-4.0 * math.sqrt(x))))
    	else:
    		tmp = 6.0 / (1.0 + (4.0 / math.sqrt(x)))
    	return tmp
    
    function code(x)
    	tmp = 0.0
    	if (x <= 1.0)
    		tmp = Float64(-6.0 / Float64(x + Float64(1.0 - Float64(-4.0 * sqrt(x)))));
    	else
    		tmp = Float64(6.0 / Float64(1.0 + Float64(4.0 / sqrt(x))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	tmp = 0.0;
    	if (x <= 1.0)
    		tmp = -6.0 / (x + (1.0 - (-4.0 * sqrt(x))));
    	else
    		tmp = 6.0 / (1.0 + (4.0 / sqrt(x)));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_] := If[LessEqual[x, 1.0], N[(-6.0 / N[(x + N[(1.0 - N[(-4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / N[(1.0 + N[(4.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq 1:\\
    \;\;\;\;\frac{-6}{x + \left(1 - -4 \cdot \sqrt{x}\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 1

      1. Initial program 99.9%

        \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
      2. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
        3. distribute-lft-inN/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
        6. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
        8. associate-+l+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
        9. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
        10. remove-double-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
        12. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
        14. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
        16. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
        17. metadata-eval100.0%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
      3. Simplified100.0%

        \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around 0

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{-6}, \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. Simplified98.1%

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

        if 1 < x

        1. Initial program 99.7%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          3. distribute-lft-inN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          8. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          10. remove-double-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
          14. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          16. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
          17. metadata-eval99.7%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        3. Simplified99.7%

          \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around inf

          \[\leadsto \color{blue}{\frac{6}{1 - -4 \cdot \sqrt{\frac{1}{x}}}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(1 - -4 \cdot \sqrt{\frac{1}{x}}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)\right)\right) \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot 4\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{x}}\right), \color{blue}{4}\right)\right)\right) \]
          8. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{x}\right)\right), 4\right)\right)\right) \]
          9. /-lowering-/.f6497.2%

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, x\right)\right), 4\right)\right)\right) \]
        7. Simplified97.2%

          \[\leadsto \color{blue}{\frac{6}{1 + \sqrt{\frac{1}{x}} \cdot 4}} \]
        8. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(6, \left(\sqrt{\frac{1}{x}} \cdot 4 + \color{blue}{1}\right)\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(\sqrt{\frac{1}{x}} \cdot 4\right), \color{blue}{1}\right)\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(4 \cdot \sqrt{\frac{1}{x}}\right), 1\right)\right) \]
          4. sqrt-divN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(4 \cdot \frac{\sqrt{1}}{\sqrt{x}}\right), 1\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(4 \cdot \frac{1}{\sqrt{x}}\right), 1\right)\right) \]
          6. un-div-invN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(\frac{4}{\sqrt{x}}\right), 1\right)\right) \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\mathsf{/.f64}\left(4, \left(\sqrt{x}\right)\right), 1\right)\right) \]
          8. sqrt-lowering-sqrt.f6497.2%

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\mathsf{/.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right), 1\right)\right) \]
        9. Applied egg-rr97.2%

          \[\leadsto \frac{6}{\color{blue}{\frac{4}{\sqrt{x}} + 1}} \]
      7. Recombined 2 regimes into one program.
      8. Final simplification97.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{x + \left(1 - -4 \cdot \sqrt{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\ \end{array} \]
      9. Add Preprocessing

      Alternative 5: 99.7% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \frac{6 \cdot x + -6}{x + \left(1 - -4 \cdot \sqrt{x}\right)} \end{array} \]
      (FPCore (x)
       :precision binary64
       (/ (+ (* 6.0 x) -6.0) (+ x (- 1.0 (* -4.0 (sqrt x))))))
      double code(double x) {
      	return ((6.0 * x) + -6.0) / (x + (1.0 - (-4.0 * sqrt(x))));
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          code = ((6.0d0 * x) + (-6.0d0)) / (x + (1.0d0 - ((-4.0d0) * sqrt(x))))
      end function
      
      public static double code(double x) {
      	return ((6.0 * x) + -6.0) / (x + (1.0 - (-4.0 * Math.sqrt(x))));
      }
      
      def code(x):
      	return ((6.0 * x) + -6.0) / (x + (1.0 - (-4.0 * math.sqrt(x))))
      
      function code(x)
      	return Float64(Float64(Float64(6.0 * x) + -6.0) / Float64(x + Float64(1.0 - Float64(-4.0 * sqrt(x)))))
      end
      
      function tmp = code(x)
      	tmp = ((6.0 * x) + -6.0) / (x + (1.0 - (-4.0 * sqrt(x))));
      end
      
      code[x_] := N[(N[(N[(6.0 * x), $MachinePrecision] + -6.0), $MachinePrecision] / N[(x + N[(1.0 - N[(-4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{6 \cdot x + -6}{x + \left(1 - -4 \cdot \sqrt{x}\right)}
      \end{array}
      
      Derivation
      1. Initial program 99.8%

        \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
      2. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
        3. distribute-lft-inN/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
        6. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
        8. associate-+l+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
        9. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
        10. remove-double-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
        12. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
        14. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
        16. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
        17. metadata-eval99.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
      3. Simplified99.8%

        \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
      4. Add Preprocessing
      5. Final simplification99.8%

        \[\leadsto \frac{6 \cdot x + -6}{x + \left(1 - -4 \cdot \sqrt{x}\right)} \]
      6. Add Preprocessing

      Alternative 6: 99.7% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \frac{6 \cdot \left(x + -1\right)}{\left(x + 1\right) + \sqrt{x} \cdot 4} \end{array} \]
      (FPCore (x)
       :precision binary64
       (/ (* 6.0 (+ x -1.0)) (+ (+ x 1.0) (* (sqrt x) 4.0))))
      double code(double x) {
      	return (6.0 * (x + -1.0)) / ((x + 1.0) + (sqrt(x) * 4.0));
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          code = (6.0d0 * (x + (-1.0d0))) / ((x + 1.0d0) + (sqrt(x) * 4.0d0))
      end function
      
      public static double code(double x) {
      	return (6.0 * (x + -1.0)) / ((x + 1.0) + (Math.sqrt(x) * 4.0));
      }
      
      def code(x):
      	return (6.0 * (x + -1.0)) / ((x + 1.0) + (math.sqrt(x) * 4.0))
      
      function code(x)
      	return Float64(Float64(6.0 * Float64(x + -1.0)) / Float64(Float64(x + 1.0) + Float64(sqrt(x) * 4.0)))
      end
      
      function tmp = code(x)
      	tmp = (6.0 * (x + -1.0)) / ((x + 1.0) + (sqrt(x) * 4.0));
      end
      
      code[x_] := N[(N[(6.0 * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{6 \cdot \left(x + -1\right)}{\left(x + 1\right) + \sqrt{x} \cdot 4}
      \end{array}
      
      Derivation
      1. Initial program 99.8%

        \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
      2. Add Preprocessing
      3. Final simplification99.8%

        \[\leadsto \frac{6 \cdot \left(x + -1\right)}{\left(x + 1\right) + \sqrt{x} \cdot 4} \]
      4. Add Preprocessing

      Alternative 7: 97.9% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{1 + \sqrt{x} \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\ \end{array} \end{array} \]
      (FPCore (x)
       :precision binary64
       (if (<= x 1.0)
         (/ -6.0 (+ 1.0 (* (sqrt x) 4.0)))
         (/ 6.0 (+ 1.0 (/ 4.0 (sqrt x))))))
      double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = -6.0 / (1.0 + (sqrt(x) * 4.0));
      	} else {
      		tmp = 6.0 / (1.0 + (4.0 / sqrt(x)));
      	}
      	return tmp;
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          real(8) :: tmp
          if (x <= 1.0d0) then
              tmp = (-6.0d0) / (1.0d0 + (sqrt(x) * 4.0d0))
          else
              tmp = 6.0d0 / (1.0d0 + (4.0d0 / sqrt(x)))
          end if
          code = tmp
      end function
      
      public static double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = -6.0 / (1.0 + (Math.sqrt(x) * 4.0));
      	} else {
      		tmp = 6.0 / (1.0 + (4.0 / Math.sqrt(x)));
      	}
      	return tmp;
      }
      
      def code(x):
      	tmp = 0
      	if x <= 1.0:
      		tmp = -6.0 / (1.0 + (math.sqrt(x) * 4.0))
      	else:
      		tmp = 6.0 / (1.0 + (4.0 / math.sqrt(x)))
      	return tmp
      
      function code(x)
      	tmp = 0.0
      	if (x <= 1.0)
      		tmp = Float64(-6.0 / Float64(1.0 + Float64(sqrt(x) * 4.0)));
      	else
      		tmp = Float64(6.0 / Float64(1.0 + Float64(4.0 / sqrt(x))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x)
      	tmp = 0.0;
      	if (x <= 1.0)
      		tmp = -6.0 / (1.0 + (sqrt(x) * 4.0));
      	else
      		tmp = 6.0 / (1.0 + (4.0 / sqrt(x)));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_] := If[LessEqual[x, 1.0], N[(-6.0 / N[(1.0 + N[(N[Sqrt[x], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / N[(1.0 + N[(4.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq 1:\\
      \;\;\;\;\frac{-6}{1 + \sqrt{x} \cdot 4}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < 1

        1. Initial program 99.9%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          3. distribute-lft-inN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          8. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          10. remove-double-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
          14. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          16. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
          17. metadata-eval100.0%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        3. Simplified100.0%

          \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{-6}{1 - -4 \cdot \sqrt{x}}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \color{blue}{\left(1 - -4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot 4\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{4}\right)\right)\right) \]
          8. sqrt-lowering-sqrt.f6498.1%

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), 4\right)\right)\right) \]
        7. Simplified98.1%

          \[\leadsto \color{blue}{\frac{-6}{1 + \sqrt{x} \cdot 4}} \]

        if 1 < x

        1. Initial program 99.7%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          3. distribute-lft-inN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          8. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          10. remove-double-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
          14. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          16. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
          17. metadata-eval99.7%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        3. Simplified99.7%

          \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around inf

          \[\leadsto \color{blue}{\frac{6}{1 - -4 \cdot \sqrt{\frac{1}{x}}}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(1 - -4 \cdot \sqrt{\frac{1}{x}}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)\right)\right) \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot 4\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{x}}\right), \color{blue}{4}\right)\right)\right) \]
          8. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{x}\right)\right), 4\right)\right)\right) \]
          9. /-lowering-/.f6497.2%

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, x\right)\right), 4\right)\right)\right) \]
        7. Simplified97.2%

          \[\leadsto \color{blue}{\frac{6}{1 + \sqrt{\frac{1}{x}} \cdot 4}} \]
        8. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(6, \left(\sqrt{\frac{1}{x}} \cdot 4 + \color{blue}{1}\right)\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(\sqrt{\frac{1}{x}} \cdot 4\right), \color{blue}{1}\right)\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(4 \cdot \sqrt{\frac{1}{x}}\right), 1\right)\right) \]
          4. sqrt-divN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(4 \cdot \frac{\sqrt{1}}{\sqrt{x}}\right), 1\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(4 \cdot \frac{1}{\sqrt{x}}\right), 1\right)\right) \]
          6. un-div-invN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\left(\frac{4}{\sqrt{x}}\right), 1\right)\right) \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\mathsf{/.f64}\left(4, \left(\sqrt{x}\right)\right), 1\right)\right) \]
          8. sqrt-lowering-sqrt.f6497.2%

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(\mathsf{/.f64}\left(4, \mathsf{sqrt.f64}\left(x\right)\right), 1\right)\right) \]
        9. Applied egg-rr97.2%

          \[\leadsto \frac{6}{\color{blue}{\frac{4}{\sqrt{x}} + 1}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification97.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{1 + \sqrt{x} \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{1 + \frac{4}{\sqrt{x}}}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 52.5% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-6}{1 + \sqrt{x} \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot 1.5\\ \end{array} \end{array} \]
      (FPCore (x)
       :precision binary64
       (if (<= x 1.0) (/ -6.0 (+ 1.0 (* (sqrt x) 4.0))) (* (sqrt x) 1.5)))
      double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = -6.0 / (1.0 + (sqrt(x) * 4.0));
      	} else {
      		tmp = sqrt(x) * 1.5;
      	}
      	return tmp;
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          real(8) :: tmp
          if (x <= 1.0d0) then
              tmp = (-6.0d0) / (1.0d0 + (sqrt(x) * 4.0d0))
          else
              tmp = sqrt(x) * 1.5d0
          end if
          code = tmp
      end function
      
      public static double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = -6.0 / (1.0 + (Math.sqrt(x) * 4.0));
      	} else {
      		tmp = Math.sqrt(x) * 1.5;
      	}
      	return tmp;
      }
      
      def code(x):
      	tmp = 0
      	if x <= 1.0:
      		tmp = -6.0 / (1.0 + (math.sqrt(x) * 4.0))
      	else:
      		tmp = math.sqrt(x) * 1.5
      	return tmp
      
      function code(x)
      	tmp = 0.0
      	if (x <= 1.0)
      		tmp = Float64(-6.0 / Float64(1.0 + Float64(sqrt(x) * 4.0)));
      	else
      		tmp = Float64(sqrt(x) * 1.5);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x)
      	tmp = 0.0;
      	if (x <= 1.0)
      		tmp = -6.0 / (1.0 + (sqrt(x) * 4.0));
      	else
      		tmp = sqrt(x) * 1.5;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_] := If[LessEqual[x, 1.0], N[(-6.0 / N[(1.0 + N[(N[Sqrt[x], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * 1.5), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq 1:\\
      \;\;\;\;\frac{-6}{1 + \sqrt{x} \cdot 4}\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{x} \cdot 1.5\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < 1

        1. Initial program 99.9%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          3. distribute-lft-inN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          8. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          10. remove-double-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
          14. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          16. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
          17. metadata-eval100.0%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        3. Simplified100.0%

          \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{-6}{1 - -4 \cdot \sqrt{x}}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \color{blue}{\left(1 - -4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot 4\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{4}\right)\right)\right) \]
          8. sqrt-lowering-sqrt.f6498.1%

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), 4\right)\right)\right) \]
        7. Simplified98.1%

          \[\leadsto \color{blue}{\frac{-6}{1 + \sqrt{x} \cdot 4}} \]

        if 1 < x

        1. Initial program 99.7%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          3. distribute-lft-inN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          8. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          10. remove-double-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
          14. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          16. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
          17. metadata-eval99.7%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        3. Simplified99.7%

          \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around inf

          \[\leadsto \color{blue}{\frac{6}{1 - -4 \cdot \sqrt{\frac{1}{x}}}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(1 - -4 \cdot \sqrt{\frac{1}{x}}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)\right)\right) \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot 4\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{x}}\right), \color{blue}{4}\right)\right)\right) \]
          8. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{x}\right)\right), 4\right)\right)\right) \]
          9. /-lowering-/.f6497.2%

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, x\right)\right), 4\right)\right)\right) \]
        7. Simplified97.2%

          \[\leadsto \color{blue}{\frac{6}{1 + \sqrt{\frac{1}{x}} \cdot 4}} \]
        8. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{3}{2} \cdot \sqrt{x}} \]
        9. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \sqrt{x} \cdot \color{blue}{\frac{3}{2}} \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\frac{3}{2}}\right) \]
          3. sqrt-lowering-sqrt.f647.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \frac{3}{2}\right) \]
        10. Simplified7.1%

          \[\leadsto \color{blue}{\sqrt{x} \cdot 1.5} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 9: 7.0% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{-1.5}{\sqrt{x}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot 1.5\\ \end{array} \end{array} \]
      (FPCore (x)
       :precision binary64
       (if (<= x 1.0) (/ -1.5 (sqrt x)) (* (sqrt x) 1.5)))
      double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = -1.5 / sqrt(x);
      	} else {
      		tmp = sqrt(x) * 1.5;
      	}
      	return tmp;
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          real(8) :: tmp
          if (x <= 1.0d0) then
              tmp = (-1.5d0) / sqrt(x)
          else
              tmp = sqrt(x) * 1.5d0
          end if
          code = tmp
      end function
      
      public static double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = -1.5 / Math.sqrt(x);
      	} else {
      		tmp = Math.sqrt(x) * 1.5;
      	}
      	return tmp;
      }
      
      def code(x):
      	tmp = 0
      	if x <= 1.0:
      		tmp = -1.5 / math.sqrt(x)
      	else:
      		tmp = math.sqrt(x) * 1.5
      	return tmp
      
      function code(x)
      	tmp = 0.0
      	if (x <= 1.0)
      		tmp = Float64(-1.5 / sqrt(x));
      	else
      		tmp = Float64(sqrt(x) * 1.5);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x)
      	tmp = 0.0;
      	if (x <= 1.0)
      		tmp = -1.5 / sqrt(x);
      	else
      		tmp = sqrt(x) * 1.5;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_] := If[LessEqual[x, 1.0], N[(-1.5 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * 1.5), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq 1:\\
      \;\;\;\;\frac{-1.5}{\sqrt{x}}\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{x} \cdot 1.5\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < 1

        1. Initial program 99.9%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          3. distribute-lft-inN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          8. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          10. remove-double-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
          14. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          16. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
          17. metadata-eval100.0%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        3. Simplified100.0%

          \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{-6}{1 - -4 \cdot \sqrt{x}}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \color{blue}{\left(1 - -4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot 4\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{4}\right)\right)\right) \]
          8. sqrt-lowering-sqrt.f6498.1%

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), 4\right)\right)\right) \]
        7. Simplified98.1%

          \[\leadsto \color{blue}{\frac{-6}{1 + \sqrt{x} \cdot 4}} \]
        8. Taylor expanded in x around inf

          \[\leadsto \mathsf{/.f64}\left(-6, \color{blue}{\left(4 \cdot \sqrt{x}\right)}\right) \]
        9. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(-6, \left(\sqrt{x} \cdot \color{blue}{4}\right)\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{4}\right)\right) \]
          3. sqrt-lowering-sqrt.f646.8%

            \[\leadsto \mathsf{/.f64}\left(-6, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), 4\right)\right) \]
        10. Simplified6.8%

          \[\leadsto \frac{-6}{\color{blue}{\sqrt{x} \cdot 4}} \]
        11. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{-6}{4 \cdot \color{blue}{\sqrt{x}}} \]
          2. associate-/r*N/A

            \[\leadsto \frac{\frac{-6}{4}}{\color{blue}{\sqrt{x}}} \]
          3. metadata-evalN/A

            \[\leadsto \frac{\frac{-3}{2}}{\sqrt{\color{blue}{x}}} \]
          4. metadata-evalN/A

            \[\leadsto \frac{\mathsf{neg}\left(\frac{3}{2}\right)}{\sqrt{\color{blue}{x}}} \]
          5. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{3}{2}\right)\right), \color{blue}{\left(\sqrt{x}\right)}\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\frac{-3}{2}, \left(\sqrt{\color{blue}{x}}\right)\right) \]
          7. sqrt-lowering-sqrt.f646.8%

            \[\leadsto \mathsf{/.f64}\left(\frac{-3}{2}, \mathsf{sqrt.f64}\left(x\right)\right) \]
        12. Applied egg-rr6.8%

          \[\leadsto \color{blue}{\frac{-1.5}{\sqrt{x}}} \]

        if 1 < x

        1. Initial program 99.7%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          3. distribute-lft-inN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          8. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          10. remove-double-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
          14. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          16. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
          17. metadata-eval99.7%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        3. Simplified99.7%

          \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around inf

          \[\leadsto \color{blue}{\frac{6}{1 - -4 \cdot \sqrt{\frac{1}{x}}}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(1 - -4 \cdot \sqrt{\frac{1}{x}}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)\right)\right) \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot 4\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{x}}\right), \color{blue}{4}\right)\right)\right) \]
          8. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{x}\right)\right), 4\right)\right)\right) \]
          9. /-lowering-/.f6497.2%

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, x\right)\right), 4\right)\right)\right) \]
        7. Simplified97.2%

          \[\leadsto \color{blue}{\frac{6}{1 + \sqrt{\frac{1}{x}} \cdot 4}} \]
        8. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{3}{2} \cdot \sqrt{x}} \]
        9. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \sqrt{x} \cdot \color{blue}{\frac{3}{2}} \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\frac{3}{2}}\right) \]
          3. sqrt-lowering-sqrt.f647.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \frac{3}{2}\right) \]
        10. Simplified7.1%

          \[\leadsto \color{blue}{\sqrt{x} \cdot 1.5} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 10: 6.9% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\sqrt{x} \cdot -1.5\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot 1.5\\ \end{array} \end{array} \]
      (FPCore (x)
       :precision binary64
       (if (<= x 1.0) (* (sqrt x) -1.5) (* (sqrt x) 1.5)))
      double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = sqrt(x) * -1.5;
      	} else {
      		tmp = sqrt(x) * 1.5;
      	}
      	return tmp;
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          real(8) :: tmp
          if (x <= 1.0d0) then
              tmp = sqrt(x) * (-1.5d0)
          else
              tmp = sqrt(x) * 1.5d0
          end if
          code = tmp
      end function
      
      public static double code(double x) {
      	double tmp;
      	if (x <= 1.0) {
      		tmp = Math.sqrt(x) * -1.5;
      	} else {
      		tmp = Math.sqrt(x) * 1.5;
      	}
      	return tmp;
      }
      
      def code(x):
      	tmp = 0
      	if x <= 1.0:
      		tmp = math.sqrt(x) * -1.5
      	else:
      		tmp = math.sqrt(x) * 1.5
      	return tmp
      
      function code(x)
      	tmp = 0.0
      	if (x <= 1.0)
      		tmp = Float64(sqrt(x) * -1.5);
      	else
      		tmp = Float64(sqrt(x) * 1.5);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x)
      	tmp = 0.0;
      	if (x <= 1.0)
      		tmp = sqrt(x) * -1.5;
      	else
      		tmp = sqrt(x) * 1.5;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_] := If[LessEqual[x, 1.0], N[(N[Sqrt[x], $MachinePrecision] * -1.5), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * 1.5), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq 1:\\
      \;\;\;\;\sqrt{x} \cdot -1.5\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{x} \cdot 1.5\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < 1

        1. Initial program 99.9%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          3. distribute-lft-inN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          8. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          10. remove-double-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
          14. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          16. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
          17. metadata-eval100.0%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        3. Simplified100.0%

          \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \color{blue}{\left(1 - -4 \cdot \sqrt{x}\right)}\right) \]
        6. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
          4. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot 4\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{4}\right)\right)\right) \]
          7. sqrt-lowering-sqrt.f6498.1%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), 4\right)\right)\right) \]
        7. Simplified98.1%

          \[\leadsto \frac{6 \cdot x + -6}{\color{blue}{1 + \sqrt{x} \cdot 4}} \]
        8. Taylor expanded in x around -inf

          \[\leadsto \color{blue}{\frac{-3}{2} \cdot \sqrt{x}} \]
        9. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \sqrt{x} \cdot \color{blue}{\frac{-3}{2}} \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\frac{-3}{2}}\right) \]
          3. sqrt-lowering-sqrt.f646.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \frac{-3}{2}\right) \]
        10. Simplified6.7%

          \[\leadsto \color{blue}{\sqrt{x} \cdot -1.5} \]

        if 1 < x

        1. Initial program 99.7%

          \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
        2. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          3. distribute-lft-inN/A

            \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          4. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
          8. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
          10. remove-double-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
          11. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
          14. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
          16. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
          17. metadata-eval99.7%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
        3. Simplified99.7%

          \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
        4. Add Preprocessing
        5. Taylor expanded in x around inf

          \[\leadsto \color{blue}{\frac{6}{1 - -4 \cdot \sqrt{\frac{1}{x}}}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left(1 - -4 \cdot \sqrt{\frac{1}{x}}\right)}\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(6, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{\frac{1}{x}}\right)\right)}\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{\frac{1}{x}} \cdot -4\right)\right)\right)\right) \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \left(\sqrt{\frac{1}{x}} \cdot 4\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{x}}\right), \color{blue}{4}\right)\right)\right) \]
          8. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{x}\right)\right), 4\right)\right)\right) \]
          9. /-lowering-/.f6497.2%

            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, x\right)\right), 4\right)\right)\right) \]
        7. Simplified97.2%

          \[\leadsto \color{blue}{\frac{6}{1 + \sqrt{\frac{1}{x}} \cdot 4}} \]
        8. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{3}{2} \cdot \sqrt{x}} \]
        9. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \sqrt{x} \cdot \color{blue}{\frac{3}{2}} \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\frac{3}{2}}\right) \]
          3. sqrt-lowering-sqrt.f647.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \frac{3}{2}\right) \]
        10. Simplified7.1%

          \[\leadsto \color{blue}{\sqrt{x} \cdot 1.5} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 11: 4.1% accurate, 1.1× speedup?

      \[\begin{array}{l} \\ \sqrt{x} \cdot -1.5 \end{array} \]
      (FPCore (x) :precision binary64 (* (sqrt x) -1.5))
      double code(double x) {
      	return sqrt(x) * -1.5;
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          code = sqrt(x) * (-1.5d0)
      end function
      
      public static double code(double x) {
      	return Math.sqrt(x) * -1.5;
      }
      
      def code(x):
      	return math.sqrt(x) * -1.5
      
      function code(x)
      	return Float64(sqrt(x) * -1.5)
      end
      
      function tmp = code(x)
      	tmp = sqrt(x) * -1.5;
      end
      
      code[x_] := N[(N[Sqrt[x], $MachinePrecision] * -1.5), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \sqrt{x} \cdot -1.5
      \end{array}
      
      Derivation
      1. Initial program 99.8%

        \[\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}} \]
      2. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x - 1\right)\right), \color{blue}{\left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)}\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
        3. distribute-lft-inN/A

          \[\leadsto \mathsf{/.f64}\left(\left(6 \cdot x + 6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(6 \cdot x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\color{blue}{\left(x + 1\right)} + 4 \cdot \sqrt{x}\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\left(\color{blue}{x} + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
        6. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), \left(6 \cdot -1\right)\right), \left(\left(x + 1\right) + 4 \cdot \sqrt{x}\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(\left(x + \color{blue}{1}\right) + 4 \cdot \sqrt{x}\right)\right) \]
        8. associate-+l+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(x + \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
        9. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \color{blue}{\left(1 + 4 \cdot \sqrt{x}\right)}\right)\right) \]
        10. remove-double-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)\right)\right)\right)\right)\right) \]
        11. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \left(1 - \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
        12. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \sqrt{x}\right)\right)}\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot 4\right)\right)\right)\right)\right) \]
        14. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\mathsf{neg}\left(4\right)\right)}\right)\right)\right)\right) \]
        16. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\mathsf{neg}\left(\color{blue}{4}\right)\right)\right)\right)\right)\right) \]
        17. metadata-eval99.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), -4\right)\right)\right)\right) \]
      3. Simplified99.8%

        \[\leadsto \color{blue}{\frac{6 \cdot x + -6}{x + \left(1 - \sqrt{x} \cdot -4\right)}} \]
      4. Add Preprocessing
      5. Taylor expanded in x around 0

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \color{blue}{\left(1 - -4 \cdot \sqrt{x}\right)}\right) \]
      6. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-4 \cdot \sqrt{x}\right)\right)}\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\sqrt{x} \cdot -4\right)\right)\right)\right) \]
        4. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot \color{blue}{\left(\mathsf{neg}\left(-4\right)\right)}\right)\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \left(\sqrt{x} \cdot 4\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{4}\right)\right)\right) \]
        7. sqrt-lowering-sqrt.f6454.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(6, x\right), -6\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), 4\right)\right)\right) \]
      7. Simplified54.1%

        \[\leadsto \frac{6 \cdot x + -6}{\color{blue}{1 + \sqrt{x} \cdot 4}} \]
      8. Taylor expanded in x around -inf

        \[\leadsto \color{blue}{\frac{-3}{2} \cdot \sqrt{x}} \]
      9. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{x} \cdot \color{blue}{\frac{-3}{2}} \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\frac{-3}{2}}\right) \]
        3. sqrt-lowering-sqrt.f644.1%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \frac{-3}{2}\right) \]
      10. Simplified4.1%

        \[\leadsto \color{blue}{\sqrt{x} \cdot -1.5} \]
      11. Add Preprocessing

      Developer Target 1: 99.9% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \frac{6}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}} \end{array} \]
      (FPCore (x)
       :precision binary64
       (/ 6.0 (/ (+ (+ x 1.0) (* 4.0 (sqrt x))) (- x 1.0))))
      double code(double x) {
      	return 6.0 / (((x + 1.0) + (4.0 * sqrt(x))) / (x - 1.0));
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          code = 6.0d0 / (((x + 1.0d0) + (4.0d0 * sqrt(x))) / (x - 1.0d0))
      end function
      
      public static double code(double x) {
      	return 6.0 / (((x + 1.0) + (4.0 * Math.sqrt(x))) / (x - 1.0));
      }
      
      def code(x):
      	return 6.0 / (((x + 1.0) + (4.0 * math.sqrt(x))) / (x - 1.0))
      
      function code(x)
      	return Float64(6.0 / Float64(Float64(Float64(x + 1.0) + Float64(4.0 * sqrt(x))) / Float64(x - 1.0)))
      end
      
      function tmp = code(x)
      	tmp = 6.0 / (((x + 1.0) + (4.0 * sqrt(x))) / (x - 1.0));
      end
      
      code[x_] := N[(6.0 / N[(N[(N[(x + 1.0), $MachinePrecision] + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{6}{\frac{\left(x + 1\right) + 4 \cdot \sqrt{x}}{x - 1}}
      \end{array}
      

      Reproduce

      ?
      herbie shell --seed 2024161 
      (FPCore (x)
        :name "Data.Approximate.Numerics:blog from approximate-0.2.2.1"
        :precision binary64
      
        :alt
        (! :herbie-platform default (/ 6 (/ (+ (+ x 1) (* 4 (sqrt x))) (- x 1))))
      
        (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))