Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D

Percentage Accurate: 99.7% → 99.6%
Time: 11.2s
Alternatives: 8
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 8 alternatives:

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

Initial Program: 99.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+76} \lor \neg \left(y \leq 6 \cdot 10^{+112}\right):\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -9.5e+76) (not (<= y 6e+112)))
   (* -0.3333333333333333 (/ y (sqrt x)))
   (+ 1.0 (/ -0.1111111111111111 x))))
double code(double x, double y) {
	double tmp;
	if ((y <= -9.5e+76) || !(y <= 6e+112)) {
		tmp = -0.3333333333333333 * (y / sqrt(x));
	} else {
		tmp = 1.0 + (-0.1111111111111111 / x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= (-9.5d+76)) .or. (.not. (y <= 6d+112))) then
        tmp = (-0.3333333333333333d0) * (y / sqrt(x))
    else
        tmp = 1.0d0 + ((-0.1111111111111111d0) / x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -9.5e+76) || !(y <= 6e+112)) {
		tmp = -0.3333333333333333 * (y / Math.sqrt(x));
	} else {
		tmp = 1.0 + (-0.1111111111111111 / x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -9.5e+76) or not (y <= 6e+112):
		tmp = -0.3333333333333333 * (y / math.sqrt(x))
	else:
		tmp = 1.0 + (-0.1111111111111111 / x)
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -9.5e+76) || !(y <= 6e+112))
		tmp = Float64(-0.3333333333333333 * Float64(y / sqrt(x)));
	else
		tmp = Float64(1.0 + Float64(-0.1111111111111111 / x));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -9.5e+76) || ~((y <= 6e+112)))
		tmp = -0.3333333333333333 * (y / sqrt(x));
	else
		tmp = 1.0 + (-0.1111111111111111 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -9.5e+76], N[Not[LessEqual[y, 6e+112]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+76} \lor \neg \left(y \leq 6 \cdot 10^{+112}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\

\mathbf{else}:\\
\;\;\;\;1 + \frac{-0.1111111111111111}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.5000000000000003e76 or 5.99999999999999958e112 < y

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(y \cdot -0.3333333333333333\right)}{\sqrt{x}}} \]
      4. *-un-lft-identity96.8%

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{\sqrt{x}} \]
      5. add-sqr-sqrt56.6%

        \[\leadsto \frac{\color{blue}{\sqrt{y \cdot -0.3333333333333333} \cdot \sqrt{y \cdot -0.3333333333333333}}}{\sqrt{x}} \]
      6. sqrt-unprod28.1%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(-0.3333333333333333 \cdot -0.3333333333333333\right)}}}{\sqrt{x}} \]
      8. metadata-eval28.1%

        \[\leadsto \frac{\sqrt{\left(y \cdot y\right) \cdot \color{blue}{0.1111111111111111}}}{\sqrt{x}} \]
      9. metadata-eval28.1%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot 0.3333333333333333\right) \cdot \left(y \cdot 0.3333333333333333\right)}}}{\sqrt{x}} \]
      11. *-commutative28.1%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(0.3333333333333333 \cdot y\right)} \cdot \left(y \cdot 0.3333333333333333\right)}}{\sqrt{x}} \]
      12. *-commutative28.1%

        \[\leadsto \frac{\sqrt{\left(0.3333333333333333 \cdot y\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot y\right)}}}{\sqrt{x}} \]
      13. sqrt-unprod0.2%

        \[\leadsto \frac{\color{blue}{\sqrt{0.3333333333333333 \cdot y} \cdot \sqrt{0.3333333333333333 \cdot y}}}{\sqrt{x}} \]
      14. add-sqr-sqrt0.6%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot y}}{\sqrt{x}} \]
      15. frac-2neg0.6%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{-\sqrt{x}}} \]
    8. Applied egg-rr96.8%

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot y}{-\sqrt{x}}} \]
    9. Step-by-step derivation
      1. *-commutative96.8%

        \[\leadsto \frac{\color{blue}{y \cdot 0.3333333333333333}}{-\sqrt{x}} \]
      2. associate-/l*96.7%

        \[\leadsto \color{blue}{\frac{y}{\frac{-\sqrt{x}}{0.3333333333333333}}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{-\sqrt{x}} \cdot \sqrt{-\sqrt{x}}}}{0.3333333333333333}} \]
      4. sqrt-unprod0.6%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{\left(-\sqrt{x}\right) \cdot \left(-\sqrt{x}\right)}}}{0.3333333333333333}} \]
      5. sqr-neg0.6%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{0.3333333333333333}} \]
      6. add-sqr-sqrt0.6%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{x}}}{0.3333333333333333}} \]
      7. frac-2neg0.6%

        \[\leadsto \frac{y}{\color{blue}{\frac{-\sqrt{x}}{-0.3333333333333333}}} \]
      8. add-sqr-sqrt0.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{-\sqrt{x}} \cdot \sqrt{-\sqrt{x}}}}{-0.3333333333333333}} \]
      9. sqrt-unprod96.7%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{\left(-\sqrt{x}\right) \cdot \left(-\sqrt{x}\right)}}}{-0.3333333333333333}} \]
      10. sqr-neg96.7%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{-0.3333333333333333}} \]
      11. add-sqr-sqrt96.7%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{x}}}{-0.3333333333333333}} \]
      12. associate-/r/96.8%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot \left(-0.3333333333333333\right)} \]
      13. metadata-eval96.8%

        \[\leadsto \frac{y}{\sqrt{x}} \cdot \color{blue}{-0.3333333333333333} \]
    10. Applied egg-rr96.8%

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

    if -9.5000000000000003e76 < y < 5.99999999999999958e112

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 - 0.1111111111111111 \cdot \frac{1}{x}} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv90.7%

        \[\leadsto \color{blue}{1 + \left(-0.1111111111111111\right) \cdot \frac{1}{x}} \]
      2. metadata-eval90.7%

        \[\leadsto 1 + \color{blue}{-0.1111111111111111} \cdot \frac{1}{x} \]
      3. associate-*r/90.7%

        \[\leadsto 1 + \color{blue}{\frac{-0.1111111111111111 \cdot 1}{x}} \]
      4. metadata-eval90.7%

        \[\leadsto 1 + \frac{\color{blue}{-0.1111111111111111}}{x} \]
    6. Simplified90.7%

      \[\leadsto \color{blue}{1 + \frac{-0.1111111111111111}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+76} \lor \neg \left(y \leq 6 \cdot 10^{+112}\right):\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \end{array} \]

