Falkner and Boettcher, Appendix A

Percentage Accurate: 90.2% → 99.0%
Time: 10.2s
Alternatives: 14
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 14 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.2% 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.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.76:\\
\;\;\;\;\frac{a}{\frac{1}{{k}^{m}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 0.76000000000000001

    1. Initial program 92.4%

      \[\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-/.f6492.4

        \[\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-+.f6492.4

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

      \[\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}{\frac{\color{blue}{1}}{{k}^{m}}} \]
    6. Step-by-step derivation
      1. Applied rewrites99.5%

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

      if 0.76000000000000001 < k

      1. Initial program 82.9%

        \[\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.f6489.2

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

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

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

      Alternative 2: 56.7% 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 5 \cdot 10^{+306}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(\frac{a}{k}, \frac{99}{k} - 10, a\right)}{k}}{k}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(99, k, -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 5e+306)
             (/ a (fma (+ 10.0 k) k 1.0))
             (if (<= t_0 INFINITY)
               (/ (/ (fma (/ a k) (- (/ 99.0 k) 10.0) a) k) k)
               (fma (* a (fma 99.0 k -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 <= 5e+306) {
      		tmp = a / fma((10.0 + k), k, 1.0);
      	} else if (t_0 <= ((double) INFINITY)) {
      		tmp = (fma((a / k), ((99.0 / k) - 10.0), a) / k) / k;
      	} else {
      		tmp = fma((a * fma(99.0, k, -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 <= 5e+306)
      		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
      	elseif (t_0 <= Inf)
      		tmp = Float64(Float64(fma(Float64(a / k), Float64(Float64(99.0 / k) - 10.0), a) / k) / k);
      	else
      		tmp = fma(Float64(a * fma(99.0, k, -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, 5e+306], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[(N[(a / k), $MachinePrecision] * N[(N[(99.0 / k), $MachinePrecision] - 10.0), $MachinePrecision] + a), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision], N[(N[(a * N[(99.0 * k + -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 5 \cdot 10^{+306}:\\
      \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
      
      \mathbf{elif}\;t\_0 \leq \infty:\\
      \;\;\;\;\frac{\frac{\mathsf{fma}\left(\frac{a}{k}, \frac{99}{k} - 10, a\right)}{k}}{k}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(99, k, -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 98.6%

          \[\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 rewrites53.5%

          \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}} \]
        6. Step-by-step derivation
          1. Applied rewrites53.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 rewrites53.3%

              \[\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))) < 4.99999999999999993e306

            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 rewrites96.7%

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

            if 4.99999999999999993e306 < (/.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.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 rewrites3.0%

                \[\leadsto \mathsf{fma}\left(k \cdot a, \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 rewrites2.1%

                  \[\leadsto \left(k \cdot a\right) \cdot -10 \]
                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 rewrites36.6%

                    \[\leadsto \frac{\frac{\mathsf{fma}\left(\frac{a}{k}, \frac{99}{k} - 10, a\right)}{k}}{\color{blue}{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 rewrites21.3%

                      \[\leadsto \mathsf{fma}\left(k \cdot a, \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 rewrites73.7%

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

                      \[\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 5 \cdot 10^{+306}:\\ \;\;\;\;\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{\mathsf{fma}\left(\frac{a}{k}, \frac{99}{k} - 10, a\right)}{k}}{k}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(99, k, -10\right), k, a\right)\\ \end{array} \]
                    6. Add Preprocessing

                    Alternative 3: 46.0% 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 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+306} \lor \neg \left(t\_0 \leq \infty\right)\right):\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(99, k, -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 (or (<= t_0 0.0) (not (or (<= t_0 5e+306) (not (<= t_0 INFINITY)))))
                         (/ a (* k k))
                         (fma (* a (fma 99.0 k -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) || !((t_0 <= 5e+306) || !(t_0 <= ((double) INFINITY)))) {
                    		tmp = a / (k * k);
                    	} else {
                    		tmp = fma((a * fma(99.0, k, -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) || !((t_0 <= 5e+306) || !(t_0 <= Inf)))
                    		tmp = Float64(a / Float64(k * k));
                    	else
                    		tmp = fma(Float64(a * fma(99.0, k, -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[Or[LessEqual[t$95$0, 0.0], N[Not[Or[LessEqual[t$95$0, 5e+306], N[Not[LessEqual[t$95$0, Infinity]], $MachinePrecision]]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(99.0 * k + -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 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+306} \lor \neg \left(t\_0 \leq \infty\right)\right):\\
                    \;\;\;\;\frac{a}{k \cdot k}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(99, k, -10\right), k, a\right)\\
                    
                    
                    \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 or 4.99999999999999993e306 < (/.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 98.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 rewrites47.5%

                        \[\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 rewrites14.7%

                          \[\leadsto \mathsf{fma}\left(k \cdot a, \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 rewrites5.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 rewrites44.4%

                              \[\leadsto \frac{a}{\color{blue}{k \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))) < 4.99999999999999993e306 or +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

                            1. Initial program 60.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 rewrites58.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 rewrites54.8%

                                \[\leadsto \mathsf{fma}\left(k \cdot a, \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 rewrites76.0%

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

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

                              Alternative 4: 16.7% 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 \cdot a, k, a\right)\\ \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 a) k 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 * a), k, 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 = fma(Float64(-10.0 * a), k, 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 * a), $MachinePrecision] * k + 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 \cdot a, k, a\right)\\
                              
                              
                              \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 98.6%

                                  \[\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 rewrites53.5%

                                  \[\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 rewrites16.3%

                                    \[\leadsto \mathsf{fma}\left(k \cdot a, \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.5%

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

                                        \[\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 70.9%

                                        \[\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.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 rewrites40.9%

                                          \[\leadsto \mathsf{fma}\left(k \cdot a, \color{blue}{-10}, a\right) \]
                                        2. Step-by-step derivation
                                          1. Applied rewrites40.9%

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

                                        Alternative 5: 16.8% 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 98.6%

                                            \[\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 rewrites53.5%

                                            \[\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 rewrites16.3%

                                              \[\leadsto \mathsf{fma}\left(k \cdot a, \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.5%

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

                                                  \[\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 70.9%

                                                  \[\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.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 rewrites40.9%

                                                    \[\leadsto \mathsf{fma}\left(k \cdot a, \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 rewrites40.9%

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

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq 0.06:\\ \;\;\;\;\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 (<= m 0.06) (* (/ (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 (m <= 0.06) {
                                                  		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 (m <= 0.06)
                                                  		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[m, 0.06], 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}\;m \leq 0.06:\\
                                                  \;\;\;\;\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 m < 0.059999999999999998

                                                    1. Initial program 98.6%

                                                      \[\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-/.f6498.6

                                                        \[\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-+.f6498.6

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

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

                                                    if 0.059999999999999998 < m

                                                    1. Initial program 71.3%

                                                      \[\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-/.f6471.3

                                                        \[\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-+.f6471.3

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

                                                      \[\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}{\frac{\color{blue}{1}}{{k}^{m}}} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites100.0%

                                                        \[\leadsto \frac{a}{\frac{\color{blue}{1}}{{k}^{m}}} \]
                                                      2. Taylor expanded in k around 0

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

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

                                                          \[\leadsto \color{blue}{{k}^{m} \cdot a} \]
                                                        3. lower-pow.f64100.0

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

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

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

                                                    Alternative 7: 97.0% accurate, 1.0× speedup?

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

                                                      1. Initial program 100.0%

                                                        \[\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-/.f64100.0

                                                          \[\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-+.f64100.0

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

                                                        \[\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}{\frac{\color{blue}{1}}{{k}^{m}}} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites100.0%

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

                                                        if -1.2499999999999999e-8 < m < 9.50000000000000036e-8

                                                        1. Initial program 97.6%

                                                          \[\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 rewrites97.3%

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

                                                        if 9.50000000000000036e-8 < m

                                                        1. Initial program 71.3%

                                                          \[\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-/.f6471.3

                                                            \[\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-+.f6471.3

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

                                                          \[\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}{\frac{\color{blue}{1}}{{k}^{m}}} \]
                                                        6. Step-by-step derivation
                                                          1. Applied rewrites100.0%

                                                            \[\leadsto \frac{a}{\frac{\color{blue}{1}}{{k}^{m}}} \]
                                                          2. Taylor expanded in k around 0

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

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

                                                              \[\leadsto \color{blue}{{k}^{m} \cdot a} \]
                                                            3. lower-pow.f64100.0

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

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

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

                                                        Alternative 8: 59.5% accurate, 1.1× speedup?

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

                                                          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 rewrites40.5%

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

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

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

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

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

                                                                if -2.8e20 < m < 1e8

                                                                1. Initial program 97.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 rewrites93.6%

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

                                                                if 1e8 < m

                                                                1. Initial program 70.2%

                                                                  \[\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 rewrites2.7%

                                                                  \[\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.5%

                                                                    \[\leadsto \mathsf{fma}\left(k \cdot a, \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.1%

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

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

                                                                  Alternative 9: 97.0% accurate, 1.1× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -1.25 \cdot 10^{-8} \lor \neg \left(m \leq 9.5 \cdot 10^{-8}\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.25e-8) (not (<= m 9.5e-8)))
                                                                     (* (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.25e-8) || !(m <= 9.5e-8)) {
                                                                  		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.25e-8) || !(m <= 9.5e-8))
                                                                  		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.25e-8], N[Not[LessEqual[m, 9.5e-8]], $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.25 \cdot 10^{-8} \lor \neg \left(m \leq 9.5 \cdot 10^{-8}\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.2499999999999999e-8 or 9.50000000000000036e-8 < m

                                                                    1. Initial program 84.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-/.f6484.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-+.f6484.1

                                                                        \[\leadsto \frac{a}{\frac{\mathsf{fma}\left(\color{blue}{k + 10}, k, 1\right)}{{k}^{m}}} \]
                                                                    4. Applied rewrites84.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}{\frac{\color{blue}{1}}{{k}^{m}}} \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites100.0%

                                                                        \[\leadsto \frac{a}{\frac{\color{blue}{1}}{{k}^{m}}} \]
                                                                      2. Taylor expanded in k around 0

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

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

                                                                          \[\leadsto \color{blue}{{k}^{m} \cdot a} \]
                                                                        3. lower-pow.f64100.0

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

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

                                                                      if -1.2499999999999999e-8 < m < 9.50000000000000036e-8

                                                                      1. Initial program 97.6%

                                                                        \[\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 rewrites97.3%

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

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

                                                                    Alternative 10: 63.0% accurate, 3.0× speedup?

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

                                                                      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 rewrites40.5%

                                                                        \[\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 rewrites3.2%

                                                                          \[\leadsto \mathsf{fma}\left(k \cdot a, \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 rewrites74.7%

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

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

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

                                                                            if -2.8e20 < m < 1e8

                                                                            1. Initial program 97.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 rewrites93.6%

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

                                                                            if 1e8 < m

                                                                            1. Initial program 70.2%

                                                                              \[\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 rewrites2.7%

                                                                              \[\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.5%

                                                                                \[\leadsto \mathsf{fma}\left(k \cdot a, \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.1%

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

                                                                              Alternative 11: 59.4% accurate, 4.1× speedup?

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

                                                                                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 rewrites40.5%

                                                                                  \[\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 rewrites3.2%

                                                                                    \[\leadsto \mathsf{fma}\left(k \cdot a, \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 rewrites2.2%

                                                                                      \[\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 rewrites67.2%

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

                                                                                      if -2.8e20 < m < 1e8

                                                                                      1. Initial program 97.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 rewrites93.6%

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

                                                                                      if 1e8 < m

                                                                                      1. Initial program 70.2%

                                                                                        \[\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 rewrites2.7%

                                                                                        \[\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.5%

                                                                                          \[\leadsto \mathsf{fma}\left(k \cdot a, \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.1%

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

                                                                                        Alternative 12: 45.5% accurate, 4.6× speedup?

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

                                                                                          1. Initial program 82.9%

                                                                                            \[\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.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 rewrites5.6%

                                                                                              \[\leadsto \mathsf{fma}\left(k \cdot a, \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.3%

                                                                                                \[\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 rewrites48.9%

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

                                                                                                if -2.30000000000000003e-278 < 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 rewrites56.5%

                                                                                                  \[\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 rewrites56.2%

                                                                                                    \[\leadsto \mathsf{fma}\left(k \cdot a, \color{blue}{-10}, a\right) \]
                                                                                                  2. Step-by-step derivation
                                                                                                    1. Applied rewrites56.2%

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

                                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq -2.3 \cdot 10^{-278} \lor \neg \left(k \leq 0.1\right):\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-10 \cdot a, k, a\right)\\ \end{array} \]
                                                                                                  5. Add Preprocessing

                                                                                                  Alternative 13: 31.5% accurate, 5.8× speedup?

                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq 0.55:\\ \;\;\;\;\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 0.55) (* (/ a k) k) (* (* -10.0 a) k)))
                                                                                                  double code(double a, double k, double m) {
                                                                                                  	double tmp;
                                                                                                  	if (m <= 0.55) {
                                                                                                  		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 <= 0.55d0) 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 <= 0.55) {
                                                                                                  		tmp = (a / k) * k;
                                                                                                  	} else {
                                                                                                  		tmp = (-10.0 * a) * k;
                                                                                                  	}
                                                                                                  	return tmp;
                                                                                                  }
                                                                                                  
                                                                                                  def code(a, k, m):
                                                                                                  	tmp = 0
                                                                                                  	if m <= 0.55:
                                                                                                  		tmp = (a / k) * k
                                                                                                  	else:
                                                                                                  		tmp = (-10.0 * a) * k
                                                                                                  	return tmp
                                                                                                  
                                                                                                  function code(a, k, m)
                                                                                                  	tmp = 0.0
                                                                                                  	if (m <= 0.55)
                                                                                                  		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 <= 0.55)
                                                                                                  		tmp = (a / k) * k;
                                                                                                  	else
                                                                                                  		tmp = (-10.0 * a) * k;
                                                                                                  	end
                                                                                                  	tmp_2 = tmp;
                                                                                                  end
                                                                                                  
                                                                                                  code[a_, k_, m_] := If[LessEqual[m, 0.55], 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 0.55:\\
                                                                                                  \;\;\;\;\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 < 0.55000000000000004

                                                                                                    1. Initial program 98.6%

                                                                                                      \[\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 rewrites74.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 rewrites32.8%

                                                                                                        \[\leadsto \mathsf{fma}\left(k \cdot a, \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 rewrites31.5%

                                                                                                          \[\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 rewrites46.0%

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

                                                                                                          if 0.55000000000000004 < m

                                                                                                          1. Initial program 70.9%

                                                                                                            \[\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 rewrites2.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 rewrites8.3%

                                                                                                              \[\leadsto \mathsf{fma}\left(k \cdot a, \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 rewrites15.7%

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

                                                                                                                  \[\leadsto \left(-10 \cdot a\right) \cdot k \]
                                                                                                              3. Recombined 2 regimes into one program.
                                                                                                              4. Add Preprocessing

                                                                                                              Alternative 14: 8.4% 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 89.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 rewrites50.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 rewrites24.6%

                                                                                                                  \[\leadsto \mathsf{fma}\left(k \cdot a, \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.0%

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

                                                                                                                      \[\leadsto \left(-10 \cdot a\right) \cdot k \]
                                                                                                                    2. Add Preprocessing

                                                                                                                    Reproduce

                                                                                                                    ?
                                                                                                                    herbie shell --seed 2024324 
                                                                                                                    (FPCore (a k m)
                                                                                                                      :name "Falkner and Boettcher, Appendix A"
                                                                                                                      :precision binary64
                                                                                                                      (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))