Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B

Percentage Accurate: 99.4% → 99.5%
Time: 19.6s
Alternatives: 14
Speedup: 1.0×

Specification

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

\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\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 14 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.4% accurate, 1.0× speedup?

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

\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\end{array}

Alternative 1: 99.5% accurate, 1.0× speedup?

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

\\
\sqrt{x \cdot 9} \cdot \left(\left(y - \frac{-1}{x \cdot 9}\right) + -1\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. metadata-eval99.4%

      \[\leadsto \left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    3. sqrt-prod99.6%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  4. Applied egg-rr99.6%

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

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

Alternative 2: 61.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.45 \cdot 10^{-61}:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+25} \lor \neg \left(x \leq 1.56 \cdot 10^{+46}\right) \land x \leq 2 \cdot 10^{+226}:\\ \;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{x \cdot 9}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 1.45e-61)
   (pow (* x 9.0) -0.5)
   (if (or (<= x 6.2e+25) (and (not (<= x 1.56e+46)) (<= x 2e+226)))
     (* 3.0 (* y (sqrt x)))
     (- (sqrt (* x 9.0))))))
double code(double x, double y) {
	double tmp;
	if (x <= 1.45e-61) {
		tmp = pow((x * 9.0), -0.5);
	} else if ((x <= 6.2e+25) || (!(x <= 1.56e+46) && (x <= 2e+226))) {
		tmp = 3.0 * (y * sqrt(x));
	} else {
		tmp = -sqrt((x * 9.0));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 1.45d-61) then
        tmp = (x * 9.0d0) ** (-0.5d0)
    else if ((x <= 6.2d+25) .or. (.not. (x <= 1.56d+46)) .and. (x <= 2d+226)) then
        tmp = 3.0d0 * (y * sqrt(x))
    else
        tmp = -sqrt((x * 9.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 1.45e-61) {
		tmp = Math.pow((x * 9.0), -0.5);
	} else if ((x <= 6.2e+25) || (!(x <= 1.56e+46) && (x <= 2e+226))) {
		tmp = 3.0 * (y * Math.sqrt(x));
	} else {
		tmp = -Math.sqrt((x * 9.0));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 1.45e-61:
		tmp = math.pow((x * 9.0), -0.5)
	elif (x <= 6.2e+25) or (not (x <= 1.56e+46) and (x <= 2e+226)):
		tmp = 3.0 * (y * math.sqrt(x))
	else:
		tmp = -math.sqrt((x * 9.0))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 1.45e-61)
		tmp = Float64(x * 9.0) ^ -0.5;
	elseif ((x <= 6.2e+25) || (!(x <= 1.56e+46) && (x <= 2e+226)))
		tmp = Float64(3.0 * Float64(y * sqrt(x)));
	else
		tmp = Float64(-sqrt(Float64(x * 9.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 1.45e-61)
		tmp = (x * 9.0) ^ -0.5;
	elseif ((x <= 6.2e+25) || (~((x <= 1.56e+46)) && (x <= 2e+226)))
		tmp = 3.0 * (y * sqrt(x));
	else
		tmp = -sqrt((x * 9.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 1.45e-61], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], If[Or[LessEqual[x, 6.2e+25], And[N[Not[LessEqual[x, 1.56e+46]], $MachinePrecision], LessEqual[x, 2e+226]]], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.45 \cdot 10^{-61}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\

\mathbf{elif}\;x \leq 6.2 \cdot 10^{+25} \lor \neg \left(x \leq 1.56 \cdot 10^{+46}\right) \land x \leq 2 \cdot 10^{+226}:\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{x \cdot 9}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 1.45e-61

    1. Initial program 99.1%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.1%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.3%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.3%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.2%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.3%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 78.5%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. metadata-eval78.5%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111}} \cdot \sqrt{\frac{1}{x}} \]
      2. sqrt-prod78.7%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111 \cdot \frac{1}{x}}} \]
      3. metadata-eval78.7%

        \[\leadsto \sqrt{\color{blue}{{9}^{-1}} \cdot \frac{1}{x}} \]
      4. inv-pow78.7%

        \[\leadsto \sqrt{{9}^{-1} \cdot \color{blue}{{x}^{-1}}} \]
      5. unpow-prod-down78.8%

        \[\leadsto \sqrt{\color{blue}{{\left(9 \cdot x\right)}^{-1}}} \]
      6. *-commutative78.8%

        \[\leadsto \sqrt{{\color{blue}{\left(x \cdot 9\right)}}^{-1}} \]
      7. sqrt-pow178.9%

        \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{\left(\frac{-1}{2}\right)}} \]
      8. metadata-eval78.9%

        \[\leadsto {\left(x \cdot 9\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr78.9%

      \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{-0.5}} \]

    if 1.45e-61 < x < 6.1999999999999996e25 or 1.56e46 < x < 1.99999999999999992e226

    1. Initial program 99.7%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.6%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.6%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 60.2%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right)} \]

    if 6.1999999999999996e25 < x < 1.56e46 or 1.99999999999999992e226 < x

    1. Initial program 99.5%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.5%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.5%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.5%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.5%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.5%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y - 3\right)} \]
    6. Taylor expanded in y around 0 72.1%

      \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
    7. Step-by-step derivation
      1. *-commutative72.1%

        \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    8. Simplified72.1%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    9. Step-by-step derivation
      1. metadata-eval72.1%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot -1\right)} \]
      2. associate-*l*72.1%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right) \cdot -1} \]
      3. *-commutative72.1%

        \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. mul-1-neg72.1%

        \[\leadsto \color{blue}{-\sqrt{x} \cdot 3} \]
      5. add-sqr-sqrt71.8%

        \[\leadsto -\color{blue}{\sqrt{\sqrt{x} \cdot 3} \cdot \sqrt{\sqrt{x} \cdot 3}} \]
      6. sqrt-unprod72.1%

        \[\leadsto -\color{blue}{\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}} \]
      7. swap-sqr72.2%

        \[\leadsto -\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      8. add-sqr-sqrt72.5%

        \[\leadsto -\sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)} \]
      9. metadata-eval72.5%

        \[\leadsto -\sqrt{x \cdot \color{blue}{9}} \]
    10. Applied egg-rr72.5%

      \[\leadsto \color{blue}{-\sqrt{x \cdot 9}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.45 \cdot 10^{-61}:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+25} \lor \neg \left(x \leq 1.56 \cdot 10^{+46}\right) \land x \leq 2 \cdot 10^{+226}:\\ \;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{x \cdot 9}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 61.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{x \cdot 9}\\ \mathbf{if}\;x \leq 1.55 \cdot 10^{-61}:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.4 \cdot 10^{+49}\right) \land x \leq 1.8 \cdot 10^{+226}:\\ \;\;\;\;t\_0 \cdot y\\ \mathbf{else}:\\ \;\;\;\;-t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (sqrt (* x 9.0))))
   (if (<= x 1.55e-61)
     (pow (* x 9.0) -0.5)
     (if (or (<= x 1.2e+26) (and (not (<= x 1.4e+49)) (<= x 1.8e+226)))
       (* t_0 y)
       (- t_0)))))
