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

Percentage Accurate: 99.4% → 99.4%
Time: 12.7s
Alternatives: 15
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 15 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.4% accurate, 0.5× speedup?

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

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

    \[\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.3%

      \[\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. Step-by-step derivation
    1. fma-undefine99.4%

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

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

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

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

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

Alternative 2: 99.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \sqrt{x} \cdot \mathsf{fma}\left(3, y, \frac{0.3333333333333333}{x} + -3\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (sqrt x) (fma 3.0 y (+ (/ 0.3333333333333333 x) -3.0))))
double code(double x, double y) {
	return sqrt(x) * fma(3.0, y, ((0.3333333333333333 / x) + -3.0));
}
function code(x, y)
	return Float64(sqrt(x) * fma(3.0, y, Float64(Float64(0.3333333333333333 / x) + -3.0)))
end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y + N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\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.3%

      \[\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. Final simplification99.4%

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

Alternative 3: 61.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\ t_1 := 3 \cdot \left(y \cdot \sqrt{x}\right)\\ \mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-26}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{+84} \lor \neg \left(x \leq 8.8 \cdot 10^{+176}\right) \land x \leq 2.9 \cdot 10^{+256}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (* 3.0 (* y (sqrt x)))))
   (if (<= x 2.95e-95)
     t_0
     (if (<= x 2.9e-55)
       t_1
       (if (<= x 3.2e-26)
         t_0
         (if (or (<= x 6.6e+84) (and (not (<= x 8.8e+176)) (<= x 2.9e+256)))
           t_1
           (* (sqrt x) -3.0)))))))
double code(double x, double y) {
	double t_0 = sqrt((0.1111111111111111 / x));
	double t_1 = 3.0 * (y * sqrt(x));
	double tmp;
	if (x <= 2.95e-95) {
		tmp = t_0;
	} else if (x <= 2.9e-55) {
		tmp = t_1;
	} else if (x <= 3.2e-26) {
		tmp = t_0;
	} else if ((x <= 6.6e+84) || (!(x <= 8.8e+176) && (x <= 2.9e+256))) {
		tmp = t_1;
	} 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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sqrt((0.1111111111111111d0 / x))
    t_1 = 3.0d0 * (y * sqrt(x))
    if (x <= 2.95d-95) then
        tmp = t_0
    else if (x <= 2.9d-55) then
        tmp = t_1
    else if (x <= 3.2d-26) then
        tmp = t_0
    else if ((x <= 6.6d+84) .or. (.not. (x <= 8.8d+176)) .and. (x <= 2.9d+256)) then
        tmp = t_1
    else
        tmp = sqrt(x) * (-3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = Math.sqrt((0.1111111111111111 / x));
	double t_1 = 3.0 * (y * Math.sqrt(x));
	double tmp;
	if (x <= 2.95e-95) {
		tmp = t_0;
	} else if (x <= 2.9e-55) {
		tmp = t_1;
	} else if (x <= 3.2e-26) {
		tmp = t_0;
	} else if ((x <= 6.6e+84) || (!(x <= 8.8e+176) && (x <= 2.9e+256))) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt(x) * -3.0;
	}
	return tmp;
}
def code(x, y):
	t_0 = math.sqrt((0.1111111111111111 / x))
	t_1 = 3.0 * (y * math.sqrt(x))
	tmp = 0
	if x <= 2.95e-95:
		tmp = t_0
	elif x <= 2.9e-55:
		tmp = t_1
	elif x <= 3.2e-26:
		tmp = t_0
	elif (x <= 6.6e+84) or (not (x <= 8.8e+176) and (x <= 2.9e+256)):
		tmp = t_1
	else:
		tmp = math.sqrt(x) * -3.0
	return tmp
