Falkner and Boettcher, Appendix A

Percentage Accurate: 90.0% → 96.9%
Time: 10.6s
Alternatives: 17
Speedup: 1.2×

Specification

?
\[\begin{array}{l} \\ \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
	return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
    real(8), intent (in) :: a
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
	return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m):
	return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m)
	return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
end
function tmp = code(a, k, m)
	tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k));
end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\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 17 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: 90.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
	return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
real(8) function code(a, k, m)
    real(8), intent (in) :: a
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    code = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
end function
public static double code(double a, double k, double m) {
	return (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
def code(a, k, m):
	return (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
function code(a, k, m)
	return Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
end
function tmp = code(a, k, m)
	tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k));
end
code[a_, k_, m_] := N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\end{array}

Alternative 1: 96.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3.7 \cdot 10^{-7}:\\ \;\;\;\;a \cdot {k}^{m}\\ \mathbf{else}:\\ \;\;\;\;\frac{{k}^{m}}{k} \cdot \frac{a}{k}\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= k 3.7e-7) (* a (pow k m)) (* (/ (pow k m) k) (/ a k))))
double code(double a, double k, double m) {
	double tmp;
	if (k <= 3.7e-7) {
		tmp = a * pow(k, m);
	} else {
		tmp = (pow(k, m) / k) * (a / k);
	}
	return tmp;
}
real(8) function code(a, k, m)
    real(8), intent (in) :: a
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8) :: tmp
    if (k <= 3.7d-7) then
        tmp = a * (k ** m)
    else
        tmp = ((k ** m) / k) * (a / k)
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (k <= 3.7e-7) {
		tmp = a * Math.pow(k, m);
	} else {
		tmp = (Math.pow(k, m) / k) * (a / k);
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if k <= 3.7e-7:
		tmp = a * math.pow(k, m)
	else:
		tmp = (math.pow(k, m) / k) * (a / k)
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (k <= 3.7e-7)
		tmp = Float64(a * (k ^ m));
	else
		tmp = Float64(Float64((k ^ m) / k) * Float64(a / k));
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (k <= 3.7e-7)
		tmp = a * (k ^ m);
	else
		tmp = ((k ^ m) / k) * (a / k);
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[k, 3.7e-7], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[k, m], $MachinePrecision] / k), $MachinePrecision] * N[(a / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;a \cdot {k}^{m}\\

\mathbf{else}:\\
\;\;\;\;\frac{{k}^{m}}{k} \cdot \frac{a}{k}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 3.70000000000000004e-7

    1. Initial program 94.5%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
      2. lower-pow.f6499.7

        \[\leadsto a \cdot \color{blue}{{k}^{m}} \]
    5. Simplified99.7%

      \[\leadsto \color{blue}{a \cdot {k}^{m}} \]

    if 3.70000000000000004e-7 < k

    1. Initial program 83.6%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}}{{k}^{2}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}}{{k}^{2}}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{a \cdot e^{\color{blue}{\mathsf{neg}\left(m \cdot \log \left(\frac{1}{k}\right)\right)}}}{{k}^{2}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{a \cdot e^{\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{k}\right) \cdot m}\right)}}{{k}^{2}} \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \frac{a \cdot e^{\color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{k}\right)\right)\right) \cdot m}}}{{k}^{2}} \]
      5. exp-prodN/A

        \[\leadsto \frac{a \cdot \color{blue}{{\left(e^{\mathsf{neg}\left(\log \left(\frac{1}{k}\right)\right)}\right)}^{m}}}{{k}^{2}} \]
      6. log-recN/A

        \[\leadsto \frac{a \cdot {\left(e^{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log k\right)\right)}\right)}\right)}^{m}}{{k}^{2}} \]
      7. remove-double-negN/A

        \[\leadsto \frac{a \cdot {\left(e^{\color{blue}{\log k}}\right)}^{m}}{{k}^{2}} \]
      8. rem-exp-logN/A

        \[\leadsto \frac{a \cdot {\color{blue}{k}}^{m}}{{k}^{2}} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{a \cdot {k}^{m}}}{{k}^{2}} \]
      10. lower-pow.f64N/A

        \[\leadsto \frac{a \cdot \color{blue}{{k}^{m}}}{{k}^{2}} \]
      11. unpow2N/A

        \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{k \cdot k}} \]
      12. lower-*.f6483.5

        \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{k \cdot k}} \]
    5. Simplified83.5%

      \[\leadsto \color{blue}{\frac{a \cdot {k}^{m}}{k \cdot k}} \]
    6. Step-by-step derivation
      1. remove-double-divN/A

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{a}}} \cdot {k}^{m}}{k \cdot k} \]
      2. lift-pow.f64N/A

        \[\leadsto \frac{\frac{1}{\frac{1}{a}} \cdot \color{blue}{{k}^{m}}}{k \cdot k} \]
      3. times-fracN/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{1}{a}}}{k} \cdot \frac{{k}^{m}}{k}} \]
      4. remove-double-divN/A

        \[\leadsto \frac{\color{blue}{a}}{k} \cdot \frac{{k}^{m}}{k} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{{k}^{m}}{k} \cdot \frac{a}{k}} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{{k}^{m}}{k} \cdot \frac{a}{k}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{{k}^{m}}{k}} \cdot \frac{a}{k} \]
      8. lower-/.f6496.5

        \[\leadsto \frac{{k}^{m}}{k} \cdot \color{blue}{\frac{a}{k}} \]
    7. Applied egg-rr96.5%

      \[\leadsto \color{blue}{\frac{{k}^{m}}{k} \cdot \frac{a}{k}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 61.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \frac{\frac{-10 + \frac{-100}{k}}{-k} - -1}{k}, 1\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k)))))
   (if (<= t_0 0.0)
     (/
      a
      (fma
       (* k (fma k k -100.0))
       (/ (- (/ (+ -10.0 (/ -100.0 k)) (- k)) -1.0) k)
       1.0))
     (if (<= t_0 1e+305)
       (/ a (fma k 10.0 (fma k k 1.0)))
       (if (<= t_0 INFINITY)
         (* a (/ (+ 1.0 (/ (+ -10.0 (/ 99.0 k)) k)) (* k k)))
         (* a (fma k (fma k 99.0 -10.0) 1.0)))))))