double code(double x, double y) {
	double t_0 = sqrt((x * 9.0));
	double tmp;
	if (x <= 1.55e-61) {
		tmp = pow((x * 9.0), -0.5);
	} else if ((x <= 1.2e+26) || (!(x <= 1.4e+49) && (x <= 1.8e+226))) {
		tmp = t_0 * y;
	} else {
		tmp = -t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((x * 9.0d0))
    if (x <= 1.55d-61) then
        tmp = (x * 9.0d0) ** (-0.5d0)
    else if ((x <= 1.2d+26) .or. (.not. (x <= 1.4d+49)) .and. (x <= 1.8d+226)) then
        tmp = t_0 * y
    else
        tmp = -t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = Math.sqrt((x * 9.0));
	double tmp;
	if (x <= 1.55e-61) {
		tmp = Math.pow((x * 9.0), -0.5);
	} else if ((x <= 1.2e+26) || (!(x <= 1.4e+49) && (x <= 1.8e+226))) {
		tmp = t_0 * y;
	} else {
		tmp = -t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = math.sqrt((x * 9.0))
	tmp = 0
	if x <= 1.55e-61:
		tmp = math.pow((x * 9.0), -0.5)
	elif (x <= 1.2e+26) or (not (x <= 1.4e+49) and (x <= 1.8e+226)):
		tmp = t_0 * y
	else:
		tmp = -t_0
	return tmp
function code(x, y)
	t_0 = sqrt(Float64(x * 9.0))
	tmp = 0.0
	if (x <= 1.55e-61)
		tmp = Float64(x * 9.0) ^ -0.5;
	elseif ((x <= 1.2e+26) || (!(x <= 1.4e+49) && (x <= 1.8e+226)))
		tmp = Float64(t_0 * y);
	else
		tmp = Float64(-t_0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = sqrt((x * 9.0));
	tmp = 0.0;
	if (x <= 1.55e-61)
		tmp = (x * 9.0) ^ -0.5;
	elseif ((x <= 1.2e+26) || (~((x <= 1.4e+49)) && (x <= 1.8e+226)))
		tmp = t_0 * y;
	else
		tmp = -t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 1.55e-61], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], If[Or[LessEqual[x, 1.2e+26], And[N[Not[LessEqual[x, 1.4e+49]], $MachinePrecision], LessEqual[x, 1.8e+226]]], N[(t$95$0 * y), $MachinePrecision], (-t$95$0)]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 1.55 \cdot 10^{-61}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.4 \cdot 10^{+49}\right) \land x \leq 1.8 \cdot 10^{+226}:\\
\;\;\;\;t\_0 \cdot y\\

\mathbf{else}:\\
\;\;\;\;-t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 1.54999999999999997e-61

    1. Initial program 99.1%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.1%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.3%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.3%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.2%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.3%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 78.5%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. metadata-eval78.5%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111}} \cdot \sqrt{\frac{1}{x}} \]
      2. sqrt-prod78.7%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111 \cdot \frac{1}{x}}} \]
      3. metadata-eval78.7%

        \[\leadsto \sqrt{\color{blue}{{9}^{-1}} \cdot \frac{1}{x}} \]
      4. inv-pow78.7%

        \[\leadsto \sqrt{{9}^{-1} \cdot \color{blue}{{x}^{-1}}} \]
      5. unpow-prod-down78.8%

        \[\leadsto \sqrt{\color{blue}{{\left(9 \cdot x\right)}^{-1}}} \]
      6. *-commutative78.8%

        \[\leadsto \sqrt{{\color{blue}{\left(x \cdot 9\right)}}^{-1}} \]
      7. sqrt-pow178.9%

        \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{\left(\frac{-1}{2}\right)}} \]
      8. metadata-eval78.9%

        \[\leadsto {\left(x \cdot 9\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr78.9%

      \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{-0.5}} \]

    if 1.54999999999999997e-61 < x < 1.20000000000000002e26 or 1.3999999999999999e49 < x < 1.7999999999999999e226

    1. Initial program 99.7%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.6%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.6%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 60.4%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative60.4%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot y\right) \cdot 3} \]
      2. *-commutative60.4%

        \[\leadsto \color{blue}{\left(y \cdot \sqrt{x}\right)} \cdot 3 \]
      3. associate-*r*60.5%

        \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. add-exp-log28.2%

        \[\leadsto \color{blue}{e^{\log y}} \cdot \left(\sqrt{x} \cdot 3\right) \]
      5. add-exp-log28.3%

        \[\leadsto e^{\log y} \cdot \color{blue}{e^{\log \left(\sqrt{x} \cdot 3\right)}} \]
      6. prod-exp28.0%

        \[\leadsto \color{blue}{e^{\log y + \log \left(\sqrt{x} \cdot 3\right)}} \]
      7. add-sqr-sqrt28.0%

        \[\leadsto e^{\log y + \log \color{blue}{\left(\sqrt{\sqrt{x} \cdot 3} \cdot \sqrt{\sqrt{x} \cdot 3}\right)}} \]
      8. sqrt-unprod28.0%

        \[\leadsto e^{\log y + \log \color{blue}{\left(\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}\right)}} \]
      9. swap-sqr28.0%

        \[\leadsto e^{\log y + \log \left(\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}}\right)} \]
      10. add-sqr-sqrt28.0%

        \[\leadsto e^{\log y + \log \left(\sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)}\right)} \]
      11. metadata-eval28.0%

        \[\leadsto e^{\log y + \log \left(\sqrt{x \cdot \color{blue}{9}}\right)} \]
    7. Applied egg-rr28.0%

      \[\leadsto \color{blue}{e^{\log y + \log \left(\sqrt{x \cdot 9}\right)}} \]
    8. Step-by-step derivation
      1. exp-sum28.3%

        \[\leadsto \color{blue}{e^{\log y} \cdot e^{\log \left(\sqrt{x \cdot 9}\right)}} \]
      2. rem-exp-log58.0%

        \[\leadsto \color{blue}{y} \cdot e^{\log \left(\sqrt{x \cdot 9}\right)} \]
      3. rem-exp-log60.4%

        \[\leadsto y \cdot \color{blue}{\sqrt{x \cdot 9}} \]
    9. Simplified60.4%

      \[\leadsto \color{blue}{y \cdot \sqrt{x \cdot 9}} \]

    if 1.20000000000000002e26 < x < 1.3999999999999999e49 or 1.7999999999999999e226 < x

    1. Initial program 99.5%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.5%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.5%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.5%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.5%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.5%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y - 3\right)} \]
    6. Taylor expanded in y around 0 71.4%

      \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
    7. Step-by-step derivation
      1. *-commutative71.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    8. Simplified71.4%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    9. Step-by-step derivation
      1. metadata-eval71.4%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot -1\right)} \]
      2. associate-*l*71.4%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right) \cdot -1} \]
      3. *-commutative71.4%

        \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. mul-1-neg71.4%

        \[\leadsto \color{blue}{-\sqrt{x} \cdot 3} \]
      5. add-sqr-sqrt71.1%

        \[\leadsto -\color{blue}{\sqrt{\sqrt{x} \cdot 3} \cdot \sqrt{\sqrt{x} \cdot 3}} \]
      6. sqrt-unprod71.4%

        \[\leadsto -\color{blue}{\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}} \]
      7. swap-sqr71.5%

        \[\leadsto -\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      8. add-sqr-sqrt71.7%

        \[\leadsto -\sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)} \]
      9. metadata-eval71.7%

        \[\leadsto -\sqrt{x \cdot \color{blue}{9}} \]
    10. Applied egg-rr71.7%

      \[\leadsto \color{blue}{-\sqrt{x \cdot 9}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.55 \cdot 10^{-61}:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.4 \cdot 10^{+49}\right) \land x \leq 1.8 \cdot 10^{+226}:\\ \;\;\;\;\sqrt{x \cdot 9} \cdot y\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{x \cdot 9}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 61.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{x \cdot 9}\\ \mathbf{if}\;x \leq 1.45 \cdot 10^{-61}:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{elif}\;x \leq 10^{+27}:\\ \;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{+47} \lor \neg \left(x \leq 3.4 \cdot 10^{+226}\right):\\ \;\;\;\;-t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (sqrt (* x 9.0))))
   (if (<= x 1.45e-61)
     (pow (* x 9.0) -0.5)
     (if (<= x 1e+27)
       (* (sqrt x) (* y 3.0))
       (if (or (<= x 3.3e+47) (not (<= x 3.4e+226))) (- t_0) (* t_0 y))))))