function code(x, y)
	t_0 = sqrt(Float64(0.1111111111111111 / x))
	t_1 = Float64(3.0 * Float64(y * sqrt(x)))
	tmp = 0.0
	if (x <= 2.95e-95)
		tmp = t_0;
	elseif (x <= 2.9e-55)
		tmp = t_1;
	elseif (x <= 3.2e-26)
		tmp = t_0;
	elseif ((x <= 6.6e+84) || (!(x <= 8.8e+176) && (x <= 2.9e+256)))
		tmp = t_1;
	else
		tmp = Float64(sqrt(x) * -3.0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = sqrt((0.1111111111111111 / x));
	t_1 = 3.0 * (y * sqrt(x));
	tmp = 0.0;
	if (x <= 2.95e-95)
		tmp = t_0;
	elseif (x <= 2.9e-55)
		tmp = t_1;
	elseif (x <= 3.2e-26)
		tmp = t_0;
	elseif ((x <= 6.6e+84) || (~((x <= 8.8e+176)) && (x <= 2.9e+256)))
		tmp = t_1;
	else
		tmp = sqrt(x) * -3.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.95e-95], t$95$0, If[LessEqual[x, 2.9e-55], t$95$1, If[LessEqual[x, 3.2e-26], t$95$0, If[Or[LessEqual[x, 6.6e+84], And[N[Not[LessEqual[x, 8.8e+176]], $MachinePrecision], LessEqual[x, 2.9e+256]]], t$95$1, N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\
t_1 := 3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 2.9 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 3.2 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 6.6 \cdot 10^{+84} \lor \neg \left(x \leq 8.8 \cdot 10^{+176}\right) \land x \leq 2.9 \cdot 10^{+256}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 2.9499999999999999e-95 or 2.9e-55 < x < 3.2000000000000001e-26

    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. sub-neg99.1%

        \[\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.1%

        \[\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.1%

        \[\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.1%

        \[\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.2%

        \[\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.2%

        \[\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.2%

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

      \[\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. add-sqr-sqrt92.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(\color{blue}{9} \cdot \left(\sqrt{x} \cdot \sqrt{x}\right)\right)} \]
      11. add-sqr-sqrt31.5%

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(9 \cdot \color{blue}{x}\right)} \]
      12. *-commutative31.5%

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

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

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

    if 2.9499999999999999e-95 < x < 2.9e-55 or 3.2000000000000001e-26 < x < 6.60000000000000034e84 or 8.80000000000000029e176 < x < 2.9000000000000002e256

    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.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.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 62.8%

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

    if 6.60000000000000034e84 < x < 8.80000000000000029e176 or 2.9000000000000002e256 < 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 y around inf 75.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{-3 + \frac{0.3333333333333333}{x}}{y}\right)\right)} \]
    8. Taylor expanded in x around inf 99.2%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(y \cdot \left(3 - 3 \cdot \frac{1}{y}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r/99.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-55}:\\ \;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-26}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{+84} \lor \neg \left(x \leq 8.8 \cdot 10^{+176}\right) \land x \leq 2.9 \cdot 10^{+256}:\\ \;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 61.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\ t_1 := y \cdot \sqrt{x \cdot 9}\\ \mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-28}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+85} \lor \neg \left(x \leq 1.95 \cdot 10^{+174}\right) \land x \leq 1.55 \cdot 10^{+257}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (* y (sqrt (* x 9.0)))))
   (if (<= x 2.95e-95)
     t_0
     (if (<= x 4.2e-55)
       t_1
       (if (<= x 1.35e-28)
         t_0
         (if (or (<= x 2.1e+85) (and (not (<= x 1.95e+174)) (<= x 1.55e+257)))
           t_1
           (* (sqrt x) -3.0)))))))
double code(double x, double y) {
	double t_0 = sqrt((0.1111111111111111 / x));
	double t_1 = y * sqrt((x * 9.0));
	double tmp;
	if (x <= 2.95e-95) {
		tmp = t_0;
	} else if (x <= 4.2e-55) {
		tmp = t_1;
	} else if (x <= 1.35e-28) {
		tmp = t_0;
	} else if ((x <= 2.1e+85) || (!(x <= 1.95e+174) && (x <= 1.55e+257))) {
		tmp = t_1;
	} 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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sqrt((0.1111111111111111d0 / x))
    t_1 = y * sqrt((x * 9.0d0))
    if (x <= 2.95d-95) then
        tmp = t_0
    else if (x <= 4.2d-55) then
        tmp = t_1
    else if (x <= 1.35d-28) then
        tmp = t_0
    else if ((x <= 2.1d+85) .or. (.not. (x <= 1.95d+174)) .and. (x <= 1.55d+257)) then
        tmp = t_1
    else
        tmp = sqrt(x) * (-3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = Math.sqrt((0.1111111111111111 / x));
	double t_1 = y * Math.sqrt((x * 9.0));
	double tmp;
	if (x <= 2.95e-95) {
		tmp = t_0;
	} else if (x <= 4.2e-55) {
		tmp = t_1;
	} else if (x <= 1.35e-28) {
		tmp = t_0;
	} else if ((x <= 2.1e+85) || (!(x <= 1.95e+174) && (x <= 1.55e+257))) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt(x) * -3.0;
	}
	return tmp;
}
def code(x, y):
	t_0 = math.sqrt((0.1111111111111111 / x))
	t_1 = y * math.sqrt((x * 9.0))
	tmp = 0
	if x <= 2.95e-95:
		tmp = t_0
	elif x <= 4.2e-55:
		tmp = t_1
	elif x <= 1.35e-28:
		tmp = t_0
	elif (x <= 2.1e+85) or (not (x <= 1.95e+174) and (x <= 1.55e+257)):
		tmp = t_1
	else:
		tmp = math.sqrt(x) * -3.0
	return tmp
