Octave 3.8, jcobi/4

Percentage Accurate: 16.0% → 85.6%
Time: 14.1s
Alternatives: 7
Speedup: 115.0×

Specification

?
\[\left(\alpha > -1 \land \beta > -1\right) \land i > 1\]
\[\begin{array}{l} \\ \begin{array}{l} t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\ t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\ t_2 := t\_1 \cdot t\_1\\ \frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1} \end{array} \end{array} \]
(FPCore (alpha beta i)
 :precision binary64
 (let* ((t_0 (* i (+ (+ alpha beta) i)))
        (t_1 (+ (+ alpha beta) (* 2.0 i)))
        (t_2 (* t_1 t_1)))
   (/ (/ (* t_0 (+ (* beta alpha) t_0)) t_2) (- t_2 1.0))))
double code(double alpha, double beta, double i) {
	double t_0 = i * ((alpha + beta) + i);
	double t_1 = (alpha + beta) + (2.0 * i);
	double t_2 = t_1 * t_1;
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
real(8) function code(alpha, beta, i)
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    t_0 = i * ((alpha + beta) + i)
    t_1 = (alpha + beta) + (2.0d0 * i)
    t_2 = t_1 * t_1
    code = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0d0)
end function
public static double code(double alpha, double beta, double i) {
	double t_0 = i * ((alpha + beta) + i);
	double t_1 = (alpha + beta) + (2.0 * i);
	double t_2 = t_1 * t_1;
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
def code(alpha, beta, i):
	t_0 = i * ((alpha + beta) + i)
	t_1 = (alpha + beta) + (2.0 * i)
	t_2 = t_1 * t_1
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0)
function code(alpha, beta, i)
	t_0 = Float64(i * Float64(Float64(alpha + beta) + i))
	t_1 = Float64(Float64(alpha + beta) + Float64(2.0 * i))
	t_2 = Float64(t_1 * t_1)
	return Float64(Float64(Float64(t_0 * Float64(Float64(beta * alpha) + t_0)) / t_2) / Float64(t_2 - 1.0))