double code(double x, double y) {
	double t_0 = sqrt((x * 9.0));
	double tmp;
	if (x <= 1.45e-61) {
		tmp = pow((x * 9.0), -0.5);
	} else if (x <= 1e+27) {
		tmp = sqrt(x) * (y * 3.0);
	} else if ((x <= 3.3e+47) || !(x <= 3.4e+226)) {
		tmp = -t_0;
	} else {
		tmp = t_0 * y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((x * 9.0d0))
    if (x <= 1.45d-61) then
        tmp = (x * 9.0d0) ** (-0.5d0)
    else if (x <= 1d+27) then
        tmp = sqrt(x) * (y * 3.0d0)
    else if ((x <= 3.3d+47) .or. (.not. (x <= 3.4d+226))) then
        tmp = -t_0
    else
        tmp = t_0 * y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = Math.sqrt((x * 9.0));
	double tmp;
	if (x <= 1.45e-61) {
		tmp = Math.pow((x * 9.0), -0.5);
	} else if (x <= 1e+27) {
		tmp = Math.sqrt(x) * (y * 3.0);
	} else if ((x <= 3.3e+47) || !(x <= 3.4e+226)) {
		tmp = -t_0;
	} else {
		tmp = t_0 * y;
	}
	return tmp;
}
def code(x, y):
	t_0 = math.sqrt((x * 9.0))
	tmp = 0
	if x <= 1.45e-61:
		tmp = math.pow((x * 9.0), -0.5)
	elif x <= 1e+27:
		tmp = math.sqrt(x) * (y * 3.0)
	elif (x <= 3.3e+47) or not (x <= 3.4e+226):
		tmp = -t_0
	else:
		tmp = t_0 * y
	return tmp
function code(x, y)
	t_0 = sqrt(Float64(x * 9.0))
	tmp = 0.0
	if (x <= 1.45e-61)
		tmp = Float64(x * 9.0) ^ -0.5;
	elseif (x <= 1e+27)
		tmp = Float64(sqrt(x) * Float64(y * 3.0));
	elseif ((x <= 3.3e+47) || !(x <= 3.4e+226))
		tmp = Float64(-t_0);
	else
		tmp = Float64(t_0 * y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = sqrt((x * 9.0));
	tmp = 0.0;
	if (x <= 1.45e-61)
		tmp = (x * 9.0) ^ -0.5;
	elseif (x <= 1e+27)
		tmp = sqrt(x) * (y * 3.0);
	elseif ((x <= 3.3e+47) || ~((x <= 3.4e+226)))
		tmp = -t_0;
	else
		tmp = t_0 * y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 1.45e-61], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], If[LessEqual[x, 1e+27], N[(N[Sqrt[x], $MachinePrecision] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 3.3e+47], N[Not[LessEqual[x, 3.4e+226]], $MachinePrecision]], (-t$95$0), N[(t$95$0 * y), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 1.45 \cdot 10^{-61}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\

\mathbf{elif}\;x \leq 10^{+27}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\

\mathbf{elif}\;x \leq 3.3 \cdot 10^{+47} \lor \neg \left(x \leq 3.4 \cdot 10^{+226}\right):\\
\;\;\;\;-t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < 1.45e-61

    1. Initial program 99.1%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.1%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.3%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.3%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.2%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.3%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 78.5%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. metadata-eval78.5%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111}} \cdot \sqrt{\frac{1}{x}} \]
      2. sqrt-prod78.7%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111 \cdot \frac{1}{x}}} \]
      3. metadata-eval78.7%

        \[\leadsto \sqrt{\color{blue}{{9}^{-1}} \cdot \frac{1}{x}} \]
      4. inv-pow78.7%

        \[\leadsto \sqrt{{9}^{-1} \cdot \color{blue}{{x}^{-1}}} \]
      5. unpow-prod-down78.8%

        \[\leadsto \sqrt{\color{blue}{{\left(9 \cdot x\right)}^{-1}}} \]
      6. *-commutative78.8%

        \[\leadsto \sqrt{{\color{blue}{\left(x \cdot 9\right)}}^{-1}} \]
      7. sqrt-pow178.9%

        \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{\left(\frac{-1}{2}\right)}} \]
      8. metadata-eval78.9%

        \[\leadsto {\left(x \cdot 9\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr78.9%

      \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{-0.5}} \]

    if 1.45e-61 < x < 1e27

    1. Initial program 99.4%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.4%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.5%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.5%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.5%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 64.5%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative64.5%

        \[\leadsto 3 \cdot \color{blue}{\left(y \cdot \sqrt{x}\right)} \]
      2. associate-*l*64.7%

        \[\leadsto \color{blue}{\left(3 \cdot y\right) \cdot \sqrt{x}} \]
      3. *-commutative64.7%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y\right)} \]
    7. Simplified64.7%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y\right)} \]

    if 1e27 < x < 3.2999999999999999e47 or 3.39999999999999979e226 < x

    1. Initial program 99.5%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.5%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.5%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.5%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.5%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.5%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y - 3\right)} \]
    6. Taylor expanded in y around 0 71.4%

      \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
    7. Step-by-step derivation
      1. *-commutative71.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    8. Simplified71.4%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    9. Step-by-step derivation
      1. metadata-eval71.4%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot -1\right)} \]
      2. associate-*l*71.4%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right) \cdot -1} \]
      3. *-commutative71.4%

        \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. mul-1-neg71.4%

        \[\leadsto \color{blue}{-\sqrt{x} \cdot 3} \]
      5. add-sqr-sqrt71.1%

        \[\leadsto -\color{blue}{\sqrt{\sqrt{x} \cdot 3} \cdot \sqrt{\sqrt{x} \cdot 3}} \]
      6. sqrt-unprod71.4%

        \[\leadsto -\color{blue}{\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}} \]
      7. swap-sqr71.5%

        \[\leadsto -\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      8. add-sqr-sqrt71.7%

        \[\leadsto -\sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)} \]
      9. metadata-eval71.7%

        \[\leadsto -\sqrt{x \cdot \color{blue}{9}} \]
    10. Applied egg-rr71.7%

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

    if 3.2999999999999999e47 < x < 3.39999999999999979e226

    1. Initial program 99.8%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.8%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.7%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.7%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.7%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 58.6%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative58.6%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot y\right) \cdot 3} \]
      2. *-commutative58.6%

        \[\leadsto \color{blue}{\left(y \cdot \sqrt{x}\right)} \cdot 3 \]
      3. associate-*r*58.7%

        \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. add-exp-log29.0%

        \[\leadsto \color{blue}{e^{\log y}} \cdot \left(\sqrt{x} \cdot 3\right) \]
      5. add-exp-log29.0%

        \[\leadsto e^{\log y} \cdot \color{blue}{e^{\log \left(\sqrt{x} \cdot 3\right)}} \]
      6. prod-exp28.8%

        \[\leadsto \color{blue}{e^{\log y + \log \left(\sqrt{x} \cdot 3\right)}} \]
      7. add-sqr-sqrt28.8%

        \[\leadsto e^{\log y + \log \color{blue}{\left(\sqrt{\sqrt{x} \cdot 3} \cdot \sqrt{\sqrt{x} \cdot 3}\right)}} \]
      8. sqrt-unprod28.8%

        \[\leadsto e^{\log y + \log \color{blue}{\left(\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}\right)}} \]
      9. swap-sqr28.8%

        \[\leadsto e^{\log y + \log \left(\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}}\right)} \]
      10. add-sqr-sqrt28.8%

        \[\leadsto e^{\log y + \log \left(\sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)}\right)} \]
      11. metadata-eval28.8%

        \[\leadsto e^{\log y + \log \left(\sqrt{x \cdot \color{blue}{9}}\right)} \]
    7. Applied egg-rr28.8%

      \[\leadsto \color{blue}{e^{\log y + \log \left(\sqrt{x \cdot 9}\right)}} \]
    8. Step-by-step derivation
      1. exp-sum29.0%

        \[\leadsto \color{blue}{e^{\log y} \cdot e^{\log \left(\sqrt{x \cdot 9}\right)}} \]
      2. rem-exp-log56.2%

        \[\leadsto \color{blue}{y} \cdot e^{\log \left(\sqrt{x \cdot 9}\right)} \]
      3. rem-exp-log58.7%

        \[\leadsto y \cdot \color{blue}{\sqrt{x \cdot 9}} \]
    9. Simplified58.7%

      \[\leadsto \color{blue}{y \cdot \sqrt{x \cdot 9}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification69.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.45 \cdot 10^{-61}:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{elif}\;x \leq 10^{+27}:\\ \;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{+47} \lor \neg \left(x \leq 3.4 \cdot 10^{+226}\right):\\ \;\;\;\;-\sqrt{x \cdot 9}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x \cdot 9} \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+100}:\\ \;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\ \mathbf{elif}\;y \leq 62000:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x \cdot 9} \cdot y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -4.5e+100)
   (* (sqrt x) (* y 3.0))
   (if (<= y 62000.0)
     (* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
     (* (sqrt (* x 9.0)) y))))