double code(double a, double k, double m) {
	double t_0 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = a / fma((k * fma(k, k, -100.0)), ((((-10.0 + (-100.0 / k)) / -k) - -1.0) / k), 1.0);
	} else if (t_0 <= 1e+305) {
		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = a * ((1.0 + ((-10.0 + (99.0 / k)) / k)) / (k * k));
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k)))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(a / fma(Float64(k * fma(k, k, -100.0)), Float64(Float64(Float64(Float64(-10.0 + Float64(-100.0 / k)) / Float64(-k)) - -1.0) / k), 1.0));
	elseif (t_0 <= 1e+305)
		tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0)));
	elseif (t_0 <= Inf)
		tmp = Float64(a * Float64(Float64(1.0 + Float64(Float64(-10.0 + Float64(99.0 / k)) / k)) / Float64(k * k)));
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(a / N[(N[(k * N[(k * k + -100.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(-10.0 + N[(-100.0 / k), $MachinePrecision]), $MachinePrecision] / (-k)), $MachinePrecision] - -1.0), $MachinePrecision] / k), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(a * N[(N[(1.0 + N[(N[(-10.0 + N[(99.0 / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \frac{\frac{-10 + \frac{-100}{k}}{-k} - -1}{k}, 1\right)}\\

\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

    1. Initial program 96.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6448.9

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified48.9%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. *-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right) \cdot k} + 1} \]
      3. lift-+.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right)} \cdot k + 1} \]
      4. flip-+N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{k \cdot k - 10 \cdot 10}{k - 10}} \cdot k + 1} \]
      5. associate-*l/N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{\left(k \cdot k - 10 \cdot 10\right) \cdot k}{k - 10}} + 1} \]
      6. div-invN/A

        \[\leadsto \frac{a}{\color{blue}{\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k\right) \cdot \frac{1}{k - 10}} + 1} \]
      7. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k - 10 \cdot 10\right) \cdot k}, \frac{1}{k - 10}, 1\right)} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      10. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(k, k, \mathsf{neg}\left(10 \cdot 10\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      13. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \mathsf{neg}\left(\color{blue}{100}\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      14. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \color{blue}{-100}\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\frac{1}{k - 10}}, 1\right)} \]
      16. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      17. lower-+.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      18. metadata-eval50.0

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + \color{blue}{-10}}, 1\right)} \]
    7. Applied egg-rr50.0%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + -10}, 1\right)}} \]
    8. Taylor expanded in k around -inf

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{-1 \cdot \frac{-1 \cdot \frac{10 + 100 \cdot \frac{1}{k}}{k} - 1}{k}}, 1\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\mathsf{neg}\left(\frac{-1 \cdot \frac{10 + 100 \cdot \frac{1}{k}}{k} - 1}{k}\right)}, 1\right)} \]
      2. lower-neg.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\mathsf{neg}\left(\frac{-1 \cdot \frac{10 + 100 \cdot \frac{1}{k}}{k} - 1}{k}\right)}, 1\right)} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\color{blue}{\frac{-1 \cdot \frac{10 + 100 \cdot \frac{1}{k}}{k} - 1}{k}}\right), 1\right)} \]
      4. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{\color{blue}{-1 \cdot \frac{10 + 100 \cdot \frac{1}{k}}{k} + \left(\mathsf{neg}\left(1\right)\right)}}{k}\right), 1\right)} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 \cdot \frac{10 + 100 \cdot \frac{1}{k}}{k} + \color{blue}{-1}}{k}\right), 1\right)} \]
      6. +-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{\color{blue}{-1 + -1 \cdot \frac{10 + 100 \cdot \frac{1}{k}}{k}}}{k}\right), 1\right)} \]
      7. lower-+.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{\color{blue}{-1 + -1 \cdot \frac{10 + 100 \cdot \frac{1}{k}}{k}}}{k}\right), 1\right)} \]
      8. associate-*r/N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 + \color{blue}{\frac{-1 \cdot \left(10 + 100 \cdot \frac{1}{k}\right)}{k}}}{k}\right), 1\right)} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 + \color{blue}{\frac{-1 \cdot \left(10 + 100 \cdot \frac{1}{k}\right)}{k}}}{k}\right), 1\right)} \]
      10. distribute-lft-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 + \frac{\color{blue}{-1 \cdot 10 + -1 \cdot \left(100 \cdot \frac{1}{k}\right)}}{k}}{k}\right), 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 + \frac{\color{blue}{-10} + -1 \cdot \left(100 \cdot \frac{1}{k}\right)}{k}}{k}\right), 1\right)} \]
      12. associate-*r/N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 + \frac{-10 + -1 \cdot \color{blue}{\frac{100 \cdot 1}{k}}}{k}}{k}\right), 1\right)} \]
      13. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 + \frac{-10 + -1 \cdot \frac{\color{blue}{100}}{k}}{k}}{k}\right), 1\right)} \]
      14. associate-*r/N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 + \frac{-10 + \color{blue}{\frac{-1 \cdot 100}{k}}}{k}}{k}\right), 1\right)} \]
      15. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 + \frac{-10 + \frac{\color{blue}{-100}}{k}}{k}}{k}\right), 1\right)} \]
      16. lower-+.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{neg}\left(\frac{-1 + \frac{\color{blue}{-10 + \frac{-100}{k}}}{k}}{k}\right), 1\right)} \]
      17. lower-/.f6454.4

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, -\frac{-1 + \frac{-10 + \color{blue}{\frac{-100}{k}}}{k}}{k}, 1\right)} \]
    10. Simplified54.4%

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{-\frac{-1 + \frac{-10 + \frac{-100}{k}}{k}}{k}}, 1\right)} \]

    if 0.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999994e304

    1. Initial program 99.8%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6496.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified96.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(10 + k\right)} + 1} \]
      2. distribute-lft-inN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k \cdot 10 + k \cdot k\right)} + 1} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{a}{\left(k \cdot 10 + \color{blue}{k \cdot k}\right) + 1} \]
      4. associate-+r+N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10 + \left(k \cdot k + 1\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \left(\color{blue}{k \cdot k} + 1\right)} \]
      6. lift-fma.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \color{blue}{\mathsf{fma}\left(k, k, 1\right)}} \]
      7. lift-fma.f6496.2

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]
    7. Applied egg-rr96.2%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]

    if 9.9999999999999994e304 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f643.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f643.2

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr3.2%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{\left(1 + \frac{99}{{k}^{2}}\right) - 10 \cdot \frac{1}{k}}{{k}^{2}}} \cdot a \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(1 + \frac{99}{{k}^{2}}\right) - 10 \cdot \frac{1}{k}}{{k}^{2}}} \cdot a \]
      2. associate--l+N/A

        \[\leadsto \frac{\color{blue}{1 + \left(\frac{99}{{k}^{2}} - 10 \cdot \frac{1}{k}\right)}}{{k}^{2}} \cdot a \]
      3. lower-+.f64N/A

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

        \[\leadsto \frac{1 + \left(\frac{99}{\color{blue}{k \cdot k}} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      5. associate-/r*N/A

        \[\leadsto \frac{1 + \left(\color{blue}{\frac{\frac{99}{k}}{k}} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      6. metadata-evalN/A

        \[\leadsto \frac{1 + \left(\frac{\frac{\color{blue}{99 \cdot 1}}{k}}{k} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      7. associate-*r/N/A

        \[\leadsto \frac{1 + \left(\frac{\color{blue}{99 \cdot \frac{1}{k}}}{k} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      8. associate-*r/N/A

        \[\leadsto \frac{1 + \left(\frac{99 \cdot \frac{1}{k}}{k} - \color{blue}{\frac{10 \cdot 1}{k}}\right)}{{k}^{2}} \cdot a \]
      9. metadata-evalN/A

        \[\leadsto \frac{1 + \left(\frac{99 \cdot \frac{1}{k}}{k} - \frac{\color{blue}{10}}{k}\right)}{{k}^{2}} \cdot a \]
      10. div-subN/A

        \[\leadsto \frac{1 + \color{blue}{\frac{99 \cdot \frac{1}{k} - 10}{k}}}{{k}^{2}} \cdot a \]
      11. lower-/.f64N/A

        \[\leadsto \frac{1 + \color{blue}{\frac{99 \cdot \frac{1}{k} - 10}{k}}}{{k}^{2}} \cdot a \]
      12. sub-negN/A

        \[\leadsto \frac{1 + \frac{\color{blue}{99 \cdot \frac{1}{k} + \left(\mathsf{neg}\left(10\right)\right)}}{k}}{{k}^{2}} \cdot a \]
      13. metadata-evalN/A

        \[\leadsto \frac{1 + \frac{99 \cdot \frac{1}{k} + \color{blue}{-10}}{k}}{{k}^{2}} \cdot a \]
      14. +-commutativeN/A

        \[\leadsto \frac{1 + \frac{\color{blue}{-10 + 99 \cdot \frac{1}{k}}}{k}}{{k}^{2}} \cdot a \]
      15. lower-+.f64N/A

        \[\leadsto \frac{1 + \frac{\color{blue}{-10 + 99 \cdot \frac{1}{k}}}{k}}{{k}^{2}} \cdot a \]
      16. associate-*r/N/A

        \[\leadsto \frac{1 + \frac{-10 + \color{blue}{\frac{99 \cdot 1}{k}}}{k}}{{k}^{2}} \cdot a \]
      17. metadata-evalN/A

        \[\leadsto \frac{1 + \frac{-10 + \frac{\color{blue}{99}}{k}}{k}}{{k}^{2}} \cdot a \]
      18. lower-/.f64N/A

        \[\leadsto \frac{1 + \frac{-10 + \color{blue}{\frac{99}{k}}}{k}}{{k}^{2}} \cdot a \]
      19. unpow2N/A

        \[\leadsto \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{\color{blue}{k \cdot k}} \cdot a \]
      20. lower-*.f6440.7

        \[\leadsto \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{\color{blue}{k \cdot k}} \cdot a \]
    10. Simplified40.7%

      \[\leadsto \color{blue}{\frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}} \cdot a \]

    if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

    1. Initial program 0.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f641.6

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified1.6%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f641.6

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr1.6%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6494.1

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified94.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 4 regimes into one program.
  4. Final simplification62.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \frac{\frac{-10 + \frac{-100}{k}}{-k} - -1}{k}, 1\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 59.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \frac{1 + \frac{10}{k}}{k}, 1\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k)))))
   (if (<= t_0 0.0)
     (/ a (fma (* k (fma k k -100.0)) (/ (+ 1.0 (/ 10.0 k)) k) 1.0))
     (if (<= t_0 1e+305)
       (/ a (fma k 10.0 (fma k k 1.0)))
       (if (<= t_0 INFINITY)
         (* a (/ (+ 1.0 (/ (+ -10.0 (/ 99.0 k)) k)) (* k k)))
         (* a (fma k (fma k 99.0 -10.0) 1.0)))))))
double code(double a, double k, double m) {
	double t_0 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = a / fma((k * fma(k, k, -100.0)), ((1.0 + (10.0 / k)) / k), 1.0);
	} else if (t_0 <= 1e+305) {
		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = a * ((1.0 + ((-10.0 + (99.0 / k)) / k)) / (k * k));
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k)))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(a / fma(Float64(k * fma(k, k, -100.0)), Float64(Float64(1.0 + Float64(10.0 / k)) / k), 1.0));
	elseif (t_0 <= 1e+305)
		tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0)));
	elseif (t_0 <= Inf)
		tmp = Float64(a * Float64(Float64(1.0 + Float64(Float64(-10.0 + Float64(99.0 / k)) / k)) / Float64(k * k)));
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(a / N[(N[(k * N[(k * k + -100.0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(10.0 / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(a * N[(N[(1.0 + N[(N[(-10.0 + N[(99.0 / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \frac{1 + \frac{10}{k}}{k}, 1\right)}\\

\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

    1. Initial program 96.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6448.9

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified48.9%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. *-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right) \cdot k} + 1} \]
      3. lift-+.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right)} \cdot k + 1} \]
      4. flip-+N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{k \cdot k - 10 \cdot 10}{k - 10}} \cdot k + 1} \]
      5. associate-*l/N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{\left(k \cdot k - 10 \cdot 10\right) \cdot k}{k - 10}} + 1} \]
      6. div-invN/A

        \[\leadsto \frac{a}{\color{blue}{\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k\right) \cdot \frac{1}{k - 10}} + 1} \]
      7. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k - 10 \cdot 10\right) \cdot k}, \frac{1}{k - 10}, 1\right)} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      10. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(k, k, \mathsf{neg}\left(10 \cdot 10\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      13. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \mathsf{neg}\left(\color{blue}{100}\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      14. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \color{blue}{-100}\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\frac{1}{k - 10}}, 1\right)} \]
      16. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      17. lower-+.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      18. metadata-eval50.0

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + \color{blue}{-10}}, 1\right)} \]
    7. Applied egg-rr50.0%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + -10}, 1\right)}} \]
    8. Taylor expanded in k around inf

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\frac{1 + 10 \cdot \frac{1}{k}}{k}}, 1\right)} \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\frac{1 + 10 \cdot \frac{1}{k}}{k}}, 1\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{\color{blue}{1 + 10 \cdot \frac{1}{k}}}{k}, 1\right)} \]
      3. associate-*r/N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1 + \color{blue}{\frac{10 \cdot 1}{k}}}{k}, 1\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1 + \frac{\color{blue}{10}}{k}}{k}, 1\right)} \]
      5. lower-/.f6448.7

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1 + \color{blue}{\frac{10}{k}}}{k}, 1\right)} \]
    10. Simplified48.7%

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\frac{1 + \frac{10}{k}}{k}}, 1\right)} \]

    if 0.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999994e304

    1. Initial program 99.8%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6496.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified96.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(10 + k\right)} + 1} \]
      2. distribute-lft-inN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k \cdot 10 + k \cdot k\right)} + 1} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{a}{\left(k \cdot 10 + \color{blue}{k \cdot k}\right) + 1} \]
      4. associate-+r+N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10 + \left(k \cdot k + 1\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \left(\color{blue}{k \cdot k} + 1\right)} \]
      6. lift-fma.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \color{blue}{\mathsf{fma}\left(k, k, 1\right)}} \]
      7. lift-fma.f6496.2

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]
    7. Applied egg-rr96.2%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]

    if 9.9999999999999994e304 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f643.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f643.2

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr3.2%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{\left(1 + \frac{99}{{k}^{2}}\right) - 10 \cdot \frac{1}{k}}{{k}^{2}}} \cdot a \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(1 + \frac{99}{{k}^{2}}\right) - 10 \cdot \frac{1}{k}}{{k}^{2}}} \cdot a \]
      2. associate--l+N/A

        \[\leadsto \frac{\color{blue}{1 + \left(\frac{99}{{k}^{2}} - 10 \cdot \frac{1}{k}\right)}}{{k}^{2}} \cdot a \]
      3. lower-+.f64N/A

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

        \[\leadsto \frac{1 + \left(\frac{99}{\color{blue}{k \cdot k}} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      5. associate-/r*N/A

        \[\leadsto \frac{1 + \left(\color{blue}{\frac{\frac{99}{k}}{k}} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      6. metadata-evalN/A

        \[\leadsto \frac{1 + \left(\frac{\frac{\color{blue}{99 \cdot 1}}{k}}{k} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      7. associate-*r/N/A

        \[\leadsto \frac{1 + \left(\frac{\color{blue}{99 \cdot \frac{1}{k}}}{k} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      8. associate-*r/N/A

        \[\leadsto \frac{1 + \left(\frac{99 \cdot \frac{1}{k}}{k} - \color{blue}{\frac{10 \cdot 1}{k}}\right)}{{k}^{2}} \cdot a \]
      9. metadata-evalN/A

        \[\leadsto \frac{1 + \left(\frac{99 \cdot \frac{1}{k}}{k} - \frac{\color{blue}{10}}{k}\right)}{{k}^{2}} \cdot a \]
      10. div-subN/A

        \[\leadsto \frac{1 + \color{blue}{\frac{99 \cdot \frac{1}{k} - 10}{k}}}{{k}^{2}} \cdot a \]
      11. lower-/.f64N/A

        \[\leadsto \frac{1 + \color{blue}{\frac{99 \cdot \frac{1}{k} - 10}{k}}}{{k}^{2}} \cdot a \]
      12. sub-negN/A

        \[\leadsto \frac{1 + \frac{\color{blue}{99 \cdot \frac{1}{k} + \left(\mathsf{neg}\left(10\right)\right)}}{k}}{{k}^{2}} \cdot a \]
      13. metadata-evalN/A

        \[\leadsto \frac{1 + \frac{99 \cdot \frac{1}{k} + \color{blue}{-10}}{k}}{{k}^{2}} \cdot a \]
      14. +-commutativeN/A

        \[\leadsto \frac{1 + \frac{\color{blue}{-10 + 99 \cdot \frac{1}{k}}}{k}}{{k}^{2}} \cdot a \]
      15. lower-+.f64N/A

        \[\leadsto \frac{1 + \frac{\color{blue}{-10 + 99 \cdot \frac{1}{k}}}{k}}{{k}^{2}} \cdot a \]
      16. associate-*r/N/A

        \[\leadsto \frac{1 + \frac{-10 + \color{blue}{\frac{99 \cdot 1}{k}}}{k}}{{k}^{2}} \cdot a \]
      17. metadata-evalN/A

        \[\leadsto \frac{1 + \frac{-10 + \frac{\color{blue}{99}}{k}}{k}}{{k}^{2}} \cdot a \]
      18. lower-/.f64N/A

        \[\leadsto \frac{1 + \frac{-10 + \color{blue}{\frac{99}{k}}}{k}}{{k}^{2}} \cdot a \]
      19. unpow2N/A

        \[\leadsto \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{\color{blue}{k \cdot k}} \cdot a \]
      20. lower-*.f6440.7

        \[\leadsto \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{\color{blue}{k \cdot k}} \cdot a \]
    10. Simplified40.7%

      \[\leadsto \color{blue}{\frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}} \cdot a \]

    if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

    1. Initial program 0.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f641.6

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified1.6%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f641.6

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr1.6%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6494.1

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified94.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 4 regimes into one program.
  4. Final simplification58.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \frac{1 + \frac{10}{k}}{k}, 1\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 59.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot -1 \cdot 10^{-5}, 0.001\right), 0.01\right), 1\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k)))))
   (if (<= t_0 0.0)
     (/
      a
      (fma
       k
       (* (fma k (* k k) 1000.0) (fma k (fma k (* k -1e-5) 0.001) 0.01))
       1.0))
     (if (<= t_0 1e+305)
       (/ a (fma k 10.0 (fma k k 1.0)))
       (if (<= t_0 INFINITY)
         (* a (/ (+ 1.0 (/ (+ -10.0 (/ 99.0 k)) k)) (* k k)))
         (* a (fma k (fma k 99.0 -10.0) 1.0)))))))
double code(double a, double k, double m) {
	double t_0 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = a / fma(k, (fma(k, (k * k), 1000.0) * fma(k, fma(k, (k * -1e-5), 0.001), 0.01)), 1.0);
	} else if (t_0 <= 1e+305) {
		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = a * ((1.0 + ((-10.0 + (99.0 / k)) / k)) / (k * k));
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k)))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(a / fma(k, Float64(fma(k, Float64(k * k), 1000.0) * fma(k, fma(k, Float64(k * -1e-5), 0.001), 0.01)), 1.0));
	elseif (t_0 <= 1e+305)
		tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0)));
	elseif (t_0 <= Inf)
		tmp = Float64(a * Float64(Float64(1.0 + Float64(Float64(-10.0 + Float64(99.0 / k)) / k)) / Float64(k * k)));
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(a / N[(k * N[(N[(k * N[(k * k), $MachinePrecision] + 1000.0), $MachinePrecision] * N[(k * N[(k * N[(k * -1e-5), $MachinePrecision] + 0.001), $MachinePrecision] + 0.01), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(a * N[(N[(1.0 + N[(N[(-10.0 + N[(99.0 / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot -1 \cdot 10^{-5}, 0.001\right), 0.01\right), 1\right)}\\

\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

    1. Initial program 96.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6448.9

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified48.9%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. flip3-+N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{\frac{{k}^{3} + {10}^{3}}{k \cdot k + \left(10 \cdot 10 - k \cdot 10\right)}}, 1\right)} \]
      2. div-invN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{\left({k}^{3} + {10}^{3}\right) \cdot \frac{1}{k \cdot k + \left(10 \cdot 10 - k \cdot 10\right)}}, 1\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{\left({k}^{3} + {10}^{3}\right) \cdot \frac{1}{k \cdot k + \left(10 \cdot 10 - k \cdot 10\right)}}, 1\right)} \]
      4. cube-multN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \left(\color{blue}{k \cdot \left(k \cdot k\right)} + {10}^{3}\right) \cdot \frac{1}{k \cdot k + \left(10 \cdot 10 - k \cdot 10\right)}, 1\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \left(k \cdot \color{blue}{\left(k \cdot k\right)} + {10}^{3}\right) \cdot \frac{1}{k \cdot k + \left(10 \cdot 10 - k \cdot 10\right)}, 1\right)} \]
      6. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, k \cdot k, {10}^{3}\right)} \cdot \frac{1}{k \cdot k + \left(10 \cdot 10 - k \cdot 10\right)}, 1\right)} \]
      7. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, \color{blue}{1000}\right) \cdot \frac{1}{k \cdot k + \left(10 \cdot 10 - k \cdot 10\right)}, 1\right)} \]
      8. lower-/.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \color{blue}{\frac{1}{k \cdot k + \left(10 \cdot 10 - k \cdot 10\right)}}, 1\right)} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{\color{blue}{k \cdot k} + \left(10 \cdot 10 - k \cdot 10\right)}, 1\right)} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{\color{blue}{\left(10 \cdot 10 - k \cdot 10\right) + k \cdot k}}, 1\right)} \]
      11. associate-+l-N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{\color{blue}{10 \cdot 10 - \left(k \cdot 10 - k \cdot k\right)}}, 1\right)} \]
      12. lower--.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{\color{blue}{10 \cdot 10 - \left(k \cdot 10 - k \cdot k\right)}}, 1\right)} \]
      13. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{\color{blue}{100} - \left(k \cdot 10 - k \cdot k\right)}, 1\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{100 - \left(k \cdot 10 - \color{blue}{k \cdot k}\right)}, 1\right)} \]
      15. distribute-lft-out--N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{100 - \color{blue}{k \cdot \left(10 - k\right)}}, 1\right)} \]
      16. lower-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{100 - \color{blue}{k \cdot \left(10 - k\right)}}, 1\right)} \]
      17. lower--.f6428.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{100 - k \cdot \color{blue}{\left(10 - k\right)}}, 1\right)} \]
    7. Applied egg-rr28.2%

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \frac{1}{100 - k \cdot \left(10 - k\right)}}, 1\right)} \]
    8. Taylor expanded in k around 0

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \color{blue}{\left(\frac{1}{100} + k \cdot \left(\frac{1}{1000} + \frac{-1}{100000} \cdot {k}^{2}\right)\right)}, 1\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \color{blue}{\left(k \cdot \left(\frac{1}{1000} + \frac{-1}{100000} \cdot {k}^{2}\right) + \frac{1}{100}\right)}, 1\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \color{blue}{\mathsf{fma}\left(k, \frac{1}{1000} + \frac{-1}{100000} \cdot {k}^{2}, \frac{1}{100}\right)}, 1\right)} \]
      3. +-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \color{blue}{\frac{-1}{100000} \cdot {k}^{2} + \frac{1}{1000}}, \frac{1}{100}\right), 1\right)} \]
      4. unpow2N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \frac{-1}{100000} \cdot \color{blue}{\left(k \cdot k\right)} + \frac{1}{1000}, \frac{1}{100}\right), 1\right)} \]
      5. associate-*r*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \color{blue}{\left(\frac{-1}{100000} \cdot k\right) \cdot k} + \frac{1}{1000}, \frac{1}{100}\right), 1\right)} \]
      6. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \color{blue}{k \cdot \left(\frac{-1}{100000} \cdot k\right)} + \frac{1}{1000}, \frac{1}{100}\right), 1\right)} \]
      7. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, \frac{-1}{100000} \cdot k, \frac{1}{1000}\right)}, \frac{1}{100}\right), 1\right)} \]
      8. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{k \cdot \frac{-1}{100000}}, \frac{1}{1000}\right), \frac{1}{100}\right), 1\right)} \]
      9. lower-*.f6450.4

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{k \cdot -1 \cdot 10^{-5}}, 0.001\right), 0.01\right), 1\right)} \]
    10. Simplified50.4%

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot -1 \cdot 10^{-5}, 0.001\right), 0.01\right)}, 1\right)} \]

    if 0.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999994e304

    1. Initial program 99.8%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6496.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified96.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(10 + k\right)} + 1} \]
      2. distribute-lft-inN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k \cdot 10 + k \cdot k\right)} + 1} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{a}{\left(k \cdot 10 + \color{blue}{k \cdot k}\right) + 1} \]
      4. associate-+r+N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10 + \left(k \cdot k + 1\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \left(\color{blue}{k \cdot k} + 1\right)} \]
      6. lift-fma.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \color{blue}{\mathsf{fma}\left(k, k, 1\right)}} \]
      7. lift-fma.f6496.2

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]
    7. Applied egg-rr96.2%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]

    if 9.9999999999999994e304 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f643.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f643.2

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr3.2%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{\left(1 + \frac{99}{{k}^{2}}\right) - 10 \cdot \frac{1}{k}}{{k}^{2}}} \cdot a \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(1 + \frac{99}{{k}^{2}}\right) - 10 \cdot \frac{1}{k}}{{k}^{2}}} \cdot a \]
      2. associate--l+N/A

        \[\leadsto \frac{\color{blue}{1 + \left(\frac{99}{{k}^{2}} - 10 \cdot \frac{1}{k}\right)}}{{k}^{2}} \cdot a \]
      3. lower-+.f64N/A

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

        \[\leadsto \frac{1 + \left(\frac{99}{\color{blue}{k \cdot k}} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      5. associate-/r*N/A

        \[\leadsto \frac{1 + \left(\color{blue}{\frac{\frac{99}{k}}{k}} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      6. metadata-evalN/A

        \[\leadsto \frac{1 + \left(\frac{\frac{\color{blue}{99 \cdot 1}}{k}}{k} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      7. associate-*r/N/A

        \[\leadsto \frac{1 + \left(\frac{\color{blue}{99 \cdot \frac{1}{k}}}{k} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      8. associate-*r/N/A

        \[\leadsto \frac{1 + \left(\frac{99 \cdot \frac{1}{k}}{k} - \color{blue}{\frac{10 \cdot 1}{k}}\right)}{{k}^{2}} \cdot a \]
      9. metadata-evalN/A

        \[\leadsto \frac{1 + \left(\frac{99 \cdot \frac{1}{k}}{k} - \frac{\color{blue}{10}}{k}\right)}{{k}^{2}} \cdot a \]
      10. div-subN/A

        \[\leadsto \frac{1 + \color{blue}{\frac{99 \cdot \frac{1}{k} - 10}{k}}}{{k}^{2}} \cdot a \]
      11. lower-/.f64N/A

        \[\leadsto \frac{1 + \color{blue}{\frac{99 \cdot \frac{1}{k} - 10}{k}}}{{k}^{2}} \cdot a \]
      12. sub-negN/A

        \[\leadsto \frac{1 + \frac{\color{blue}{99 \cdot \frac{1}{k} + \left(\mathsf{neg}\left(10\right)\right)}}{k}}{{k}^{2}} \cdot a \]
      13. metadata-evalN/A

        \[\leadsto \frac{1 + \frac{99 \cdot \frac{1}{k} + \color{blue}{-10}}{k}}{{k}^{2}} \cdot a \]
      14. +-commutativeN/A

        \[\leadsto \frac{1 + \frac{\color{blue}{-10 + 99 \cdot \frac{1}{k}}}{k}}{{k}^{2}} \cdot a \]
      15. lower-+.f64N/A

        \[\leadsto \frac{1 + \frac{\color{blue}{-10 + 99 \cdot \frac{1}{k}}}{k}}{{k}^{2}} \cdot a \]
      16. associate-*r/N/A

        \[\leadsto \frac{1 + \frac{-10 + \color{blue}{\frac{99 \cdot 1}{k}}}{k}}{{k}^{2}} \cdot a \]
      17. metadata-evalN/A

        \[\leadsto \frac{1 + \frac{-10 + \frac{\color{blue}{99}}{k}}{k}}{{k}^{2}} \cdot a \]
      18. lower-/.f64N/A

        \[\leadsto \frac{1 + \frac{-10 + \color{blue}{\frac{99}{k}}}{k}}{{k}^{2}} \cdot a \]
      19. unpow2N/A

        \[\leadsto \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{\color{blue}{k \cdot k}} \cdot a \]
      20. lower-*.f6440.7

        \[\leadsto \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{\color{blue}{k \cdot k}} \cdot a \]
    10. Simplified40.7%

      \[\leadsto \color{blue}{\frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}} \cdot a \]

    if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

    1. Initial program 0.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f641.6

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified1.6%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f641.6

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr1.6%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6494.1

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified94.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 4 regimes into one program.
  4. Final simplification59.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot k, 1000\right) \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot -1 \cdot 10^{-5}, 0.001\right), 0.01\right), 1\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 58.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right), 1\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k)))))
   (if (<= t_0 0.0)
     (/
      a
      (fma
       (* k (fma k k -100.0))
       (fma k (fma k (fma k -0.0001 -0.001) -0.01) -0.1)
       1.0))
     (if (<= t_0 1e+305)
       (/ a (fma k 10.0 (fma k k 1.0)))
       (if (<= t_0 INFINITY)
         (* a (/ (+ 1.0 (/ (+ -10.0 (/ 99.0 k)) k)) (* k k)))
         (* a (fma k (fma k 99.0 -10.0) 1.0)))))))
