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

Percentage Accurate: 99.7% → 99.7%
Time: 10.6s
Alternatives: 13
Speedup: 1.0×

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 13 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.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 1 + \left(\frac{-1}{x \cdot 9} - \frac{\frac{y}{3}}{\sqrt{x}}\right) \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(1.0 + Float64(Float64(-1.0 / Float64(x * 9.0)) - Float64(Float64(y / 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[(1.0 + N[(N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / 3.0), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
1 + \left(\frac{-1}{x \cdot 9} - \frac{\frac{y}{3}}{\sqrt{x}}\right)
\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. add-exp-log_binary6446.3%

      \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
  3. Applied rewrite-once46.3%

    \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
  4. Step-by-step derivation
    1. rem-exp-log99.7%

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

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

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

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

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

Alternative 2: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 1 - \left(\frac{0.1111111111111111}{x} + \frac{y}{3} \cdot {x}^{-0.5}\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (- 1.0 (+ (/ 0.1111111111111111 x) (* (/ y 3.0) (pow x -0.5)))))
double code(double x, double y) {
	return 1.0 - ((0.1111111111111111 / x) + ((y / 3.0) * pow(x, -0.5)));
}
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) * (x ** (-0.5d0))))
end function
public static double code(double x, double y) {
	return 1.0 - ((0.1111111111111111 / x) + ((y / 3.0) * Math.pow(x, -0.5)));
}
def code(x, y):
	return 1.0 - ((0.1111111111111111 / x) + ((y / 3.0) * math.pow(x, -0.5)))
function code(x, y)
	return Float64(1.0 - Float64(Float64(0.1111111111111111 / x) + Float64(Float64(y / 3.0) * (x ^ -0.5))))
end
function tmp = code(x, y)
	tmp = 1.0 - ((0.1111111111111111 / x) + ((y / 3.0) * (x ^ -0.5)));
end
code[x_, y_] := N[(1.0 - N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(N[(y / 3.0), $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
1 - \left(\frac{0.1111111111111111}{x} + \frac{y}{3} \cdot {x}^{-0.5}\right)
\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. associate--l-99.7%

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

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

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

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

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

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

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

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

      \[\leadsto 1 - \left(\frac{0.1111111111111111}{x} + \frac{1}{\color{blue}{{x}^{0.5}}} \cdot \frac{y}{3}\right) \]
    5. pow-flip99.7%

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

      \[\leadsto 1 - \left(\frac{0.1111111111111111}{x} + {x}^{\color{blue}{-0.5}} \cdot \frac{y}{3}\right) \]
    7. div-inv99.6%

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

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

    \[\leadsto 1 - \left(\frac{0.1111111111111111}{x} + \color{blue}{{x}^{-0.5} \cdot \left(y \cdot 0.3333333333333333\right)}\right) \]
  6. Step-by-step derivation
    1. metadata-eval99.6%

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

      \[\leadsto 1 - \left(\frac{0.1111111111111111}{x} + {x}^{-0.5} \cdot \color{blue}{\frac{y}{3}}\right) \]
  7. Applied egg-rr99.7%

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

\\
1 - \left(\frac{0.1111111111111111}{x} + \frac{y}{\sqrt{x}} \cdot 0.3333333333333333\right)
\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. associate--l-99.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 1 - \left(\frac{0.1111111111111111}{x} + \frac{y}{3 \cdot \sqrt{x}}\right) \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(1.0 - Float64(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[(1.0 - N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
1 - \left(\frac{0.1111111111111111}{x} + \frac{y}{3 \cdot \sqrt{x}}\right)
\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. associate--l-99.7%

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

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

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

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

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

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

Alternative 5: 99.6% accurate, 1.0× speedup?

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

\\
1 - \left(\frac{0.1111111111111111}{x} + \frac{\frac{y}{\sqrt{x}}}{3}\right)
\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. associate--l-99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 91.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.72 \cdot 10^{+100} \lor \neg \left(y \leq 1.9 \cdot 10^{+32}\right):\\
\;\;\;\;\frac{{x}^{-0.5}}{\frac{-3}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.7200000000000001e100 or 1.9000000000000002e32 < 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. add-exp-log_binary6444.6%

        \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    3. Applied rewrite-once44.6%

      \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    4. Step-by-step derivation
      1. rem-exp-log99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(-0.3333333333333333 \cdot \frac{\color{blue}{1}}{\sqrt{x}}\right) \]
      4. un-div-inv89.9%

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

      \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{\sqrt{x}}} \]
    11. Step-by-step derivation
      1. associate-*r/89.9%

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

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot -0.3333333333333333} \]
      3. metadata-eval90.0%

        \[\leadsto \frac{y}{\sqrt{x}} \cdot \color{blue}{\frac{1}{-3}} \]
      4. metadata-eval90.0%

        \[\leadsto \frac{y}{\sqrt{x}} \cdot \frac{1}{\color{blue}{-3}} \]
      5. div-inv90.2%

        \[\leadsto \color{blue}{\frac{\frac{y}{\sqrt{x}}}{-3}} \]
      6. div-inv90.1%

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\sqrt{\frac{1}{x}}}}{-3} \]
      9. *-commutative90.1%

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{x}} \cdot y}}{-3} \]
      10. associate-/l*90.1%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{x}}}{\frac{-3}{y}}} \]
      11. remove-double-neg90.1%

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

        \[\leadsto \frac{\sqrt{\frac{1}{x}}}{\color{blue}{\frac{3}{-y}}} \]
      13. inv-pow90.1%

        \[\leadsto \frac{\sqrt{\color{blue}{{x}^{-1}}}}{\frac{3}{-y}} \]
      14. metadata-eval90.1%

        \[\leadsto \frac{\sqrt{{x}^{\color{blue}{\left(-1\right)}}}}{\frac{3}{-y}} \]
      15. sqrt-pow190.2%

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{-1}{2}\right)}}}{\frac{3}{-y}} \]
      16. metadata-eval90.2%

        \[\leadsto \frac{{x}^{\left(\frac{\color{blue}{-1}}{2}\right)}}{\frac{3}{-y}} \]
      17. metadata-eval90.2%

        \[\leadsto \frac{{x}^{\color{blue}{-0.5}}}{\frac{3}{-y}} \]
      18. frac-2neg90.2%

        \[\leadsto \frac{{x}^{-0.5}}{\color{blue}{\frac{-3}{-\left(-y\right)}}} \]
      19. metadata-eval90.2%

        \[\leadsto \frac{{x}^{-0.5}}{\frac{\color{blue}{-3}}{-\left(-y\right)}} \]
      20. remove-double-neg90.2%

        \[\leadsto \frac{{x}^{-0.5}}{\frac{-3}{\color{blue}{y}}} \]
    12. Applied egg-rr90.2%

      \[\leadsto \color{blue}{\frac{{x}^{-0.5}}{\frac{-3}{y}}} \]

    if -1.7200000000000001e100 < y < 1.9000000000000002e32

    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. associate--l-99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.72 \cdot 10^{+100} \lor \neg \left(y \leq 1.9 \cdot 10^{+32}\right):\\ \;\;\;\;\frac{{x}^{-0.5}}{\frac{-3}{y}}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{0.1111111111111111}{x}\\ \end{array} \]