double code(double x, double y) {
	double tmp;
	if (y <= -4.5e+100) {
		tmp = sqrt(x) * (y * 3.0);
	} else if (y <= 62000.0) {
		tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
	} else {
		tmp = sqrt((x * 9.0)) * y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-4.5d+100)) then
        tmp = sqrt(x) * (y * 3.0d0)
    else if (y <= 62000.0d0) then
        tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
    else
        tmp = sqrt((x * 9.0d0)) * y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -4.5e+100) {
		tmp = Math.sqrt(x) * (y * 3.0);
	} else if (y <= 62000.0) {
		tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
	} else {
		tmp = Math.sqrt((x * 9.0)) * y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -4.5e+100:
		tmp = math.sqrt(x) * (y * 3.0)
	elif y <= 62000.0:
		tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0)
	else:
		tmp = math.sqrt((x * 9.0)) * y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -4.5e+100)
		tmp = Float64(sqrt(x) * Float64(y * 3.0));
	elseif (y <= 62000.0)
		tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0));
	else
		tmp = Float64(sqrt(Float64(x * 9.0)) * y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -4.5e+100)
		tmp = sqrt(x) * (y * 3.0);
	elseif (y <= 62000.0)
		tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
	else
		tmp = sqrt((x * 9.0)) * y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -4.5e+100], N[(N[Sqrt[x], $MachinePrecision] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 62000.0], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+100}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\