double code(double a, double k, double m) {
	double t_0 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = a / fma((k * fma(k, k, -100.0)), fma(k, fma(k, fma(k, -0.0001, -0.001), -0.01), -0.1), 1.0);
	} else if (t_0 <= 1e+305) {
		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = a * ((1.0 + ((-10.0 + (99.0 / k)) / k)) / (k * k));
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k)))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(a / fma(Float64(k * fma(k, k, -100.0)), fma(k, fma(k, fma(k, -0.0001, -0.001), -0.01), -0.1), 1.0));
	elseif (t_0 <= 1e+305)
		tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0)));
	elseif (t_0 <= Inf)
		tmp = Float64(a * Float64(Float64(1.0 + Float64(Float64(-10.0 + Float64(99.0 / k)) / k)) / Float64(k * k)));
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(a / N[(N[(k * N[(k * k + -100.0), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k * N[(k * -0.0001 + -0.001), $MachinePrecision] + -0.01), $MachinePrecision] + -0.1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(a * N[(N[(1.0 + N[(N[(-10.0 + N[(99.0 / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right), 1\right)}\\

\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

    1. Initial program 96.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6448.9

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified48.9%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. *-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right) \cdot k} + 1} \]
      3. lift-+.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right)} \cdot k + 1} \]
      4. flip-+N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{k \cdot k - 10 \cdot 10}{k - 10}} \cdot k + 1} \]
      5. associate-*l/N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{\left(k \cdot k - 10 \cdot 10\right) \cdot k}{k - 10}} + 1} \]
      6. div-invN/A

        \[\leadsto \frac{a}{\color{blue}{\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k\right) \cdot \frac{1}{k - 10}} + 1} \]
      7. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k - 10 \cdot 10\right) \cdot k}, \frac{1}{k - 10}, 1\right)} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      10. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(k, k, \mathsf{neg}\left(10 \cdot 10\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      13. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \mathsf{neg}\left(\color{blue}{100}\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      14. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \color{blue}{-100}\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\frac{1}{k - 10}}, 1\right)} \]
      16. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      17. lower-+.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      18. metadata-eval50.0

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + \color{blue}{-10}}, 1\right)} \]
    7. Applied egg-rr50.0%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + -10}, 1\right)}} \]
    8. Taylor expanded in k around 0

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{k \cdot \left(k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) - \frac{1}{100}\right) - \frac{1}{10}}, 1\right)} \]
    9. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{k \cdot \left(k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) - \frac{1}{100}\right) + \left(\mathsf{neg}\left(\frac{1}{10}\right)\right)}, 1\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\mathsf{fma}\left(k, k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) - \frac{1}{100}, \mathsf{neg}\left(\frac{1}{10}\right)\right)}, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \color{blue}{k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) + \left(\mathsf{neg}\left(\frac{1}{100}\right)\right)}, \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) + \color{blue}{\frac{-1}{100}}, \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, \frac{-1}{10000} \cdot k - \frac{1}{1000}, \frac{-1}{100}\right)}, \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      6. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{\frac{-1}{10000} \cdot k + \left(\mathsf{neg}\left(\frac{1}{1000}\right)\right)}, \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      7. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{k \cdot \frac{-1}{10000}} + \left(\mathsf{neg}\left(\frac{1}{1000}\right)\right), \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot \frac{-1}{10000} + \color{blue}{\frac{-1}{1000}}, \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, \frac{-1}{10000}, \frac{-1}{1000}\right)}, \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      10. metadata-eval50.3

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), \color{blue}{-0.1}\right), 1\right)} \]
    10. Simplified50.3%

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right)}, 1\right)} \]

    if 0.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999994e304

    1. Initial program 99.8%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6496.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified96.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(10 + k\right)} + 1} \]
      2. distribute-lft-inN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k \cdot 10 + k \cdot k\right)} + 1} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{a}{\left(k \cdot 10 + \color{blue}{k \cdot k}\right) + 1} \]
      4. associate-+r+N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10 + \left(k \cdot k + 1\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \left(\color{blue}{k \cdot k} + 1\right)} \]
      6. lift-fma.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \color{blue}{\mathsf{fma}\left(k, k, 1\right)}} \]
      7. lift-fma.f6496.2

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]
    7. Applied egg-rr96.2%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]

    if 9.9999999999999994e304 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f643.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f643.2

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr3.2%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{\left(1 + \frac{99}{{k}^{2}}\right) - 10 \cdot \frac{1}{k}}{{k}^{2}}} \cdot a \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(1 + \frac{99}{{k}^{2}}\right) - 10 \cdot \frac{1}{k}}{{k}^{2}}} \cdot a \]
      2. associate--l+N/A

        \[\leadsto \frac{\color{blue}{1 + \left(\frac{99}{{k}^{2}} - 10 \cdot \frac{1}{k}\right)}}{{k}^{2}} \cdot a \]
      3. lower-+.f64N/A

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

        \[\leadsto \frac{1 + \left(\frac{99}{\color{blue}{k \cdot k}} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      5. associate-/r*N/A

        \[\leadsto \frac{1 + \left(\color{blue}{\frac{\frac{99}{k}}{k}} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      6. metadata-evalN/A

        \[\leadsto \frac{1 + \left(\frac{\frac{\color{blue}{99 \cdot 1}}{k}}{k} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      7. associate-*r/N/A

        \[\leadsto \frac{1 + \left(\frac{\color{blue}{99 \cdot \frac{1}{k}}}{k} - 10 \cdot \frac{1}{k}\right)}{{k}^{2}} \cdot a \]
      8. associate-*r/N/A

        \[\leadsto \frac{1 + \left(\frac{99 \cdot \frac{1}{k}}{k} - \color{blue}{\frac{10 \cdot 1}{k}}\right)}{{k}^{2}} \cdot a \]
      9. metadata-evalN/A

        \[\leadsto \frac{1 + \left(\frac{99 \cdot \frac{1}{k}}{k} - \frac{\color{blue}{10}}{k}\right)}{{k}^{2}} \cdot a \]
      10. div-subN/A

        \[\leadsto \frac{1 + \color{blue}{\frac{99 \cdot \frac{1}{k} - 10}{k}}}{{k}^{2}} \cdot a \]
      11. lower-/.f64N/A

        \[\leadsto \frac{1 + \color{blue}{\frac{99 \cdot \frac{1}{k} - 10}{k}}}{{k}^{2}} \cdot a \]
      12. sub-negN/A

        \[\leadsto \frac{1 + \frac{\color{blue}{99 \cdot \frac{1}{k} + \left(\mathsf{neg}\left(10\right)\right)}}{k}}{{k}^{2}} \cdot a \]
      13. metadata-evalN/A

        \[\leadsto \frac{1 + \frac{99 \cdot \frac{1}{k} + \color{blue}{-10}}{k}}{{k}^{2}} \cdot a \]
      14. +-commutativeN/A

        \[\leadsto \frac{1 + \frac{\color{blue}{-10 + 99 \cdot \frac{1}{k}}}{k}}{{k}^{2}} \cdot a \]
      15. lower-+.f64N/A

        \[\leadsto \frac{1 + \frac{\color{blue}{-10 + 99 \cdot \frac{1}{k}}}{k}}{{k}^{2}} \cdot a \]
      16. associate-*r/N/A

        \[\leadsto \frac{1 + \frac{-10 + \color{blue}{\frac{99 \cdot 1}{k}}}{k}}{{k}^{2}} \cdot a \]
      17. metadata-evalN/A

        \[\leadsto \frac{1 + \frac{-10 + \frac{\color{blue}{99}}{k}}{k}}{{k}^{2}} \cdot a \]
      18. lower-/.f64N/A

        \[\leadsto \frac{1 + \frac{-10 + \color{blue}{\frac{99}{k}}}{k}}{{k}^{2}} \cdot a \]
      19. unpow2N/A

        \[\leadsto \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{\color{blue}{k \cdot k}} \cdot a \]
      20. lower-*.f6440.7

        \[\leadsto \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{\color{blue}{k \cdot k}} \cdot a \]
    10. Simplified40.7%

      \[\leadsto \color{blue}{\frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}} \cdot a \]

    if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

    1. Initial program 0.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f641.6

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified1.6%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f641.6

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr1.6%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6494.1

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified94.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 4 regimes into one program.
  4. Final simplification59.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right), 1\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;a \cdot \frac{1 + \frac{-10 + \frac{99}{k}}{k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 58.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right), 1\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{\mathsf{fma}\left(a, \frac{-10 + \frac{99}{k}}{k}, a\right)}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k)))))
   (if (<= t_0 0.0)
     (/
      a
      (fma
       (* k (fma k k -100.0))
       (fma k (fma k (fma k -0.0001 -0.001) -0.01) -0.1)
       1.0))
     (if (<= t_0 1e+305)
       (/ a (fma k 10.0 (fma k k 1.0)))
       (if (<= t_0 INFINITY)
         (/ (fma a (/ (+ -10.0 (/ 99.0 k)) k) a) (* k k))
         (* a (fma k (fma k 99.0 -10.0) 1.0)))))))
double code(double a, double k, double m) {
	double t_0 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = a / fma((k * fma(k, k, -100.0)), fma(k, fma(k, fma(k, -0.0001, -0.001), -0.01), -0.1), 1.0);
	} else if (t_0 <= 1e+305) {
		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = fma(a, ((-10.0 + (99.0 / k)) / k), a) / (k * k);
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k)))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(a / fma(Float64(k * fma(k, k, -100.0)), fma(k, fma(k, fma(k, -0.0001, -0.001), -0.01), -0.1), 1.0));
	elseif (t_0 <= 1e+305)
		tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0)));
	elseif (t_0 <= Inf)
		tmp = Float64(fma(a, Float64(Float64(-10.0 + Float64(99.0 / k)) / k), a) / Float64(k * k));
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(a / N[(N[(k * N[(k * k + -100.0), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k * N[(k * -0.0001 + -0.001), $MachinePrecision] + -0.01), $MachinePrecision] + -0.1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(a * N[(N[(-10.0 + N[(99.0 / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] + a), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right), 1\right)}\\

\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, \frac{-10 + \frac{99}{k}}{k}, a\right)}{k \cdot k}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

    1. Initial program 96.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6448.9

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified48.9%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. *-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right) \cdot k} + 1} \]
      3. lift-+.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right)} \cdot k + 1} \]
      4. flip-+N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{k \cdot k - 10 \cdot 10}{k - 10}} \cdot k + 1} \]
      5. associate-*l/N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{\left(k \cdot k - 10 \cdot 10\right) \cdot k}{k - 10}} + 1} \]
      6. div-invN/A

        \[\leadsto \frac{a}{\color{blue}{\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k\right) \cdot \frac{1}{k - 10}} + 1} \]
      7. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k - 10 \cdot 10\right) \cdot k}, \frac{1}{k - 10}, 1\right)} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      10. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(k, k, \mathsf{neg}\left(10 \cdot 10\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      13. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \mathsf{neg}\left(\color{blue}{100}\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      14. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \color{blue}{-100}\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\frac{1}{k - 10}}, 1\right)} \]
      16. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      17. lower-+.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      18. metadata-eval50.0

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + \color{blue}{-10}}, 1\right)} \]
    7. Applied egg-rr50.0%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + -10}, 1\right)}} \]
    8. Taylor expanded in k around 0

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{k \cdot \left(k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) - \frac{1}{100}\right) - \frac{1}{10}}, 1\right)} \]
    9. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{k \cdot \left(k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) - \frac{1}{100}\right) + \left(\mathsf{neg}\left(\frac{1}{10}\right)\right)}, 1\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\mathsf{fma}\left(k, k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) - \frac{1}{100}, \mathsf{neg}\left(\frac{1}{10}\right)\right)}, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \color{blue}{k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) + \left(\mathsf{neg}\left(\frac{1}{100}\right)\right)}, \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) + \color{blue}{\frac{-1}{100}}, \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, \frac{-1}{10000} \cdot k - \frac{1}{1000}, \frac{-1}{100}\right)}, \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      6. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{\frac{-1}{10000} \cdot k + \left(\mathsf{neg}\left(\frac{1}{1000}\right)\right)}, \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      7. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{k \cdot \frac{-1}{10000}} + \left(\mathsf{neg}\left(\frac{1}{1000}\right)\right), \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot \frac{-1}{10000} + \color{blue}{\frac{-1}{1000}}, \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, \frac{-1}{10000}, \frac{-1}{1000}\right)}, \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      10. metadata-eval50.3

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), \color{blue}{-0.1}\right), 1\right)} \]
    10. Simplified50.3%

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right)}, 1\right)} \]

    if 0.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999994e304

    1. Initial program 99.8%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6496.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified96.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(10 + k\right)} + 1} \]
      2. distribute-lft-inN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k \cdot 10 + k \cdot k\right)} + 1} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{a}{\left(k \cdot 10 + \color{blue}{k \cdot k}\right) + 1} \]
      4. associate-+r+N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10 + \left(k \cdot k + 1\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \left(\color{blue}{k \cdot k} + 1\right)} \]
      6. lift-fma.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \color{blue}{\mathsf{fma}\left(k, k, 1\right)}} \]
      7. lift-fma.f6496.2

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]
    7. Applied egg-rr96.2%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]

    if 9.9999999999999994e304 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f643.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f643.2

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr3.2%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{\left(a + -1 \cdot \frac{a + -100 \cdot a}{{k}^{2}}\right) - 10 \cdot \frac{a}{k}}{{k}^{2}}} \]
    9. Simplified32.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, \frac{-10 + \frac{99}{k}}{k}, a\right)}{k \cdot k}} \]

    if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

    1. Initial program 0.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f641.6

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified1.6%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f641.6

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr1.6%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6494.1

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified94.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 4 regimes into one program.
  4. Final simplification58.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right), 1\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;\frac{\mathsf{fma}\left(a, \frac{-10 + \frac{99}{k}}{k}, a\right)}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 57.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right), 1\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k)))))
   (if (<= t_0 0.0)
     (/
      a
      (fma
       (* k (fma k k -100.0))
       (fma k (fma k (fma k -0.0001 -0.001) -0.01) -0.1)
       1.0))
     (if (<= t_0 1e+305)
       (/ a (fma k 10.0 (fma k k 1.0)))
       (if (<= t_0 INFINITY)
         (/ a (* k k))
         (* a (fma k (fma k 99.0 -10.0) 1.0)))))))