function code(x, y)
	t_0 = sqrt(Float64(0.1111111111111111 / x))
	t_1 = Float64(y * sqrt(Float64(x * 9.0)))
	tmp = 0.0
	if (x <= 2.95e-95)
		tmp = t_0;
	elseif (x <= 4.2e-55)
		tmp = t_1;
	elseif (x <= 1.35e-28)
		tmp = t_0;
	elseif ((x <= 2.1e+85) || (!(x <= 1.95e+174) && (x <= 1.55e+257)))
		tmp = t_1;
	else
		tmp = Float64(sqrt(x) * -3.0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = sqrt((0.1111111111111111 / x));
	t_1 = y * sqrt((x * 9.0));
	tmp = 0.0;
	if (x <= 2.95e-95)
		tmp = t_0;
	elseif (x <= 4.2e-55)
		tmp = t_1;
	elseif (x <= 1.35e-28)
		tmp = t_0;
	elseif ((x <= 2.1e+85) || (~((x <= 1.95e+174)) && (x <= 1.55e+257)))
		tmp = t_1;
	else
		tmp = sqrt(x) * -3.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.95e-95], t$95$0, If[LessEqual[x, 4.2e-55], t$95$1, If[LessEqual[x, 1.35e-28], t$95$0, If[Or[LessEqual[x, 2.1e+85], And[N[Not[LessEqual[x, 1.95e+174]], $MachinePrecision], LessEqual[x, 1.55e+257]]], t$95$1, N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\
t_1 := y \cdot \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 4.2 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.35 \cdot 10^{-28}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 2.1 \cdot 10^{+85} \lor \neg \left(x \leq 1.95 \cdot 10^{+174}\right) \land x \leq 1.55 \cdot 10^{+257}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 2.9499999999999999e-95 or 4.2000000000000003e-55 < x < 1.3499999999999999e-28

    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. sub-neg99.1%

        \[\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.1%

        \[\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.1%

        \[\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.1%

        \[\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.2%

        \[\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.2%

        \[\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.2%

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

      \[\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. add-sqr-sqrt92.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(\color{blue}{9} \cdot \left(\sqrt{x} \cdot \sqrt{x}\right)\right)} \]
      11. add-sqr-sqrt31.5%

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(9 \cdot \color{blue}{x}\right)} \]
      12. *-commutative31.5%

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

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

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

    if 2.9499999999999999e-95 < x < 4.2000000000000003e-55 or 1.3499999999999999e-28 < x < 2.1000000000000001e85 or 1.9499999999999999e174 < x < 1.55e257

    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(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \]
      2. metadata-eval99.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. rem-square-sqrt62.8%

        \[\leadsto y \cdot \left(\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} \cdot 3\right) \]
      5. rem-sqrt-square62.8%

        \[\leadsto y \cdot \left(\color{blue}{\left|\sqrt{x}\right|} \cdot 3\right) \]
      6. metadata-eval62.8%

        \[\leadsto y \cdot \left(\left|\sqrt{x}\right| \cdot \color{blue}{\left|3\right|}\right) \]
      7. fabs-mul62.8%

        \[\leadsto y \cdot \color{blue}{\left|\sqrt{x} \cdot 3\right|} \]
      8. rem-sqrt-square62.8%

        \[\leadsto y \cdot \color{blue}{\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}} \]
      9. swap-sqr62.8%

        \[\leadsto y \cdot \sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      10. rem-square-sqrt62.9%

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

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

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

    if 2.1000000000000001e85 < x < 1.9499999999999999e174 or 1.55e257 < 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 y around inf 75.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{-3 + \frac{0.3333333333333333}{x}}{y}\right)\right)} \]
    8. Taylor expanded in x around inf 99.2%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(y \cdot \left(3 - 3 \cdot \frac{1}{y}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r/99.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-55}:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-28}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+85} \lor \neg \left(x \leq 1.95 \cdot 10^{+174}\right) \land x \leq 1.55 \cdot 10^{+257}:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 61.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \sqrt{x \cdot 9}\\ \mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-54}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-27}:\\ \;\;\;\;\frac{1}{3 \cdot \sqrt{x}}\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+84} \lor \neg \left(x \leq 2.1 \cdot 10^{+180}\right) \land x \leq 2.4 \cdot 10^{+255}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (sqrt (* x 9.0)))))
   (if (<= x 2.95e-95)
     (sqrt (/ 0.1111111111111111 x))
     (if (<= x 1.1e-54)
       t_0
       (if (<= x 1.55e-27)
         (/ 1.0 (* 3.0 (sqrt x)))
         (if (or (<= x 8.2e+84) (and (not (<= x 2.1e+180)) (<= x 2.4e+255)))
           t_0
           (* (sqrt x) -3.0)))))))