\mathbf{elif}\;y \leq 62000:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\

\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.50000000000000036e100

    1. Initial program 99.4%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.4%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.6%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.6%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 79.2%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative79.2%

        \[\leadsto 3 \cdot \color{blue}{\left(y \cdot \sqrt{x}\right)} \]
      2. associate-*l*79.2%

        \[\leadsto \color{blue}{\left(3 \cdot y\right) \cdot \sqrt{x}} \]
      3. *-commutative79.2%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y\right)} \]
    7. Simplified79.2%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y\right)} \]

    if -4.50000000000000036e100 < y < 62000

    1. Initial program 99.4%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.4%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.4%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.4%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.4%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.4%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 92.1%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(0.3333333333333333 \cdot \frac{1}{x} - 3\right)} \]
    6. Step-by-step derivation
      1. sub-neg92.1%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{x} + \left(-3\right)\right)} \]
      2. associate-*r/92.1%

        \[\leadsto \sqrt{x} \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{x}} + \left(-3\right)\right) \]
      3. metadata-eval92.1%

        \[\leadsto \sqrt{x} \cdot \left(\frac{\color{blue}{0.3333333333333333}}{x} + \left(-3\right)\right) \]
      4. metadata-eval92.1%

        \[\leadsto \sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + \color{blue}{-3}\right) \]
      5. +-commutative92.1%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(-3 + \frac{0.3333333333333333}{x}\right)} \]
    7. Simplified92.1%

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

    if 62000 < y

    1. Initial program 99.5%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.5%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.5%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.5%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.5%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.5%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.5%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 81.4%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative81.4%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot y\right) \cdot 3} \]
      2. *-commutative81.4%

        \[\leadsto \color{blue}{\left(y \cdot \sqrt{x}\right)} \cdot 3 \]
      3. associate-*r*81.5%

        \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. add-exp-log75.8%

        \[\leadsto \color{blue}{e^{\log y}} \cdot \left(\sqrt{x} \cdot 3\right) \]
      5. add-exp-log75.8%

        \[\leadsto e^{\log y} \cdot \color{blue}{e^{\log \left(\sqrt{x} \cdot 3\right)}} \]
      6. prod-exp75.4%

        \[\leadsto \color{blue}{e^{\log y + \log \left(\sqrt{x} \cdot 3\right)}} \]
      7. add-sqr-sqrt75.4%

        \[\leadsto e^{\log y + \log \color{blue}{\left(\sqrt{\sqrt{x} \cdot 3} \cdot \sqrt{\sqrt{x} \cdot 3}\right)}} \]
      8. sqrt-unprod75.4%

        \[\leadsto e^{\log y + \log \color{blue}{\left(\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}\right)}} \]
      9. swap-sqr75.4%

        \[\leadsto e^{\log y + \log \left(\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}}\right)} \]
      10. add-sqr-sqrt75.4%

        \[\leadsto e^{\log y + \log \left(\sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)}\right)} \]
      11. metadata-eval75.4%

        \[\leadsto e^{\log y + \log \left(\sqrt{x \cdot \color{blue}{9}}\right)} \]
    7. Applied egg-rr75.4%

      \[\leadsto \color{blue}{e^{\log y + \log \left(\sqrt{x \cdot 9}\right)}} \]
    8. Step-by-step derivation
      1. exp-sum75.8%

        \[\leadsto \color{blue}{e^{\log y} \cdot e^{\log \left(\sqrt{x \cdot 9}\right)}} \]
      2. rem-exp-log77.6%

        \[\leadsto \color{blue}{y} \cdot e^{\log \left(\sqrt{x \cdot 9}\right)} \]
      3. rem-exp-log81.6%

        \[\leadsto y \cdot \color{blue}{\sqrt{x \cdot 9}} \]
    9. Simplified81.6%

      \[\leadsto \color{blue}{y \cdot \sqrt{x \cdot 9}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+100}:\\ \;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\ \mathbf{elif}\;y \leq 62000:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x \cdot 9} \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 85.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.4 \cdot 10^{-61}:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(y \cdot 3 - 3\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 1.4e-61) (pow (* x 9.0) -0.5) (* (sqrt x) (- (* y 3.0) 3.0))))
