Falkner and Boettcher, Appendix A

Percentage Accurate: 90.0% → 99.8%
Time: 10.2s
Alternatives: 16
Speedup: 1.1×

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 16 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: 99.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 10^{-137}:\\ \;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\ \mathbf{elif}\;k \leq 5 \cdot 10^{+134}:\\ \;\;\;\;\frac{{k}^{m}}{\mathsf{fma}\left(k + 10, k, 1\right)} \cdot a\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{k}{\frac{a \cdot {k}^{m}}{k}}\right)}^{-1}\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= k 1e-137)
   (/ a (pow k (- m)))
   (if (<= k 5e+134)
     (* (/ (pow k m) (fma (+ k 10.0) k 1.0)) a)
     (pow (/ k (/ (* a (pow k m)) k)) -1.0))))
double code(double a, double k, double m) {
	double tmp;
	if (k <= 1e-137) {
		tmp = a / pow(k, -m);
	} else if (k <= 5e+134) {
		tmp = (pow(k, m) / fma((k + 10.0), k, 1.0)) * a;
	} else {
		tmp = pow((k / ((a * pow(k, m)) / k)), -1.0);
	}
	return tmp;
}
function code(a, k, m)
	tmp = 0.0
	if (k <= 1e-137)
		tmp = Float64(a / (k ^ Float64(-m)));
	elseif (k <= 5e+134)
		tmp = Float64(Float64((k ^ m) / fma(Float64(k + 10.0), k, 1.0)) * a);
	else
		tmp = Float64(k / Float64(Float64(a * (k ^ m)) / k)) ^ -1.0;
	end
	return tmp