double code(double a, double k, double m) {
	double t_0 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = a / fma((k * fma(k, k, -100.0)), fma(k, fma(k, fma(k, -0.0001, -0.001), -0.01), -0.1), 1.0);
	} else if (t_0 <= 1e+305) {
		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = a / (k * k);
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k)))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(a / fma(Float64(k * fma(k, k, -100.0)), fma(k, fma(k, fma(k, -0.0001, -0.001), -0.01), -0.1), 1.0));
	elseif (t_0 <= 1e+305)
		tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0)));
	elseif (t_0 <= Inf)
		tmp = Float64(a / Float64(k * k));
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(a / N[(N[(k * N[(k * k + -100.0), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k * N[(k * -0.0001 + -0.001), $MachinePrecision] + -0.01), $MachinePrecision] + -0.1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right), 1\right)}\\

\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{a}{k \cdot k}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

    1. Initial program 96.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6448.9

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified48.9%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. *-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right) \cdot k} + 1} \]
      3. lift-+.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\left(k + 10\right)} \cdot k + 1} \]
      4. flip-+N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{k \cdot k - 10 \cdot 10}{k - 10}} \cdot k + 1} \]
      5. associate-*l/N/A

        \[\leadsto \frac{a}{\color{blue}{\frac{\left(k \cdot k - 10 \cdot 10\right) \cdot k}{k - 10}} + 1} \]
      6. div-invN/A

        \[\leadsto \frac{a}{\color{blue}{\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k\right) \cdot \frac{1}{k - 10}} + 1} \]
      7. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\left(k \cdot k - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k - 10 \cdot 10\right) \cdot k}, \frac{1}{k - 10}, 1\right)} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} - 10 \cdot 10\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      10. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\left(k \cdot k + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\left(\color{blue}{k \cdot k} + \left(\mathsf{neg}\left(10 \cdot 10\right)\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(k, k, \mathsf{neg}\left(10 \cdot 10\right)\right)} \cdot k, \frac{1}{k - 10}, 1\right)} \]
      13. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \mathsf{neg}\left(\color{blue}{100}\right)\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      14. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, \color{blue}{-100}\right) \cdot k, \frac{1}{k - 10}, 1\right)} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\frac{1}{k - 10}}, 1\right)} \]
      16. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      17. lower-+.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{\color{blue}{k + \left(\mathsf{neg}\left(10\right)\right)}}, 1\right)} \]
      18. metadata-eval50.0

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + \color{blue}{-10}}, 1\right)} \]
    7. Applied egg-rr50.0%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \frac{1}{k + -10}, 1\right)}} \]
    8. Taylor expanded in k around 0

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{k \cdot \left(k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) - \frac{1}{100}\right) - \frac{1}{10}}, 1\right)} \]
    9. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{k \cdot \left(k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) - \frac{1}{100}\right) + \left(\mathsf{neg}\left(\frac{1}{10}\right)\right)}, 1\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\mathsf{fma}\left(k, k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) - \frac{1}{100}, \mathsf{neg}\left(\frac{1}{10}\right)\right)}, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \color{blue}{k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) + \left(\mathsf{neg}\left(\frac{1}{100}\right)\right)}, \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, k \cdot \left(\frac{-1}{10000} \cdot k - \frac{1}{1000}\right) + \color{blue}{\frac{-1}{100}}, \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, \frac{-1}{10000} \cdot k - \frac{1}{1000}, \frac{-1}{100}\right)}, \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      6. sub-negN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{\frac{-1}{10000} \cdot k + \left(\mathsf{neg}\left(\frac{1}{1000}\right)\right)}, \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      7. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{k \cdot \frac{-1}{10000}} + \left(\mathsf{neg}\left(\frac{1}{1000}\right)\right), \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, k \cdot \frac{-1}{10000} + \color{blue}{\frac{-1}{1000}}, \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, \frac{-1}{10000}, \frac{-1}{1000}\right)}, \frac{-1}{100}\right), \mathsf{neg}\left(\frac{1}{10}\right)\right), 1\right)} \]
      10. metadata-eval50.3

        \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), \color{blue}{-0.1}\right), 1\right)} \]
    10. Simplified50.3%

      \[\leadsto \frac{a}{\mathsf{fma}\left(\mathsf{fma}\left(k, k, -100\right) \cdot k, \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right)}, 1\right)} \]

    if 0.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999994e304

    1. Initial program 99.8%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6496.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified96.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(10 + k\right)} + 1} \]
      2. distribute-lft-inN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k \cdot 10 + k \cdot k\right)} + 1} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{a}{\left(k \cdot 10 + \color{blue}{k \cdot k}\right) + 1} \]
      4. associate-+r+N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10 + \left(k \cdot k + 1\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \left(\color{blue}{k \cdot k} + 1\right)} \]
      6. lift-fma.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \color{blue}{\mathsf{fma}\left(k, k, 1\right)}} \]
      7. lift-fma.f6496.2

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]
    7. Applied egg-rr96.2%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]

    if 9.9999999999999994e304 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f643.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
      3. lower-*.f6432.3

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
    8. Simplified32.3%

      \[\leadsto \color{blue}{\frac{a}{k \cdot k}} \]

    if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

    1. Initial program 0.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f641.6

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified1.6%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f641.6

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr1.6%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6494.1

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified94.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 4 regimes into one program.
  4. Final simplification58.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k \cdot \mathsf{fma}\left(k, k, -100\right), \mathsf{fma}\left(k, \mathsf{fma}\left(k, \mathsf{fma}\left(k, -0.0001, -0.001\right), -0.01\right), -0.1\right), 1\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 44.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-320}:\\ \;\;\;\;\frac{a}{k \cdot \left(k + 10\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k)))))
   (if (<= t_0 2e-320)
     (/ a (* k (+ k 10.0)))
     (if (<= t_0 1e+305)
       (/ a (fma k 10.0 1.0))
       (if (<= t_0 INFINITY)
         (/ a (* k k))
         (* a (fma k (fma k 99.0 -10.0) 1.0)))))))