end
function tmp = code(alpha, beta, i)
	t_0 = i * ((alpha + beta) + i);
	t_1 = (alpha + beta) + (2.0 * i);
	t_2 = t_1 * t_1;
	tmp = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(i * N[(N[(alpha + beta), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, N[(N[(N[(t$95$0 * N[(N[(beta * alpha), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(t$95$2 - 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\
t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\
t_2 := t\_1 \cdot t\_1\\
\frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1}
\end{array}
\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 7 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: 16.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\ t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\ t_2 := t\_1 \cdot t\_1\\ \frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1} \end{array} \end{array} \]
(FPCore (alpha beta i)
 :precision binary64
 (let* ((t_0 (* i (+ (+ alpha beta) i)))
        (t_1 (+ (+ alpha beta) (* 2.0 i)))
        (t_2 (* t_1 t_1)))
   (/ (/ (* t_0 (+ (* beta alpha) t_0)) t_2) (- t_2 1.0))))
double code(double alpha, double beta, double i) {
	double t_0 = i * ((alpha + beta) + i);
	double t_1 = (alpha + beta) + (2.0 * i);
	double t_2 = t_1 * t_1;
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
real(8) function code(alpha, beta, i)
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    t_0 = i * ((alpha + beta) + i)
    t_1 = (alpha + beta) + (2.0d0 * i)
    t_2 = t_1 * t_1
    code = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0d0)
end function
public static double code(double alpha, double beta, double i) {
	double t_0 = i * ((alpha + beta) + i);
	double t_1 = (alpha + beta) + (2.0 * i);
	double t_2 = t_1 * t_1;
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
def code(alpha, beta, i):
	t_0 = i * ((alpha + beta) + i)
	t_1 = (alpha + beta) + (2.0 * i)
	t_2 = t_1 * t_1
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0)
function code(alpha, beta, i)
	t_0 = Float64(i * Float64(Float64(alpha + beta) + i))
	t_1 = Float64(Float64(alpha + beta) + Float64(2.0 * i))
	t_2 = Float64(t_1 * t_1)
	return Float64(Float64(Float64(t_0 * Float64(Float64(beta * alpha) + t_0)) / t_2) / Float64(t_2 - 1.0))
end
function tmp = code(alpha, beta, i)
	t_0 = i * ((alpha + beta) + i);
	t_1 = (alpha + beta) + (2.0 * i);
	t_2 = t_1 * t_1;
	tmp = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(i * N[(N[(alpha + beta), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, N[(N[(N[(t$95$0 * N[(N[(beta * alpha), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(t$95$2 - 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\
t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\
t_2 := t\_1 \cdot t\_1\\
\frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1}
\end{array}
\end{array}

Alternative 1: 85.6% accurate, 2.7× speedup?

\[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 8.2 \cdot 10^{+129}:\\ \;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{i + \alpha}{\beta}}{\frac{\beta}{i}}\\ \end{array} \end{array} \]
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
 :precision binary64
 (if (<= beta 8.2e+129)
   (+ 0.0625 (/ 0.015625 (* i i)))
   (/ (/ (+ i alpha) beta) (/ beta i))))
assert(alpha < beta && beta < i);
double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 8.2e+129) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = ((i + alpha) / beta) / (beta / i);
	}
	return tmp;
}
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: tmp
    if (beta <= 8.2d+129) then
        tmp = 0.0625d0 + (0.015625d0 / (i * i))
    else
        tmp = ((i + alpha) / beta) / (beta / i)
    end if
    code = tmp
end function
assert alpha < beta && beta < i;
public static double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 8.2e+129) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = ((i + alpha) / beta) / (beta / i);
	}
	return tmp;
}
[alpha, beta, i] = sort([alpha, beta, i])
def code(alpha, beta, i):
	tmp = 0
	if beta <= 8.2e+129:
		tmp = 0.0625 + (0.015625 / (i * i))
	else:
		tmp = ((i + alpha) / beta) / (beta / i)
	return tmp
alpha, beta, i = sort([alpha, beta, i])
function code(alpha, beta, i)
	tmp = 0.0
	if (beta <= 8.2e+129)
		tmp = Float64(0.0625 + Float64(0.015625 / Float64(i * i)));
	else
		tmp = Float64(Float64(Float64(i + alpha) / beta) / Float64(beta / i));
	end
	return tmp
end
alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
function tmp_2 = code(alpha, beta, i)
	tmp = 0.0;
	if (beta <= 8.2e+129)
		tmp = 0.0625 + (0.015625 / (i * i));
	else
		tmp = ((i + alpha) / beta) / (beta / i);
	end
	tmp_2 = tmp;
end
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
code[alpha_, beta_, i_] := If[LessEqual[beta, 8.2e+129], N[(0.0625 + N[(0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i + alpha), $MachinePrecision] / beta), $MachinePrecision] / N[(beta / i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 8.2 \cdot 10^{+129}:\\
\;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{i + \alpha}{\beta}}{\frac{\beta}{i}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if beta < 8.2000000000000005e129

    1. Initial program 20.8%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around 0

      \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      3. unpow2N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      7. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\color{blue}{\left(\alpha + i\right)} \cdot \left(\alpha + i\right)\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      8. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \color{blue}{\left(\alpha + i\right)}\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      9. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      12. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\left(2 \cdot i + \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\left(\color{blue}{i \cdot 2} + \alpha\right) \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      14. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      15. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\left(2 \cdot i + \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \left(\color{blue}{i \cdot 2} + \alpha\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      17. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      18. sub-negN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\left({\left(\alpha + 2 \cdot i\right)}^{2} + \left(\mathsf{neg}\left(1\right)\right)\right)}} \]
      19. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\color{blue}{\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
      20. metadata-evalN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right) + \color{blue}{-1}\right)} \]
      21. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\mathsf{fma}\left(\alpha + 2 \cdot i, \alpha + 2 \cdot i, -1\right)}} \]
    5. Simplified17.8%

      \[\leadsto \color{blue}{\frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(i, 2, \alpha\right), \mathsf{fma}\left(i, 2, \alpha\right), -1\right)}} \]
    6. Taylor expanded in alpha around 0

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \frac{{i}^{2}}{4 \cdot {i}^{2} - 1}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{1}{4} \cdot {i}^{2}}}{4 \cdot {i}^{2} - 1} \]
      4. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      6. sub-negN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{4 \cdot {i}^{2} + \left(\mathsf{neg}\left(1\right)\right)}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{{i}^{2} \cdot 4} + \left(\mathsf{neg}\left(1\right)\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{{i}^{2} \cdot 4 + \color{blue}{-1}} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{\mathsf{fma}\left({i}^{2}, 4, -1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
      11. *-lowering-*.f6431.5

        \[\leadsto \frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
    8. Simplified31.5%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(i \cdot i, 4, -1\right)}} \]
    9. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64} \cdot 1}{{i}^{2}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{16} + \frac{\color{blue}{\frac{1}{64}}}{{i}^{2}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64}}{{i}^{2}}} \]
      5. unpow2N/A

        \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{\color{blue}{i \cdot i}} \]
      6. *-lowering-*.f6475.9

        \[\leadsto 0.0625 + \frac{0.015625}{\color{blue}{i \cdot i}} \]
    11. Simplified75.9%

      \[\leadsto \color{blue}{0.0625 + \frac{0.015625}{i \cdot i}} \]

    if 8.2000000000000005e129 < beta

    1. Initial program 0.1%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around inf

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{i \cdot \left(\alpha + i\right)}}{{\beta}^{2}} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \frac{i \cdot \color{blue}{\left(\alpha + i\right)}}{{\beta}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
      5. *-lowering-*.f6420.9

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
    5. Simplified20.9%

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{\beta \cdot \beta}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{\beta \cdot \beta} \]
      2. times-fracN/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
      5. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{i + \alpha}}{\beta} \cdot \frac{i}{\beta} \]
      6. +-lowering-+.f64N/A

        \[\leadsto \frac{\color{blue}{i + \alpha}}{\beta} \cdot \frac{i}{\beta} \]
      7. /-lowering-/.f6460.7

        \[\leadsto \frac{i + \alpha}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
    7. Applied egg-rr60.7%

      \[\leadsto \color{blue}{\frac{i + \alpha}{\beta} \cdot \frac{i}{\beta}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{i + \alpha}{\beta} \cdot \color{blue}{\frac{1}{\frac{\beta}{i}}} \]
      2. un-div-invN/A

        \[\leadsto \color{blue}{\frac{\frac{i + \alpha}{\beta}}{\frac{\beta}{i}}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{i + \alpha}{\beta}}{\frac{\beta}{i}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{i + \alpha}{\beta}}}{\frac{\beta}{i}} \]
      5. +-lowering-+.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{i + \alpha}}{\beta}}{\frac{\beta}{i}} \]
      6. /-lowering-/.f6460.8

        \[\leadsto \frac{\frac{i + \alpha}{\beta}}{\color{blue}{\frac{\beta}{i}}} \]
    9. Applied egg-rr60.8%

      \[\leadsto \color{blue}{\frac{\frac{i + \alpha}{\beta}}{\frac{\beta}{i}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 85.6% accurate, 3.1× speedup?

\[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 1.02 \cdot 10^{+130}:\\ \;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;\frac{i + \alpha}{\beta} \cdot \frac{i}{\beta}\\ \end{array} \end{array} \]
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
 :precision binary64
 (if (<= beta 1.02e+130)
   (+ 0.0625 (/ 0.015625 (* i i)))
   (* (/ (+ i alpha) beta) (/ i beta))))
assert(alpha < beta && beta < i);
double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 1.02e+130) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = ((i + alpha) / beta) * (i / beta);
	}
	return tmp;
}
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: tmp
    if (beta <= 1.02d+130) then
        tmp = 0.0625d0 + (0.015625d0 / (i * i))
    else
        tmp = ((i + alpha) / beta) * (i / beta)
    end if
    code = tmp