Alternative 3: 91.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+76}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}\\

\mathbf{elif}\;y \leq 6 \cdot 10^{+112}:\\
\;\;\;\;1 + \frac{-0.1111111111111111}{x}\\

\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{x}} \cdot y\right) \cdot -0.3333333333333333} \]
      2. *-commutative96.5%

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

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{\frac{1}{\sqrt{\frac{1}{x}} \cdot y}}} \]
      5. sqrt-div96.5%

        \[\leadsto \frac{-0.3333333333333333}{\frac{1}{\color{blue}{\frac{\sqrt{1}}{\sqrt{x}}} \cdot y}} \]
      6. metadata-eval96.5%

        \[\leadsto \frac{-0.3333333333333333}{\frac{1}{\frac{\color{blue}{1}}{\sqrt{x}} \cdot y}} \]
      7. associate-*l/96.7%

        \[\leadsto \frac{-0.3333333333333333}{\frac{1}{\color{blue}{\frac{1 \cdot y}{\sqrt{x}}}}} \]
      8. *-un-lft-identity96.7%

        \[\leadsto \frac{-0.3333333333333333}{\frac{1}{\frac{\color{blue}{y}}{\sqrt{x}}}} \]
      9. clear-num96.7%

        \[\leadsto \frac{-0.3333333333333333}{\color{blue}{\frac{\sqrt{x}}{y}}} \]
    8. Applied egg-rr96.7%

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

    if -3.3000000000000001e76 < y < 5.99999999999999958e112

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 - 0.1111111111111111 \cdot \frac{1}{x}} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv90.7%

        \[\leadsto \color{blue}{1 + \left(-0.1111111111111111\right) \cdot \frac{1}{x}} \]
      2. metadata-eval90.7%

        \[\leadsto 1 + \color{blue}{-0.1111111111111111} \cdot \frac{1}{x} \]
      3. associate-*r/90.7%

        \[\leadsto 1 + \color{blue}{\frac{-0.1111111111111111 \cdot 1}{x}} \]
      4. metadata-eval90.7%

        \[\leadsto 1 + \frac{\color{blue}{-0.1111111111111111}}{x} \]
    6. Simplified90.7%

      \[\leadsto \color{blue}{1 + \frac{-0.1111111111111111}{x}} \]

    if 5.99999999999999958e112 < y

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} \cdot \left(y \cdot -0.3333333333333333\right)} \]
    7. Step-by-step derivation
      1. sqrt-div97.0%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(y \cdot -0.3333333333333333\right)}{\sqrt{x}}} \]
      4. *-un-lft-identity97.0%

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{\sqrt{x}} \]
      5. add-sqr-sqrt0.0%

        \[\leadsto \frac{\color{blue}{\sqrt{y \cdot -0.3333333333333333} \cdot \sqrt{y \cdot -0.3333333333333333}}}{\sqrt{x}} \]
      6. sqrt-unprod0.5%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(-0.3333333333333333 \cdot -0.3333333333333333\right)}}}{\sqrt{x}} \]
      8. metadata-eval0.5%

        \[\leadsto \frac{\sqrt{\left(y \cdot y\right) \cdot \color{blue}{0.1111111111111111}}}{\sqrt{x}} \]
      9. metadata-eval0.5%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot 0.3333333333333333\right) \cdot \left(y \cdot 0.3333333333333333\right)}}}{\sqrt{x}} \]
      11. *-commutative0.5%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(0.3333333333333333 \cdot y\right)} \cdot \left(y \cdot 0.3333333333333333\right)}}{\sqrt{x}} \]
      12. *-commutative0.5%

        \[\leadsto \frac{\sqrt{\left(0.3333333333333333 \cdot y\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot y\right)}}}{\sqrt{x}} \]
      13. sqrt-unprod0.6%

        \[\leadsto \frac{\color{blue}{\sqrt{0.3333333333333333 \cdot y} \cdot \sqrt{0.3333333333333333 \cdot y}}}{\sqrt{x}} \]
      14. add-sqr-sqrt0.6%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot y}}{\sqrt{x}} \]
      15. frac-2neg0.6%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{-\sqrt{x}}} \]
    8. Applied egg-rr97.0%

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot y}{-\sqrt{x}}} \]
    9. Step-by-step derivation
      1. *-commutative97.0%

        \[\leadsto \frac{\color{blue}{y \cdot 0.3333333333333333}}{-\sqrt{x}} \]
      2. associate-/l*96.8%

        \[\leadsto \color{blue}{\frac{y}{\frac{-\sqrt{x}}{0.3333333333333333}}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{-\sqrt{x}} \cdot \sqrt{-\sqrt{x}}}}{0.3333333333333333}} \]
      4. sqrt-unprod0.6%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{\left(-\sqrt{x}\right) \cdot \left(-\sqrt{x}\right)}}}{0.3333333333333333}} \]
      5. sqr-neg0.6%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{0.3333333333333333}} \]
      6. add-sqr-sqrt0.6%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{x}}}{0.3333333333333333}} \]
      7. frac-2neg0.6%

        \[\leadsto \frac{y}{\color{blue}{\frac{-\sqrt{x}}{-0.3333333333333333}}} \]
      8. add-sqr-sqrt0.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{-\sqrt{x}} \cdot \sqrt{-\sqrt{x}}}}{-0.3333333333333333}} \]
      9. sqrt-unprod96.8%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{\left(-\sqrt{x}\right) \cdot \left(-\sqrt{x}\right)}}}{-0.3333333333333333}} \]
      10. sqr-neg96.8%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{-0.3333333333333333}} \]
      11. add-sqr-sqrt96.8%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{x}}}{-0.3333333333333333}} \]
      12. associate-/r/97.1%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot \left(-0.3333333333333333\right)} \]
      13. metadata-eval97.1%

        \[\leadsto \frac{y}{\sqrt{x}} \cdot \color{blue}{-0.3333333333333333} \]
    10. Applied egg-rr97.1%

      \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot -0.3333333333333333} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{+76}:\\ \;\;\;\;\frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+112}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\ \end{array} \]