double code(double a, double k, double m) {
	double t_0 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
	double tmp;
	if (t_0 <= 2e-320) {
		tmp = a / (k * (k + 10.0));
	} else if (t_0 <= 1e+305) {
		tmp = a / fma(k, 10.0, 1.0);
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = a / (k * k);
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k)))
	tmp = 0.0
	if (t_0 <= 2e-320)
		tmp = Float64(a / Float64(k * Float64(k + 10.0)));
	elseif (t_0 <= 1e+305)
		tmp = Float64(a / fma(k, 10.0, 1.0));
	elseif (t_0 <= Inf)
		tmp = Float64(a / Float64(k * k));
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-320], N[(a / N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(a / N[(k * 10.0 + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-320}:\\
\;\;\;\;\frac{a}{k \cdot \left(k + 10\right)}\\

\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{a}{k \cdot k}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 1.99998e-320

    1. Initial program 96.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6448.9

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified48.9%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \frac{a}{\color{blue}{{k}^{2} \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}} \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{a}{\color{blue}{\left(k \cdot k\right)} \cdot \left(1 + 10 \cdot \frac{1}{k}\right)} \]
      2. associate-*l*N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)\right)}} \]
      4. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k\right)}} \]
      5. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k\right)} \]
      6. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}\right)} \]
      7. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(k + 10 \cdot \color{blue}{1}\right)} \]
      8. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(k + \color{blue}{10}\right)} \]
      9. lower-+.f6437.4

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)}} \]
    8. Simplified37.4%

      \[\leadsto \frac{a}{\color{blue}{k \cdot \left(k + 10\right)}} \]

    if 1.99998e-320 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999994e304

    1. Initial program 99.8%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6496.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified96.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around 0

      \[\leadsto \frac{a}{\color{blue}{1 + 10 \cdot k}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{10 \cdot k + 1}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10} + 1} \]
      3. lower-fma.f6469.5

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, 1\right)}} \]
    8. Simplified69.5%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, 1\right)}} \]

    if 9.9999999999999994e304 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f643.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
      3. lower-*.f6432.3

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
    8. Simplified32.3%

      \[\leadsto \color{blue}{\frac{a}{k \cdot k}} \]

    if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

    1. Initial program 0.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f641.6

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified1.6%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f641.6

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr1.6%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6494.1

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified94.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 4 regimes into one program.
  4. Final simplification45.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 2 \cdot 10^{-320}:\\ \;\;\;\;\frac{a}{k \cdot \left(k + 10\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 47.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a}{k \cdot k}\\ t_1 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-320}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ a (* k k)))
        (t_1 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k)))))
   (if (<= t_1 2e-320)
     t_0
     (if (<= t_1 1e+305)
       (/ a (fma k 10.0 1.0))
       (if (<= t_1 INFINITY) t_0 (* a (fma k (fma k 99.0 -10.0) 1.0)))))))