end function
assert alpha < beta && beta < i;
public static double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 1.02e+130) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = ((i + alpha) / beta) * (i / beta);
	}
	return tmp;
}
[alpha, beta, i] = sort([alpha, beta, i])
def code(alpha, beta, i):
	tmp = 0
	if beta <= 1.02e+130:
		tmp = 0.0625 + (0.015625 / (i * i))
	else:
		tmp = ((i + alpha) / beta) * (i / beta)
	return tmp
alpha, beta, i = sort([alpha, beta, i])
function code(alpha, beta, i)
	tmp = 0.0
	if (beta <= 1.02e+130)
		tmp = Float64(0.0625 + Float64(0.015625 / Float64(i * i)));
	else
		tmp = Float64(Float64(Float64(i + alpha) / beta) * Float64(i / beta));
	end
	return tmp
end
alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
function tmp_2 = code(alpha, beta, i)
	tmp = 0.0;
	if (beta <= 1.02e+130)
		tmp = 0.0625 + (0.015625 / (i * i));
	else
		tmp = ((i + alpha) / beta) * (i / beta);
	end
	tmp_2 = tmp;
end
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
code[alpha_, beta_, i_] := If[LessEqual[beta, 1.02e+130], N[(0.0625 + N[(0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i + alpha), $MachinePrecision] / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.02 \cdot 10^{+130}:\\
\;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\

\mathbf{else}:\\
\;\;\;\;\frac{i + \alpha}{\beta} \cdot \frac{i}{\beta}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if beta < 1.01999999999999999e130

    1. Initial program 20.8%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around 0

      \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      3. unpow2N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      7. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\color{blue}{\left(\alpha + i\right)} \cdot \left(\alpha + i\right)\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      8. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \color{blue}{\left(\alpha + i\right)}\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      9. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      12. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\left(2 \cdot i + \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\left(\color{blue}{i \cdot 2} + \alpha\right) \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      14. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      15. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\left(2 \cdot i + \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \left(\color{blue}{i \cdot 2} + \alpha\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      17. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      18. sub-negN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\left({\left(\alpha + 2 \cdot i\right)}^{2} + \left(\mathsf{neg}\left(1\right)\right)\right)}} \]
      19. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\color{blue}{\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
      20. metadata-evalN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right) + \color{blue}{-1}\right)} \]
      21. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\mathsf{fma}\left(\alpha + 2 \cdot i, \alpha + 2 \cdot i, -1\right)}} \]
    5. Simplified17.8%

      \[\leadsto \color{blue}{\frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(i, 2, \alpha\right), \mathsf{fma}\left(i, 2, \alpha\right), -1\right)}} \]
    6. Taylor expanded in alpha around 0

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \frac{{i}^{2}}{4 \cdot {i}^{2} - 1}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{1}{4} \cdot {i}^{2}}}{4 \cdot {i}^{2} - 1} \]
      4. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      6. sub-negN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{4 \cdot {i}^{2} + \left(\mathsf{neg}\left(1\right)\right)}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{{i}^{2} \cdot 4} + \left(\mathsf{neg}\left(1\right)\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{{i}^{2} \cdot 4 + \color{blue}{-1}} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{\mathsf{fma}\left({i}^{2}, 4, -1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
      11. *-lowering-*.f6431.5

        \[\leadsto \frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
    8. Simplified31.5%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(i \cdot i, 4, -1\right)}} \]
    9. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64} \cdot 1}{{i}^{2}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{16} + \frac{\color{blue}{\frac{1}{64}}}{{i}^{2}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64}}{{i}^{2}}} \]
      5. unpow2N/A

        \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{\color{blue}{i \cdot i}} \]
      6. *-lowering-*.f6475.9

        \[\leadsto 0.0625 + \frac{0.015625}{\color{blue}{i \cdot i}} \]
    11. Simplified75.9%

      \[\leadsto \color{blue}{0.0625 + \frac{0.015625}{i \cdot i}} \]

    if 1.01999999999999999e130 < beta

    1. Initial program 0.1%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around inf

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{i \cdot \left(\alpha + i\right)}}{{\beta}^{2}} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \frac{i \cdot \color{blue}{\left(\alpha + i\right)}}{{\beta}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
      5. *-lowering-*.f6420.9

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
    5. Simplified20.9%

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{\beta \cdot \beta}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{\beta \cdot \beta} \]
      2. times-fracN/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
      5. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{i + \alpha}}{\beta} \cdot \frac{i}{\beta} \]
      6. +-lowering-+.f64N/A

        \[\leadsto \frac{\color{blue}{i + \alpha}}{\beta} \cdot \frac{i}{\beta} \]
      7. /-lowering-/.f6460.7

        \[\leadsto \frac{i + \alpha}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
    7. Applied egg-rr60.7%

      \[\leadsto \color{blue}{\frac{i + \alpha}{\beta} \cdot \frac{i}{\beta}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 83.2% accurate, 3.4× speedup?

\[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 1.02 \cdot 10^{+130}:\\ \;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;\frac{i}{\beta} \cdot \frac{i}{\beta}\\ \end{array} \end{array} \]
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
 :precision binary64
 (if (<= beta 1.02e+130)
   (+ 0.0625 (/ 0.015625 (* i i)))
   (* (/ i beta) (/ i beta))))
assert(alpha < beta && beta < i);
double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 1.02e+130) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = (i / beta) * (i / beta);
	}
	return tmp;
}
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: tmp
    if (beta <= 1.02d+130) then
        tmp = 0.0625d0 + (0.015625d0 / (i * i))
    else
        tmp = (i / beta) * (i / beta)
    end if
    code = tmp