Alternative 7: 91.0% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.20000000000000033e103 or 1.9000000000000002e32 < 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. add-exp-log_binary6443.6%

        \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    3. Applied rewrite-once43.6%

      \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    4. Step-by-step derivation
      1. rem-exp-log99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.20000000000000033e103 < y < 1.9000000000000002e32

    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. associate--l-99.8%

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

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

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

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

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

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

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

Alternative 8: 91.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.72 \cdot 10^{+100} \lor \neg \left(y \leq 1.9 \cdot 10^{+32}\right):\\
\;\;\;\;\frac{\frac{y}{\sqrt{x}}}{-3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.7200000000000001e100 or 1.9000000000000002e32 < 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. add-exp-log_binary6444.6%

        \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    3. Applied rewrite-once44.6%

      \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    4. Step-by-step derivation
      1. rem-exp-log99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(-0.3333333333333333 \cdot \frac{\color{blue}{1}}{\sqrt{x}}\right) \]
      4. un-div-inv89.9%

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

      \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{\sqrt{x}}} \]
    11. Step-by-step derivation
      1. associate-*r/89.9%

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

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot -0.3333333333333333} \]
      3. metadata-eval90.0%

        \[\leadsto \frac{y}{\sqrt{x}} \cdot \color{blue}{\frac{1}{-3}} \]
      4. metadata-eval90.0%

        \[\leadsto \frac{y}{\sqrt{x}} \cdot \frac{1}{\color{blue}{-3}} \]
      5. div-inv90.2%

        \[\leadsto \color{blue}{\frac{\frac{y}{\sqrt{x}}}{-3}} \]
      6. metadata-eval90.2%

        \[\leadsto \frac{\frac{y}{\sqrt{x}}}{\color{blue}{-3}} \]
    12. Applied egg-rr90.2%

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

    if -1.7200000000000001e100 < y < 1.9000000000000002e32

    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. associate--l-99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.72 \cdot 10^{+100} \lor \neg \left(y \leq 1.9 \cdot 10^{+32}\right):\\ \;\;\;\;\frac{\frac{y}{\sqrt{x}}}{-3}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{0.1111111111111111}{x}\\ \end{array} \]