double code(double a, double k, double m) {
	double t_0 = a / (k * k);
	double t_1 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
	double tmp;
	if (t_1 <= 2e-320) {
		tmp = t_0;
	} else if (t_1 <= 1e+305) {
		tmp = a / fma(k, 10.0, 1.0);
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = t_0;
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(a / Float64(k * k))
	t_1 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k)))
	tmp = 0.0
	if (t_1 <= 2e-320)
		tmp = t_0;
	elseif (t_1 <= 1e+305)
		tmp = Float64(a / fma(k, 10.0, 1.0));
	elseif (t_1 <= Inf)
		tmp = t_0;
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-320], t$95$0, If[LessEqual[t$95$1, 1e+305], N[(a / N[(k * 10.0 + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$0, N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
t_1 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-320}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 10^{+305}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 1.99998e-320 or 9.9999999999999994e304 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

    1. Initial program 96.4%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6443.7

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified43.7%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
      3. lower-*.f6441.0

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
    8. Simplified41.0%

      \[\leadsto \color{blue}{\frac{a}{k \cdot k}} \]

    if 1.99998e-320 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999994e304

    1. Initial program 99.8%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6496.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified96.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around 0

      \[\leadsto \frac{a}{\color{blue}{1 + 10 \cdot k}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{10 \cdot k + 1}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10} + 1} \]
      3. lower-fma.f6469.5

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, 1\right)}} \]
    8. Simplified69.5%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, 1\right)}} \]

    if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

    1. Initial program 0.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f641.6

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified1.6%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f641.6

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr1.6%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6494.1

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified94.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 2 \cdot 10^{-320}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+305}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, 1\right)}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 47.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a}{k \cdot k}\\ t_1 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\ t_2 := a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-320}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 10^{+305}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ a (* k k)))
        (t_1 (/ (* a (pow k m)) (+ (+ 1.0 (* k 10.0)) (* k k))))
        (t_2 (* a (fma k (fma k 99.0 -10.0) 1.0))))
   (if (<= t_1 2e-320)
     t_0
     (if (<= t_1 1e+305) t_2 (if (<= t_1 INFINITY) t_0 t_2)))))
double code(double a, double k, double m) {
	double t_0 = a / (k * k);
	double t_1 = (a * pow(k, m)) / ((1.0 + (k * 10.0)) + (k * k));
	double t_2 = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	double tmp;
	if (t_1 <= 2e-320) {
		tmp = t_0;
	} else if (t_1 <= 1e+305) {
		tmp = t_2;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = t_0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(a / Float64(k * k))
	t_1 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k)))
	t_2 = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0))
	tmp = 0.0
	if (t_1 <= 2e-320)
		tmp = t_0;
	elseif (t_1 <= 1e+305)
		tmp = t_2;
	elseif (t_1 <= Inf)
		tmp = t_0;
	else
		tmp = t_2;
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-320], t$95$0, If[LessEqual[t$95$1, 1e+305], t$95$2, If[LessEqual[t$95$1, Infinity], t$95$0, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
t_1 := \frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k}\\
t_2 := a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-320}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 10^{+305}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 1.99998e-320 or 9.9999999999999994e304 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

    1. Initial program 96.4%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6443.7

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified43.7%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
      3. lower-*.f6441.0

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
    8. Simplified41.0%

      \[\leadsto \color{blue}{\frac{a}{k \cdot k}} \]

    if 1.99998e-320 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999994e304 or +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

    1. Initial program 69.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6467.0

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified67.0%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f6467.0

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr67.0%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6476.4

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified76.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 2 \cdot 10^{-320}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq 10^{+305}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \mathbf{elif}\;\frac{a \cdot {k}^{m}}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 97.2% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot {k}^{m}\\ \mathbf{if}\;m \leq -5.5 \cdot 10^{-8}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;m \leq 0.00012:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (* a (pow k m))))
   (if (<= m -5.5e-8)
     t_0
     (if (<= m 0.00012) (/ a (fma k 10.0 (fma k k 1.0))) t_0))))
