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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.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}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Final simplification99.4%

    \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) + -1\right) \]

Alternative 2: 62.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{x} \cdot -3\\ t_1 := 3 \cdot \left(\sqrt{x} \cdot y\right)\\ \mathbf{if}\;x \leq 0.00015:\\ \;\;\;\;\sqrt{x} \cdot \frac{0.3333333333333333}{x}\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{+54}:\\ \;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+86}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{+138}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 7.6 \cdot 10^{+167}:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+243} \lor \neg \left(x \leq 9.6 \cdot 10^{+291}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (sqrt x) -3.0)) (t_1 (* 3.0 (* (sqrt x) y))))
   (if (<= x 0.00015)
     (* (sqrt x) (/ 0.3333333333333333 x))
     (if (<= x 1.22e+54)
       (* (sqrt x) (* 3.0 y))
       (if (<= x 2.1e+86)
         t_0
         (if (<= x 9e+106)
           t_1
           (if (<= x 2.05e+138)
             t_0
             (if (<= x 7.6e+167)
               (* y (sqrt (* x 9.0)))
               (if (or (<= x 2.1e+243) (not (<= x 9.6e+291))) t_0 t_1)))))))))
double code(double x, double y) {
	double t_0 = sqrt(x) * -3.0;
	double t_1 = 3.0 * (sqrt(x) * y);
	double tmp;
	if (x <= 0.00015) {
		tmp = sqrt(x) * (0.3333333333333333 / x);
	} else if (x <= 1.22e+54) {
		tmp = sqrt(x) * (3.0 * y);
	} else if (x <= 2.1e+86) {
		tmp = t_0;
	} else if (x <= 9e+106) {
		tmp = t_1;
	} else if (x <= 2.05e+138) {
		tmp = t_0;
	} else if (x <= 7.6e+167) {
		tmp = y * sqrt((x * 9.0));
	} else if ((x <= 2.1e+243) || !(x <= 9.6e+291)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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(x) * (-3.0d0)
    t_1 = 3.0d0 * (sqrt(x) * y)
    if (x <= 0.00015d0) then
        tmp = sqrt(x) * (0.3333333333333333d0 / x)
    else if (x <= 1.22d+54) then
        tmp = sqrt(x) * (3.0d0 * y)
    else if (x <= 2.1d+86) then
        tmp = t_0
    else if (x <= 9d+106) then
        tmp = t_1
    else if (x <= 2.05d+138) then
        tmp = t_0
    else if (x <= 7.6d+167) then
        tmp = y * sqrt((x * 9.0d0))
    else if ((x <= 2.1d+243) .or. (.not. (x <= 9.6d+291))) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = Math.sqrt(x) * -3.0;
	double t_1 = 3.0 * (Math.sqrt(x) * y);
	double tmp;
	if (x <= 0.00015) {
		tmp = Math.sqrt(x) * (0.3333333333333333 / x);
	} else if (x <= 1.22e+54) {
		tmp = Math.sqrt(x) * (3.0 * y);
	} else if (x <= 2.1e+86) {
		tmp = t_0;
	} else if (x <= 9e+106) {
		tmp = t_1;
	} else if (x <= 2.05e+138) {
		tmp = t_0;
	} else if (x <= 7.6e+167) {
		tmp = y * Math.sqrt((x * 9.0));
	} else if ((x <= 2.1e+243) || !(x <= 9.6e+291)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y):
	t_0 = math.sqrt(x) * -3.0
	t_1 = 3.0 * (math.sqrt(x) * y)
	tmp = 0
	if x <= 0.00015:
		tmp = math.sqrt(x) * (0.3333333333333333 / x)
	elif x <= 1.22e+54:
		tmp = math.sqrt(x) * (3.0 * y)
	elif x <= 2.1e+86:
		tmp = t_0
	elif x <= 9e+106:
		tmp = t_1
	elif x <= 2.05e+138:
		tmp = t_0
	elif x <= 7.6e+167:
		tmp = y * math.sqrt((x * 9.0))
	elif (x <= 2.1e+243) or not (x <= 9.6e+291):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y)
	t_0 = Float64(sqrt(x) * -3.0)
	t_1 = Float64(3.0 * Float64(sqrt(x) * y))
	tmp = 0.0
	if (x <= 0.00015)
		tmp = Float64(sqrt(x) * Float64(0.3333333333333333 / x));
	elseif (x <= 1.22e+54)
		tmp = Float64(sqrt(x) * Float64(3.0 * y));
	elseif (x <= 2.1e+86)
		tmp = t_0;
	elseif (x <= 9e+106)
		tmp = t_1;
	elseif (x <= 2.05e+138)
		tmp = t_0;
	elseif (x <= 7.6e+167)
		tmp = Float64(y * sqrt(Float64(x * 9.0)));
	elseif ((x <= 2.1e+243) || !(x <= 9.6e+291))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = sqrt(x) * -3.0;
	t_1 = 3.0 * (sqrt(x) * y);
	tmp = 0.0;
	if (x <= 0.00015)
		tmp = sqrt(x) * (0.3333333333333333 / x);
	elseif (x <= 1.22e+54)
		tmp = sqrt(x) * (3.0 * y);
	elseif (x <= 2.1e+86)
		tmp = t_0;
	elseif (x <= 9e+106)
		tmp = t_1;
	elseif (x <= 2.05e+138)
		tmp = t_0;
	elseif (x <= 7.6e+167)
		tmp = y * sqrt((x * 9.0));
	elseif ((x <= 2.1e+243) || ~((x <= 9.6e+291)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.00015], N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.22e+54], N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+86], t$95$0, If[LessEqual[x, 9e+106], t$95$1, If[LessEqual[x, 2.05e+138], t$95$0, If[LessEqual[x, 7.6e+167], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 2.1e+243], N[Not[LessEqual[x, 9.6e+291]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot -3\\
t_1 := 3 \cdot \left(\sqrt{x} \cdot y\right)\\
\mathbf{if}\;x \leq 0.00015:\\
\;\;\;\;\sqrt{x} \cdot \frac{0.3333333333333333}{x}\\

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

\mathbf{elif}\;x \leq 2.1 \cdot 10^{+86}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 9 \cdot 10^{+106}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 2.05 \cdot 10^{+138}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 7.6 \cdot 10^{+167}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\

\mathbf{elif}\;x \leq 2.1 \cdot 10^{+243} \lor \neg \left(x \leq 9.6 \cdot 10^{+291}\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    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-def99.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.2%

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

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

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

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

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

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

    if 1.49999999999999987e-4 < x < 1.22e54

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.22e54 < x < 2.0999999999999999e86 or 8.9999999999999994e106 < x < 2.0499999999999999e138 or 7.59999999999999987e167 < x < 2.0999999999999999e243 or 9.6e291 < 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.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-def99.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. Taylor expanded in x around inf 99.4%

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

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

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

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

    if 2.0999999999999999e86 < x < 8.9999999999999994e106 or 2.0999999999999999e243 < x < 9.6e291

    1. Initial program 99.6%

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

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

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

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

    if 2.0499999999999999e138 < x < 7.59999999999999987e167

    1. Initial program 99.6%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \left(\sqrt{x} \cdot y\right)\right)\right)} \]
      2. expm1-udef37.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(3 \cdot \left(\sqrt{x} \cdot y\right)\right)} - 1} \]
      3. *-commutative37.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{x} \cdot y\right) \cdot 3}\right)} - 1 \]
      4. *-commutative37.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(y \cdot \sqrt{x}\right)} \cdot 3\right)} - 1 \]
      5. associate-*r*37.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)}\right)} - 1 \]
      6. *-commutative37.3%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(3 \cdot \sqrt{x}\right)}\right)} - 1 \]
      7. *-commutative37.3%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{x} \cdot 3\right)}\right)} - 1 \]
      8. metadata-eval37.3%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right)\right)} - 1 \]
      9. sqrt-prod37.3%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\sqrt{x \cdot 9}}\right)} - 1 \]
    6. Applied egg-rr37.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \sqrt{x \cdot 9}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def37.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \sqrt{x \cdot 9}\right)\right)} \]
      2. expm1-log1p71.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.00015:\\ \;\;\;\;\sqrt{x} \cdot \frac{0.3333333333333333}{x}\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{+54}:\\ \;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+86}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+106}:\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{+138}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{elif}\;x \leq 7.6 \cdot 10^{+167}:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+243} \lor \neg \left(x \leq 9.6 \cdot 10^{+291}\right):\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{else}:\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \end{array} \]