double code(double x, double y) {
	double tmp;
	if (x <= 1.4e-61) {
		tmp = pow((x * 9.0), -0.5);
	} else {
		tmp = sqrt(x) * ((y * 3.0) - 3.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 1.4d-61) then
        tmp = (x * 9.0d0) ** (-0.5d0)
    else
        tmp = sqrt(x) * ((y * 3.0d0) - 3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 1.4e-61) {
		tmp = Math.pow((x * 9.0), -0.5);
	} else {
		tmp = Math.sqrt(x) * ((y * 3.0) - 3.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 1.4e-61:
		tmp = math.pow((x * 9.0), -0.5)
	else:
		tmp = math.sqrt(x) * ((y * 3.0) - 3.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 1.4e-61)
		tmp = Float64(x * 9.0) ^ -0.5;
	else
		tmp = Float64(sqrt(x) * Float64(Float64(y * 3.0) - 3.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 1.4e-61)
		tmp = (x * 9.0) ^ -0.5;
	else
		tmp = sqrt(x) * ((y * 3.0) - 3.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 1.4e-61], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{-61}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3 - 3\right)\\


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

    1. Initial program 99.1%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.1%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.3%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.3%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.2%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.3%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 78.5%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. metadata-eval78.5%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111}} \cdot \sqrt{\frac{1}{x}} \]
      2. sqrt-prod78.7%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111 \cdot \frac{1}{x}}} \]
      3. metadata-eval78.7%

        \[\leadsto \sqrt{\color{blue}{{9}^{-1}} \cdot \frac{1}{x}} \]
      4. inv-pow78.7%

        \[\leadsto \sqrt{{9}^{-1} \cdot \color{blue}{{x}^{-1}}} \]
      5. unpow-prod-down78.8%

        \[\leadsto \sqrt{\color{blue}{{\left(9 \cdot x\right)}^{-1}}} \]
      6. *-commutative78.8%

        \[\leadsto \sqrt{{\color{blue}{\left(x \cdot 9\right)}}^{-1}} \]
      7. sqrt-pow178.9%

        \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{\left(\frac{-1}{2}\right)}} \]
      8. metadata-eval78.9%

        \[\leadsto {\left(x \cdot 9\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr78.9%

      \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{-0.5}} \]

    if 1.4000000000000001e-61 < x

    1. Initial program 99.6%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.6%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.6%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 95.2%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y - 3\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.4 \cdot 10^{-61}:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(y \cdot 3 - 3\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 99.4% accurate, 1.0× speedup?

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

\\
\sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. metadata-eval99.4%

      \[\leadsto \left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    3. sqrt-prod99.6%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  4. Applied egg-rr99.6%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  5. Taylor expanded in x around 0 99.5%

    \[\leadsto \sqrt{x \cdot 9} \cdot \left(\left(y + \color{blue}{\frac{0.1111111111111111}{x}}\right) - 1\right) \]
  6. Taylor expanded in y around 0 99.3%

    \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right) + 3 \cdot \left(\sqrt{x} \cdot \left(0.1111111111111111 \cdot \frac{1}{x} - 1\right)\right)} \]
  7. Step-by-step derivation
    1. distribute-lft-out99.3%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(0.1111111111111111 \cdot \frac{1}{x} - 1\right)\right)} \]
    2. sub-neg99.3%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \color{blue}{\left(0.1111111111111111 \cdot \frac{1}{x} + \left(-1\right)\right)}\right) \]
    3. associate-*r/99.3%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(\color{blue}{\frac{0.1111111111111111 \cdot 1}{x}} + \left(-1\right)\right)\right) \]
    4. metadata-eval99.3%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(\frac{\color{blue}{0.1111111111111111}}{x} + \left(-1\right)\right)\right) \]
    5. metadata-eval99.3%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \color{blue}{-1}\right)\right) \]
    6. distribute-lft-out99.3%

      \[\leadsto 3 \cdot \color{blue}{\left(\sqrt{x} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)\right)} \]
    7. associate-*l*99.4%

      \[\leadsto \color{blue}{\left(3 \cdot \sqrt{x}\right) \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)} \]
    8. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right) \]
    9. associate-*l*99.4%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)\right)} \]
    10. +-commutative99.4%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(\left(\frac{0.1111111111111111}{x} + -1\right) + y\right)}\right) \]
    11. metadata-eval99.4%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\left(\frac{0.1111111111111111}{x} + \color{blue}{\left(-1\right)}\right) + y\right)\right) \]
    12. sub-neg99.4%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\color{blue}{\left(\frac{0.1111111111111111}{x} - 1\right)} + y\right)\right) \]
    13. associate-+l-99.4%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(\frac{0.1111111111111111}{x} - \left(1 - y\right)\right)}\right) \]
  8. Simplified99.4%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} - \left(1 - y\right)\right)\right)} \]
  9. Final simplification99.4%

    \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)\right) \]
  10. Add Preprocessing

Alternative 8: 99.4% accurate, 1.0× speedup?

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

\\
\sqrt{x} \cdot \left(y \cdot 3 + \left(\frac{0.3333333333333333}{x} + -3\right)\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. associate-*l*99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
    3. associate--l+99.5%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
    4. distribute-lft-in99.5%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    5. fma-define99.5%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    6. sub-neg99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
    7. +-commutative99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
    8. distribute-lft-in99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
    9. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    10. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    11. *-commutative99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
    12. associate-/r*99.4%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
    13. associate-*r/99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
    14. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
    15. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
  3. Simplified99.5%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. fma-undefine99.5%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + \left(-3 + \frac{0.3333333333333333}{x}\right)\right)} \]
    2. +-commutative99.5%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\left(\left(-3 + \frac{0.3333333333333333}{x}\right) + 3 \cdot y\right)} \]
    3. +-commutative99.5%

      \[\leadsto \sqrt{x} \cdot \left(\color{blue}{\left(\frac{0.3333333333333333}{x} + -3\right)} + 3 \cdot y\right) \]
  6. Applied egg-rr99.5%

    \[\leadsto \sqrt{x} \cdot \color{blue}{\left(\left(\frac{0.3333333333333333}{x} + -3\right) + 3 \cdot y\right)} \]
  7. Final simplification99.5%

    \[\leadsto \sqrt{x} \cdot \left(y \cdot 3 + \left(\frac{0.3333333333333333}{x} + -3\right)\right) \]
  8. Add Preprocessing

Alternative 9: 99.5% accurate, 1.0× speedup?

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

\\
\sqrt{x \cdot 9} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. sub-neg99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \color{blue}{\left(\left(y + \frac{1}{x \cdot 9}\right) + \left(-1\right)\right)} \]
    2. +-commutative99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(\color{blue}{\left(\frac{1}{x \cdot 9} + y\right)} + \left(-1\right)\right) \]
    3. associate-+l+99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(y + \left(-1\right)\right)\right)} \]
    4. *-commutative99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{1}{\color{blue}{9 \cdot x}} + \left(y + \left(-1\right)\right)\right) \]
    5. associate-/r*99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(\color{blue}{\frac{\frac{1}{9}}{x}} + \left(y + \left(-1\right)\right)\right) \]
    6. metadata-eval99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{\color{blue}{0.1111111111111111}}{x} + \left(y + \left(-1\right)\right)\right) \]
    7. metadata-eval99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{0.1111111111111111}{x} + \left(y + \color{blue}{-1}\right)\right) \]
  3. Simplified99.4%

    \[\leadsto \color{blue}{\left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. metadata-eval99.4%

      \[\leadsto \left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    3. sqrt-prod99.6%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  6. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \]
  7. Final simplification99.5%

    \[\leadsto \sqrt{x \cdot 9} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \]
  8. Add Preprocessing

Alternative 10: 61.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.0115:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{x \cdot 9}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 0.0115) (sqrt (/ 0.1111111111111111 x)) (- (sqrt (* x 9.0)))))
double code(double x, double y) {
	double tmp;
	if (x <= 0.0115) {
		tmp = sqrt((0.1111111111111111 / x));
	} else {
		tmp = -sqrt((x * 9.0));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 0.0115d0) then
        tmp = sqrt((0.1111111111111111d0 / x))
    else
        tmp = -sqrt((x * 9.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 0.0115) {
		tmp = Math.sqrt((0.1111111111111111 / x));
	} else {
		tmp = -Math.sqrt((x * 9.0));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 0.0115:
		tmp = math.sqrt((0.1111111111111111 / x))
	else:
		tmp = -math.sqrt((x * 9.0))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 0.0115)
		tmp = sqrt(Float64(0.1111111111111111 / x));
	else
		tmp = Float64(-sqrt(Float64(x * 9.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 0.0115)
		tmp = sqrt((0.1111111111111111 / x));
	else
		tmp = -sqrt((x * 9.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 0.0115], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], (-N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0115:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{x \cdot 9}\\


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

    1. Initial program 99.2%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.4%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.4%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.2%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.3%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 71.9%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. metadata-eval71.9%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111}} \cdot \sqrt{\frac{1}{x}} \]
      2. sqrt-prod72.1%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111 \cdot \frac{1}{x}}} \]
      3. div-inv72.1%

        \[\leadsto \sqrt{\color{blue}{\frac{0.1111111111111111}{x}}} \]
    7. Applied egg-rr72.1%

      \[\leadsto \color{blue}{\sqrt{\frac{0.1111111111111111}{x}}} \]

    if 0.0115 < x

    1. Initial program 99.6%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.6%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.6%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 98.7%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y - 3\right)} \]
    6. Taylor expanded in y around 0 52.2%

      \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
    7. Step-by-step derivation
      1. *-commutative52.2%

        \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    8. Simplified52.2%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    9. Step-by-step derivation
      1. metadata-eval52.2%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot -1\right)} \]
      2. associate-*l*52.2%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right) \cdot -1} \]
      3. *-commutative52.2%

        \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. mul-1-neg52.2%

        \[\leadsto \color{blue}{-\sqrt{x} \cdot 3} \]
      5. add-sqr-sqrt52.0%

        \[\leadsto -\color{blue}{\sqrt{\sqrt{x} \cdot 3} \cdot \sqrt{\sqrt{x} \cdot 3}} \]
      6. sqrt-unprod52.2%

        \[\leadsto -\color{blue}{\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}} \]
      7. swap-sqr52.3%

        \[\leadsto -\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      8. add-sqr-sqrt52.4%

        \[\leadsto -\sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)} \]
      9. metadata-eval52.4%

        \[\leadsto -\sqrt{x \cdot \color{blue}{9}} \]
    10. Applied egg-rr52.4%

      \[\leadsto \color{blue}{-\sqrt{x \cdot 9}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.0115:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{x \cdot 9}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 61.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.0115:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{x \cdot 9}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 0.0115) (pow (* x 9.0) -0.5) (- (sqrt (* x 9.0)))))