end function
assert alpha < beta && beta < i;
public static double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 1.02e+130) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = (i / beta) * (i / beta);
	}
	return tmp;
}
[alpha, beta, i] = sort([alpha, beta, i])
def code(alpha, beta, i):
	tmp = 0
	if beta <= 1.02e+130:
		tmp = 0.0625 + (0.015625 / (i * i))
	else:
		tmp = (i / beta) * (i / beta)
	return tmp
alpha, beta, i = sort([alpha, beta, i])
function code(alpha, beta, i)
	tmp = 0.0
	if (beta <= 1.02e+130)
		tmp = Float64(0.0625 + Float64(0.015625 / Float64(i * i)));
	else
		tmp = Float64(Float64(i / beta) * Float64(i / beta));
	end
	return tmp
end
alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
function tmp_2 = code(alpha, beta, i)
	tmp = 0.0;
	if (beta <= 1.02e+130)
		tmp = 0.0625 + (0.015625 / (i * i));
	else
		tmp = (i / beta) * (i / beta);
	end
	tmp_2 = tmp;
end
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
code[alpha_, beta_, i_] := If[LessEqual[beta, 1.02e+130], N[(0.0625 + N[(0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 1.02 \cdot 10^{+130}:\\
\;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\

\mathbf{else}:\\
\;\;\;\;\frac{i}{\beta} \cdot \frac{i}{\beta}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if beta < 1.01999999999999999e130

    1. Initial program 20.8%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around 0

      \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      3. unpow2N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      7. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\color{blue}{\left(\alpha + i\right)} \cdot \left(\alpha + i\right)\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      8. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \color{blue}{\left(\alpha + i\right)}\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      9. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      12. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\left(2 \cdot i + \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\left(\color{blue}{i \cdot 2} + \alpha\right) \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      14. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      15. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\left(2 \cdot i + \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \left(\color{blue}{i \cdot 2} + \alpha\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      17. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      18. sub-negN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\left({\left(\alpha + 2 \cdot i\right)}^{2} + \left(\mathsf{neg}\left(1\right)\right)\right)}} \]
      19. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\color{blue}{\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
      20. metadata-evalN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right) + \color{blue}{-1}\right)} \]
      21. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\mathsf{fma}\left(\alpha + 2 \cdot i, \alpha + 2 \cdot i, -1\right)}} \]
    5. Simplified17.8%

      \[\leadsto \color{blue}{\frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(i, 2, \alpha\right), \mathsf{fma}\left(i, 2, \alpha\right), -1\right)}} \]
    6. Taylor expanded in alpha around 0

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \frac{{i}^{2}}{4 \cdot {i}^{2} - 1}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{1}{4} \cdot {i}^{2}}}{4 \cdot {i}^{2} - 1} \]
      4. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      6. sub-negN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{4 \cdot {i}^{2} + \left(\mathsf{neg}\left(1\right)\right)}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{{i}^{2} \cdot 4} + \left(\mathsf{neg}\left(1\right)\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{{i}^{2} \cdot 4 + \color{blue}{-1}} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{\mathsf{fma}\left({i}^{2}, 4, -1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
      11. *-lowering-*.f6431.5

        \[\leadsto \frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
    8. Simplified31.5%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(i \cdot i, 4, -1\right)}} \]
    9. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64} \cdot 1}{{i}^{2}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{16} + \frac{\color{blue}{\frac{1}{64}}}{{i}^{2}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64}}{{i}^{2}}} \]
      5. unpow2N/A

        \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{\color{blue}{i \cdot i}} \]
      6. *-lowering-*.f6475.9

        \[\leadsto 0.0625 + \frac{0.015625}{\color{blue}{i \cdot i}} \]
    11. Simplified75.9%

      \[\leadsto \color{blue}{0.0625 + \frac{0.015625}{i \cdot i}} \]

    if 1.01999999999999999e130 < beta

    1. Initial program 0.1%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around inf

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{i \cdot \left(\alpha + i\right)}}{{\beta}^{2}} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \frac{i \cdot \color{blue}{\left(\alpha + i\right)}}{{\beta}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
      5. *-lowering-*.f6420.9

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
    5. Simplified20.9%

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{\beta \cdot \beta}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{\beta \cdot \beta} \]
      2. times-fracN/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
      5. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{i + \alpha}}{\beta} \cdot \frac{i}{\beta} \]
      6. +-lowering-+.f64N/A

        \[\leadsto \frac{\color{blue}{i + \alpha}}{\beta} \cdot \frac{i}{\beta} \]
      7. /-lowering-/.f6460.7

        \[\leadsto \frac{i + \alpha}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
    7. Applied egg-rr60.7%

      \[\leadsto \color{blue}{\frac{i + \alpha}{\beta} \cdot \frac{i}{\beta}} \]
    8. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{i}{\beta}} \cdot \frac{i}{\beta} \]
    9. Step-by-step derivation
      1. /-lowering-/.f6458.6

        \[\leadsto \color{blue}{\frac{i}{\beta}} \cdot \frac{i}{\beta} \]
    10. Simplified58.6%

      \[\leadsto \color{blue}{\frac{i}{\beta}} \cdot \frac{i}{\beta} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 75.1% accurate, 3.7× speedup?

\[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 9.2 \cdot 10^{+230}:\\ \;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;i \cdot \frac{i + \alpha}{\beta \cdot \beta}\\ \end{array} \end{array} \]
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
 :precision binary64
 (if (<= beta 9.2e+230)
   (+ 0.0625 (/ 0.015625 (* i i)))
   (* i (/ (+ i alpha) (* beta beta)))))