double code(double x, double y) {
	double t_0 = y * sqrt((x * 9.0));
	double tmp;
	if (x <= 2.95e-95) {
		tmp = sqrt((0.1111111111111111 / x));
	} else if (x <= 1.1e-54) {
		tmp = t_0;
	} else if (x <= 1.55e-27) {
		tmp = 1.0 / (3.0 * sqrt(x));
	} else if ((x <= 8.2e+84) || (!(x <= 2.1e+180) && (x <= 2.4e+255))) {
		tmp = t_0;
	} 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) :: t_0
    real(8) :: tmp
    t_0 = y * sqrt((x * 9.0d0))
    if (x <= 2.95d-95) then
        tmp = sqrt((0.1111111111111111d0 / x))
    else if (x <= 1.1d-54) then
        tmp = t_0
    else if (x <= 1.55d-27) then
        tmp = 1.0d0 / (3.0d0 * sqrt(x))
    else if ((x <= 8.2d+84) .or. (.not. (x <= 2.1d+180)) .and. (x <= 2.4d+255)) then
        tmp = t_0
    else
        tmp = sqrt(x) * (-3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y * Math.sqrt((x * 9.0));
	double tmp;
	if (x <= 2.95e-95) {
		tmp = Math.sqrt((0.1111111111111111 / x));
	} else if (x <= 1.1e-54) {
		tmp = t_0;
	} else if (x <= 1.55e-27) {
		tmp = 1.0 / (3.0 * Math.sqrt(x));
	} else if ((x <= 8.2e+84) || (!(x <= 2.1e+180) && (x <= 2.4e+255))) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt(x) * -3.0;
	}
	return tmp;
}
def code(x, y):
	t_0 = y * math.sqrt((x * 9.0))
	tmp = 0
	if x <= 2.95e-95:
		tmp = math.sqrt((0.1111111111111111 / x))
	elif x <= 1.1e-54:
		tmp = t_0
	elif x <= 1.55e-27:
		tmp = 1.0 / (3.0 * math.sqrt(x))
	elif (x <= 8.2e+84) or (not (x <= 2.1e+180) and (x <= 2.4e+255)):
		tmp = t_0
	else:
		tmp = math.sqrt(x) * -3.0
	return tmp