Alternative 3: 86.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \left(\sqrt{x} \cdot y\right)\right)\right)} \]
      2. expm1-udef0.1%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(3 \cdot \left(\sqrt{x} \cdot y\right)\right)} - 1} \]
      3. *-commutative0.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{x} \cdot y\right) \cdot 3}\right)} - 1 \]
      4. *-commutative0.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(y \cdot \sqrt{x}\right)} \cdot 3\right)} - 1 \]
      5. associate-*r*0.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)}\right)} - 1 \]
      6. *-commutative0.1%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(3 \cdot \sqrt{x}\right)}\right)} - 1 \]
      7. *-commutative0.1%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{x} \cdot 3\right)}\right)} - 1 \]
      8. metadata-eval0.1%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right)\right)} - 1 \]
      9. sqrt-prod0.1%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\sqrt{x \cdot 9}}\right)} - 1 \]
    6. Applied egg-rr0.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \sqrt{x \cdot 9}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def0.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \sqrt{x \cdot 9}\right)\right)} \]
      2. expm1-log1p76.2%

        \[\leadsto \color{blue}{y \cdot \sqrt{x \cdot 9}} \]
    8. Simplified76.2%

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

    if -3.10000000000000005e56 < y < 1.1e18

    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-def99.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.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1e18 < y

    1. Initial program 99.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+56}:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+18}:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot y\\ \end{array} \]