assert(alpha < beta && beta < i);
double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 9.2e+230) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = i * ((i + alpha) / (beta * beta));
	}
	return tmp;
}
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: tmp
    if (beta <= 9.2d+230) then
        tmp = 0.0625d0 + (0.015625d0 / (i * i))
    else
        tmp = i * ((i + alpha) / (beta * beta))
    end if
    code = tmp
end function
assert alpha < beta && beta < i;
public static double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 9.2e+230) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = i * ((i + alpha) / (beta * beta));
	}
	return tmp;
}
[alpha, beta, i] = sort([alpha, beta, i])
def code(alpha, beta, i):
	tmp = 0
	if beta <= 9.2e+230:
		tmp = 0.0625 + (0.015625 / (i * i))
	else:
		tmp = i * ((i + alpha) / (beta * beta))
	return tmp
alpha, beta, i = sort([alpha, beta, i])
function code(alpha, beta, i)
	tmp = 0.0
	if (beta <= 9.2e+230)
		tmp = Float64(0.0625 + Float64(0.015625 / Float64(i * i)));
	else
		tmp = Float64(i * Float64(Float64(i + alpha) / Float64(beta * beta)));
	end
	return tmp
end
alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
function tmp_2 = code(alpha, beta, i)
	tmp = 0.0;
	if (beta <= 9.2e+230)
		tmp = 0.0625 + (0.015625 / (i * i));
	else
		tmp = i * ((i + alpha) / (beta * beta));
	end
	tmp_2 = tmp;