Alternative 4: 91.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.72 \cdot 10^{+87}:\\
\;\;\;\;y \cdot \left(-0.3333333333333333 \cdot {x}^{-0.5}\right)\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+112}:\\
\;\;\;\;1 + \frac{-0.1111111111111111}{x}\\

\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} \cdot \left(y \cdot -0.3333333333333333\right)} \]
    7. Step-by-step derivation
      1. sqrt-div96.4%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(y \cdot -0.3333333333333333\right)}{\sqrt{x}}} \]
      4. *-un-lft-identity96.6%

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{\sqrt{x}} \]
      5. add-sqr-sqrt96.3%

        \[\leadsto \frac{\color{blue}{\sqrt{y \cdot -0.3333333333333333} \cdot \sqrt{y \cdot -0.3333333333333333}}}{\sqrt{x}} \]
      6. sqrt-unprod47.4%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(-0.3333333333333333 \cdot -0.3333333333333333\right)}}}{\sqrt{x}} \]
      8. metadata-eval47.5%

        \[\leadsto \frac{\sqrt{\left(y \cdot y\right) \cdot \color{blue}{0.1111111111111111}}}{\sqrt{x}} \]
      9. metadata-eval47.5%

        \[\leadsto \frac{\sqrt{\left(y \cdot y\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot 0.3333333333333333\right)}}}{\sqrt{x}} \]
      10. swap-sqr47.4%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot 0.3333333333333333\right) \cdot \left(y \cdot 0.3333333333333333\right)}}}{\sqrt{x}} \]
      11. *-commutative47.4%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(0.3333333333333333 \cdot y\right)} \cdot \left(y \cdot 0.3333333333333333\right)}}{\sqrt{x}} \]
      12. *-commutative47.4%

        \[\leadsto \frac{\sqrt{\left(0.3333333333333333 \cdot y\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot y\right)}}}{\sqrt{x}} \]
      13. sqrt-unprod0.0%

        \[\leadsto \frac{\color{blue}{\sqrt{0.3333333333333333 \cdot y} \cdot \sqrt{0.3333333333333333 \cdot y}}}{\sqrt{x}} \]
      14. add-sqr-sqrt0.6%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot y}}{\sqrt{x}} \]
      15. frac-2neg0.6%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{-\sqrt{x}}} \]
    8. Applied egg-rr96.6%

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{-\left(-\sqrt{x}\right)}} \]
      2. remove-double-neg96.6%

        \[\leadsto \frac{-0.3333333333333333 \cdot y}{\color{blue}{\sqrt{x}}} \]
      3. clear-num96.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{x}}{-0.3333333333333333 \cdot y}}} \]
      4. associate-/r/96.4%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{x}} \cdot \left(-0.3333333333333333 \cdot y\right)} \]
      5. pow1/296.4%

        \[\leadsto \frac{1}{\color{blue}{{x}^{0.5}}} \cdot \left(-0.3333333333333333 \cdot y\right) \]
      6. pow-flip96.6%

        \[\leadsto \color{blue}{{x}^{\left(-0.5\right)}} \cdot \left(-0.3333333333333333 \cdot y\right) \]
      7. metadata-eval96.6%

        \[\leadsto {x}^{\color{blue}{-0.5}} \cdot \left(-0.3333333333333333 \cdot y\right) \]
      8. *-commutative96.6%

        \[\leadsto {x}^{-0.5} \cdot \left(-\color{blue}{y \cdot 0.3333333333333333}\right) \]
      9. distribute-rgt-neg-in96.6%

        \[\leadsto {x}^{-0.5} \cdot \color{blue}{\left(y \cdot \left(-0.3333333333333333\right)\right)} \]
      10. metadata-eval96.6%

        \[\leadsto {x}^{-0.5} \cdot \left(y \cdot \color{blue}{-0.3333333333333333}\right) \]
    10. Applied egg-rr96.6%

      \[\leadsto \color{blue}{{x}^{-0.5} \cdot \left(y \cdot -0.3333333333333333\right)} \]
    11. Step-by-step derivation
      1. *-commutative96.6%

        \[\leadsto \color{blue}{\left(y \cdot -0.3333333333333333\right) \cdot {x}^{-0.5}} \]
      2. associate-*l*96.8%

        \[\leadsto \color{blue}{y \cdot \left(-0.3333333333333333 \cdot {x}^{-0.5}\right)} \]
    12. Simplified96.8%

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

    if -1.72000000000000008e87 < y < 7.5e112

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 - 0.1111111111111111 \cdot \frac{1}{x}} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv90.7%

        \[\leadsto \color{blue}{1 + \left(-0.1111111111111111\right) \cdot \frac{1}{x}} \]
      2. metadata-eval90.7%

        \[\leadsto 1 + \color{blue}{-0.1111111111111111} \cdot \frac{1}{x} \]
      3. associate-*r/90.7%

        \[\leadsto 1 + \color{blue}{\frac{-0.1111111111111111 \cdot 1}{x}} \]
      4. metadata-eval90.7%

        \[\leadsto 1 + \frac{\color{blue}{-0.1111111111111111}}{x} \]
    6. Simplified90.7%

      \[\leadsto \color{blue}{1 + \frac{-0.1111111111111111}{x}} \]

    if 7.5e112 < y

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} \cdot \left(y \cdot -0.3333333333333333\right)} \]
    7. Step-by-step derivation
      1. sqrt-div97.0%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(y \cdot -0.3333333333333333\right)}{\sqrt{x}}} \]
      4. *-un-lft-identity97.0%

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{\sqrt{x}} \]
      5. add-sqr-sqrt0.0%

        \[\leadsto \frac{\color{blue}{\sqrt{y \cdot -0.3333333333333333} \cdot \sqrt{y \cdot -0.3333333333333333}}}{\sqrt{x}} \]
      6. sqrt-unprod0.5%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(-0.3333333333333333 \cdot -0.3333333333333333\right)}}}{\sqrt{x}} \]
      8. metadata-eval0.5%

        \[\leadsto \frac{\sqrt{\left(y \cdot y\right) \cdot \color{blue}{0.1111111111111111}}}{\sqrt{x}} \]
      9. metadata-eval0.5%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot 0.3333333333333333\right) \cdot \left(y \cdot 0.3333333333333333\right)}}}{\sqrt{x}} \]
      11. *-commutative0.5%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(0.3333333333333333 \cdot y\right)} \cdot \left(y \cdot 0.3333333333333333\right)}}{\sqrt{x}} \]
      12. *-commutative0.5%

        \[\leadsto \frac{\sqrt{\left(0.3333333333333333 \cdot y\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot y\right)}}}{\sqrt{x}} \]
      13. sqrt-unprod0.6%

        \[\leadsto \frac{\color{blue}{\sqrt{0.3333333333333333 \cdot y} \cdot \sqrt{0.3333333333333333 \cdot y}}}{\sqrt{x}} \]
      14. add-sqr-sqrt0.6%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot y}}{\sqrt{x}} \]
      15. frac-2neg0.6%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{-\sqrt{x}}} \]
    8. Applied egg-rr97.0%

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot y}{-\sqrt{x}}} \]
    9. Step-by-step derivation
      1. *-commutative97.0%

        \[\leadsto \frac{\color{blue}{y \cdot 0.3333333333333333}}{-\sqrt{x}} \]
      2. associate-/l*96.8%

        \[\leadsto \color{blue}{\frac{y}{\frac{-\sqrt{x}}{0.3333333333333333}}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{-\sqrt{x}} \cdot \sqrt{-\sqrt{x}}}}{0.3333333333333333}} \]
      4. sqrt-unprod0.6%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{\left(-\sqrt{x}\right) \cdot \left(-\sqrt{x}\right)}}}{0.3333333333333333}} \]
      5. sqr-neg0.6%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{0.3333333333333333}} \]
      6. add-sqr-sqrt0.6%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{x}}}{0.3333333333333333}} \]
      7. frac-2neg0.6%

        \[\leadsto \frac{y}{\color{blue}{\frac{-\sqrt{x}}{-0.3333333333333333}}} \]
      8. add-sqr-sqrt0.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{-\sqrt{x}} \cdot \sqrt{-\sqrt{x}}}}{-0.3333333333333333}} \]
      9. sqrt-unprod96.8%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{\left(-\sqrt{x}\right) \cdot \left(-\sqrt{x}\right)}}}{-0.3333333333333333}} \]
      10. sqr-neg96.8%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{-0.3333333333333333}} \]
      11. add-sqr-sqrt96.8%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{x}}}{-0.3333333333333333}} \]
      12. associate-/r/97.1%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot \left(-0.3333333333333333\right)} \]
      13. metadata-eval97.1%

        \[\leadsto \frac{y}{\sqrt{x}} \cdot \color{blue}{-0.3333333333333333} \]
    10. Applied egg-rr97.1%

      \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot -0.3333333333333333} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.72 \cdot 10^{+87}:\\ \;\;\;\;y \cdot \left(-0.3333333333333333 \cdot {x}^{-0.5}\right)\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+112}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\ \end{array} \]