Alternative 4: 86.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.0032:\\ \;\;\;\;\sqrt{x} \cdot \left(0.3333333333333333 \cdot \frac{1}{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 (<= x 0.0032)
   (* (sqrt x) (- (* 0.3333333333333333 (/ 1.0 x)) 3.0))
   (* (* 3.0 (sqrt x)) (+ y -1.0))))
double code(double x, double y) {
	double tmp;
	if (x <= 0.0032) {
		tmp = sqrt(x) * ((0.3333333333333333 * (1.0 / 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 (x <= 0.0032d0) then
        tmp = sqrt(x) * ((0.3333333333333333d0 * (1.0d0 / 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 (x <= 0.0032) {
		tmp = Math.sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0);
	} else {
		tmp = (3.0 * Math.sqrt(x)) * (y + -1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 0.0032:
		tmp = math.sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0)
	else:
		tmp = (3.0 * math.sqrt(x)) * (y + -1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 0.0032)
		tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 * Float64(1.0 / 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 (x <= 0.0032)
		tmp = sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0);
	else
		tmp = (3.0 * sqrt(x)) * (y + -1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 0.0032], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 * N[(1.0 / x), $MachinePrecision]), $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}\;x \leq 0.0032:\\
\;\;\;\;\sqrt{x} \cdot \left(0.3333333333333333 \cdot \frac{1}{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 2 regimes
  2. if x < 0.00320000000000000015

    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-def99.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.2%

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

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

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

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

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

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

    if 0.00320000000000000015 < x

    1. Initial program 99.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.0032:\\ \;\;\;\;\sqrt{x} \cdot \left(0.3333333333333333 \cdot \frac{1}{x} - 3\right)\\ \mathbf{else}:\\ \;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot \left(y + -1\right)\\ \end{array} \]

Alternative 5: 86.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.0145:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{1}{\frac{x}{0.3333333333333333}} - 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 (<= x 0.0145)
   (* (sqrt x) (- (/ 1.0 (/ x 0.3333333333333333)) 3.0))
   (* (* 3.0 (sqrt x)) (+ y -1.0))))
double code(double x, double y) {
	double tmp;
	if (x <= 0.0145) {
		tmp = sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 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 (x <= 0.0145d0) then
        tmp = sqrt(x) * ((1.0d0 / (x / 0.3333333333333333d0)) - 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 (x <= 0.0145) {
		tmp = Math.sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0);
	} else {
		tmp = (3.0 * Math.sqrt(x)) * (y + -1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 0.0145:
		tmp = math.sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0)
	else:
		tmp = (3.0 * math.sqrt(x)) * (y + -1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 0.0145)
		tmp = Float64(sqrt(x) * Float64(Float64(1.0 / Float64(x / 0.3333333333333333)) - 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 (x <= 0.0145)
		tmp = sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0);
	else
		tmp = (3.0 * sqrt(x)) * (y + -1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 0.0145], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(1.0 / N[(x / 0.3333333333333333), $MachinePrecision]), $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}\;x \leq 0.0145:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{1}{\frac{x}{0.3333333333333333}} - 3\right)\\

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


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

    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-def99.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.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{x} - 3\right) \cdot \sqrt{x}} \]
    5. Step-by-step derivation
      1. un-div-inv79.5%

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

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

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

    if 0.0145000000000000007 < x

    1. Initial program 99.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.0145:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{1}{\frac{x}{0.3333333333333333}} - 3\right)\\ \mathbf{else}:\\ \;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot \left(y + -1\right)\\ \end{array} \]

Alternative 6: 99.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 99.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 60.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 3.65 \cdot 10^{-7}\right):\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1 or 3.65e-7 < y

    1. Initial program 99.5%

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

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

        \[\leadsto 3 \cdot \color{blue}{\left(\sqrt{x} \cdot y\right)} \]
    4. Simplified70.6%

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

    if -1 < y < 3.65e-7

    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-def99.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.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 3.65 \cdot 10^{-7}\right):\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]