function code(x, y)
	t_0 = Float64(y * sqrt(Float64(x * 9.0)))
	tmp = 0.0
	if (x <= 2.95e-95)
		tmp = sqrt(Float64(0.1111111111111111 / x));
	elseif (x <= 1.1e-54)
		tmp = t_0;
	elseif (x <= 1.55e-27)
		tmp = Float64(1.0 / Float64(3.0 * sqrt(x)));
	elseif ((x <= 8.2e+84) || (!(x <= 2.1e+180) && (x <= 2.4e+255)))
		tmp = t_0;
	else
		tmp = Float64(sqrt(x) * -3.0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y * sqrt((x * 9.0));
	tmp = 0.0;
	if (x <= 2.95e-95)
		tmp = sqrt((0.1111111111111111 / x));
	elseif (x <= 1.1e-54)
		tmp = t_0;
	elseif (x <= 1.55e-27)
		tmp = 1.0 / (3.0 * sqrt(x));
	elseif ((x <= 8.2e+84) || (~((x <= 2.1e+180)) && (x <= 2.4e+255)))
		tmp = t_0;
	else
		tmp = sqrt(x) * -3.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.95e-95], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.1e-54], t$95$0, If[LessEqual[x, 1.55e-27], N[(1.0 / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 8.2e+84], And[N[Not[LessEqual[x, 2.1e+180]], $MachinePrecision], LessEqual[x, 2.4e+255]]], t$95$0, N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{-54}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 1.55 \cdot 10^{-27}:\\
\;\;\;\;\frac{1}{3 \cdot \sqrt{x}}\\

\mathbf{elif}\;x \leq 8.2 \cdot 10^{+84} \lor \neg \left(x \leq 2.1 \cdot 10^{+180}\right) \land x \leq 2.4 \cdot 10^{+255}:\\
\;\;\;\;t\_0\\

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


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

    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. sub-neg99.2%

        \[\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.2%

        \[\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.2%

        \[\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.2%

        \[\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.2%

        \[\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.2%

        \[\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.2%

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

      \[\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. add-sqr-sqrt92.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(\color{blue}{9} \cdot \left(\sqrt{x} \cdot \sqrt{x}\right)\right)} \]
      11. add-sqr-sqrt23.4%

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(9 \cdot \color{blue}{x}\right)} \]
      12. *-commutative23.4%

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

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

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

    if 2.9499999999999999e-95 < x < 1.1e-54 or 1.5499999999999999e-27 < x < 8.2000000000000006e84 or 2.1e180 < x < 2.40000000000000006e255

    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(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \]
      2. metadata-eval99.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. rem-square-sqrt62.8%

        \[\leadsto y \cdot \left(\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} \cdot 3\right) \]
      5. rem-sqrt-square62.8%

        \[\leadsto y \cdot \left(\color{blue}{\left|\sqrt{x}\right|} \cdot 3\right) \]
      6. metadata-eval62.8%

        \[\leadsto y \cdot \left(\left|\sqrt{x}\right| \cdot \color{blue}{\left|3\right|}\right) \]
      7. fabs-mul62.8%

        \[\leadsto y \cdot \color{blue}{\left|\sqrt{x} \cdot 3\right|} \]
      8. rem-sqrt-square62.8%

        \[\leadsto y \cdot \color{blue}{\sqrt{\left(\sqrt{x} \cdot 3\right) \cdot \left(\sqrt{x} \cdot 3\right)}} \]
      9. swap-sqr62.8%

        \[\leadsto y \cdot \sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      10. rem-square-sqrt62.9%

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

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

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

    if 1.1e-54 < x < 1.5499999999999999e-27

    1. Initial program 99.0%

      \[\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.0%

        \[\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.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 76.6%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{0.1111111111111111}{x}}} \]
      4. clear-num76.6%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{\frac{x}{0.1111111111111111}}}} \]
      5. sqrt-div76.8%

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{x}{0.1111111111111111}}}} \]
      6. metadata-eval76.8%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x}{0.1111111111111111}}} \]
      7. div-inv76.8%

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

        \[\leadsto \frac{1}{\sqrt{x \cdot \color{blue}{9}}} \]
      9. sqrt-prod76.8%

        \[\leadsto \frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{9}}} \]
      10. metadata-eval76.8%

        \[\leadsto \frac{1}{\sqrt{x} \cdot \color{blue}{3}} \]
    7. Applied egg-rr76.8%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{x} \cdot 3}} \]

    if 8.2000000000000006e84 < x < 2.1e180 or 2.40000000000000006e255 < 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 y around inf 75.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{-3 + \frac{0.3333333333333333}{x}}{y}\right)\right)} \]
    8. Taylor expanded in x around inf 99.2%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(y \cdot \left(3 - 3 \cdot \frac{1}{y}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r/99.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-54}:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-27}:\\ \;\;\;\;\frac{1}{3 \cdot \sqrt{x}}\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+84} \lor \neg \left(x \leq 2.1 \cdot 10^{+180}\right) \land x \leq 2.4 \cdot 10^{+255}:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 84.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\

\mathbf{elif}\;x \leq 4.5 \cdot 10^{-55}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\