Alternative 5: 91.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+85}:\\
\;\;\;\;y \cdot \left(-0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\right)\\

\mathbf{elif}\;y \leq 6 \cdot 10^{+112}:\\
\;\;\;\;1 + \frac{-0.1111111111111111}{x}\\

\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(1 - \frac{0.1111111111111111}{x}\right) - \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{y}{3 \cdot \sqrt{x}}\right)} - 1\right)} \]
      3. div-inv0.0%

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

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

        \[\leadsto \left(1 - \frac{0.1111111111111111}{x}\right) - \left(e^{\mathsf{log1p}\left(y \cdot \frac{\color{blue}{0.3333333333333333}}{\sqrt{x}}\right)} - 1\right) \]
    5. Applied egg-rr0.0%

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

        \[\leadsto \left(1 - \frac{0.1111111111111111}{x}\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \frac{0.3333333333333333}{\sqrt{x}}\right)\right)} \]
      2. expm1-log1p99.4%

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

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

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

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

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

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

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

    if -1.7000000000000002e85 < y < 5.99999999999999958e112

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 - 0.1111111111111111 \cdot \frac{1}{x}} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv90.7%

        \[\leadsto \color{blue}{1 + \left(-0.1111111111111111\right) \cdot \frac{1}{x}} \]
      2. metadata-eval90.7%

        \[\leadsto 1 + \color{blue}{-0.1111111111111111} \cdot \frac{1}{x} \]
      3. associate-*r/90.7%

        \[\leadsto 1 + \color{blue}{\frac{-0.1111111111111111 \cdot 1}{x}} \]
      4. metadata-eval90.7%

        \[\leadsto 1 + \frac{\color{blue}{-0.1111111111111111}}{x} \]
    6. Simplified90.7%

      \[\leadsto \color{blue}{1 + \frac{-0.1111111111111111}{x}} \]

    if 5.99999999999999958e112 < y

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{x}} \cdot \left(y \cdot -0.3333333333333333\right)} \]
    7. Step-by-step derivation
      1. sqrt-div97.0%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(y \cdot -0.3333333333333333\right)}{\sqrt{x}}} \]
      4. *-un-lft-identity97.0%

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{\sqrt{x}} \]
      5. add-sqr-sqrt0.0%

        \[\leadsto \frac{\color{blue}{\sqrt{y \cdot -0.3333333333333333} \cdot \sqrt{y \cdot -0.3333333333333333}}}{\sqrt{x}} \]
      6. sqrt-unprod0.5%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot y\right) \cdot \left(-0.3333333333333333 \cdot -0.3333333333333333\right)}}}{\sqrt{x}} \]
      8. metadata-eval0.5%

        \[\leadsto \frac{\sqrt{\left(y \cdot y\right) \cdot \color{blue}{0.1111111111111111}}}{\sqrt{x}} \]
      9. metadata-eval0.5%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(y \cdot 0.3333333333333333\right) \cdot \left(y \cdot 0.3333333333333333\right)}}}{\sqrt{x}} \]
      11. *-commutative0.5%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(0.3333333333333333 \cdot y\right)} \cdot \left(y \cdot 0.3333333333333333\right)}}{\sqrt{x}} \]
      12. *-commutative0.5%

        \[\leadsto \frac{\sqrt{\left(0.3333333333333333 \cdot y\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot y\right)}}}{\sqrt{x}} \]
      13. sqrt-unprod0.6%

        \[\leadsto \frac{\color{blue}{\sqrt{0.3333333333333333 \cdot y} \cdot \sqrt{0.3333333333333333 \cdot y}}}{\sqrt{x}} \]
      14. add-sqr-sqrt0.6%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot y}}{\sqrt{x}} \]
      15. frac-2neg0.6%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{-\sqrt{x}}} \]
    8. Applied egg-rr97.0%

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot y}{-\sqrt{x}}} \]
    9. Step-by-step derivation
      1. *-commutative97.0%

        \[\leadsto \frac{\color{blue}{y \cdot 0.3333333333333333}}{-\sqrt{x}} \]
      2. associate-/l*96.8%

        \[\leadsto \color{blue}{\frac{y}{\frac{-\sqrt{x}}{0.3333333333333333}}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{-\sqrt{x}} \cdot \sqrt{-\sqrt{x}}}}{0.3333333333333333}} \]
      4. sqrt-unprod0.6%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{\left(-\sqrt{x}\right) \cdot \left(-\sqrt{x}\right)}}}{0.3333333333333333}} \]
      5. sqr-neg0.6%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{0.3333333333333333}} \]
      6. add-sqr-sqrt0.6%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{x}}}{0.3333333333333333}} \]
      7. frac-2neg0.6%

        \[\leadsto \frac{y}{\color{blue}{\frac{-\sqrt{x}}{-0.3333333333333333}}} \]
      8. add-sqr-sqrt0.0%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{-\sqrt{x}} \cdot \sqrt{-\sqrt{x}}}}{-0.3333333333333333}} \]
      9. sqrt-unprod96.8%

        \[\leadsto \frac{y}{\frac{\color{blue}{\sqrt{\left(-\sqrt{x}\right) \cdot \left(-\sqrt{x}\right)}}}{-0.3333333333333333}} \]
      10. sqr-neg96.8%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{-0.3333333333333333}} \]
      11. add-sqr-sqrt96.8%

        \[\leadsto \frac{y}{\frac{\sqrt{\color{blue}{x}}}{-0.3333333333333333}} \]
      12. associate-/r/97.1%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot \left(-0.3333333333333333\right)} \]
      13. metadata-eval97.1%

        \[\leadsto \frac{y}{\sqrt{x}} \cdot \color{blue}{-0.3333333333333333} \]
    10. Applied egg-rr97.1%

      \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot -0.3333333333333333} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+85}:\\ \;\;\;\;y \cdot \left(-0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\right)\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+112}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\ \end{array} \]