Alternative 9: 90.9% accurate, 1.0× speedup?

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

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

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

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


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

    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. add-exp-log_binary6493.1%

        \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    3. Applied rewrite-once93.1%

      \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    4. Step-by-step derivation
      1. rem-exp-log99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.70000000000000001e109 < y < 1.9000000000000002e32

    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. associate--l-99.8%

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

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

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

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

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

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

    if 1.9000000000000002e32 < y

    1. Initial program 99.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x}}} \cdot -0.3333333333333333 \]
      5. remove-double-neg85.7%

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

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

        \[\leadsto \left(0 - \left(-\color{blue}{\frac{-y}{-\sqrt{x}}}\right)\right) \cdot -0.3333333333333333 \]
      8. distribute-frac-neg85.7%

        \[\leadsto \left(0 - \left(-\color{blue}{\left(-\frac{y}{-\sqrt{x}}\right)}\right)\right) \cdot -0.3333333333333333 \]
      9. remove-double-neg85.7%

        \[\leadsto \left(0 - \color{blue}{\frac{y}{-\sqrt{x}}}\right) \cdot -0.3333333333333333 \]
    6. Applied egg-rr85.7%

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

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

        \[\leadsto \color{blue}{\frac{-y}{-\sqrt{x}}} \cdot -0.3333333333333333 \]
      3. neg-mul-185.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot y}}{-\sqrt{x}} \cdot -0.3333333333333333 \]
      4. neg-mul-185.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+109}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+32}:\\ \;\;\;\;1 - \frac{0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\sqrt{x}} \cdot -0.3333333333333333\\ \end{array} \]

