Falkner and Boettcher, Appendix A

Percentage Accurate: 90.1% → 97.1%
Time: 6.3s
Alternatives: 13
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 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.1% 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: 97.1% accurate, 1.1× speedup?

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

\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 < 0.098000000000000004

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(k \cdot -10 + 1\right) \cdot \left(a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}\right)} \]
    5. Applied rewrites99.7%

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

    if 0.098000000000000004 < k

    1. Initial program 82.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.f6493.0

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

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

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

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

    Alternative 2: 41.9% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a}{k \cdot k}\\ t_1 := \frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k}\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\ \;\;\;\;\mathsf{fma}\left(-10, k, 1\right) \cdot a\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(k, 10, 1\right) \cdot a\\ \end{array} \end{array} \]
    (FPCore (a k m)
     :precision binary64
     (let* ((t_0 (/ a (* k k)))
            (t_1 (/ (* (pow k m) a) (+ (+ (* 10.0 k) 1.0) (* k k)))))
       (if (<= t_1 0.0)
         t_0
         (if (<= t_1 2e+306)
           (* (fma -10.0 k 1.0) a)
           (if (<= t_1 INFINITY) t_0 (* (fma k 10.0 1.0) a))))))
    double code(double a, double k, double m) {
    	double t_0 = a / (k * k);
    	double t_1 = (pow(k, m) * a) / (((10.0 * k) + 1.0) + (k * k));
    	double tmp;
    	if (t_1 <= 0.0) {
    		tmp = t_0;
    	} else if (t_1 <= 2e+306) {
    		tmp = fma(-10.0, k, 1.0) * a;
    	} else if (t_1 <= ((double) INFINITY)) {
    		tmp = t_0;
    	} else {
    		tmp = fma(k, 10.0, 1.0) * a;
    	}
    	return tmp;
    }
    
    function code(a, k, m)
    	t_0 = Float64(a / Float64(k * k))
    	t_1 = Float64(Float64((k ^ m) * a) / Float64(Float64(Float64(10.0 * k) + 1.0) + Float64(k * k)))
    	tmp = 0.0
    	if (t_1 <= 0.0)
    		tmp = t_0;
    	elseif (t_1 <= 2e+306)
    		tmp = Float64(fma(-10.0, k, 1.0) * a);
    	elseif (t_1 <= Inf)
    		tmp = t_0;
    	else
    		tmp = Float64(fma(k, 10.0, 1.0) * a);
    	end
    	return tmp
    end
    
    code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision] / N[(N[(N[(10.0 * k), $MachinePrecision] + 1.0), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], t$95$0, If[LessEqual[t$95$1, 2e+306], N[(N[(-10.0 * k + 1.0), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$0, N[(N[(k * 10.0 + 1.0), $MachinePrecision] * a), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{a}{k \cdot k}\\
    t_1 := \frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k}\\
    \mathbf{if}\;t\_1 \leq 0:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
    \;\;\;\;\mathsf{fma}\left(-10, k, 1\right) \cdot a\\
    
    \mathbf{elif}\;t\_1 \leq \infty:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(k, 10, 1\right) \cdot a\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0 or 2.00000000000000003e306 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

      1. Initial program 97.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 rewrites42.3%

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

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

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

            \[\leadsto \frac{a}{k \cdot \color{blue}{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))) < 2.00000000000000003e306

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(k, 10, 1\right) \cdot a \]
            8. Recombined 3 regimes into one program.
            9. Final simplification45.8%

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

            Alternative 3: 16.9% accurate, 0.9× speedup?

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(-10, k, 1\right) \cdot \color{blue}{a} \]
                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.6%

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(k, 10, 1\right) \cdot a \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification18.9%

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

                  Alternative 4: 79.5% accurate, 1.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-10 \cdot k\right) \cdot \left({k}^{m} \cdot a\right)\\ \mathbf{if}\;m \leq -6.2 \cdot 10^{+63}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;m \leq -0.7:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{k}, 10 - \frac{99}{k}, -1\right)}{k \cdot k} \cdot \left(-a\right)\\ \mathbf{elif}\;m \leq 1.15:\\ \;\;\;\;\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 (* (* -10.0 k) (* (pow k m) a))))
                     (if (<= m -6.2e+63)
                       t_0
                       (if (<= m -0.7)
                         (* (/ (fma (/ 1.0 k) (- 10.0 (/ 99.0 k)) -1.0) (* k k)) (- a))
                         (if (<= m 1.15) (/ a (fma (+ 10.0 k) k 1.0)) t_0)))))
                  double code(double a, double k, double m) {
                  	double t_0 = (-10.0 * k) * (pow(k, m) * a);
                  	double tmp;
                  	if (m <= -6.2e+63) {
                  		tmp = t_0;
                  	} else if (m <= -0.7) {
                  		tmp = (fma((1.0 / k), (10.0 - (99.0 / k)), -1.0) / (k * k)) * -a;
                  	} else if (m <= 1.15) {
                  		tmp = a / fma((10.0 + k), k, 1.0);
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  function code(a, k, m)
                  	t_0 = Float64(Float64(-10.0 * k) * Float64((k ^ m) * a))
                  	tmp = 0.0
                  	if (m <= -6.2e+63)
                  		tmp = t_0;
                  	elseif (m <= -0.7)
                  		tmp = Float64(Float64(fma(Float64(1.0 / k), Float64(10.0 - Float64(99.0 / k)), -1.0) / Float64(k * k)) * Float64(-a));
                  	elseif (m <= 1.15)
                  		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[(N[(-10.0 * k), $MachinePrecision] * N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -6.2e+63], t$95$0, If[LessEqual[m, -0.7], N[(N[(N[(N[(1.0 / k), $MachinePrecision] * N[(10.0 - N[(99.0 / k), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * (-a)), $MachinePrecision], If[LessEqual[m, 1.15], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \left(-10 \cdot k\right) \cdot \left({k}^{m} \cdot a\right)\\
                  \mathbf{if}\;m \leq -6.2 \cdot 10^{+63}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;m \leq -0.7:\\
                  \;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{k}, 10 - \frac{99}{k}, -1\right)}{k \cdot k} \cdot \left(-a\right)\\
                  
                  \mathbf{elif}\;m \leq 1.15:\\
                  \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if m < -6.2000000000000001e63 or 1.1499999999999999 < m

                    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(k \cdot -10 + 1\right) \cdot \left(a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}\right)} \]
                    5. Applied rewrites87.1%

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

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

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

                      if -6.2000000000000001e63 < m < -0.69999999999999996

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

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

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

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

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

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

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

                            if -0.69999999999999996 < m < 1.1499999999999999

                            1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 5: 96.7% accurate, 1.0× speedup?

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

                            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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \color{blue}{\left(k \cdot -10 + 1\right) \cdot \left(a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}\right)} \]
                            5. Applied rewrites100.0%

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

                            if -1.40000000000000006e-18 < m < 2.2499999999999999e-4

                            1. Initial program 93.6%

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

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

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

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

                            if 2.2499999999999999e-4 < m

                            1. Initial program 77.0%

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

                              \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{1}} \]
                            4. Step-by-step derivation
                              1. Applied rewrites100.0%

                                \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{1}} \]
                            5. Recombined 3 regimes into one program.
                            6. Final simplification97.6%

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

                            Alternative 6: 87.7% accurate, 1.0× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left({k}^{m} \cdot a\right) \cdot \mathsf{fma}\left(-10, k, 1\right)\\ \mathbf{if}\;m \leq -1.4 \cdot 10^{-18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;m \leq 0.000225:\\ \;\;\;\;\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 (* (* (pow k m) a) (fma -10.0 k 1.0))))
                               (if (<= m -1.4e-18)
                                 t_0
                                 (if (<= m 0.000225) (/ a (fma (+ 10.0 k) k 1.0)) t_0))))
                            double code(double a, double k, double m) {
                            	double t_0 = (pow(k, m) * a) * fma(-10.0, k, 1.0);
                            	double tmp;
                            	if (m <= -1.4e-18) {
                            		tmp = t_0;
                            	} else if (m <= 0.000225) {
                            		tmp = a / fma((10.0 + k), k, 1.0);
                            	} else {
                            		tmp = t_0;
                            	}
                            	return tmp;
                            }
                            
                            function code(a, k, m)
                            	t_0 = Float64(Float64((k ^ m) * a) * fma(-10.0, k, 1.0))
                            	tmp = 0.0
                            	if (m <= -1.4e-18)
                            		tmp = t_0;
                            	elseif (m <= 0.000225)
                            		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[(N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision] * N[(-10.0 * k + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -1.4e-18], t$95$0, If[LessEqual[m, 0.000225], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := \left({k}^{m} \cdot a\right) \cdot \mathsf{fma}\left(-10, k, 1\right)\\
                            \mathbf{if}\;m \leq -1.4 \cdot 10^{-18}:\\
                            \;\;\;\;t\_0\\
                            
                            \mathbf{elif}\;m \leq 0.000225:\\
                            \;\;\;\;\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.40000000000000006e-18 or 2.2499999999999999e-4 < m

                              1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{\left(k \cdot -10 + 1\right) \cdot \left(a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}\right)} \]
                              5. Applied rewrites88.9%

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

                              if -1.40000000000000006e-18 < m < 2.2499999999999999e-4

                              1. Initial program 93.6%

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

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

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

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

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

                            Alternative 7: 75.0% accurate, 2.2× speedup?

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

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

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

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

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

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

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

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

                                    if -0.69999999999999996 < m < 1.1499999999999999

                                    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 1.1499999999999999 < m

                                    1. Initial program 77.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 rewrites2.9%

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

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

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

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

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

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

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

                                        Alternative 8: 74.4% accurate, 2.4× speedup?

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

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

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

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

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

                                            if -0.69999999999999996 < m < 1.1499999999999999

                                            1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if 1.1499999999999999 < m

                                            1. Initial program 77.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 rewrites2.9%

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

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

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

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

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

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

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

                                                Alternative 9: 72.4% accurate, 4.1× speedup?

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

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

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

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

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

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

                                                      if -0.69999999999999996 < m < 1.1499999999999999

                                                      1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      if 1.1499999999999999 < m

                                                      1. Initial program 77.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 rewrites2.9%

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

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

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

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

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

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

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

                                                          Alternative 10: 61.9% accurate, 4.5× speedup?

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

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

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

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

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

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

                                                                if -8.00000000000000065e-5 < m < 1.1499999999999999

                                                                1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  if 1.1499999999999999 < m

                                                                  1. Initial program 77.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 rewrites2.9%

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

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

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

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

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

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

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

                                                                      Alternative 11: 57.0% accurate, 4.5× speedup?

                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -1.8 \cdot 10^{-252}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 0.38:\\ \;\;\;\;1 \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-99 \cdot k\right) \cdot k\right) \cdot \left(-a\right)\\ \end{array} \end{array} \]
                                                                      (FPCore (a k m)
                                                                       :precision binary64
                                                                       (if (<= m -1.8e-252)
                                                                         (/ a (* k k))
                                                                         (if (<= m 0.38) (* 1.0 a) (* (* (* -99.0 k) k) (- a)))))
                                                                      double code(double a, double k, double m) {
                                                                      	double tmp;
                                                                      	if (m <= -1.8e-252) {
                                                                      		tmp = a / (k * k);
                                                                      	} else if (m <= 0.38) {
                                                                      		tmp = 1.0 * a;
                                                                      	} else {
                                                                      		tmp = ((-99.0 * k) * k) * -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 (m <= (-1.8d-252)) then
                                                                              tmp = a / (k * k)
                                                                          else if (m <= 0.38d0) then
                                                                              tmp = 1.0d0 * a
                                                                          else
                                                                              tmp = (((-99.0d0) * k) * k) * -a
                                                                          end if
                                                                          code = tmp
                                                                      end function
                                                                      
                                                                      public static double code(double a, double k, double m) {
                                                                      	double tmp;
                                                                      	if (m <= -1.8e-252) {
                                                                      		tmp = a / (k * k);
                                                                      	} else if (m <= 0.38) {
                                                                      		tmp = 1.0 * a;
                                                                      	} else {
                                                                      		tmp = ((-99.0 * k) * k) * -a;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      def code(a, k, m):
                                                                      	tmp = 0
                                                                      	if m <= -1.8e-252:
                                                                      		tmp = a / (k * k)
                                                                      	elif m <= 0.38:
                                                                      		tmp = 1.0 * a
                                                                      	else:
                                                                      		tmp = ((-99.0 * k) * k) * -a
                                                                      	return tmp
                                                                      
                                                                      function code(a, k, m)
                                                                      	tmp = 0.0
                                                                      	if (m <= -1.8e-252)
                                                                      		tmp = Float64(a / Float64(k * k));
                                                                      	elseif (m <= 0.38)
                                                                      		tmp = Float64(1.0 * a);
                                                                      	else
                                                                      		tmp = Float64(Float64(Float64(-99.0 * k) * k) * Float64(-a));
                                                                      	end
                                                                      	return tmp
                                                                      end
                                                                      
                                                                      function tmp_2 = code(a, k, m)
                                                                      	tmp = 0.0;
                                                                      	if (m <= -1.8e-252)
                                                                      		tmp = a / (k * k);
                                                                      	elseif (m <= 0.38)
                                                                      		tmp = 1.0 * a;
                                                                      	else
                                                                      		tmp = ((-99.0 * k) * k) * -a;
                                                                      	end
                                                                      	tmp_2 = tmp;
                                                                      end
                                                                      
                                                                      code[a_, k_, m_] := If[LessEqual[m, -1.8e-252], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.38], N[(1.0 * a), $MachinePrecision], N[(N[(N[(-99.0 * k), $MachinePrecision] * k), $MachinePrecision] * (-a)), $MachinePrecision]]]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      \begin{array}{l}
                                                                      \mathbf{if}\;m \leq -1.8 \cdot 10^{-252}:\\
                                                                      \;\;\;\;\frac{a}{k \cdot k}\\
                                                                      
                                                                      \mathbf{elif}\;m \leq 0.38:\\
                                                                      \;\;\;\;1 \cdot a\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;\left(\left(-99 \cdot k\right) \cdot k\right) \cdot \left(-a\right)\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 3 regimes
                                                                      2. if m < -1.80000000000000011e-252

                                                                        1. Initial program 99.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 rewrites50.2%

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

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

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

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

                                                                            if -1.80000000000000011e-252 < m < 0.38

                                                                            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 rewrites92.0%

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

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

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

                                                                                \[\leadsto 1 \cdot a \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites61.3%

                                                                                  \[\leadsto 1 \cdot a \]

                                                                                if 0.38 < m

                                                                                1. Initial program 77.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 rewrites2.9%

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

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

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

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

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

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

                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;m \leq -1.8 \cdot 10^{-252}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 0.38:\\ \;\;\;\;1 \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-99 \cdot k\right) \cdot k\right) \cdot \left(-a\right)\\ \end{array} \]
                                                                                    6. Add Preprocessing

                                                                                    Alternative 12: 25.1% accurate, 7.9× speedup?

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

                                                                                      1. Initial program 96.8%

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

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

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

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

                                                                                          \[\leadsto 1 \cdot a \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites29.9%

                                                                                            \[\leadsto 1 \cdot a \]

                                                                                          if 1.65000000000000013e30 < m

                                                                                          1. Initial program 74.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 rewrites2.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 rewrites9.2%

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

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

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

                                                                                            Alternative 13: 20.2% accurate, 22.3× speedup?

                                                                                            \[\begin{array}{l} \\ 1 \cdot a \end{array} \]
                                                                                            (FPCore (a k m) :precision binary64 (* 1.0 a))
                                                                                            double code(double a, double k, double m) {
                                                                                            	return 1.0 * a;
                                                                                            }
                                                                                            
                                                                                            real(8) function code(a, k, m)
                                                                                                real(8), intent (in) :: a
                                                                                                real(8), intent (in) :: k
                                                                                                real(8), intent (in) :: m
                                                                                                code = 1.0d0 * a
                                                                                            end function
                                                                                            
                                                                                            public static double code(double a, double k, double m) {
                                                                                            	return 1.0 * a;
                                                                                            }
                                                                                            
                                                                                            def code(a, k, m):
                                                                                            	return 1.0 * a
                                                                                            
                                                                                            function code(a, k, m)
                                                                                            	return Float64(1.0 * a)
                                                                                            end
                                                                                            
                                                                                            function tmp = code(a, k, m)
                                                                                            	tmp = 1.0 * a;
                                                                                            end
                                                                                            
                                                                                            code[a_, k_, m_] := N[(1.0 * a), $MachinePrecision]
                                                                                            
                                                                                            \begin{array}{l}
                                                                                            
                                                                                            \\
                                                                                            1 \cdot a
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            1. Initial program 91.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 rewrites47.0%

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

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

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

                                                                                                \[\leadsto 1 \cdot a \]
                                                                                              3. Step-by-step derivation
                                                                                                1. Applied rewrites23.3%

                                                                                                  \[\leadsto 1 \cdot a \]
                                                                                                2. Add Preprocessing

                                                                                                Reproduce

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