double code(double x, double y) {
	double tmp;
	if (x <= 0.0115) {
		tmp = pow((x * 9.0), -0.5);
	} else {
		tmp = -sqrt((x * 9.0));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 0.0115d0) then
        tmp = (x * 9.0d0) ** (-0.5d0)
    else
        tmp = -sqrt((x * 9.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 0.0115) {
		tmp = Math.pow((x * 9.0), -0.5);
	} else {
		tmp = -Math.sqrt((x * 9.0));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 0.0115:
		tmp = math.pow((x * 9.0), -0.5)
	else:
		tmp = -math.sqrt((x * 9.0))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 0.0115)
		tmp = Float64(x * 9.0) ^ -0.5;
	else
		tmp = Float64(-sqrt(Float64(x * 9.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 0.0115)
		tmp = (x * 9.0) ^ -0.5;
	else
		tmp = -sqrt((x * 9.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 0.0115], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], (-N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0115:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{x \cdot 9}\\


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

    1. Initial program 99.2%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.4%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.4%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.2%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.3%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 71.9%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. metadata-eval71.9%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111}} \cdot \sqrt{\frac{1}{x}} \]
      2. sqrt-prod72.1%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111 \cdot \frac{1}{x}}} \]
      3. metadata-eval72.1%

        \[\leadsto \sqrt{\color{blue}{{9}^{-1}} \cdot \frac{1}{x}} \]
      4. inv-pow72.1%

        \[\leadsto \sqrt{{9}^{-1} \cdot \color{blue}{{x}^{-1}}} \]
      5. unpow-prod-down72.2%

        \[\leadsto \sqrt{\color{blue}{{\left(9 \cdot x\right)}^{-1}}} \]
      6. *-commutative72.2%

        \[\leadsto \sqrt{{\color{blue}{\left(x \cdot 9\right)}}^{-1}} \]
      7. sqrt-pow172.3%

        \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{\left(\frac{-1}{2}\right)}} \]
      8. metadata-eval72.3%

        \[\leadsto {\left(x \cdot 9\right)}^{\color{blue}{-0.5}} \]
    7. Applied egg-rr72.3%

      \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{-0.5}} \]

    if 0.0115 < x

    1. Initial program 99.6%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.6%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.6%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 98.7%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y - 3\right)} \]
    6. Taylor expanded in y around 0 52.2%

      \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
    7. Step-by-step derivation
      1. *-commutative52.2%

        \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    8. Simplified52.2%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    9. Step-by-step derivation
      1. metadata-eval52.2%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot -1\right)} \]
      2. associate-*l*52.2%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right) \cdot -1} \]
      3. *-commutative52.2%

        \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. mul-1-neg52.2%

        \[\leadsto \color{blue}{-\sqrt{x} \cdot 3} \]
      5. add-sqr-sqrt52.0%

        \[\leadsto -\color{blue}{\sqrt{\sqrt{x} \cdot 3} \cdot \sqrt{\sqrt{x} \cdot 3}} \]
      6. sqrt-unprod52.2%

        \[\leadsto -\color{blue}{\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}} \]
      7. swap-sqr52.3%

        \[\leadsto -\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      8. add-sqr-sqrt52.4%

        \[\leadsto -\sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)} \]
      9. metadata-eval52.4%

        \[\leadsto -\sqrt{x \cdot \color{blue}{9}} \]
    10. Applied egg-rr52.4%

      \[\leadsto \color{blue}{-\sqrt{x \cdot 9}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.0115:\\ \;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{x \cdot 9}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 61.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.0115:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 0.0115) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
	double tmp;
	if (x <= 0.0115) {
		tmp = sqrt((0.1111111111111111 / x));
	} else {
		tmp = sqrt(x) * -3.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 0.0115d0) then
        tmp = sqrt((0.1111111111111111d0 / x))
    else
        tmp = sqrt(x) * (-3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 0.0115) {
		tmp = Math.sqrt((0.1111111111111111 / x));
	} else {
		tmp = Math.sqrt(x) * -3.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 0.0115:
		tmp = math.sqrt((0.1111111111111111 / x))
	else:
		tmp = math.sqrt(x) * -3.0
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 0.0115)
		tmp = sqrt(Float64(0.1111111111111111 / x));
	else
		tmp = Float64(sqrt(x) * -3.0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 0.0115)
		tmp = sqrt((0.1111111111111111 / x));
	else
		tmp = sqrt(x) * -3.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 0.0115], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0115:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\

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


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

    1. Initial program 99.2%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.4%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.4%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.4%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.3%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.2%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.3%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.3%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 71.9%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{1}{x}}} \]
    6. Step-by-step derivation
      1. metadata-eval71.9%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111}} \cdot \sqrt{\frac{1}{x}} \]
      2. sqrt-prod72.1%

        \[\leadsto \color{blue}{\sqrt{0.1111111111111111 \cdot \frac{1}{x}}} \]
      3. div-inv72.1%

        \[\leadsto \sqrt{\color{blue}{\frac{0.1111111111111111}{x}}} \]
    7. Applied egg-rr72.1%

      \[\leadsto \color{blue}{\sqrt{\frac{0.1111111111111111}{x}}} \]

    if 0.0115 < x

    1. Initial program 99.6%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.6%

        \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
      3. associate--l+99.6%

        \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
      4. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      5. fma-define99.6%

        \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
      6. sub-neg99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
      7. +-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
      8. distribute-lft-in99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      10. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
      11. *-commutative99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
      12. associate-/r*99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
      13. associate-*r/99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
      14. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
      15. metadata-eval99.6%

        \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 98.7%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y - 3\right)} \]
    6. Taylor expanded in y around 0 52.2%

      \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
    7. Step-by-step derivation
      1. *-commutative52.2%

        \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    8. Simplified52.2%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.0115:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 3.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \sqrt{x \cdot 9} \end{array} \]