Alternative 10: 91.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.72 \cdot 10^{+100}:\\
\;\;\;\;\frac{y}{\sqrt{x} \cdot -3}\\

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

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


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

    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. add-exp-log_binary6493.2%

        \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    3. Applied rewrite-once93.2%

      \[\leadsto \color{blue}{e^{\log \left(\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\right)}} \]
    4. Step-by-step derivation
      1. rem-exp-log99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{\sqrt{x}}} \]
    11. Step-by-step derivation
      1. associate-*r/95.5%

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

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x}} \cdot -0.3333333333333333} \]
      3. metadata-eval95.5%

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

        \[\leadsto \frac{y}{\sqrt{x}} \cdot \left(-\color{blue}{0.1111111111111111 \cdot 3}\right) \]
      5. distribute-rgt-neg-in95.5%

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

        \[\leadsto -\frac{y}{\sqrt{x}} \cdot \color{blue}{0.3333333333333333} \]
      7. metadata-eval95.5%

        \[\leadsto -\frac{y}{\sqrt{x}} \cdot \color{blue}{\frac{1}{3}} \]
      8. div-inv95.8%

        \[\leadsto -\color{blue}{\frac{\frac{y}{\sqrt{x}}}{3}} \]
      9. neg-sub095.8%

        \[\leadsto \color{blue}{0 - \frac{\frac{y}{\sqrt{x}}}{3}} \]
      10. associate-/l/95.8%

        \[\leadsto 0 - \color{blue}{\frac{y}{3 \cdot \sqrt{x}}} \]
      11. div-inv95.6%

        \[\leadsto 0 - \color{blue}{y \cdot \frac{1}{3 \cdot \sqrt{x}}} \]
      12. associate-/r*95.6%

        \[\leadsto 0 - y \cdot \color{blue}{\frac{\frac{1}{3}}{\sqrt{x}}} \]
      13. metadata-eval95.6%

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

      \[\leadsto \color{blue}{0 - y \cdot \frac{0.3333333333333333}{\sqrt{x}}} \]
    13. Step-by-step derivation
      1. sub0-neg95.6%

        \[\leadsto \color{blue}{-y \cdot \frac{0.3333333333333333}{\sqrt{x}}} \]
      2. neg-mul-195.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{-1}{0.3333333333333333}}}}{\sqrt{x}} \]
      10. metadata-eval95.9%

        \[\leadsto \frac{\frac{y}{\color{blue}{-3}}}{\sqrt{x}} \]
      11. associate-/l/95.8%

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x} \cdot -3}} \]
    14. Simplified95.8%

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

    if -1.7200000000000001e100 < y < 1.9000000000000002e32

    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. associate--l-99.8%

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

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

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

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

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

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

    if 1.9000000000000002e32 < y

    1. Initial program 99.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\sqrt{x}}} \cdot -0.3333333333333333 \]
      5. remove-double-neg85.7%

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

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

        \[\leadsto \left(0 - \left(-\color{blue}{\frac{-y}{-\sqrt{x}}}\right)\right) \cdot -0.3333333333333333 \]
      8. distribute-frac-neg85.7%

        \[\leadsto \left(0 - \left(-\color{blue}{\left(-\frac{y}{-\sqrt{x}}\right)}\right)\right) \cdot -0.3333333333333333 \]
      9. remove-double-neg85.7%

        \[\leadsto \left(0 - \color{blue}{\frac{y}{-\sqrt{x}}}\right) \cdot -0.3333333333333333 \]
    6. Applied egg-rr85.7%

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

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

        \[\leadsto \color{blue}{\frac{-y}{-\sqrt{x}}} \cdot -0.3333333333333333 \]
      3. neg-mul-185.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot y}}{-\sqrt{x}} \cdot -0.3333333333333333 \]
      4. neg-mul-185.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.72 \cdot 10^{+100}:\\ \;\;\;\;\frac{y}{\sqrt{x} \cdot -3}\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+32}:\\ \;\;\;\;1 - \frac{0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\sqrt{x}} \cdot -0.3333333333333333\\ \end{array} \]

Alternative 11: 59.1% accurate, 22.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+26}:\\ \;\;\;\;\frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 5e+26) (/ -0.1111111111111111 x) 1.0))
double code(double x, double y) {
	double tmp;
	if (x <= 5e+26) {
		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 <= 5d+26) 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 <= 5e+26) {
		tmp = -0.1111111111111111 / x;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 5e+26:
		tmp = -0.1111111111111111 / x
	else:
		tmp = 1.0
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 5e+26)
		tmp = Float64(-0.1111111111111111 / x);
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 5e+26)
		tmp = -0.1111111111111111 / x;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 5e+26], N[(-0.1111111111111111 / x), $MachinePrecision], 1.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+26}:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\

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


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

    1. Initial program 99.7%

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

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

    if 5.0000000000000001e26 < x

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+26}:\\ \;\;\;\;\frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 12: 61.8% 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. associate--l-99.7%

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

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

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

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

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

    \[\leadsto 1 - \color{blue}{\frac{0.1111111111111111}{x}} \]
  5. Final simplification61.1%

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

Alternative 13: 31.6% 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. Taylor expanded in x around inf 29.8%

    \[\leadsto \color{blue}{1} \]
  3. Final simplification29.8%

    \[\leadsto 1 \]

Developer target: 99.7% 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 2023297 
(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)))))