Falkner and Boettcher, Appendix A

Percentage Accurate: 90.7% → 98.4%
Time: 9.5s
Alternatives: 14
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 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.7% 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: 98.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;k \leq -5 \cdot 10^{+156}:\\
\;\;\;\;a \cdot {k}^{m}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < -4.99999999999999992e156

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999992e156 < k < 1.20000000000000007e154

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.20000000000000007e154 < k

    1. Initial program 77.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{{k}^{2}} \cdot {\left(e^{\color{blue}{\log k}}\right)}^{m} \]
      10. rem-exp-logN/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.f6491.8

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

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

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

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

    Alternative 2: 28.8% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(10 \cdot k + 1\right) + k \cdot k} \leq 0:\\ \;\;\;\;\left(\left(99 \cdot k\right) \cdot a\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(99, k, -10\right), k, 1\right) \cdot a\\ \end{array} \end{array} \]
    (FPCore (a k m)
     :precision binary64
     (if (<= (/ (* a (pow k m)) (+ (+ (* 10.0 k) 1.0) (* k k))) 0.0)
       (* (* (* 99.0 k) a) k)
       (* (fma (fma 99.0 k -10.0) k 1.0) a)))
    double code(double a, double k, double m) {
    	double tmp;
    	if (((a * pow(k, m)) / (((10.0 * k) + 1.0) + (k * k))) <= 0.0) {
    		tmp = ((99.0 * k) * a) * k;
    	} else {
    		tmp = fma(fma(99.0, k, -10.0), k, 1.0) * a;
    	}
    	return tmp;
    }
    
    function code(a, k, m)
    	tmp = 0.0
    	if (Float64(Float64(a * (k ^ m)) / Float64(Float64(Float64(10.0 * k) + 1.0) + Float64(k * k))) <= 0.0)
    		tmp = Float64(Float64(Float64(99.0 * k) * a) * k);
    	else
    		tmp = Float64(fma(fma(99.0, k, -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[(N[(10.0 * k), $MachinePrecision] + 1.0), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(99.0 * k), $MachinePrecision] * a), $MachinePrecision] * k), $MachinePrecision], N[(N[(N[(99.0 * k + -10.0), $MachinePrecision] * k + 1.0), $MachinePrecision] * a), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(10 \cdot k + 1\right) + k \cdot k} \leq 0:\\
    \;\;\;\;\left(\left(99 \cdot k\right) \cdot a\right) \cdot k\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(99, k, -10\right), k, 1\right) \cdot a\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

      1. Initial program 96.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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
        16. 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 rewrites48.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}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
      7. Step-by-step derivation
        1. Applied rewrites17.4%

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

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

            \[\leadsto \left(\left(99 \cdot k\right) \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 81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
            16. 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 rewrites38.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 rewrites34.2%

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

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

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

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

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

              Alternative 3: 17.0% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                  16. 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 rewrites48.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 rewrites15.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                        16. 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 rewrites38.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 rewrites34.2%

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

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

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

                        Alternative 4: 96.9% accurate, 1.1× speedup?

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

                          1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 6.9999999999999998e-9 < k

                          1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{a}{{k}^{2}} \cdot {\left(e^{\color{blue}{\log k}}\right)}^{m} \]
                            10. rem-exp-logN/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.7

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

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

                              \[\leadsto \frac{a}{k} \cdot \color{blue}{{k}^{\left(-1 + m\right)}} \]
                          7. Recombined 2 regimes into one program.
                          8. Final simplification97.9%

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

                          Alternative 5: 97.0% accurate, 1.1× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot {k}^{m}\\ \mathbf{if}\;m \leq -1.1 \cdot 10^{-12}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;m \leq 0.00025:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                          (FPCore (a k m)
                           :precision binary64
                           (let* ((t_0 (* a (pow k m))))
                             (if (<= m -1.1e-12)
                               t_0
                               (if (<= m 0.00025) (/ a (fma (+ 10.0 k) k 1.0)) t_0))))
                          double code(double a, double k, double m) {
                          	double t_0 = a * pow(k, m);
                          	double tmp;
                          	if (m <= -1.1e-12) {
                          		tmp = t_0;
                          	} else if (m <= 0.00025) {
                          		tmp = a / fma((10.0 + k), k, 1.0);
                          	} else {
                          		tmp = t_0;
                          	}
                          	return tmp;
                          }
                          
                          function code(a, k, m)
                          	t_0 = Float64(a * (k ^ m))
                          	tmp = 0.0
                          	if (m <= -1.1e-12)
                          		tmp = t_0;
                          	elseif (m <= 0.00025)
                          		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
                          	else
                          		tmp = t_0;
                          	end
                          	return tmp
                          end
                          
                          code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -1.1e-12], t$95$0, If[LessEqual[m, 0.00025], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := a \cdot {k}^{m}\\
                          \mathbf{if}\;m \leq -1.1 \cdot 10^{-12}:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{elif}\;m \leq 0.00025:\\
                          \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_0\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if m < -1.09999999999999996e-12 or 2.5000000000000001e-4 < m

                            1. Initial program 92.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. *-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-/.f6492.3

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

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

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

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

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

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

                            if -1.09999999999999996e-12 < m < 2.5000000000000001e-4

                            1. Initial program 91.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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 6: 96.7% accurate, 1.2× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 7 \cdot 10^{-9}:\\ \;\;\;\;a \cdot {k}^{m}\\ \mathbf{else}:\\ \;\;\;\;{k}^{\left(-2 + m\right)} \cdot a\\ \end{array} \end{array} \]
                          (FPCore (a k m)
                           :precision binary64
                           (if (<= k 7e-9) (* a (pow k m)) (* (pow k (+ -2.0 m)) a)))
                          double code(double a, double k, double m) {
                          	double tmp;
                          	if (k <= 7e-9) {
                          		tmp = a * pow(k, m);
                          	} else {
                          		tmp = pow(k, (-2.0 + m)) * a;
                          	}
                          	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 <= 7d-9) then
                                  tmp = a * (k ** m)
                              else
                                  tmp = (k ** ((-2.0d0) + m)) * a
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double a, double k, double m) {
                          	double tmp;
                          	if (k <= 7e-9) {
                          		tmp = a * Math.pow(k, m);
                          	} else {
                          		tmp = Math.pow(k, (-2.0 + m)) * a;
                          	}
                          	return tmp;
                          }
                          
                          def code(a, k, m):
                          	tmp = 0
                          	if k <= 7e-9:
                          		tmp = a * math.pow(k, m)
                          	else:
                          		tmp = math.pow(k, (-2.0 + m)) * a
                          	return tmp
                          
                          function code(a, k, m)
                          	tmp = 0.0
                          	if (k <= 7e-9)
                          		tmp = Float64(a * (k ^ m));
                          	else
                          		tmp = Float64((k ^ Float64(-2.0 + m)) * a);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(a, k, m)
                          	tmp = 0.0;
                          	if (k <= 7e-9)
                          		tmp = a * (k ^ m);
                          	else
                          		tmp = (k ^ (-2.0 + m)) * a;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[a_, k_, m_] := If[LessEqual[k, 7e-9], N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision], N[(N[Power[k, N[(-2.0 + m), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;k \leq 7 \cdot 10^{-9}:\\
                          \;\;\;\;a \cdot {k}^{m}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;{k}^{\left(-2 + m\right)} \cdot a\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if k < 6.9999999999999998e-9

                            1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 6.9999999999999998e-9 < k

                            1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{a}{{k}^{2}} \cdot {\left(e^{\color{blue}{\log k}}\right)}^{m} \]
                              10. rem-exp-logN/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.7

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

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

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

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

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

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 7 \cdot 10^{-9}:\\ \;\;\;\;a \cdot {k}^{m}\\ \mathbf{else}:\\ \;\;\;\;{k}^{\left(-2 + m\right)} \cdot a\\ \end{array} \]
                                5. Add Preprocessing

                                Alternative 7: 72.4% accurate, 2.7× speedup?

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

                                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                    16. 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 rewrites37.3%

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

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

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

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

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

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

                                        if -2e3 < m < 0.94999999999999996

                                        1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if 0.94999999999999996 < m

                                        1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                          16. 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}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites18.3%

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

                                            \[\leadsto 99 \cdot \left(a \cdot \color{blue}{{k}^{2}}\right) \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites47.0%

                                              \[\leadsto \left(\left(99 \cdot k\right) \cdot a\right) \cdot k \]
                                          4. Recombined 3 regimes into one program.
                                          5. Final simplification73.9%

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

                                          Alternative 8: 68.7% accurate, 4.1× speedup?

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

                                            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 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. *-commutativeN/A

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{a}{{k}^{2}} \cdot {\left(e^{\color{blue}{\log k}}\right)}^{m} \]
                                              10. rem-exp-logN/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.f64100.0

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

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

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

                                                  \[\leadsto a \cdot \color{blue}{{k}^{\left(-1 + \left(-1 + m\right)\right)}} \]
                                                2. Taylor expanded in m around 0

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

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

                                                  if -2e3 < m < 0.94999999999999996

                                                  1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if 0.94999999999999996 < m

                                                  1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                                    16. 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}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites18.3%

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

                                                      \[\leadsto 99 \cdot \left(a \cdot \color{blue}{{k}^{2}}\right) \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites47.0%

                                                        \[\leadsto \left(\left(99 \cdot k\right) \cdot a\right) \cdot k \]
                                                    4. Recombined 3 regimes into one program.
                                                    5. Final simplification70.9%

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

                                                    Alternative 9: 60.9% accurate, 5.0× speedup?

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

                                                      1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                                        16. 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 rewrites63.3%

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

                                                      if 0.94999999999999996 < m

                                                      1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                                        16. 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}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites18.3%

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

                                                          \[\leadsto 99 \cdot \left(a \cdot \color{blue}{{k}^{2}}\right) \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites47.0%

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

                                                        Alternative 10: 44.5% accurate, 5.6× speedup?

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

                                                          1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                                            16. 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 rewrites63.3%

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

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

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

                                                            if 0.680000000000000049 < m

                                                            1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                                              16. 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}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites18.3%

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

                                                                \[\leadsto 99 \cdot \left(a \cdot \color{blue}{{k}^{2}}\right) \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites47.0%

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

                                                              Alternative 11: 35.3% accurate, 6.1× speedup?

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

                                                                1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                                                  16. 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 rewrites63.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 rewrites25.7%

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

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

                                                                    if 0.19 < m

                                                                    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                                                      16. 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}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites18.3%

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

                                                                        \[\leadsto 99 \cdot \left(a \cdot \color{blue}{{k}^{2}}\right) \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites47.0%

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

                                                                      Alternative 12: 25.1% accurate, 7.4× speedup?

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

                                                                        1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                            \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                                                          16. 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 rewrites63.1%

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

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

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

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

                                                                            if 2.09999999999999988e-5 < m

                                                                            1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                \[\leadsto \frac{a}{\color{blue}{\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k\right) \cdot k} + 1} \]
                                                                              16. 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 rewrites4.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 rewrites7.0%

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

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

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

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

                                                                                Alternative 13: 8.9% accurate, 12.2× speedup?

                                                                                \[\begin{array}{l} \\ \left(-10 \cdot k\right) \cdot a \end{array} \]
                                                                                (FPCore (a k m) :precision binary64 (* (* -10.0 k) a))
                                                                                double code(double a, double k, double m) {
                                                                                	return (-10.0 * k) * a;
                                                                                }
                                                                                
                                                                                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) * k) * a
                                                                                end function
                                                                                
                                                                                public static double code(double a, double k, double m) {
                                                                                	return (-10.0 * k) * a;
                                                                                }
                                                                                
                                                                                def code(a, k, m):
                                                                                	return (-10.0 * k) * a
                                                                                
                                                                                function code(a, k, m)
                                                                                	return Float64(Float64(-10.0 * k) * a)
                                                                                end
                                                                                
                                                                                function tmp = code(a, k, m)
                                                                                	tmp = (-10.0 * k) * a;
                                                                                end
                                                                                
                                                                                code[a_, k_, m_] := N[(N[(-10.0 * k), $MachinePrecision] * a), $MachinePrecision]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                \left(-10 \cdot k\right) \cdot a
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Initial program 92.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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      Alternative 14: 8.9% 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 92.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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            Reproduce

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