end
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
code[alpha_, beta_, i_] := If[LessEqual[beta, 9.2e+230], N[(0.0625 + N[(0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(N[(i + alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 9.2 \cdot 10^{+230}:\\
\;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\

\mathbf{else}:\\
\;\;\;\;i \cdot \frac{i + \alpha}{\beta \cdot \beta}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if beta < 9.1999999999999993e230

    1. Initial program 18.2%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around 0

      \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      3. unpow2N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      7. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\color{blue}{\left(\alpha + i\right)} \cdot \left(\alpha + i\right)\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      8. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \color{blue}{\left(\alpha + i\right)}\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      9. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      12. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\left(2 \cdot i + \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\left(\color{blue}{i \cdot 2} + \alpha\right) \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      14. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      15. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\left(2 \cdot i + \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \left(\color{blue}{i \cdot 2} + \alpha\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      17. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      18. sub-negN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\left({\left(\alpha + 2 \cdot i\right)}^{2} + \left(\mathsf{neg}\left(1\right)\right)\right)}} \]
      19. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\color{blue}{\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
      20. metadata-evalN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right) + \color{blue}{-1}\right)} \]
      21. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\mathsf{fma}\left(\alpha + 2 \cdot i, \alpha + 2 \cdot i, -1\right)}} \]
    5. Simplified15.6%

      \[\leadsto \color{blue}{\frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(i, 2, \alpha\right), \mathsf{fma}\left(i, 2, \alpha\right), -1\right)}} \]
    6. Taylor expanded in alpha around 0

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \frac{{i}^{2}}{4 \cdot {i}^{2} - 1}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{1}{4} \cdot {i}^{2}}}{4 \cdot {i}^{2} - 1} \]
      4. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      6. sub-negN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{4 \cdot {i}^{2} + \left(\mathsf{neg}\left(1\right)\right)}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{{i}^{2} \cdot 4} + \left(\mathsf{neg}\left(1\right)\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{{i}^{2} \cdot 4 + \color{blue}{-1}} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{\mathsf{fma}\left({i}^{2}, 4, -1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
      11. *-lowering-*.f6427.8

        \[\leadsto \frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
    8. Simplified27.8%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(i \cdot i, 4, -1\right)}} \]
    9. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64} \cdot 1}{{i}^{2}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{16} + \frac{\color{blue}{\frac{1}{64}}}{{i}^{2}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64}}{{i}^{2}}} \]
      5. unpow2N/A

        \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{\color{blue}{i \cdot i}} \]
      6. *-lowering-*.f6472.5

        \[\leadsto 0.0625 + \frac{0.015625}{\color{blue}{i \cdot i}} \]
    11. Simplified72.5%

      \[\leadsto \color{blue}{0.0625 + \frac{0.015625}{i \cdot i}} \]

    if 9.1999999999999993e230 < beta

    1. Initial program 0.0%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around inf

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{i \cdot \left(\alpha + i\right)}}{{\beta}^{2}} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \frac{i \cdot \color{blue}{\left(\alpha + i\right)}}{{\beta}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
      5. *-lowering-*.f6428.8

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
    5. Simplified28.8%

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{\beta \cdot \beta}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \color{blue}{i \cdot \frac{\alpha + i}{\beta \cdot \beta}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta \cdot \beta} \cdot i} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta \cdot \beta} \cdot i} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta \cdot \beta}} \cdot i \]
      5. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{i + \alpha}}{\beta \cdot \beta} \cdot i \]
      6. +-lowering-+.f64N/A

        \[\leadsto \frac{\color{blue}{i + \alpha}}{\beta \cdot \beta} \cdot i \]
      7. *-lowering-*.f6430.7

        \[\leadsto \frac{i + \alpha}{\color{blue}{\beta \cdot \beta}} \cdot i \]
    7. Applied egg-rr30.7%

      \[\leadsto \color{blue}{\frac{i + \alpha}{\beta \cdot \beta} \cdot i} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification69.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\beta \leq 9.2 \cdot 10^{+230}:\\ \;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;i \cdot \frac{i + \alpha}{\beta \cdot \beta}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.0% accurate, 4.1× speedup?

\[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 5 \cdot 10^{+230}:\\ \;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;\frac{i \cdot \alpha}{\beta \cdot \beta}\\ \end{array} \end{array} \]
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
 :precision binary64
 (if (<= beta 5e+230)
   (+ 0.0625 (/ 0.015625 (* i i)))
   (/ (* i alpha) (* beta beta))))
assert(alpha < beta && beta < i);
double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 5e+230) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = (i * alpha) / (beta * beta);
	}
	return tmp;
}
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
real(8) function code(alpha, beta, i)
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: tmp
    if (beta <= 5d+230) then
        tmp = 0.0625d0 + (0.015625d0 / (i * i))
    else
        tmp = (i * alpha) / (beta * beta)
    end if
    code = tmp
end function
assert alpha < beta && beta < i;
public static double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 5e+230) {
		tmp = 0.0625 + (0.015625 / (i * i));
	} else {
		tmp = (i * alpha) / (beta * beta);
	}
	return tmp;
}
[alpha, beta, i] = sort([alpha, beta, i])
def code(alpha, beta, i):
	tmp = 0
	if beta <= 5e+230:
		tmp = 0.0625 + (0.015625 / (i * i))
	else:
		tmp = (i * alpha) / (beta * beta)
	return tmp
alpha, beta, i = sort([alpha, beta, i])
function code(alpha, beta, i)
	tmp = 0.0
	if (beta <= 5e+230)
		tmp = Float64(0.0625 + Float64(0.015625 / Float64(i * i)));
	else
		tmp = Float64(Float64(i * alpha) / Float64(beta * beta));
	end
	return tmp
end
alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
function tmp_2 = code(alpha, beta, i)
	tmp = 0.0;
	if (beta <= 5e+230)
		tmp = 0.0625 + (0.015625 / (i * i));
	else
		tmp = (i * alpha) / (beta * beta);
	end
	tmp_2 = tmp;