(FPCore (x y) :precision binary64 (sqrt (* x 9.0)))
double code(double x, double y) {
	return sqrt((x * 9.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sqrt((x * 9.0d0))
end function
public static double code(double x, double y) {
	return Math.sqrt((x * 9.0));
}
def code(x, y):
	return math.sqrt((x * 9.0))
function code(x, y)
	return sqrt(Float64(x * 9.0))
end
function tmp = code(x, y)
	tmp = sqrt((x * 9.0));
end
code[x_, y_] := N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{x \cdot 9}
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. associate-*l*99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
    3. associate--l+99.5%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
    4. distribute-lft-in99.5%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    5. fma-define99.5%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    6. sub-neg99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
    7. +-commutative99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
    8. distribute-lft-in99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
    9. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    10. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    11. *-commutative99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
    12. associate-/r*99.4%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
    13. associate-*r/99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
    14. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
    15. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
  3. Simplified99.5%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 68.1%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot y - 3\right)} \]
  6. Taylor expanded in y around 0 30.6%

    \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
  7. Step-by-step derivation
    1. *-commutative30.6%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  8. Simplified30.6%

    \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  9. Step-by-step derivation
    1. pow130.6%

      \[\leadsto \color{blue}{{\left(\sqrt{x} \cdot -3\right)}^{1}} \]
    2. add-sqr-sqrt0.0%

      \[\leadsto {\color{blue}{\left(\sqrt{\sqrt{x} \cdot -3} \cdot \sqrt{\sqrt{x} \cdot -3}\right)}}^{1} \]
    3. sqrt-unprod2.9%

      \[\leadsto {\color{blue}{\left(\sqrt{\left(\sqrt{x} \cdot -3\right) \cdot \left(\sqrt{x} \cdot -3\right)}\right)}}^{1} \]
    4. swap-sqr2.9%

      \[\leadsto {\left(\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(-3 \cdot -3\right)}}\right)}^{1} \]
    5. add-sqr-sqrt2.9%

      \[\leadsto {\left(\sqrt{\color{blue}{x} \cdot \left(-3 \cdot -3\right)}\right)}^{1} \]
    6. metadata-eval2.9%

      \[\leadsto {\left(\sqrt{x \cdot \color{blue}{9}}\right)}^{1} \]
  10. Applied egg-rr2.9%

    \[\leadsto \color{blue}{{\left(\sqrt{x \cdot 9}\right)}^{1}} \]
  11. Step-by-step derivation
    1. unpow12.9%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \]
  12. Simplified2.9%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \]
  13. Final simplification2.9%

    \[\leadsto \sqrt{x \cdot 9} \]
  14. Add Preprocessing

Alternative 14: 38.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \sqrt{\frac{0.1111111111111111}{x}} \end{array} \]
(FPCore (x y) :precision binary64 (sqrt (/ 0.1111111111111111 x)))
double code(double x, double y) {
	return sqrt((0.1111111111111111 / x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sqrt((0.1111111111111111d0 / x))
end function
public static double code(double x, double y) {
	return Math.sqrt((0.1111111111111111 / x));
}
def code(x, y):
	return math.sqrt((0.1111111111111111 / x))
function code(x, y)
	return sqrt(Float64(0.1111111111111111 / x))
end
function tmp = code(x, y)
	tmp = sqrt((0.1111111111111111 / x));
end
code[x_, y_] := N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{\frac{0.1111111111111111}{x}}
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. associate-*l*99.5%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
    3. associate--l+99.5%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
    4. distribute-lft-in99.5%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    5. fma-define99.5%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    6. sub-neg99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
    7. +-commutative99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
    8. distribute-lft-in99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
    9. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    10. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    11. *-commutative99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
    12. associate-/r*99.4%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
    13. associate-*r/99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
    14. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
    15. metadata-eval99.5%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
  3. Simplified99.5%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 32.0%

    \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{1}{x}}} \]
  6. Step-by-step derivation
    1. metadata-eval32.0%

      \[\leadsto \color{blue}{\sqrt{0.1111111111111111}} \cdot \sqrt{\frac{1}{x}} \]
    2. sqrt-prod32.1%

      \[\leadsto \color{blue}{\sqrt{0.1111111111111111 \cdot \frac{1}{x}}} \]
    3. div-inv32.1%

      \[\leadsto \sqrt{\color{blue}{\frac{0.1111111111111111}{x}}} \]
  7. Applied egg-rr32.1%

    \[\leadsto \color{blue}{\sqrt{\frac{0.1111111111111111}{x}}} \]
  8. Final simplification32.1%

    \[\leadsto \sqrt{\frac{0.1111111111111111}{x}} \]
  9. Add Preprocessing

Developer target: 99.4% accurate, 0.5× speedup?

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

\\
3 \cdot \left(y \cdot \sqrt{x} + \left(\frac{1}{x \cdot 9} - 1\right) \cdot \sqrt{x}\right)
\end{array}

Reproduce

?
herbie shell --seed 2024076 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
  :precision binary64

  :alt
  (* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x))))

  (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))