double code(double a, double k, double m) {
	double t_0 = a * pow(k, m);
	double tmp;
	if (m <= -5.5e-8) {
		tmp = t_0;
	} else if (m <= 0.00012) {
		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(a * (k ^ m))
	tmp = 0.0
	if (m <= -5.5e-8)
		tmp = t_0;
	elseif (m <= 0.00012)
		tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0)));
	else
		tmp = t_0;
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -5.5e-8], t$95$0, If[LessEqual[m, 0.00012], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq -5.5 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;m \leq 0.00012:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if m < -5.5000000000000003e-8 or 1.20000000000000003e-4 < m

    1. Initial program 88.8%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
      2. lower-pow.f64100.0

        \[\leadsto a \cdot \color{blue}{{k}^{m}} \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{a \cdot {k}^{m}} \]

    if -5.5000000000000003e-8 < m < 1.20000000000000003e-4

    1. Initial program 93.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6491.1

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified91.1%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(10 + k\right)} + 1} \]
      2. distribute-lft-inN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k \cdot 10 + k \cdot k\right)} + 1} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{a}{\left(k \cdot 10 + \color{blue}{k \cdot k}\right) + 1} \]
      4. associate-+r+N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10 + \left(k \cdot k + 1\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \left(\color{blue}{k \cdot k} + 1\right)} \]
      6. lift-fma.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \color{blue}{\mathsf{fma}\left(k, k, 1\right)}} \]
      7. lift-fma.f6491.1

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]
    7. Applied egg-rr91.1%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 97.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3.7 \cdot 10^{-7}:\\ \;\;\;\;a \cdot {k}^{m}\\ \mathbf{else}:\\ \;\;\;\;a \cdot {k}^{\left(m + -2\right)}\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= k 3.7e-7) (* a (pow k m)) (* a (pow k (+ m -2.0)))))
double code(double a, double k, double m) {
	double tmp;
	if (k <= 3.7e-7) {
		tmp = a * pow(k, m);
	} else {
		tmp = a * pow(k, (m + -2.0));
	}
	return tmp;
}
real(8) function code(a, k, m)
    real(8), intent (in) :: a
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8) :: tmp
    if (k <= 3.7d-7) then
        tmp = a * (k ** m)
    else
        tmp = a * (k ** (m + (-2.0d0)))
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (k <= 3.7e-7) {
		tmp = a * Math.pow(k, m);
	} else {
		tmp = a * Math.pow(k, (m + -2.0));
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if k <= 3.7e-7:
		tmp = a * math.pow(k, m)
	else:
		tmp = a * math.pow(k, (m + -2.0))
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (k <= 3.7e-7)
		tmp = Float64(a * (k ^ m));
	else
		tmp = Float64(a * (k ^ Float64(m + -2.0)));
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (k <= 3.7e-7)
		tmp = a * (k ^ m);
	else
		tmp = a * (k ^ (m + -2.0));
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[k, 3.7e-7], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(a * N[Power[k, N[(m + -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;a \cdot {k}^{m}\\

\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m + -2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 3.70000000000000004e-7

    1. Initial program 94.5%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
      2. lower-pow.f6499.7

        \[\leadsto a \cdot \color{blue}{{k}^{m}} \]
    5. Simplified99.7%

      \[\leadsto \color{blue}{a \cdot {k}^{m}} \]

    if 3.70000000000000004e-7 < k

    1. Initial program 83.6%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}}{{k}^{2}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}}{{k}^{2}}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{a \cdot e^{\color{blue}{\mathsf{neg}\left(m \cdot \log \left(\frac{1}{k}\right)\right)}}}{{k}^{2}} \]
      3. *-commutativeN/A

        \[\leadsto \frac{a \cdot e^{\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{k}\right) \cdot m}\right)}}{{k}^{2}} \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \frac{a \cdot e^{\color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{k}\right)\right)\right) \cdot m}}}{{k}^{2}} \]
      5. exp-prodN/A

        \[\leadsto \frac{a \cdot \color{blue}{{\left(e^{\mathsf{neg}\left(\log \left(\frac{1}{k}\right)\right)}\right)}^{m}}}{{k}^{2}} \]
      6. log-recN/A

        \[\leadsto \frac{a \cdot {\left(e^{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log k\right)\right)}\right)}\right)}^{m}}{{k}^{2}} \]
      7. remove-double-negN/A

        \[\leadsto \frac{a \cdot {\left(e^{\color{blue}{\log k}}\right)}^{m}}{{k}^{2}} \]
      8. rem-exp-logN/A

        \[\leadsto \frac{a \cdot {\color{blue}{k}}^{m}}{{k}^{2}} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{a \cdot {k}^{m}}}{{k}^{2}} \]
      10. lower-pow.f64N/A

        \[\leadsto \frac{a \cdot \color{blue}{{k}^{m}}}{{k}^{2}} \]
      11. unpow2N/A

        \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{k \cdot k}} \]
      12. lower-*.f6483.5

        \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{k \cdot k}} \]
    5. Simplified83.5%

      \[\leadsto \color{blue}{\frac{a \cdot {k}^{m}}{k \cdot k}} \]
    6. Step-by-step derivation
      1. remove-double-divN/A

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{a}}} \cdot {k}^{m}}{k \cdot k} \]
      2. lift-pow.f64N/A

        \[\leadsto \frac{\frac{1}{\frac{1}{a}} \cdot \color{blue}{{k}^{m}}}{k \cdot k} \]
      3. times-fracN/A

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{1}{a}}}{k} \cdot \frac{{k}^{m}}{k}} \]
      4. remove-double-divN/A

        \[\leadsto \frac{\color{blue}{a}}{k} \cdot \frac{{k}^{m}}{k} \]
      5. times-fracN/A

        \[\leadsto \color{blue}{\frac{a \cdot {k}^{m}}{k \cdot k}} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{k \cdot k}} \]
      7. associate-/l*N/A

        \[\leadsto \color{blue}{a \cdot \frac{{k}^{m}}{k \cdot k}} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{{k}^{m}}{k \cdot k} \cdot a} \]
      9. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{{k}^{m}}{k \cdot k} \cdot a} \]
      10. lift-pow.f64N/A

        \[\leadsto \frac{\color{blue}{{k}^{m}}}{k \cdot k} \cdot a \]
      11. lift-*.f64N/A

        \[\leadsto \frac{{k}^{m}}{\color{blue}{k \cdot k}} \cdot a \]
      12. pow2N/A

        \[\leadsto \frac{{k}^{m}}{\color{blue}{{k}^{2}}} \cdot a \]
      13. pow-divN/A

        \[\leadsto \color{blue}{{k}^{\left(m - 2\right)}} \cdot a \]
      14. lower-pow.f64N/A

        \[\leadsto \color{blue}{{k}^{\left(m - 2\right)}} \cdot a \]
      15. sub-negN/A

        \[\leadsto {k}^{\color{blue}{\left(m + \left(\mathsf{neg}\left(2\right)\right)\right)}} \cdot a \]
      16. lower-+.f64N/A

        \[\leadsto {k}^{\color{blue}{\left(m + \left(\mathsf{neg}\left(2\right)\right)\right)}} \cdot a \]
      17. metadata-eval94.1

        \[\leadsto {k}^{\left(m + \color{blue}{-2}\right)} \cdot a \]
    7. Applied egg-rr94.1%

      \[\leadsto \color{blue}{{k}^{\left(m + -2\right)} \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 3.7 \cdot 10^{-7}:\\ \;\;\;\;a \cdot {k}^{m}\\ \mathbf{else}:\\ \;\;\;\;a \cdot {k}^{\left(m + -2\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 61.7% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -1.4 \cdot 10^{+21}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 2.65 \cdot 10^{+14}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= m -1.4e+21)
   (/ a (* k k))
   (if (<= m 2.65e+14)
     (/ a (fma k 10.0 (fma k k 1.0)))
     (* a (fma k (fma k 99.0 -10.0) 1.0)))))
double code(double a, double k, double m) {
	double tmp;
	if (m <= -1.4e+21) {
		tmp = a / (k * k);
	} else if (m <= 2.65e+14) {
		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	tmp = 0.0
	if (m <= -1.4e+21)
		tmp = Float64(a / Float64(k * k));
	elseif (m <= 2.65e+14)
		tmp = Float64(a / fma(k, 10.0, fma(k, k, 1.0)));
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := If[LessEqual[m, -1.4e+21], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.65e+14], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.4 \cdot 10^{+21}:\\
\;\;\;\;\frac{a}{k \cdot k}\\

\mathbf{elif}\;m \leq 2.65 \cdot 10^{+14}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


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

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6439.5

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified39.5%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
      3. lower-*.f6467.7

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
    8. Simplified67.7%

      \[\leadsto \color{blue}{\frac{a}{k \cdot k}} \]

    if -1.4e21 < m < 2.65e14

    1. Initial program 92.7%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6487.1

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified87.1%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(10 + k\right)} + 1} \]
      2. distribute-lft-inN/A

        \[\leadsto \frac{a}{\color{blue}{\left(k \cdot 10 + k \cdot k\right)} + 1} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{a}{\left(k \cdot 10 + \color{blue}{k \cdot k}\right) + 1} \]
      4. associate-+r+N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot 10 + \left(k \cdot k + 1\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \left(\color{blue}{k \cdot k} + 1\right)} \]
      6. lift-fma.f64N/A

        \[\leadsto \frac{a}{k \cdot 10 + \color{blue}{\mathsf{fma}\left(k, k, 1\right)}} \]
      7. lift-fma.f6487.1

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]
    7. Applied egg-rr87.1%

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}} \]

    if 2.65e14 < m

    1. Initial program 80.5%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f643.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f643.2

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr3.2%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6431.0

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified31.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;m \leq -1.4 \cdot 10^{+21}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 2.65 \cdot 10^{+14}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 61.7% accurate, 4.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -1.4 \cdot 10^{+21}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 2.65 \cdot 10^{+14}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= m -1.4e+21)
   (/ a (* k k))
   (if (<= m 2.65e+14)
     (/ a (fma k (+ k 10.0) 1.0))
     (* a (fma k (fma k 99.0 -10.0) 1.0)))))
double code(double a, double k, double m) {
	double tmp;
	if (m <= -1.4e+21) {
		tmp = a / (k * k);
	} else if (m <= 2.65e+14) {
		tmp = a / fma(k, (k + 10.0), 1.0);
	} else {
		tmp = a * fma(k, fma(k, 99.0, -10.0), 1.0);
	}
	return tmp;
}
function code(a, k, m)
	tmp = 0.0
	if (m <= -1.4e+21)
		tmp = Float64(a / Float64(k * k));
	elseif (m <= 2.65e+14)
		tmp = Float64(a / fma(k, Float64(k + 10.0), 1.0));
	else
		tmp = Float64(a * fma(k, fma(k, 99.0, -10.0), 1.0));
	end
	return tmp