\mathbf{elif}\;x \leq 2.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{1}{3 \cdot \sqrt{x}}\\

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


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

    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. sub-neg99.2%

        \[\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.2%

        \[\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.2%

        \[\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.2%

        \[\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.2%

        \[\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.2%

        \[\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.2%

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

      \[\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. add-sqr-sqrt92.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(\color{blue}{9} \cdot \left(\sqrt{x} \cdot \sqrt{x}\right)\right)} \]
      11. add-sqr-sqrt23.4%

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(9 \cdot \color{blue}{x}\right)} \]
      12. *-commutative23.4%

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

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

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

    if 2.9499999999999999e-95 < x < 4.4999999999999997e-55

    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. sub-neg99.1%

        \[\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.1%

        \[\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.1%

        \[\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.1%

        \[\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.2%

        \[\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.2%

        \[\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.2%

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

      \[\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.2%

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

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

        \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\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. Taylor expanded in y around inf 62.8%

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. rem-square-sqrt62.7%

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

        \[\leadsto y \cdot \left(\color{blue}{\left|\sqrt{x}\right|} \cdot 3\right) \]
      6. metadata-eval62.7%

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

        \[\leadsto y \cdot \color{blue}{\left|\sqrt{x} \cdot 3\right|} \]
      8. rem-sqrt-square62.7%

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

        \[\leadsto y \cdot \sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      10. rem-square-sqrt63.0%

        \[\leadsto y \cdot \sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)} \]
      11. metadata-eval63.0%

        \[\leadsto y \cdot \sqrt{x \cdot \color{blue}{9}} \]
    9. Simplified63.0%

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

    if 4.4999999999999997e-55 < x < 2.1999999999999999e-29

    1. Initial program 99.0%

      \[\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.0%

        \[\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.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 76.6%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{0.1111111111111111}{x}}} \]
      4. clear-num76.6%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{\frac{x}{0.1111111111111111}}}} \]
      5. sqrt-div76.8%

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{x}{0.1111111111111111}}}} \]
      6. metadata-eval76.8%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{x}{0.1111111111111111}}} \]
      7. div-inv76.8%

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

        \[\leadsto \frac{1}{\sqrt{x \cdot \color{blue}{9}}} \]
      9. sqrt-prod76.8%

        \[\leadsto \frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{9}}} \]
      10. metadata-eval76.8%

        \[\leadsto \frac{1}{\sqrt{x} \cdot \color{blue}{3}} \]
    7. Applied egg-rr76.8%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{x} \cdot 3}} \]

    if 2.1999999999999999e-29 < 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. sub-neg99.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-55}:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-29}:\\ \;\;\;\;\frac{1}{3 \cdot \sqrt{x}}\\ \mathbf{else}:\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(y + -1\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 97.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.2 \lor \neg \left(y \leq 1.7 \cdot 10^{-25}\right):\\ \;\;\;\;y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{\frac{0.3333333333333333}{x}}{y}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -1.2) (not (<= y 1.7e-25)))
   (* y (* (sqrt x) (+ 3.0 (/ (/ 0.3333333333333333 x) y))))
   (* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))))