end
code[a_, k_, m_] := If[LessEqual[k, 1e-137], N[(a / N[Power[k, (-m)], $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 5e+134], N[(N[(N[Power[k, m], $MachinePrecision] / N[(N[(k + 10.0), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], N[Power[N[(k / N[(N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 10^{-137}:\\
\;\;\;\;\frac{a}{{k}^{\left(-m\right)}}\\

\mathbf{elif}\;k \leq 5 \cdot 10^{+134}:\\
\;\;\;\;\frac{{k}^{m}}{\mathsf{fma}\left(k + 10, k, 1\right)} \cdot a\\

\mathbf{else}:\\
\;\;\;\;{\left(\frac{k}{\frac{a \cdot {k}^{m}}{k}}\right)}^{-1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 9.99999999999999978e-138

    1. Initial program 95.1%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{\frac{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)}{{k}^{m}}} \]
      18. lower-+.f6495.1

        \[\leadsto \frac{a}{\frac{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)}{{k}^{m}}} \]
    4. Applied rewrites95.1%

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

      \[\leadsto \frac{a}{\color{blue}{\frac{1}{{k}^{m}}}} \]
    6. Step-by-step derivation
      1. rem-exp-logN/A

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

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

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

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

        \[\leadsto \frac{a}{\frac{1}{\color{blue}{e^{\left(-1 \cdot \log \left(\frac{1}{k}\right)\right) \cdot m}}}} \]
      6. associate-*r*N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{e^{\color{blue}{\mathsf{neg}\left(\log k \cdot m\right)}}} \]
      14. distribute-rgt-neg-outN/A

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

        \[\leadsto \frac{a}{e^{\log k \cdot \color{blue}{\left(-1 \cdot m\right)}}} \]
      16. exp-to-powN/A

        \[\leadsto \frac{a}{\color{blue}{{k}^{\left(-1 \cdot m\right)}}} \]
      17. lower-pow.f64N/A

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

        \[\leadsto \frac{a}{{k}^{\color{blue}{\left(\mathsf{neg}\left(m\right)\right)}}} \]
      19. lower-neg.f64100.0

        \[\leadsto \frac{a}{{k}^{\color{blue}{\left(-m\right)}}} \]
    7. Applied rewrites100.0%

      \[\leadsto \frac{a}{\color{blue}{{k}^{\left(-m\right)}}} \]

    if 9.99999999999999978e-138 < k < 4.99999999999999981e134

    1. Initial program 99.9%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
      6. lower-/.f6499.9

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
      17. lower-+.f6499.9

        \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
    4. Applied rewrites99.9%

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

    if 4.99999999999999981e134 < k

    1. Initial program 67.5%

      \[\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. *-rgt-identityN/A

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

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

        \[\leadsto \frac{a}{{k}^{2}} \cdot \frac{e^{-1 \cdot \color{blue}{\left(\log \left(\frac{1}{k}\right) \cdot m\right)}}}{1} \]
      4. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \frac{a}{{k}^{2}} \cdot \frac{{\color{blue}{k}}^{m}}{1} \]
      10. /-rgt-identityN/A

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

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

        \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \cdot {k}^{m} \]
      13. associate-/r*N/A

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

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

        \[\leadsto \frac{\color{blue}{\frac{a}{k}}}{k} \cdot {k}^{m} \]
      16. lower-pow.f6488.1

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

      \[\leadsto \color{blue}{\frac{\frac{a}{k}}{k} \cdot {k}^{m}} \]
    6. Step-by-step derivation
      1. Applied rewrites99.9%

        \[\leadsto \frac{1}{\color{blue}{\frac{k}{\frac{a \cdot {k}^{m}}{k}}}} \]
    7. Recombined 3 regimes into one program.
    8. Final simplification100.0%

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

    Alternative 2: 57.6% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;{\left(k \cdot \mathsf{fma}\left(\frac{\frac{{a}^{-1}}{k}}{k} + \frac{\frac{10}{a}}{k}, k, \frac{k}{a}\right)\right)}^{-1}\\ \mathbf{elif}\;t\_0 \leq 10^{+298}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{\frac{\frac{a \cdot \mathsf{fma}\left(-10, k, 99\right)}{k \cdot k}}{k}}{k}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\right)\\ \end{array} \end{array} \]
    (FPCore (a k m)
     :precision binary64
     (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))))
       (if (<= t_0 0.0)
         (pow
          (* k (fma (+ (/ (/ (pow a -1.0) k) k) (/ (/ 10.0 a) k)) k (/ k a)))
          -1.0)
         (if (<= t_0 1e+298)
           (/ a (fma (+ 10.0 k) k 1.0))
           (if (<= t_0 INFINITY)
             (/ (/ (/ (* a (fma -10.0 k 99.0)) (* k k)) k) k)
             (fma (* a (fma (- k) -99.0 -10.0)) k a))))))
    double code(double a, double k, double m) {
    	double t_0 = (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
    	double tmp;
    	if (t_0 <= 0.0) {
    		tmp = pow((k * fma((((pow(a, -1.0) / k) / k) + ((10.0 / a) / k)), k, (k / a))), -1.0);
    	} else if (t_0 <= 1e+298) {
    		tmp = a / fma((10.0 + k), k, 1.0);
    	} else if (t_0 <= ((double) INFINITY)) {
    		tmp = (((a * fma(-10.0, k, 99.0)) / (k * k)) / k) / k;
    	} else {
    		tmp = fma((a * fma(-k, -99.0, -10.0)), k, a);
    	}
    	return tmp;
    }
    
    function code(a, k, m)
    	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
    	tmp = 0.0
    	if (t_0 <= 0.0)
    		tmp = Float64(k * fma(Float64(Float64(Float64((a ^ -1.0) / k) / k) + Float64(Float64(10.0 / a) / k)), k, Float64(k / a))) ^ -1.0;
    	elseif (t_0 <= 1e+298)
    		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
    	elseif (t_0 <= Inf)
    		tmp = Float64(Float64(Float64(Float64(a * fma(-10.0, k, 99.0)) / Float64(k * k)) / k) / k);
    	else
    		tmp = fma(Float64(a * fma(Float64(-k), -99.0, -10.0)), k, a);
    	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[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Power[N[(k * N[(N[(N[(N[(N[Power[a, -1.0], $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] + N[(N[(10.0 / a), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * k + N[(k / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], If[LessEqual[t$95$0, 1e+298], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[(N[(a * N[(-10.0 * k + 99.0), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision], N[(N[(a * N[((-k) * -99.0 + -10.0), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
    \mathbf{if}\;t\_0 \leq 0:\\
    \;\;\;\;{\left(k \cdot \mathsf{fma}\left(\frac{\frac{{a}^{-1}}{k}}{k} + \frac{\frac{10}{a}}{k}, k, \frac{k}{a}\right)\right)}^{-1}\\
    
    \mathbf{elif}\;t\_0 \leq 10^{+298}:\\
    \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
    
    \mathbf{elif}\;t\_0 \leq \infty:\\
    \;\;\;\;\frac{\frac{\frac{a \cdot \mathsf{fma}\left(-10, k, 99\right)}{k \cdot k}}{k}}{k}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\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.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{{k}^{2} \cdot \color{blue}{\left(\frac{1}{a} + \left(\frac{1}{a \cdot {k}^{2}} + \frac{10}{a \cdot k}\right)\right)}} \]
        3. Step-by-step derivation
          1. Applied rewrites56.6%

            \[\leadsto \frac{1}{k \cdot \color{blue}{\mathsf{fma}\left(\frac{\frac{\frac{1}{a}}{k}}{k} + \frac{\frac{10}{a}}{k}, k, \frac{k}{a}\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.9999999999999996e297

          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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 9.9999999999999996e297 < (/.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\left(a + -1 \cdot \frac{a + -100 \cdot a}{{k}^{2}}\right) - 10 \cdot \frac{a}{k}}{\color{blue}{{k}^{2}}} \]
          7. Step-by-step derivation
            1. Applied rewrites23.5%

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

              \[\leadsto \frac{\frac{\frac{-10 \cdot \left(a \cdot k\right) - -99 \cdot a}{{k}^{2}}}{k}}{k} \]
            3. Step-by-step derivation
              1. Applied rewrites44.3%

                \[\leadsto \frac{\frac{\frac{a \cdot \mathsf{fma}\left(-10, k, 99\right)}{k \cdot k}}{k}}{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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
              7. Step-by-step derivation
                1. Applied rewrites12.9%

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

                  \[\leadsto a + \color{blue}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                3. Step-by-step derivation
                  1. Applied rewrites89.1%

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

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

                Alternative 3: 46.6% 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 + 10 \cdot k\right) + k \cdot k}\\ \mathbf{if}\;t\_1 \leq 4 \cdot 10^{-229}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 10^{+298}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10, k, 1\right)}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\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 (* 10.0 k)) (* k k)))))
                   (if (<= t_1 4e-229)
                     t_0
                     (if (<= t_1 1e+298)
                       (/ a (fma 10.0 k 1.0))
                       (if (<= t_1 INFINITY) t_0 (fma (* a (fma (- k) -99.0 -10.0)) k a))))))
                double code(double a, double k, double m) {
                	double t_0 = a / (k * k);
                	double t_1 = (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
                	double tmp;
                	if (t_1 <= 4e-229) {
                		tmp = t_0;
                	} else if (t_1 <= 1e+298) {
                		tmp = a / fma(10.0, k, 1.0);
                	} else if (t_1 <= ((double) INFINITY)) {
                		tmp = t_0;
                	} else {
                		tmp = fma((a * fma(-k, -99.0, -10.0)), k, a);
                	}
                	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(10.0 * k)) + Float64(k * k)))
                	tmp = 0.0
                	if (t_1 <= 4e-229)
                		tmp = t_0;
                	elseif (t_1 <= 1e+298)
                		tmp = Float64(a / fma(10.0, k, 1.0));
                	elseif (t_1 <= Inf)
                		tmp = t_0;
                	else
                		tmp = fma(Float64(a * fma(Float64(-k), -99.0, -10.0)), k, a);
                	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[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e-229], t$95$0, If[LessEqual[t$95$1, 1e+298], N[(a / N[(10.0 * k + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$0, N[(N[(a * N[((-k) * -99.0 + -10.0), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision]]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{a}{k \cdot k}\\
                t_1 := \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
                \mathbf{if}\;t\_1 \leq 4 \cdot 10^{-229}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;t\_1 \leq 10^{+298}:\\
                \;\;\;\;\frac{a}{\mathsf{fma}\left(10, k, 1\right)}\\
                
                \mathbf{elif}\;t\_1 \leq \infty:\\
                \;\;\;\;t\_0\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\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))) < 4.00000000000000028e-229 or 9.9999999999999996e297 < (/.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 97.3%

                    \[\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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                  7. Step-by-step derivation
                    1. Applied rewrites15.0%

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

                      \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites7.8%

                        \[\leadsto \left(k \cdot a\right) \cdot -10 \]
                      2. Taylor expanded in k around inf

                        \[\leadsto \frac{a}{\color{blue}{{k}^{2}}} \]
                      3. Step-by-step derivation
                        1. Applied rewrites38.5%

                          \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]

                        if 4.00000000000000028e-229 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 9.9999999999999996e297

                        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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{a}{\mathsf{fma}\left(10, k, 1\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites63.6%

                            \[\leadsto \frac{a}{\mathsf{fma}\left(10, k, 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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                          7. Step-by-step derivation
                            1. Applied rewrites12.9%

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

                              \[\leadsto a + \color{blue}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                            3. Step-by-step derivation
                              1. Applied rewrites89.1%

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

                            Alternative 4: 97.7% accurate, 0.5× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 4 \cdot 10^{+271}:\\ \;\;\;\;\frac{{k}^{m}}{\mathsf{fma}\left(k + 10, k, 1\right)} \cdot a\\ \mathbf{else}:\\ \;\;\;\;{k}^{m} \cdot a\\ \end{array} \end{array} \]
                            (FPCore (a k m)
                             :precision binary64
                             (if (<= (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))) 4e+271)
                               (* (/ (pow k m) (fma (+ k 10.0) k 1.0)) a)
                               (* (pow k m) a)))
                            double code(double a, double k, double m) {
                            	double tmp;
                            	if (((a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 4e+271) {
                            		tmp = (pow(k, m) / fma((k + 10.0), k, 1.0)) * a;
                            	} else {
                            		tmp = pow(k, m) * a;
                            	}
                            	return tmp;
                            }
                            
                            function code(a, k, m)
                            	tmp = 0.0
                            	if (Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) <= 4e+271)
                            		tmp = Float64(Float64((k ^ m) / fma(Float64(k + 10.0), k, 1.0)) * a);
                            	else
                            		tmp = Float64((k ^ m) * a);
                            	end
                            	return tmp
                            end
                            
                            code[a_, k_, m_] := If[LessEqual[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], 4e+271], N[(N[(N[Power[k, m], $MachinePrecision] / N[(N[(k + 10.0), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 4 \cdot 10^{+271}:\\
                            \;\;\;\;\frac{{k}^{m}}{\mathsf{fma}\left(k + 10, k, 1\right)} \cdot a\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;{k}^{m} \cdot a\\
                            
                            
                            \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))) < 3.99999999999999981e271

                              1. Initial program 97.2%

                                \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. lift-/.f64N/A

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

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

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

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

                                  \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
                                6. lower-/.f6497.2

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
                                17. lower-+.f6497.2

                                  \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
                              4. Applied rewrites97.2%

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

                              if 3.99999999999999981e271 < (/.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 66.7%

                                \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. lift-/.f64N/A

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

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

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

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

                                  \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
                                6. lower-/.f6466.7

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
                                17. lower-+.f6466.7

                                  \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
                              4. Applied rewrites66.7%

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

                                \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                              6. Step-by-step derivation
                                1. lower-pow.f64100.0

                                  \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                              7. Applied rewrites100.0%

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

                            Alternative 5: 17.2% accurate, 0.9× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 0:\\ \;\;\;\;\left(-10 \cdot a\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-10, k, 1\right) \cdot a\\ \end{array} \end{array} \]
                            (FPCore (a k m)
                             :precision binary64
                             (if (<= (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))) 0.0)
                               (* (* -10.0 a) k)
                               (* (fma -10.0 k 1.0) a)))
                            double code(double a, double k, double m) {
                            	double tmp;
                            	if (((a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 0.0) {
                            		tmp = (-10.0 * a) * k;
                            	} else {
                            		tmp = fma(-10.0, k, 1.0) * a;
                            	}
                            	return tmp;
                            }
                            
                            function code(a, k, m)
                            	tmp = 0.0
                            	if (Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) <= 0.0)
                            		tmp = Float64(Float64(-10.0 * a) * k);
                            	else
                            		tmp = Float64(fma(-10.0, k, 1.0) * a);
                            	end
                            	return tmp
                            end
                            
                            code[a_, k_, m_] := If[LessEqual[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], 0.0], N[(N[(-10.0 * a), $MachinePrecision] * k), $MachinePrecision], N[(N[(-10.0 * k + 1.0), $MachinePrecision] * a), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 0:\\
                            \;\;\;\;\left(-10 \cdot a\right) \cdot k\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(-10, k, 1\right) \cdot a\\
                            
                            
                            \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))) < 0.0

                              1. Initial program 96.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                              7. Step-by-step derivation
                                1. Applied rewrites15.5%

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

                                  \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
                                3. Step-by-step derivation
                                  1. Applied rewrites7.8%

                                    \[\leadsto \left(k \cdot a\right) \cdot -10 \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites7.8%

                                      \[\leadsto \left(-10 \cdot a\right) \cdot k \]

                                    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)))

                                    1. Initial program 80.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites30.0%

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

                                        \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites30.0%

                                          \[\leadsto \mathsf{fma}\left(-10, k, 1\right) \cdot \color{blue}{a} \]
                                      4. Recombined 2 regimes into one program.
                                      5. Add Preprocessing

                                      Alternative 6: 97.0% accurate, 1.0× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 8.8 \cdot 10^{-6}:\\ \;\;\;\;{k}^{m} \cdot a\\ \mathbf{elif}\;k \leq 600000:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{k} \cdot {k}^{\left(-1 + m\right)}\\ \end{array} \end{array} \]
                                      (FPCore (a k m)
                                       :precision binary64
                                       (if (<= k 8.8e-6)
                                         (* (pow k m) a)
                                         (if (<= k 600000.0)
                                           (/ a (fma (+ 10.0 k) k 1.0))
                                           (* (/ a k) (pow k (+ -1.0 m))))))
                                      double code(double a, double k, double m) {
                                      	double tmp;
                                      	if (k <= 8.8e-6) {
                                      		tmp = pow(k, m) * a;
                                      	} else if (k <= 600000.0) {
                                      		tmp = a / fma((10.0 + k), k, 1.0);
                                      	} else {
                                      		tmp = (a / k) * pow(k, (-1.0 + m));
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(a, k, m)
                                      	tmp = 0.0
                                      	if (k <= 8.8e-6)
                                      		tmp = Float64((k ^ m) * a);
                                      	elseif (k <= 600000.0)
                                      		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
                                      	else
                                      		tmp = Float64(Float64(a / k) * (k ^ Float64(-1.0 + m)));
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[a_, k_, m_] := If[LessEqual[k, 8.8e-6], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], If[LessEqual[k, 600000.0], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(a / k), $MachinePrecision] * N[Power[k, N[(-1.0 + m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;k \leq 8.8 \cdot 10^{-6}:\\
                                      \;\;\;\;{k}^{m} \cdot a\\
                                      
                                      \mathbf{elif}\;k \leq 600000:\\
                                      \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{a}{k} \cdot {k}^{\left(-1 + m\right)}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if k < 8.8000000000000004e-6

                                        1. Initial program 96.2%

                                          \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
                                        2. Add Preprocessing
                                        3. Step-by-step derivation
                                          1. lift-/.f64N/A

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

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

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

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

                                            \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
                                          6. lower-/.f6496.2

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
                                        4. Applied rewrites96.2%

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

                                          \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                                        6. Step-by-step derivation
                                          1. lower-pow.f6499.5

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

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

                                        if 8.8000000000000004e-6 < k < 6e5

                                        1. Initial program 99.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if 6e5 < k

                                        1. Initial program 81.5%

                                          \[\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. *-rgt-identityN/A

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

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

                                            \[\leadsto \frac{a}{{k}^{2}} \cdot \frac{e^{-1 \cdot \color{blue}{\left(\log \left(\frac{1}{k}\right) \cdot m\right)}}}{1} \]
                                          4. associate-*r*N/A

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

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

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

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

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

                                            \[\leadsto \frac{a}{{k}^{2}} \cdot \frac{{\color{blue}{k}}^{m}}{1} \]
                                          10. /-rgt-identityN/A

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

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

                                            \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \cdot {k}^{m} \]
                                          13. associate-/r*N/A

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

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

                                            \[\leadsto \frac{\color{blue}{\frac{a}{k}}}{k} \cdot {k}^{m} \]
                                          16. lower-pow.f6493.2

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

                                          \[\leadsto \color{blue}{\frac{\frac{a}{k}}{k} \cdot {k}^{m}} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites97.3%

                                            \[\leadsto \frac{a}{k} \cdot \color{blue}{{k}^{\left(-1 + m\right)}} \]
                                        7. Recombined 3 regimes into one program.
                                        8. Add Preprocessing

                                        Alternative 7: 96.9% accurate, 1.1× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 8.8 \cdot 10^{-6}:\\ \;\;\;\;{k}^{m} \cdot a\\ \mathbf{elif}\;k \leq 600000:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;{k}^{\left(-2 + m\right)} \cdot a\\ \end{array} \end{array} \]
                                        (FPCore (a k m)
                                         :precision binary64
                                         (if (<= k 8.8e-6)
                                           (* (pow k m) a)
                                           (if (<= k 600000.0) (/ a (fma (+ 10.0 k) k 1.0)) (* (pow k (+ -2.0 m)) a))))
                                        double code(double a, double k, double m) {
                                        	double tmp;
                                        	if (k <= 8.8e-6) {
                                        		tmp = pow(k, m) * a;
                                        	} else if (k <= 600000.0) {
                                        		tmp = a / fma((10.0 + k), k, 1.0);
                                        	} else {
                                        		tmp = pow(k, (-2.0 + m)) * a;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(a, k, m)
                                        	tmp = 0.0
                                        	if (k <= 8.8e-6)
                                        		tmp = Float64((k ^ m) * a);
                                        	elseif (k <= 600000.0)
                                        		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
                                        	else
                                        		tmp = Float64((k ^ Float64(-2.0 + m)) * a);
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[a_, k_, m_] := If[LessEqual[k, 8.8e-6], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], If[LessEqual[k, 600000.0], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, N[(-2.0 + m), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;k \leq 8.8 \cdot 10^{-6}:\\
                                        \;\;\;\;{k}^{m} \cdot a\\
                                        
                                        \mathbf{elif}\;k \leq 600000:\\
                                        \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;{k}^{\left(-2 + m\right)} \cdot a\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if k < 8.8000000000000004e-6

                                          1. Initial program 96.2%

                                            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
                                          2. Add Preprocessing
                                          3. Step-by-step derivation
                                            1. lift-/.f64N/A

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

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

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

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

                                              \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
                                            6. lower-/.f6496.2

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
                                          4. Applied rewrites96.2%

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

                                            \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                                          6. Step-by-step derivation
                                            1. lower-pow.f6499.5

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

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

                                          if 8.8000000000000004e-6 < k < 6e5

                                          1. Initial program 99.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          if 6e5 < k

                                          1. Initial program 81.5%

                                            \[\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. *-rgt-identityN/A

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

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

                                              \[\leadsto \frac{a}{{k}^{2}} \cdot \frac{e^{-1 \cdot \color{blue}{\left(\log \left(\frac{1}{k}\right) \cdot m\right)}}}{1} \]
                                            4. associate-*r*N/A

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

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

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

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

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

                                              \[\leadsto \frac{a}{{k}^{2}} \cdot \frac{{\color{blue}{k}}^{m}}{1} \]
                                            10. /-rgt-identityN/A

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

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

                                              \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \cdot {k}^{m} \]
                                            13. associate-/r*N/A

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

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

                                              \[\leadsto \frac{\color{blue}{\frac{a}{k}}}{k} \cdot {k}^{m} \]
                                            16. lower-pow.f6493.2

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

                                            \[\leadsto \color{blue}{\frac{\frac{a}{k}}{k} \cdot {k}^{m}} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites97.3%

                                              \[\leadsto \frac{a}{k} \cdot \color{blue}{{k}^{\left(-1 + m\right)}} \]
                                            2. Step-by-step derivation
                                              1. Applied rewrites93.4%

                                                \[\leadsto a \cdot \color{blue}{{k}^{\left(-1 + \left(-1 + m\right)\right)}} \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites93.4%

                                                  \[\leadsto \color{blue}{{k}^{\left(-2 + m\right)} \cdot a} \]
                                              3. Recombined 3 regimes into one program.
                                              4. Add Preprocessing

                                              Alternative 8: 97.2% accurate, 1.1× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -1.55 \cdot 10^{-6} \lor \neg \left(m \leq 2.45 \cdot 10^{-12}\right):\\ \;\;\;\;{k}^{m} \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \end{array} \end{array} \]
                                              (FPCore (a k m)
                                               :precision binary64
                                               (if (or (<= m -1.55e-6) (not (<= m 2.45e-12)))
                                                 (* (pow k m) a)
                                                 (/ a (fma (+ 10.0 k) k 1.0))))
                                              double code(double a, double k, double m) {
                                              	double tmp;
                                              	if ((m <= -1.55e-6) || !(m <= 2.45e-12)) {
                                              		tmp = pow(k, m) * a;
                                              	} else {
                                              		tmp = a / fma((10.0 + k), k, 1.0);
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(a, k, m)
                                              	tmp = 0.0
                                              	if ((m <= -1.55e-6) || !(m <= 2.45e-12))
                                              		tmp = Float64((k ^ m) * a);
                                              	else
                                              		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[a_, k_, m_] := If[Or[LessEqual[m, -1.55e-6], N[Not[LessEqual[m, 2.45e-12]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;m \leq -1.55 \cdot 10^{-6} \lor \neg \left(m \leq 2.45 \cdot 10^{-12}\right):\\
                                              \;\;\;\;{k}^{m} \cdot a\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if m < -1.55e-6 or 2.44999999999999986e-12 < m

                                                1. Initial program 89.1%

                                                  \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
                                                2. Add Preprocessing
                                                3. Step-by-step derivation
                                                  1. lift-/.f64N/A

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

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

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

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

                                                    \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
                                                  6. lower-/.f6489.1

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
                                                  17. lower-+.f6489.1

                                                    \[\leadsto \frac{{k}^{m}}{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)} \cdot a \]
                                                4. Applied rewrites89.1%

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

                                                  \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                                                6. Step-by-step derivation
                                                  1. lower-pow.f6498.2

                                                    \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                                                7. Applied rewrites98.2%

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

                                                if -1.55e-6 < m < 2.44999999999999986e-12

                                                1. Initial program 94.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}} \]
                                              3. Recombined 2 regimes into one program.
                                              4. Final simplification96.7%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;m \leq -1.55 \cdot 10^{-6} \lor \neg \left(m \leq 2.45 \cdot 10^{-12}\right):\\ \;\;\;\;{k}^{m} \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \end{array} \]
                                              5. Add Preprocessing

                                              Alternative 9: 65.3% accurate, 1.8× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.235:\\ \;\;\;\;\frac{\frac{\frac{\frac{a}{k}}{k} \cdot 99}{k}}{k}\\ \mathbf{elif}\;m \leq 1.85:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{elif}\;m \leq 4.2 \cdot 10^{+261}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{\left(k \cdot k\right) \cdot \left(k - 10\right) - \left(k - 10\right) \cdot 100}{k \cdot k}, k, 1\right)}\\ \end{array} \end{array} \]
                                              (FPCore (a k m)
                                               :precision binary64
                                               (if (<= m -0.235)
                                                 (/ (/ (* (/ (/ a k) k) 99.0) k) k)
                                                 (if (<= m 1.85)
                                                   (/ a (fma (+ 10.0 k) k 1.0))
                                                   (if (<= m 4.2e+261)
                                                     (fma (* a (fma (- k) -99.0 -10.0)) k a)
                                                     (/
                                                      a
                                                      (fma
                                                       (/ (- (* (* k k) (- k 10.0)) (* (- k 10.0) 100.0)) (* k k))
                                                       k
                                                       1.0))))))
                                              double code(double a, double k, double m) {
                                              	double tmp;
                                              	if (m <= -0.235) {
                                              		tmp = ((((a / k) / k) * 99.0) / k) / k;
                                              	} else if (m <= 1.85) {
                                              		tmp = a / fma((10.0 + k), k, 1.0);
                                              	} else if (m <= 4.2e+261) {
                                              		tmp = fma((a * fma(-k, -99.0, -10.0)), k, a);
                                              	} else {
                                              		tmp = a / fma(((((k * k) * (k - 10.0)) - ((k - 10.0) * 100.0)) / (k * k)), k, 1.0);
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(a, k, m)
                                              	tmp = 0.0
                                              	if (m <= -0.235)
                                              		tmp = Float64(Float64(Float64(Float64(Float64(a / k) / k) * 99.0) / k) / k);
                                              	elseif (m <= 1.85)
                                              		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
                                              	elseif (m <= 4.2e+261)
                                              		tmp = fma(Float64(a * fma(Float64(-k), -99.0, -10.0)), k, a);
                                              	else
                                              		tmp = Float64(a / fma(Float64(Float64(Float64(Float64(k * k) * Float64(k - 10.0)) - Float64(Float64(k - 10.0) * 100.0)) / Float64(k * k)), k, 1.0));
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[a_, k_, m_] := If[LessEqual[m, -0.235], N[(N[(N[(N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision] * 99.0), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 1.85], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4.2e+261], N[(N[(a * N[((-k) * -99.0 + -10.0), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision], N[(a / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * N[(k - 10.0), $MachinePrecision]), $MachinePrecision] - N[(N[(k - 10.0), $MachinePrecision] * 100.0), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision]]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;m \leq -0.235:\\
                                              \;\;\;\;\frac{\frac{\frac{\frac{a}{k}}{k} \cdot 99}{k}}{k}\\
                                              
                                              \mathbf{elif}\;m \leq 1.85:\\
                                              \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                                              
                                              \mathbf{elif}\;m \leq 4.2 \cdot 10^{+261}:\\
                                              \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\right)\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{\left(k \cdot k\right) \cdot \left(k - 10\right) - \left(k - 10\right) \cdot 100}{k \cdot k}, k, 1\right)}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 4 regimes
                                              2. if m < -0.23499999999999999

                                                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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{\left(a + -1 \cdot \frac{a + -100 \cdot a}{{k}^{2}}\right) - 10 \cdot \frac{a}{k}}{\color{blue}{{k}^{2}}} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites37.7%

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

                                                    \[\leadsto \frac{\frac{99 \cdot \frac{a}{{k}^{2}}}{k}}{k} \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites58.2%

                                                      \[\leadsto \frac{\frac{\frac{\frac{a}{k}}{k} \cdot 99}{k}}{k} \]

                                                    if -0.23499999999999999 < m < 1.8500000000000001

                                                    1. Initial program 94.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    if 1.8500000000000001 < m < 4.2000000000000001e261

                                                    1. Initial program 75.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites9.2%

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

                                                        \[\leadsto a + \color{blue}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites32.6%

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

                                                        if 4.2000000000000001e261 < m

                                                        1. Initial program 94.1%

                                                          \[\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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \frac{a}{\mathsf{fma}\left(\frac{\left(k \cdot k\right) \cdot \left(k - 10\right) - \left(k - 10\right) \cdot 100}{{k}^{2}}, k, 1\right)} \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites54.2%

                                                              \[\leadsto \frac{a}{\mathsf{fma}\left(\frac{\left(k \cdot k\right) \cdot \left(k - 10\right) - \left(k - 10\right) \cdot 100}{k \cdot k}, k, 1\right)} \]
                                                          4. Recombined 4 regimes into one program.
                                                          5. Add Preprocessing

                                                          Alternative 10: 65.0% accurate, 2.4× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.235:\\ \;\;\;\;\frac{\frac{\frac{\frac{a}{k}}{k} \cdot 99}{k}}{k}\\ \mathbf{elif}\;m \leq 1.85:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\right)\\ \end{array} \end{array} \]
                                                          (FPCore (a k m)
                                                           :precision binary64
                                                           (if (<= m -0.235)
                                                             (/ (/ (* (/ (/ a k) k) 99.0) k) k)
                                                             (if (<= m 1.85)
                                                               (/ a (fma (+ 10.0 k) k 1.0))
                                                               (fma (* a (fma (- k) -99.0 -10.0)) k a))))
                                                          double code(double a, double k, double m) {
                                                          	double tmp;
                                                          	if (m <= -0.235) {
                                                          		tmp = ((((a / k) / k) * 99.0) / k) / k;
                                                          	} else if (m <= 1.85) {
                                                          		tmp = a / fma((10.0 + k), k, 1.0);
                                                          	} else {
                                                          		tmp = fma((a * fma(-k, -99.0, -10.0)), k, a);
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          function code(a, k, m)
                                                          	tmp = 0.0
                                                          	if (m <= -0.235)
                                                          		tmp = Float64(Float64(Float64(Float64(Float64(a / k) / k) * 99.0) / k) / k);
                                                          	elseif (m <= 1.85)
                                                          		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
                                                          	else
                                                          		tmp = fma(Float64(a * fma(Float64(-k), -99.0, -10.0)), k, a);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          code[a_, k_, m_] := If[LessEqual[m, -0.235], N[(N[(N[(N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision] * 99.0), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision], If[LessEqual[m, 1.85], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[((-k) * -99.0 + -10.0), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision]]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;m \leq -0.235:\\
                                                          \;\;\;\;\frac{\frac{\frac{\frac{a}{k}}{k} \cdot 99}{k}}{k}\\
                                                          
                                                          \mathbf{elif}\;m \leq 1.85:\\
                                                          \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\right)\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 3 regimes
                                                          2. if m < -0.23499999999999999

                                                            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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \frac{\left(a + -1 \cdot \frac{a + -100 \cdot a}{{k}^{2}}\right) - 10 \cdot \frac{a}{k}}{\color{blue}{{k}^{2}}} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites37.7%

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

                                                                \[\leadsto \frac{\frac{99 \cdot \frac{a}{{k}^{2}}}{k}}{k} \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites58.2%

                                                                  \[\leadsto \frac{\frac{\frac{\frac{a}{k}}{k} \cdot 99}{k}}{k} \]

                                                                if -0.23499999999999999 < m < 1.8500000000000001

                                                                1. Initial program 94.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                if 1.8500000000000001 < m

                                                                1. Initial program 79.3%

                                                                  \[\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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites8.1%

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

                                                                    \[\leadsto a + \color{blue}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites29.0%

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

                                                                  Alternative 11: 62.9% accurate, 2.5× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -4000000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{a}{k}, \frac{99}{k} - 10, a\right)}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.85:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\right)\\ \end{array} \end{array} \]
                                                                  (FPCore (a k m)
                                                                   :precision binary64
                                                                   (if (<= m -4000000000.0)
                                                                     (/ (fma (/ a k) (- (/ 99.0 k) 10.0) a) (* k k))
                                                                     (if (<= m 1.85)
                                                                       (/ a (fma (+ 10.0 k) k 1.0))
                                                                       (fma (* a (fma (- k) -99.0 -10.0)) k a))))
                                                                  double code(double a, double k, double m) {
                                                                  	double tmp;
                                                                  	if (m <= -4000000000.0) {
                                                                  		tmp = fma((a / k), ((99.0 / k) - 10.0), a) / (k * k);
                                                                  	} else if (m <= 1.85) {
                                                                  		tmp = a / fma((10.0 + k), k, 1.0);
                                                                  	} else {
                                                                  		tmp = fma((a * fma(-k, -99.0, -10.0)), k, a);
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  function code(a, k, m)
                                                                  	tmp = 0.0
                                                                  	if (m <= -4000000000.0)
                                                                  		tmp = Float64(fma(Float64(a / k), Float64(Float64(99.0 / k) - 10.0), a) / Float64(k * k));
                                                                  	elseif (m <= 1.85)
                                                                  		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
                                                                  	else
                                                                  		tmp = fma(Float64(a * fma(Float64(-k), -99.0, -10.0)), k, a);
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  code[a_, k_, m_] := If[LessEqual[m, -4000000000.0], N[(N[(N[(a / k), $MachinePrecision] * N[(N[(99.0 / k), $MachinePrecision] - 10.0), $MachinePrecision] + a), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.85], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[((-k) * -99.0 + -10.0), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;m \leq -4000000000:\\
                                                                  \;\;\;\;\frac{\mathsf{fma}\left(\frac{a}{k}, \frac{99}{k} - 10, a\right)}{k \cdot k}\\
                                                                  
                                                                  \mathbf{elif}\;m \leq 1.85:\\
                                                                  \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\right)\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 3 regimes
                                                                  2. if m < -4e9

                                                                    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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites2.8%

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

                                                                        \[\leadsto \frac{\left(a + -1 \cdot \frac{a + -100 \cdot a}{{k}^{2}}\right) - 10 \cdot \frac{a}{k}}{\color{blue}{{k}^{2}}} \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites56.4%

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

                                                                        if -4e9 < m < 1.8500000000000001

                                                                        1. Initial program 94.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        if 1.8500000000000001 < m

                                                                        1. Initial program 79.3%

                                                                          \[\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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites8.1%

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

                                                                            \[\leadsto a + \color{blue}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites29.0%

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

                                                                          Alternative 12: 61.0% accurate, 4.1× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -4000000000:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.85:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\right)\\ \end{array} \end{array} \]
                                                                          (FPCore (a k m)
                                                                           :precision binary64
                                                                           (if (<= m -4000000000.0)
                                                                             (/ a (* k k))
                                                                             (if (<= m 1.85)
                                                                               (/ a (fma (+ 10.0 k) k 1.0))
                                                                               (fma (* a (fma (- k) -99.0 -10.0)) k a))))
                                                                          double code(double a, double k, double m) {
                                                                          	double tmp;
                                                                          	if (m <= -4000000000.0) {
                                                                          		tmp = a / (k * k);
                                                                          	} else if (m <= 1.85) {
                                                                          		tmp = a / fma((10.0 + k), k, 1.0);
                                                                          	} else {
                                                                          		tmp = fma((a * fma(-k, -99.0, -10.0)), k, a);
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          function code(a, k, m)
                                                                          	tmp = 0.0
                                                                          	if (m <= -4000000000.0)
                                                                          		tmp = Float64(a / Float64(k * k));
                                                                          	elseif (m <= 1.85)
                                                                          		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
                                                                          	else
                                                                          		tmp = fma(Float64(a * fma(Float64(-k), -99.0, -10.0)), k, a);
                                                                          	end
                                                                          	return tmp
                                                                          end
                                                                          
                                                                          code[a_, k_, m_] := If[LessEqual[m, -4000000000.0], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.85], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[((-k) * -99.0 + -10.0), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision]]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          \mathbf{if}\;m \leq -4000000000:\\
                                                                          \;\;\;\;\frac{a}{k \cdot k}\\
                                                                          
                                                                          \mathbf{elif}\;m \leq 1.85:\\
                                                                          \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(-k, -99, -10\right), k, a\right)\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 3 regimes
                                                                          2. if m < -4e9

                                                                            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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                              \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                            7. Step-by-step derivation
                                                                              1. Applied rewrites2.8%

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

                                                                                \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites1.9%

                                                                                  \[\leadsto \left(k \cdot a\right) \cdot -10 \]
                                                                                2. Taylor expanded in k around inf

                                                                                  \[\leadsto \frac{a}{\color{blue}{{k}^{2}}} \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites51.9%

                                                                                    \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]

                                                                                  if -4e9 < m < 1.8500000000000001

                                                                                  1. Initial program 94.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                  if 1.8500000000000001 < m

                                                                                  1. Initial program 79.3%

                                                                                    \[\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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                    \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                                  7. Step-by-step derivation
                                                                                    1. Applied rewrites8.1%

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

                                                                                      \[\leadsto a + \color{blue}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites29.0%

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

                                                                                    Alternative 13: 46.7% accurate, 4.5× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq -3.1 \cdot 10^{-256} \lor \neg \left(k \leq 10.2\right):\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10, k, 1\right)}\\ \end{array} \end{array} \]
                                                                                    (FPCore (a k m)
                                                                                     :precision binary64
                                                                                     (if (or (<= k -3.1e-256) (not (<= k 10.2)))
                                                                                       (/ a (* k k))
                                                                                       (/ a (fma 10.0 k 1.0))))
                                                                                    double code(double a, double k, double m) {
                                                                                    	double tmp;
                                                                                    	if ((k <= -3.1e-256) || !(k <= 10.2)) {
                                                                                    		tmp = a / (k * k);
                                                                                    	} else {
                                                                                    		tmp = a / fma(10.0, k, 1.0);
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    function code(a, k, m)
                                                                                    	tmp = 0.0
                                                                                    	if ((k <= -3.1e-256) || !(k <= 10.2))
                                                                                    		tmp = Float64(a / Float64(k * k));
                                                                                    	else
                                                                                    		tmp = Float64(a / fma(10.0, k, 1.0));
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    code[a_, k_, m_] := If[Or[LessEqual[k, -3.1e-256], N[Not[LessEqual[k, 10.2]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a / N[(10.0 * k + 1.0), $MachinePrecision]), $MachinePrecision]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    \mathbf{if}\;k \leq -3.1 \cdot 10^{-256} \lor \neg \left(k \leq 10.2\right):\\
                                                                                    \;\;\;\;\frac{a}{k \cdot k}\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;\frac{a}{\mathsf{fma}\left(10, k, 1\right)}\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 2 regimes
                                                                                    2. if k < -3.09999999999999986e-256 or 10.199999999999999 < k

                                                                                      1. Initial program 86.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                        \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites4.9%

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

                                                                                          \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites6.1%

                                                                                            \[\leadsto \left(k \cdot a\right) \cdot -10 \]
                                                                                          2. Taylor expanded in k around inf

                                                                                            \[\leadsto \frac{a}{\color{blue}{{k}^{2}}} \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites45.4%

                                                                                              \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]

                                                                                            if -3.09999999999999986e-256 < k < 10.199999999999999

                                                                                            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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \frac{a}{\mathsf{fma}\left(10, k, 1\right)} \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Applied rewrites47.7%

                                                                                                \[\leadsto \frac{a}{\mathsf{fma}\left(10, k, 1\right)} \]
                                                                                            8. Recombined 2 regimes into one program.
                                                                                            9. Final simplification46.2%

                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq -3.1 \cdot 10^{-256} \lor \neg \left(k \leq 10.2\right):\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10, k, 1\right)}\\ \end{array} \]
                                                                                            10. Add Preprocessing

                                                                                            Alternative 14: 46.6% accurate, 4.6× speedup?

                                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq -3.1 \cdot 10^{-256} \lor \neg \left(k \leq 0.1\right):\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-10, k, 1\right) \cdot a\\ \end{array} \end{array} \]
                                                                                            (FPCore (a k m)
                                                                                             :precision binary64
                                                                                             (if (or (<= k -3.1e-256) (not (<= k 0.1)))
                                                                                               (/ a (* k k))
                                                                                               (* (fma -10.0 k 1.0) a)))
                                                                                            double code(double a, double k, double m) {
                                                                                            	double tmp;
                                                                                            	if ((k <= -3.1e-256) || !(k <= 0.1)) {
                                                                                            		tmp = a / (k * k);
                                                                                            	} else {
                                                                                            		tmp = fma(-10.0, k, 1.0) * a;
                                                                                            	}
                                                                                            	return tmp;
                                                                                            }
                                                                                            
                                                                                            function code(a, k, m)
                                                                                            	tmp = 0.0
                                                                                            	if ((k <= -3.1e-256) || !(k <= 0.1))
                                                                                            		tmp = Float64(a / Float64(k * k));
                                                                                            	else
                                                                                            		tmp = Float64(fma(-10.0, k, 1.0) * a);
                                                                                            	end
                                                                                            	return tmp
                                                                                            end
                                                                                            
                                                                                            code[a_, k_, m_] := If[Or[LessEqual[k, -3.1e-256], N[Not[LessEqual[k, 0.1]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(N[(-10.0 * k + 1.0), $MachinePrecision] * a), $MachinePrecision]]
                                                                                            
                                                                                            \begin{array}{l}
                                                                                            
                                                                                            \\
                                                                                            \begin{array}{l}
                                                                                            \mathbf{if}\;k \leq -3.1 \cdot 10^{-256} \lor \neg \left(k \leq 0.1\right):\\
                                                                                            \;\;\;\;\frac{a}{k \cdot k}\\
                                                                                            
                                                                                            \mathbf{else}:\\
                                                                                            \;\;\;\;\mathsf{fma}\left(-10, k, 1\right) \cdot a\\
                                                                                            
                                                                                            
                                                                                            \end{array}
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            1. Split input into 2 regimes
                                                                                            2. if k < -3.09999999999999986e-256 or 0.10000000000000001 < k

                                                                                              1. Initial program 86.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                                              7. Step-by-step derivation
                                                                                                1. Applied rewrites4.9%

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

                                                                                                  \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites6.1%

                                                                                                    \[\leadsto \left(k \cdot a\right) \cdot -10 \]
                                                                                                  2. Taylor expanded in k around inf

                                                                                                    \[\leadsto \frac{a}{\color{blue}{{k}^{2}}} \]
                                                                                                  3. Step-by-step derivation
                                                                                                    1. Applied rewrites45.4%

                                                                                                      \[\leadsto \frac{a}{\color{blue}{k \cdot k}} \]

                                                                                                    if -3.09999999999999986e-256 < k < 0.10000000000000001

                                                                                                    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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                      \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                                                    7. Step-by-step derivation
                                                                                                      1. Applied rewrites47.3%

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

                                                                                                        \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites47.3%

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

                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq -3.1 \cdot 10^{-256} \lor \neg \left(k \leq 0.1\right):\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-10, k, 1\right) \cdot a\\ \end{array} \]
                                                                                                      6. Add Preprocessing

                                                                                                      Alternative 15: 32.1% accurate, 5.8× speedup?

                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq 4.5 \cdot 10^{+25}:\\ \;\;\;\;\frac{a}{k} \cdot k\\ \mathbf{else}:\\ \;\;\;\;\left(-10 \cdot a\right) \cdot k\\ \end{array} \end{array} \]
                                                                                                      (FPCore (a k m)
                                                                                                       :precision binary64
                                                                                                       (if (<= m 4.5e+25) (* (/ a k) k) (* (* -10.0 a) k)))
                                                                                                      double code(double a, double k, double m) {
                                                                                                      	double tmp;
                                                                                                      	if (m <= 4.5e+25) {
                                                                                                      		tmp = (a / k) * k;
                                                                                                      	} else {
                                                                                                      		tmp = (-10.0 * 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 (m <= 4.5d+25) then
                                                                                                              tmp = (a / k) * k
                                                                                                          else
                                                                                                              tmp = ((-10.0d0) * a) * k
                                                                                                          end if
                                                                                                          code = tmp
                                                                                                      end function
                                                                                                      
                                                                                                      public static double code(double a, double k, double m) {
                                                                                                      	double tmp;
                                                                                                      	if (m <= 4.5e+25) {
                                                                                                      		tmp = (a / k) * k;
                                                                                                      	} else {
                                                                                                      		tmp = (-10.0 * a) * k;
                                                                                                      	}
                                                                                                      	return tmp;
                                                                                                      }
                                                                                                      
                                                                                                      def code(a, k, m):
                                                                                                      	tmp = 0
                                                                                                      	if m <= 4.5e+25:
                                                                                                      		tmp = (a / k) * k
                                                                                                      	else:
                                                                                                      		tmp = (-10.0 * a) * k
                                                                                                      	return tmp
                                                                                                      
                                                                                                      function code(a, k, m)
                                                                                                      	tmp = 0.0
                                                                                                      	if (m <= 4.5e+25)
                                                                                                      		tmp = Float64(Float64(a / k) * k);
                                                                                                      	else
                                                                                                      		tmp = Float64(Float64(-10.0 * a) * k);
                                                                                                      	end
                                                                                                      	return tmp
                                                                                                      end
                                                                                                      
                                                                                                      function tmp_2 = code(a, k, m)
                                                                                                      	tmp = 0.0;
                                                                                                      	if (m <= 4.5e+25)
                                                                                                      		tmp = (a / k) * k;
                                                                                                      	else
                                                                                                      		tmp = (-10.0 * a) * k;
                                                                                                      	end
                                                                                                      	tmp_2 = tmp;
                                                                                                      end
                                                                                                      
                                                                                                      code[a_, k_, m_] := If[LessEqual[m, 4.5e+25], N[(N[(a / k), $MachinePrecision] * k), $MachinePrecision], N[(N[(-10.0 * a), $MachinePrecision] * k), $MachinePrecision]]
                                                                                                      
                                                                                                      \begin{array}{l}
                                                                                                      
                                                                                                      \\
                                                                                                      \begin{array}{l}
                                                                                                      \mathbf{if}\;m \leq 4.5 \cdot 10^{+25}:\\
                                                                                                      \;\;\;\;\frac{a}{k} \cdot k\\
                                                                                                      
                                                                                                      \mathbf{else}:\\
                                                                                                      \;\;\;\;\left(-10 \cdot a\right) \cdot k\\
                                                                                                      
                                                                                                      
                                                                                                      \end{array}
                                                                                                      \end{array}
                                                                                                      
                                                                                                      Derivation
                                                                                                      1. Split input into 2 regimes
                                                                                                      2. if m < 4.5000000000000003e25

                                                                                                        1. Initial program 96.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                          \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                                                        7. Step-by-step derivation
                                                                                                          1. Applied rewrites26.1%

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

                                                                                                            \[\leadsto k \cdot \left(-10 \cdot a + \color{blue}{\frac{a}{k}}\right) \]
                                                                                                          3. Step-by-step derivation
                                                                                                            1. Applied rewrites24.0%

                                                                                                              \[\leadsto \mathsf{fma}\left(-10, a, \frac{a}{k}\right) \cdot k \]
                                                                                                            2. Taylor expanded in k around 0

                                                                                                              \[\leadsto \frac{a}{k} \cdot k \]
                                                                                                            3. Step-by-step derivation
                                                                                                              1. Applied rewrites34.2%

                                                                                                                \[\leadsto \frac{a}{k} \cdot k \]

                                                                                                              if 4.5000000000000003e25 < m

                                                                                                              1. Initial program 79.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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                                                              7. Step-by-step derivation
                                                                                                                1. Applied rewrites8.2%

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

                                                                                                                  \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
                                                                                                                3. Step-by-step derivation
                                                                                                                  1. Applied rewrites19.0%

                                                                                                                    \[\leadsto \left(k \cdot a\right) \cdot -10 \]
                                                                                                                  2. Step-by-step derivation
                                                                                                                    1. Applied rewrites19.0%

                                                                                                                      \[\leadsto \left(-10 \cdot a\right) \cdot k \]
                                                                                                                  3. Recombined 2 regimes into one program.
                                                                                                                  4. Add Preprocessing

                                                                                                                  Alternative 16: 8.6% accurate, 12.2× speedup?

                                                                                                                  \[\begin{array}{l} \\ \left(-10 \cdot a\right) \cdot k \end{array} \]
                                                                                                                  (FPCore (a k m) :precision binary64 (* (* -10.0 a) k))
                                                                                                                  double code(double a, double k, double m) {
                                                                                                                  	return (-10.0 * a) * k;
                                                                                                                  }
                                                                                                                  
                                                                                                                  real(8) function code(a, k, m)
                                                                                                                      real(8), intent (in) :: a
                                                                                                                      real(8), intent (in) :: k
                                                                                                                      real(8), intent (in) :: m
                                                                                                                      code = ((-10.0d0) * a) * k
                                                                                                                  end function
                                                                                                                  
                                                                                                                  public static double code(double a, double k, double m) {
                                                                                                                  	return (-10.0 * a) * k;
                                                                                                                  }
                                                                                                                  
                                                                                                                  def code(a, k, m):
                                                                                                                  	return (-10.0 * a) * k
                                                                                                                  
                                                                                                                  function code(a, k, m)
                                                                                                                  	return Float64(Float64(-10.0 * a) * k)
                                                                                                                  end
                                                                                                                  
                                                                                                                  function tmp = code(a, k, m)
                                                                                                                  	tmp = (-10.0 * a) * k;
                                                                                                                  end
                                                                                                                  
                                                                                                                  code[a_, k_, m_] := N[(N[(-10.0 * a), $MachinePrecision] * k), $MachinePrecision]
                                                                                                                  
                                                                                                                  \begin{array}{l}
                                                                                                                  
                                                                                                                  \\
                                                                                                                  \left(-10 \cdot a\right) \cdot k
                                                                                                                  \end{array}
                                                                                                                  
                                                                                                                  Derivation
                                                                                                                  1. Initial program 91.1%

                                                                                                                    \[\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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                    \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
                                                                                                                  7. Step-by-step derivation
                                                                                                                    1. Applied rewrites20.4%

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

                                                                                                                      \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
                                                                                                                    3. Step-by-step derivation
                                                                                                                      1. Applied rewrites7.5%

                                                                                                                        \[\leadsto \left(k \cdot a\right) \cdot -10 \]
                                                                                                                      2. Step-by-step derivation
                                                                                                                        1. Applied rewrites7.5%

                                                                                                                          \[\leadsto \left(-10 \cdot a\right) \cdot k \]
                                                                                                                        2. Add Preprocessing

                                                                                                                        Reproduce

                                                                                                                        ?
                                                                                                                        herbie shell --seed 2024321 
                                                                                                                        (FPCore (a k m)
                                                                                                                          :name "Falkner and Boettcher, Appendix A"
                                                                                                                          :precision binary64
                                                                                                                          (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))