end
code[a_, k_, m_] := If[LessEqual[m, -1.4e+21], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.65e+14], N[(a / N[(k * N[(k + 10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a * N[(k * N[(k * 99.0 + -10.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.4 \cdot 10^{+21}:\\
\;\;\;\;\frac{a}{k \cdot k}\\

\mathbf{elif}\;m \leq 2.65 \cdot 10^{+14}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\


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

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6439.5

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified39.5%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
      3. lower-*.f6467.7

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
    8. Simplified67.7%

      \[\leadsto \color{blue}{\frac{a}{k \cdot k}} \]

    if -1.4e21 < m < 2.65e14

    1. Initial program 92.7%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6487.1

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified87.1%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]

    if 2.65e14 < m

    1. Initial program 80.5%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f643.2

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified3.2%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f643.2

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr3.2%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + k \cdot \left(99 \cdot k - 10\right)\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(k \cdot \left(99 \cdot k - 10\right) + 1\right)} \cdot a \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, 99 \cdot k - 10, 1\right)} \cdot a \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{99 \cdot k + \left(\mathsf{neg}\left(10\right)\right)}, 1\right) \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{k \cdot 99} + \left(\mathsf{neg}\left(10\right)\right), 1\right) \cdot a \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k, k \cdot 99 + \color{blue}{-10}, 1\right) \cdot a \]
      6. lower-fma.f6431.0

        \[\leadsto \mathsf{fma}\left(k, \color{blue}{\mathsf{fma}\left(k, 99, -10\right)}, 1\right) \cdot a \]
    10. Simplified31.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)} \cdot a \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;m \leq -1.4 \cdot 10^{+21}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 2.65 \cdot 10^{+14}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, \mathsf{fma}\left(k, 99, -10\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 46.2% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a}{k \cdot k}\\ \mathbf{if}\;k \leq -1 \cdot 10^{-310}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;k \leq 3.7 \cdot 10^{-7}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, -10, 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (/ a (* k k))))
   (if (<= k -1e-310) t_0 (if (<= k 3.7e-7) (* a (fma k -10.0 1.0)) t_0))))
double code(double a, double k, double m) {
	double t_0 = a / (k * k);
	double tmp;
	if (k <= -1e-310) {
		tmp = t_0;
	} else if (k <= 3.7e-7) {
		tmp = a * fma(k, -10.0, 1.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64(a / Float64(k * k))
	tmp = 0.0
	if (k <= -1e-310)
		tmp = t_0;
	elseif (k <= 3.7e-7)
		tmp = Float64(a * fma(k, -10.0, 1.0));
	else
		tmp = t_0;
	end
	return tmp
end
code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1e-310], t$95$0, If[LessEqual[k, 3.7e-7], N[(a * N[(k * -10.0 + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{a}{k \cdot k}\\
\mathbf{if}\;k \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;k \leq 3.7 \cdot 10^{-7}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(k, -10, 1\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < -9.999999999999969e-311 or 3.70000000000000004e-7 < k

    1. Initial program 85.4%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6444.9

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified44.9%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a}{{k}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
      3. lower-*.f6449.2

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]
    8. Simplified49.2%

      \[\leadsto \color{blue}{\frac{a}{k \cdot k}} \]

    if -9.999999999999969e-311 < k < 3.70000000000000004e-7

    1. Initial program 100.0%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Taylor expanded in m around 0

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

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

        \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
      4. +-commutativeN/A

        \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
      5. metadata-evalN/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
      6. lft-mult-inverseN/A

        \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
      7. associate-*l*N/A

        \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
      10. +-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
      11. *-commutativeN/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
      12. lower-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
      14. distribute-rgt-inN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
      15. *-lft-identityN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
      16. associate-*l*N/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
      17. lft-mult-inverseN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
      18. metadata-evalN/A

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
      19. lower-+.f6455.6

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
    5. Simplified55.6%

      \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      4. lift-/.f64N/A

        \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
      6. lower-*.f6455.6

        \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    7. Applied egg-rr55.6%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(1 + -10 \cdot k\right)} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-10 \cdot k + 1\right)} \cdot a \]
      2. *-commutativeN/A

        \[\leadsto \left(\color{blue}{k \cdot -10} + 1\right) \cdot a \]
      3. lower-fma.f6455.6

        \[\leadsto \color{blue}{\mathsf{fma}\left(k, -10, 1\right)} \cdot a \]
    10. Simplified55.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, -10, 1\right)} \cdot a \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;k \leq 3.7 \cdot 10^{-7}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(k, -10, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 21.3% accurate, 11.2× speedup?

\[\begin{array}{l} \\ a \cdot \mathsf{fma}\left(k, -10, 1\right) \end{array} \]
(FPCore (a k m) :precision binary64 (* a (fma k -10.0 1.0)))
double code(double a, double k, double m) {
	return a * fma(k, -10.0, 1.0);
}
function code(a, k, m)
	return Float64(a * fma(k, -10.0, 1.0))
end
code[a_, k_, m_] := N[(a * N[(k * -10.0 + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
a \cdot \mathsf{fma}\left(k, -10, 1\right)
\end{array}
Derivation
  1. Initial program 90.5%

    \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
  2. Add Preprocessing
  3. Taylor expanded in m around 0

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

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

      \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
    3. distribute-rgt-inN/A

      \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
    4. +-commutativeN/A

      \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
    5. metadata-evalN/A

      \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
    6. lft-mult-inverseN/A

      \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
    7. associate-*l*N/A

      \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
    8. *-lft-identityN/A

      \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
    9. distribute-rgt-inN/A

      \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
    10. +-commutativeN/A

      \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
    11. *-commutativeN/A

      \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
    12. lower-fma.f64N/A

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
    13. *-commutativeN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
    14. distribute-rgt-inN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
    15. *-lft-identityN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
    16. associate-*l*N/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
    17. lft-mult-inverseN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
    18. metadata-evalN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
    19. lower-+.f6448.7

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
  5. Simplified48.7%

    \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
  6. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k + 10\right)} + 1} \]
    2. lift-fma.f64N/A

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    3. div-invN/A

      \[\leadsto \color{blue}{a \cdot \frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    4. lift-/.f64N/A

      \[\leadsto a \cdot \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
    5. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
    6. lower-*.f6448.7

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
  7. Applied egg-rr48.7%

    \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(k, k + 10, 1\right)} \cdot a} \]
  8. Taylor expanded in k around 0

    \[\leadsto \color{blue}{\left(1 + -10 \cdot k\right)} \cdot a \]
  9. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \color{blue}{\left(-10 \cdot k + 1\right)} \cdot a \]
    2. *-commutativeN/A

      \[\leadsto \left(\color{blue}{k \cdot -10} + 1\right) \cdot a \]
    3. lower-fma.f6425.0

      \[\leadsto \color{blue}{\mathsf{fma}\left(k, -10, 1\right)} \cdot a \]
  10. Simplified25.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(k, -10, 1\right)} \cdot a \]
  11. Final simplification25.0%

    \[\leadsto a \cdot \mathsf{fma}\left(k, -10, 1\right) \]
  12. Add Preprocessing

Alternative 17: 20.3% accurate, 134.0× speedup?

\[\begin{array}{l} \\ a \end{array} \]
(FPCore (a k m) :precision binary64 a)
double code(double a, double k, double m) {
	return a;
}
real(8) function code(a, k, m)
    real(8), intent (in) :: a
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    code = a
end function
public static double code(double a, double k, double m) {
	return a;
}
def code(a, k, m):
	return a
function code(a, k, m)
	return a
end
function tmp = code(a, k, m)
	tmp = a;
end
code[a_, k_, m_] := a
\begin{array}{l}

\\
a
\end{array}
Derivation
  1. Initial program 90.5%

    \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
  2. Add Preprocessing
  3. Taylor expanded in m around 0

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

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

      \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{k \cdot k}\right)} \]
    3. distribute-rgt-inN/A

      \[\leadsto \frac{a}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \]
    4. +-commutativeN/A

      \[\leadsto \frac{a}{\color{blue}{k \cdot \left(10 + k\right) + 1}} \]
    5. metadata-evalN/A

      \[\leadsto \frac{a}{k \cdot \left(\color{blue}{10 \cdot 1} + k\right) + 1} \]
    6. lft-mult-inverseN/A

      \[\leadsto \frac{a}{k \cdot \left(10 \cdot \color{blue}{\left(\frac{1}{k} \cdot k\right)} + k\right) + 1} \]
    7. associate-*l*N/A

      \[\leadsto \frac{a}{k \cdot \left(\color{blue}{\left(10 \cdot \frac{1}{k}\right) \cdot k} + k\right) + 1} \]
    8. *-lft-identityN/A

      \[\leadsto \frac{a}{k \cdot \left(\left(10 \cdot \frac{1}{k}\right) \cdot k + \color{blue}{1 \cdot k}\right) + 1} \]
    9. distribute-rgt-inN/A

      \[\leadsto \frac{a}{k \cdot \color{blue}{\left(k \cdot \left(10 \cdot \frac{1}{k} + 1\right)\right)} + 1} \]
    10. +-commutativeN/A

      \[\leadsto \frac{a}{k \cdot \left(k \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}\right) + 1} \]
    11. *-commutativeN/A

      \[\leadsto \frac{a}{k \cdot \color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right)} + 1} \]
    12. lower-fma.f64N/A

      \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(k, \left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, 1\right)}} \]
    13. *-commutativeN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k \cdot \left(1 + 10 \cdot \frac{1}{k}\right)}, 1\right)} \]
    14. distribute-rgt-inN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{1 \cdot k + \left(10 \cdot \frac{1}{k}\right) \cdot k}, 1\right)} \]
    15. *-lft-identityN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k} + \left(10 \cdot \frac{1}{k}\right) \cdot k, 1\right)} \]
    16. associate-*l*N/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10 \cdot \left(\frac{1}{k} \cdot k\right)}, 1\right)} \]
    17. lft-mult-inverseN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + 10 \cdot \color{blue}{1}, 1\right)} \]
    18. metadata-evalN/A

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, k + \color{blue}{10}, 1\right)} \]
    19. lower-+.f6448.7

      \[\leadsto \frac{a}{\mathsf{fma}\left(k, \color{blue}{k + 10}, 1\right)} \]
  5. Simplified48.7%

    \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(k, k + 10, 1\right)}} \]
  6. Taylor expanded in k around 0

    \[\leadsto \frac{a}{\color{blue}{1}} \]
  7. Step-by-step derivation
    1. Simplified22.2%

      \[\leadsto \frac{a}{\color{blue}{1}} \]
    2. Step-by-step derivation
      1. /-rgt-identity22.2

        \[\leadsto \color{blue}{a} \]
    3. Applied egg-rr22.2%

      \[\leadsto \color{blue}{a} \]
    4. Add Preprocessing

    Reproduce

    ?
    herbie shell --seed 2024215 
    (FPCore (a k m)
      :name "Falkner and Boettcher, Appendix A"
      :precision binary64
      (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))