double code(double x, double y) {
	double tmp;
	if ((y <= -1.2) || !(y <= 1.7e-25)) {
		tmp = y * (sqrt(x) * (3.0 + ((0.3333333333333333 / x) / y)));
	} else {
		tmp = sqrt(x) * ((0.3333333333333333 / 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 ((y <= (-1.2d0)) .or. (.not. (y <= 1.7d-25))) then
        tmp = y * (sqrt(x) * (3.0d0 + ((0.3333333333333333d0 / x) / y)))
    else
        tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -1.2) || !(y <= 1.7e-25)) {
		tmp = y * (Math.sqrt(x) * (3.0 + ((0.3333333333333333 / x) / y)));
	} else {
		tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -1.2) or not (y <= 1.7e-25):
		tmp = y * (math.sqrt(x) * (3.0 + ((0.3333333333333333 / x) / y)))
	else:
		tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -1.2) || !(y <= 1.7e-25))
		tmp = Float64(y * Float64(sqrt(x) * Float64(3.0 + Float64(Float64(0.3333333333333333 / x) / y))));
	else
		tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -1.2) || ~((y <= 1.7e-25)))
		tmp = y * (sqrt(x) * (3.0 + ((0.3333333333333333 / x) / y)));
	else
		tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -1.2], N[Not[LessEqual[y, 1.7e-25]], $MachinePrecision]], N[(y * N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 + N[(N[(0.3333333333333333 / x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \lor \neg \left(y \leq 1.7 \cdot 10^{-25}\right):\\
\;\;\;\;y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{\frac{0.3333333333333333}{x}}{y}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.19999999999999996 or 1.70000000000000001e-25 < y

    1. Initial program 99.3%

      \[\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.3%

        \[\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.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 inf 99.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{-3 + \frac{0.3333333333333333}{x}}{y}\right)\right)} \]
    8. Taylor expanded in x around 0 99.0%

      \[\leadsto y \cdot \left(\sqrt{x} \cdot \left(3 + \color{blue}{\frac{0.3333333333333333}{x \cdot y}}\right)\right) \]
    9. Step-by-step derivation
      1. associate-/r*99.0%

        \[\leadsto y \cdot \left(\sqrt{x} \cdot \left(3 + \color{blue}{\frac{\frac{0.3333333333333333}{x}}{y}}\right)\right) \]
    10. Simplified99.0%

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

    if -1.19999999999999996 < y < 1.70000000000000001e-25

    1. Initial program 99.3%

      \[\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.3%

        \[\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.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 0 98.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \lor \neg \left(y \leq 1.7 \cdot 10^{-25}\right):\\ \;\;\;\;y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{\frac{0.3333333333333333}{x}}{y}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 85.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{elif}\;y \leq 82000000:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\sqrt{x} \cdot \left(3 - \frac{3}{y}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -1.55e+22)
   (* y (sqrt (* x 9.0)))
   (if (<= y 82000000.0)
     (* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
     (* y (* (sqrt x) (- 3.0 (/ 3.0 y)))))))
double code(double x, double y) {
	double tmp;
	if (y <= -1.55e+22) {
		tmp = y * sqrt((x * 9.0));
	} else if (y <= 82000000.0) {
		tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
	} else {
		tmp = y * (sqrt(x) * (3.0 - (3.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 <= (-1.55d+22)) then
        tmp = y * sqrt((x * 9.0d0))
    else if (y <= 82000000.0d0) then
        tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
    else
        tmp = y * (sqrt(x) * (3.0d0 - (3.0d0 / y)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -1.55e+22) {
		tmp = y * Math.sqrt((x * 9.0));
	} else if (y <= 82000000.0) {
		tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
	} else {
		tmp = y * (Math.sqrt(x) * (3.0 - (3.0 / y)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -1.55e+22:
		tmp = y * math.sqrt((x * 9.0))
	elif y <= 82000000.0:
		tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0)
	else:
		tmp = y * (math.sqrt(x) * (3.0 - (3.0 / y)))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -1.55e+22)
		tmp = Float64(y * sqrt(Float64(x * 9.0)));
	elseif (y <= 82000000.0)
		tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0));
	else
		tmp = Float64(y * Float64(sqrt(x) * Float64(3.0 - Float64(3.0 / y))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -1.55e+22)
		tmp = y * sqrt((x * 9.0));
	elseif (y <= 82000000.0)
		tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
	else
		tmp = y * (sqrt(x) * (3.0 - (3.0 / y)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -1.55e+22], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 82000000.0], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 - N[(3.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+22}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\

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

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


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

    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(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \]
      2. metadata-eval99.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. rem-square-sqrt81.9%

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

        \[\leadsto y \cdot \left(\color{blue}{\left|\sqrt{x}\right|} \cdot 3\right) \]
      6. metadata-eval81.9%

        \[\leadsto y \cdot \left(\left|\sqrt{x}\right| \cdot \color{blue}{\left|3\right|}\right) \]
      7. fabs-mul81.9%

        \[\leadsto y \cdot \color{blue}{\left|\sqrt{x} \cdot 3\right|} \]
      8. rem-sqrt-square81.9%

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

        \[\leadsto y \cdot \sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      10. rem-square-sqrt82.1%

        \[\leadsto y \cdot \sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)} \]
      11. metadata-eval82.1%

        \[\leadsto y \cdot \sqrt{x \cdot \color{blue}{9}} \]
    9. Simplified82.1%

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

    if -1.5500000000000001e22 < y < 8.2e7

    1. Initial program 99.3%

      \[\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.3%

        \[\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 97.4%

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

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

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

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

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

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

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

    if 8.2e7 < y

    1. Initial program 99.3%

      \[\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.3%

        \[\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.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 inf 99.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{-3 + \frac{0.3333333333333333}{x}}{y}\right)\right)} \]
    8. Taylor expanded in x around inf 76.6%

      \[\leadsto y \cdot \color{blue}{\left(\sqrt{x} \cdot \left(3 - 3 \cdot \frac{1}{y}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r/76.6%

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

        \[\leadsto y \cdot \left(\sqrt{x} \cdot \left(3 - \frac{\color{blue}{3}}{y}\right)\right) \]
    10. Simplified76.6%

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

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

Alternative 9: 85.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+21}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\

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

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


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

    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(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \]
      2. metadata-eval99.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. rem-square-sqrt81.9%

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

        \[\leadsto y \cdot \left(\color{blue}{\left|\sqrt{x}\right|} \cdot 3\right) \]
      6. metadata-eval81.9%

        \[\leadsto y \cdot \left(\left|\sqrt{x}\right| \cdot \color{blue}{\left|3\right|}\right) \]
      7. fabs-mul81.9%

        \[\leadsto y \cdot \color{blue}{\left|\sqrt{x} \cdot 3\right|} \]
      8. rem-sqrt-square81.9%

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

        \[\leadsto y \cdot \sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      10. rem-square-sqrt82.1%

        \[\leadsto y \cdot \sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)} \]
      11. metadata-eval82.1%

        \[\leadsto y \cdot \sqrt{x \cdot \color{blue}{9}} \]
    9. Simplified82.1%

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

    if -2.7e21 < y < 15200

    1. Initial program 99.3%

      \[\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.3%

        \[\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 97.4%

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

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

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

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

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

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

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

    if 15200 < y

    1. Initial program 99.3%

      \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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.3%

        \[\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. Taylor expanded in x around inf 76.5%

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

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

Alternative 10: 85.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+18}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\

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

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


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

    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(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \]
      2. metadata-eval99.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)} \]
      4. rem-square-sqrt81.9%

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

        \[\leadsto y \cdot \left(\color{blue}{\left|\sqrt{x}\right|} \cdot 3\right) \]
      6. metadata-eval81.9%

        \[\leadsto y \cdot \left(\left|\sqrt{x}\right| \cdot \color{blue}{\left|3\right|}\right) \]
      7. fabs-mul81.9%

        \[\leadsto y \cdot \color{blue}{\left|\sqrt{x} \cdot 3\right|} \]
      8. rem-sqrt-square81.9%

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

        \[\leadsto y \cdot \sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(3 \cdot 3\right)}} \]
      10. rem-square-sqrt82.1%

        \[\leadsto y \cdot \sqrt{\color{blue}{x} \cdot \left(3 \cdot 3\right)} \]
      11. metadata-eval82.1%

        \[\leadsto y \cdot \sqrt{x \cdot \color{blue}{9}} \]
    9. Simplified82.1%

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

    if -2.3e18 < y < 7.5e7

    1. Initial program 99.3%

      \[\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.3%

        \[\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 97.4%

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

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

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

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

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

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

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

    if 7.5e7 < y

    1. Initial program 99.3%

      \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.6%

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

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

Alternative 11: 99.5% accurate, 1.0× speedup?

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

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

    \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

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

    \[\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.3%

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

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

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

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

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

Alternative 12: 99.4% accurate, 1.0× speedup?

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

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

    \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

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

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

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

Alternative 13: 61.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.11:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 0.11) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
	double tmp;
	if (x <= 0.11) {
		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.11d0) 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.11) {
		tmp = Math.sqrt((0.1111111111111111 / x));
	} else {
		tmp = Math.sqrt(x) * -3.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 0.11:
		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.11)
		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.11)
		tmp = sqrt((0.1111111111111111 / x));
	else
		tmp = sqrt(x) * -3.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 0.11], 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.11:\\
\;\;\;\;\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.110000000000000001

    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. sub-neg99.1%

        \[\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.1%

        \[\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.1%

        \[\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.1%

        \[\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.2%

        \[\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.2%

        \[\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.2%

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

      \[\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. add-sqr-sqrt89.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(\color{blue}{9} \cdot \left(\sqrt{x} \cdot \sqrt{x}\right)\right)} \]
      11. add-sqr-sqrt35.2%

        \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(9 \cdot \color{blue}{x}\right)} \]
      12. *-commutative35.2%

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

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

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

    if 0.110000000000000001 < 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.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.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 88.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{-3 + \frac{0.3333333333333333}{x}}{y}\right)\right)} \]
    8. Taylor expanded in x around inf 98.2%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(y \cdot \left(3 - 3 \cdot \frac{1}{y}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r/98.3%

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

        \[\leadsto \sqrt{x} \cdot \left(y \cdot \left(3 - \frac{\color{blue}{3}}{y}\right)\right) \]
    10. Simplified98.3%

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

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

        \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
    13. Simplified47.7%

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

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

Alternative 14: 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.3%

    \[\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.3%

      \[\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 inf 79.6%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{-3 + \frac{0.3333333333333333}{x}}{y}\right)\right)} \]
  8. Taylor expanded in x around inf 62.0%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \left(y \cdot \left(3 - 3 \cdot \frac{1}{y}\right)\right)} \]
  9. Step-by-step derivation
    1. associate-*r/62.1%

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

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

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

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

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

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

      \[\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-unprod3.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \]
  17. Simplified3.3%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \]
  18. Final simplification3.3%

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

Alternative 15: 38.3% 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.3%

    \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

      \[\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.3%

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

    \[\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. add-sqr-sqrt57.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(\color{blue}{9} \cdot \left(\sqrt{x} \cdot \sqrt{x}\right)\right)} \]
    11. add-sqr-sqrt24.2%

      \[\leadsto \sqrt{{\left(y + \left(-1 + \frac{0.1111111111111111}{x}\right)\right)}^{2} \cdot \left(9 \cdot \color{blue}{x}\right)} \]
    12. *-commutative24.2%

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

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

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

    \[\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 2024073 
(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)))