Alternative 9: 60.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 3.65 \cdot 10^{-7}\right):\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1 or 3.65e-7 < y

    1. Initial program 99.5%

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

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

        \[\leadsto 3 \cdot \color{blue}{\left(\sqrt{x} \cdot y\right)} \]
    4. Simplified70.6%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u30.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \left(\sqrt{x} \cdot y\right)\right)\right)} \]
      2. expm1-udef30.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(3 \cdot \left(\sqrt{x} \cdot y\right)\right)} - 1} \]
      3. *-commutative30.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{x} \cdot y\right) \cdot 3}\right)} - 1 \]
      4. *-commutative30.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(y \cdot \sqrt{x}\right)} \cdot 3\right)} - 1 \]
      5. associate-*r*30.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)}\right)} - 1 \]
      6. *-commutative30.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(3 \cdot \sqrt{x}\right)}\right)} - 1 \]
      7. *-commutative30.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{x} \cdot 3\right)}\right)} - 1 \]
      8. metadata-eval30.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right)\right)} - 1 \]
      9. sqrt-prod30.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\sqrt{x \cdot 9}}\right)} - 1 \]
    6. Applied egg-rr30.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \sqrt{x \cdot 9}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def30.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \sqrt{x \cdot 9}\right)\right)} \]
      2. expm1-log1p70.7%

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

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

    if -1 < y < 3.65e-7

    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-def99.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.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 3.65 \cdot 10^{-7}\right):\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]

Alternative 10: 60.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\

\mathbf{elif}\;y \leq 3.65 \cdot 10^{-7}:\\
\;\;\;\;\sqrt{x} \cdot -3\\

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


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

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \left(\sqrt{x} \cdot y\right)\right)\right)} \]
      2. expm1-udef0.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(3 \cdot \left(\sqrt{x} \cdot y\right)\right)} - 1} \]
      3. *-commutative0.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{x} \cdot y\right) \cdot 3}\right)} - 1 \]
      4. *-commutative0.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(y \cdot \sqrt{x}\right)} \cdot 3\right)} - 1 \]
      5. associate-*r*0.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{y \cdot \left(\sqrt{x} \cdot 3\right)}\right)} - 1 \]
      6. *-commutative0.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(3 \cdot \sqrt{x}\right)}\right)} - 1 \]
      7. *-commutative0.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(\sqrt{x} \cdot 3\right)}\right)} - 1 \]
      8. metadata-eval0.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right)\right)} - 1 \]
      9. sqrt-prod0.2%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\sqrt{x \cdot 9}}\right)} - 1 \]
    6. Applied egg-rr0.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \sqrt{x \cdot 9}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def0.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \sqrt{x \cdot 9}\right)\right)} \]
      2. expm1-log1p72.2%

        \[\leadsto \color{blue}{y \cdot \sqrt{x \cdot 9}} \]
    8. Simplified72.2%

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

    if -1.25 < y < 3.65e-7

    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-def99.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.3%

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

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

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

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

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

    if 3.65e-7 < y

    1. Initial program 99.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25:\\ \;\;\;\;y \cdot \sqrt{x \cdot 9}\\ \mathbf{elif}\;y \leq 3.65 \cdot 10^{-7}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{else}:\\ \;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot y\\ \end{array} \]

Alternative 11: 86.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.52:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\

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


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

    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-def99.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.52000000000000002 < x

    1. Initial program 99.6%

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

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
      2. associate-*l*99.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-def99.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. Taylor expanded in x around inf 98.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.52:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(3 \cdot y - 3\right)\\ \end{array} \]

Alternative 12: 86.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.0009:\\ \;\;\;\;\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 (<= x 0.0009)
   (* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
   (* (* 3.0 (sqrt x)) (+ y -1.0))))
double code(double x, double y) {
	double tmp;
	if (x <= 0.0009) {
		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 (x <= 0.0009d0) 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 (x <= 0.0009) {
		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 x <= 0.0009:
		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 (x <= 0.0009)
		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 (x <= 0.0009)
		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[x, 0.0009], 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}\;x \leq 0.0009:\\
\;\;\;\;\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 2 regimes
  2. if x < 8.9999999999999998e-4

    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-def99.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.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.9999999999999998e-4 < x

    1. Initial program 99.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.0009:\\ \;\;\;\;\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} \]

Alternative 13: 3.3% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  8. Step-by-step derivation
    1. add-sqr-sqrt0.0%

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

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

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

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

      \[\leadsto \sqrt{x \cdot \color{blue}{9}} \]
    6. pow1/23.4%

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

    \[\leadsto \color{blue}{{\left(x \cdot 9\right)}^{0.5}} \]
  10. Step-by-step derivation
    1. unpow1/23.4%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \]
  11. Simplified3.4%

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

    \[\leadsto \sqrt{x \cdot 9} \]

Alternative 14: 25.7% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  8. Final simplification26.5%

    \[\leadsto \sqrt{x} \cdot -3 \]

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 2023268 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (* 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)))