Alternative 6: 62.1% accurate, 22.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.9:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\

\mathbf{else}:\\
\;\;\;\;1\\


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.89999999999999991 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.9:\\ \;\;\;\;\frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 7: 63.1% accurate, 22.6× speedup?

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

\\
1 + \frac{-0.1111111111111111}{x}
\end{array}
Derivation
  1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1 - 0.1111111111111111 \cdot \frac{1}{x}} \]
  5. Step-by-step derivation
    1. cancel-sign-sub-inv58.3%

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

      \[\leadsto 1 + \color{blue}{-0.1111111111111111} \cdot \frac{1}{x} \]
    3. associate-*r/58.3%

      \[\leadsto 1 + \color{blue}{\frac{-0.1111111111111111 \cdot 1}{x}} \]
    4. metadata-eval58.3%

      \[\leadsto 1 + \frac{\color{blue}{-0.1111111111111111}}{x} \]
  6. Simplified58.3%

    \[\leadsto \color{blue}{1 + \frac{-0.1111111111111111}{x}} \]
  7. Final simplification58.3%

    \[\leadsto 1 + \frac{-0.1111111111111111}{x} \]

Alternative 8: 31.3% accurate, 113.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
	return 1.0;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0
end function
public static double code(double x, double y) {
	return 1.0;
}
def code(x, y):
	return 1.0
function code(x, y)
	return 1.0
end
function tmp = code(x, y)
	tmp = 1.0;
end
code[x_, y_] := 1.0
\begin{array}{l}

\\
1
\end{array}
Derivation
  1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  5. Final simplification31.9%

    \[\leadsto 1 \]

Developer target: 99.6% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023301 
(FPCore (x y)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
  :precision binary64

  :herbie-target
  (- (- 1.0 (/ (/ 1.0 x) 9.0)) (/ y (* 3.0 (sqrt x))))

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