end
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
code[alpha_, beta_, i_] := If[LessEqual[beta, 5e+230], N[(0.0625 + N[(0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 5 \cdot 10^{+230}:\\
\;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\

\mathbf{else}:\\
\;\;\;\;\frac{i \cdot \alpha}{\beta \cdot \beta}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if beta < 5.0000000000000003e230

    1. Initial program 18.2%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around 0

      \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      3. unpow2N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      7. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\color{blue}{\left(\alpha + i\right)} \cdot \left(\alpha + i\right)\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      8. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \color{blue}{\left(\alpha + i\right)}\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      9. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      12. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\left(2 \cdot i + \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\left(\color{blue}{i \cdot 2} + \alpha\right) \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      14. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      15. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\left(2 \cdot i + \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \left(\color{blue}{i \cdot 2} + \alpha\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      17. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      18. sub-negN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\left({\left(\alpha + 2 \cdot i\right)}^{2} + \left(\mathsf{neg}\left(1\right)\right)\right)}} \]
      19. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\color{blue}{\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
      20. metadata-evalN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right) + \color{blue}{-1}\right)} \]
      21. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\mathsf{fma}\left(\alpha + 2 \cdot i, \alpha + 2 \cdot i, -1\right)}} \]
    5. Simplified15.6%

      \[\leadsto \color{blue}{\frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(i, 2, \alpha\right), \mathsf{fma}\left(i, 2, \alpha\right), -1\right)}} \]
    6. Taylor expanded in alpha around 0

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \frac{{i}^{2}}{4 \cdot {i}^{2} - 1}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{1}{4} \cdot {i}^{2}}}{4 \cdot {i}^{2} - 1} \]
      4. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      6. sub-negN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{4 \cdot {i}^{2} + \left(\mathsf{neg}\left(1\right)\right)}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{{i}^{2} \cdot 4} + \left(\mathsf{neg}\left(1\right)\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{{i}^{2} \cdot 4 + \color{blue}{-1}} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{\mathsf{fma}\left({i}^{2}, 4, -1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
      11. *-lowering-*.f6427.8

        \[\leadsto \frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
    8. Simplified27.8%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(i \cdot i, 4, -1\right)}} \]
    9. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64} \cdot 1}{{i}^{2}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{16} + \frac{\color{blue}{\frac{1}{64}}}{{i}^{2}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64}}{{i}^{2}}} \]
      5. unpow2N/A

        \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{\color{blue}{i \cdot i}} \]
      6. *-lowering-*.f6472.5

        \[\leadsto 0.0625 + \frac{0.015625}{\color{blue}{i \cdot i}} \]
    11. Simplified72.5%

      \[\leadsto \color{blue}{0.0625 + \frac{0.015625}{i \cdot i}} \]

    if 5.0000000000000003e230 < beta

    1. Initial program 0.0%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around inf

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{i \cdot \left(\alpha + i\right)}}{{\beta}^{2}} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \frac{i \cdot \color{blue}{\left(\alpha + i\right)}}{{\beta}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
      5. *-lowering-*.f6428.8

        \[\leadsto \frac{i \cdot \left(\alpha + i\right)}{\color{blue}{\beta \cdot \beta}} \]
    5. Simplified28.8%

      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{\beta \cdot \beta}} \]
    6. Taylor expanded in alpha around inf

      \[\leadsto \frac{i \cdot \color{blue}{\alpha}}{\beta \cdot \beta} \]
    7. Step-by-step derivation
      1. Simplified30.3%

        \[\leadsto \frac{i \cdot \color{blue}{\alpha}}{\beta \cdot \beta} \]
    8. Recombined 2 regimes into one program.
    9. Add Preprocessing

    Alternative 6: 71.4% accurate, 5.8× speedup?

    \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ 0.0625 + \frac{0.015625}{i \cdot i} \end{array} \]
    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
    (FPCore (alpha beta i) :precision binary64 (+ 0.0625 (/ 0.015625 (* i i))))
    assert(alpha < beta && beta < i);
    double code(double alpha, double beta, double i) {
    	return 0.0625 + (0.015625 / (i * i));
    }
    
    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
    real(8) function code(alpha, beta, i)
        real(8), intent (in) :: alpha
        real(8), intent (in) :: beta
        real(8), intent (in) :: i
        code = 0.0625d0 + (0.015625d0 / (i * i))
    end function
    
    assert alpha < beta && beta < i;
    public static double code(double alpha, double beta, double i) {
    	return 0.0625 + (0.015625 / (i * i));
    }
    
    [alpha, beta, i] = sort([alpha, beta, i])
    def code(alpha, beta, i):
    	return 0.0625 + (0.015625 / (i * i))
    
    alpha, beta, i = sort([alpha, beta, i])
    function code(alpha, beta, i)
    	return Float64(0.0625 + Float64(0.015625 / Float64(i * i)))
    end
    
    alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
    function tmp = code(alpha, beta, i)
    	tmp = 0.0625 + (0.015625 / (i * i));
    end
    
    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
    code[alpha_, beta_, i_] := N[(0.0625 + N[(0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
    \\
    0.0625 + \frac{0.015625}{i \cdot i}
    \end{array}
    
    Derivation
    1. Initial program 16.8%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in beta around 0

      \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{{i}^{2} \cdot {\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      3. unpow2N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(i \cdot i\right)} \cdot {\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \color{blue}{\left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      7. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\color{blue}{\left(\alpha + i\right)} \cdot \left(\alpha + i\right)\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      8. +-lowering-+.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \color{blue}{\left(\alpha + i\right)}\right)}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      9. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\color{blue}{\left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)\right)} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      12. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\left(2 \cdot i + \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      13. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\left(\color{blue}{i \cdot 2} + \alpha\right) \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      14. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)} \cdot \left(\alpha + 2 \cdot i\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      15. +-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\left(2 \cdot i + \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      16. *-commutativeN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \left(\color{blue}{i \cdot 2} + \alpha\right)\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      17. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \color{blue}{\mathsf{fma}\left(i, 2, \alpha\right)}\right) \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      18. sub-negN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\left({\left(\alpha + 2 \cdot i\right)}^{2} + \left(\mathsf{neg}\left(1\right)\right)\right)}} \]
      19. unpow2N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\color{blue}{\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
      20. metadata-evalN/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \left(\left(\alpha + 2 \cdot i\right) \cdot \left(\alpha + 2 \cdot i\right) + \color{blue}{-1}\right)} \]
      21. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \color{blue}{\mathsf{fma}\left(\alpha + 2 \cdot i, \alpha + 2 \cdot i, -1\right)}} \]
    5. Simplified14.8%

      \[\leadsto \color{blue}{\frac{\left(i \cdot i\right) \cdot \left(\left(\alpha + i\right) \cdot \left(\alpha + i\right)\right)}{\left(\mathsf{fma}\left(i, 2, \alpha\right) \cdot \mathsf{fma}\left(i, 2, \alpha\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(i, 2, \alpha\right), \mathsf{fma}\left(i, 2, \alpha\right), -1\right)}} \]
    6. Taylor expanded in alpha around 0

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \frac{{i}^{2}}{4 \cdot {i}^{2} - 1}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{4} \cdot {i}^{2}}{4 \cdot {i}^{2} - 1}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{1}{4} \cdot {i}^{2}}}{4 \cdot {i}^{2} - 1} \]
      4. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \color{blue}{\left(i \cdot i\right)}}{4 \cdot {i}^{2} - 1} \]
      6. sub-negN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{4 \cdot {i}^{2} + \left(\mathsf{neg}\left(1\right)\right)}} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{{i}^{2} \cdot 4} + \left(\mathsf{neg}\left(1\right)\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{{i}^{2} \cdot 4 + \color{blue}{-1}} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\color{blue}{\mathsf{fma}\left({i}^{2}, 4, -1\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\frac{1}{4} \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
      11. *-lowering-*.f6425.7

        \[\leadsto \frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(\color{blue}{i \cdot i}, 4, -1\right)} \]
    8. Simplified25.7%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(i \cdot i\right)}{\mathsf{fma}\left(i \cdot i, 4, -1\right)}} \]
    9. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \color{blue}{\frac{1}{16} + \frac{1}{64} \cdot \frac{1}{{i}^{2}}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64} \cdot 1}{{i}^{2}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{16} + \frac{\color{blue}{\frac{1}{64}}}{{i}^{2}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{1}{16} + \color{blue}{\frac{\frac{1}{64}}{{i}^{2}}} \]
      5. unpow2N/A

        \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{\color{blue}{i \cdot i}} \]
      6. *-lowering-*.f6468.3

        \[\leadsto 0.0625 + \frac{0.015625}{\color{blue}{i \cdot i}} \]
    11. Simplified68.3%

      \[\leadsto \color{blue}{0.0625 + \frac{0.015625}{i \cdot i}} \]
    12. Add Preprocessing

    Alternative 7: 71.2% accurate, 115.0× speedup?

    \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ 0.0625 \end{array} \]
    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
    (FPCore (alpha beta i) :precision binary64 0.0625)
    assert(alpha < beta && beta < i);
    double code(double alpha, double beta, double i) {
    	return 0.0625;
    }
    
    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
    real(8) function code(alpha, beta, i)
        real(8), intent (in) :: alpha
        real(8), intent (in) :: beta
        real(8), intent (in) :: i
        code = 0.0625d0
    end function
    
    assert alpha < beta && beta < i;
    public static double code(double alpha, double beta, double i) {
    	return 0.0625;
    }
    
    [alpha, beta, i] = sort([alpha, beta, i])
    def code(alpha, beta, i):
    	return 0.0625
    
    alpha, beta, i = sort([alpha, beta, i])
    function code(alpha, beta, i)
    	return 0.0625
    end
    
    alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
    function tmp = code(alpha, beta, i)
    	tmp = 0.0625;
    end
    
    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
    code[alpha_, beta_, i_] := 0.0625
    
    \begin{array}{l}
    [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
    \\
    0.0625
    \end{array}
    
    Derivation
    1. Initial program 16.8%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{1}{16}} \]
    4. Step-by-step derivation
      1. Simplified68.0%

        \[\leadsto \color{blue}{0.0625} \]
      2. Add Preprocessing

      Reproduce

      ?
      herbie shell --seed 2024205 
      (FPCore (alpha beta i)
        :name "Octave 3.8, jcobi/4"
        :precision binary64
        :pre (and (and (> alpha -1.0) (> beta -1.0)) (> i 1.0))
        (/ (/ (* (* i (+ (+ alpha beta) i)) (+ (* beta alpha) (* i (+ (+ alpha beta) i)))) (* (+ (+ alpha beta) (* 2.0 i)) (+ (+ alpha beta) (* 2.0 i)))) (- (* (+ (+ alpha beta) (* 2.0 i)) (+ (+ alpha beta) (* 2.0 i))) 1.0)))