Falkner and Boettcher, Appendix A

Percentage Accurate: 90.1% → 97.6%
Time: 9.0s
Alternatives: 14
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 90.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.6% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if m < 3

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3 < m

    1. Initial program 72.2%

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

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

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

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

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

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

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

Alternative 2: 52.4% accurate, 0.3× speedup?

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

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

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

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

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


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

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\left(\left(\frac{\frac{10}{k}}{a} + \frac{1}{a}\right) \cdot k\right) \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))) < 1.00000000000000005e301

      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 rewrites97.6%

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

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

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}} \]
        6. Taylor expanded in k around 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 rewrites49.4%

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

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

          1. Initial program 0.0%

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

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

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

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

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

          Alternative 3: 51.4% accurate, 0.3× speedup?

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

            1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{1}{\left(\left(\frac{\frac{10}{k}}{a} + \frac{1}{a}\right) \cdot k\right) \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))) < 1.00000000000000005e301

              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 rewrites97.6%

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

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

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

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 0.0%

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

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k} \leq 0:\\ \;\;\;\;\frac{1}{\left(\left(\frac{1}{a} + \frac{\frac{10}{k}}{a}\right) \cdot k\right) \cdot k}\\ \mathbf{elif}\;\frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k} \leq 10^{+301}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{1}{\frac{1}{10 + k}}, k, 1\right)}\\ \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(\mathsf{fma}\left(-10, a, \left(k \cdot a\right) \cdot 99\right), k, a\right)\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 4: 53.0% accurate, 0.3× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{-1}{10} \cdot \mathsf{fma}\left(k, k, -100\right), k, 1\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+301}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{1}{\frac{1}{10 + k}}, k, 1\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-10, a, \left(k \cdot a\right) \cdot 99\right), k, a\right)\\ \end{array} \end{array} \]
                  (FPCore (a k m)
                   :precision binary64
                   (let* ((t_0 (/ (* (pow k m) a) (+ (+ (* 10.0 k) 1.0) (* k k)))))
                     (if (<= t_0 0.0)
                       (/ a (fma (* (/ -1.0 10.0) (fma k k -100.0)) k 1.0))
                       (if (<= t_0 1e+301)
                         (/ a (fma (/ 1.0 (/ 1.0 (+ 10.0 k))) k 1.0))
                         (if (<= t_0 INFINITY)
                           (/ a (* k k))
                           (fma (fma -10.0 a (* (* k a) 99.0)) k a))))))
                  double code(double a, double k, double m) {
                  	double t_0 = (pow(k, m) * a) / (((10.0 * k) + 1.0) + (k * k));
                  	double tmp;
                  	if (t_0 <= 0.0) {
                  		tmp = a / fma(((-1.0 / 10.0) * fma(k, k, -100.0)), k, 1.0);
                  	} else if (t_0 <= 1e+301) {
                  		tmp = a / fma((1.0 / (1.0 / (10.0 + k))), k, 1.0);
                  	} else if (t_0 <= ((double) INFINITY)) {
                  		tmp = a / (k * k);
                  	} else {
                  		tmp = fma(fma(-10.0, a, ((k * a) * 99.0)), k, a);
                  	}
                  	return tmp;
                  }
                  
                  function code(a, k, m)
                  	t_0 = Float64(Float64((k ^ m) * a) / Float64(Float64(Float64(10.0 * k) + 1.0) + Float64(k * k)))
                  	tmp = 0.0
                  	if (t_0 <= 0.0)
                  		tmp = Float64(a / fma(Float64(Float64(-1.0 / 10.0) * fma(k, k, -100.0)), k, 1.0));
                  	elseif (t_0 <= 1e+301)
                  		tmp = Float64(a / fma(Float64(1.0 / Float64(1.0 / Float64(10.0 + k))), k, 1.0));
                  	elseif (t_0 <= Inf)
                  		tmp = Float64(a / Float64(k * k));
                  	else
                  		tmp = fma(fma(-10.0, a, Float64(Float64(k * a) * 99.0)), k, a);
                  	end
                  	return tmp
                  end
                  
                  code[a_, k_, m_] := Block[{t$95$0 = 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$0, 0.0], N[(a / N[(N[(N[(-1.0 / 10.0), $MachinePrecision] * N[(k * k + -100.0), $MachinePrecision]), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+301], N[(a / N[(N[(1.0 / N[(1.0 / N[(10.0 + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(N[(-10.0 * a + N[(N[(k * a), $MachinePrecision] * 99.0), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k}\\
                  \mathbf{if}\;t\_0 \leq 0:\\
                  \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{-1}{10} \cdot \mathsf{fma}\left(k, k, -100\right), k, 1\right)}\\
                  
                  \mathbf{elif}\;t\_0 \leq 10^{+301}:\\
                  \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{1}{\frac{1}{10 + k}}, k, 1\right)}\\
                  
                  \mathbf{elif}\;t\_0 \leq \infty:\\
                  \;\;\;\;\frac{a}{k \cdot k}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-10, a, \left(k \cdot a\right) \cdot 99\right), k, a\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

                    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        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 rewrites97.6%

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

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

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

                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            1. Initial program 0.0%

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

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k} \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{-1}{10} \cdot \mathsf{fma}\left(k, k, -100\right), k, 1\right)}\\ \mathbf{elif}\;\frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k} \leq 10^{+301}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{1}{\frac{1}{10 + k}}, k, 1\right)}\\ \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(\mathsf{fma}\left(-10, a, \left(k \cdot a\right) \cdot 99\right), k, a\right)\\ \end{array} \]
                            10. Add Preprocessing

                            Alternative 5: 53.0% accurate, 0.3× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{-1}{10} \cdot \mathsf{fma}\left(k, k, -100\right), k, 1\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+301}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-10, a, \left(k \cdot a\right) \cdot 99\right), k, a\right)\\ \end{array} \end{array} \]
                            (FPCore (a k m)
                             :precision binary64
                             (let* ((t_0 (/ (* (pow k m) a) (+ (+ (* 10.0 k) 1.0) (* k k)))))
                               (if (<= t_0 0.0)
                                 (/ a (fma (* (/ -1.0 10.0) (fma k k -100.0)) k 1.0))
                                 (if (<= t_0 1e+301)
                                   (/ a (fma (+ 10.0 k) k 1.0))
                                   (if (<= t_0 INFINITY)
                                     (/ a (* k k))
                                     (fma (fma -10.0 a (* (* k a) 99.0)) k a))))))
                            double code(double a, double k, double m) {
                            	double t_0 = (pow(k, m) * a) / (((10.0 * k) + 1.0) + (k * k));
                            	double tmp;
                            	if (t_0 <= 0.0) {
                            		tmp = a / fma(((-1.0 / 10.0) * fma(k, k, -100.0)), k, 1.0);
                            	} else if (t_0 <= 1e+301) {
                            		tmp = a / fma((10.0 + k), k, 1.0);
                            	} else if (t_0 <= ((double) INFINITY)) {
                            		tmp = a / (k * k);
                            	} else {
                            		tmp = fma(fma(-10.0, a, ((k * a) * 99.0)), k, a);
                            	}
                            	return tmp;
                            }
                            
                            function code(a, k, m)
                            	t_0 = Float64(Float64((k ^ m) * a) / Float64(Float64(Float64(10.0 * k) + 1.0) + Float64(k * k)))
                            	tmp = 0.0
                            	if (t_0 <= 0.0)
                            		tmp = Float64(a / fma(Float64(Float64(-1.0 / 10.0) * fma(k, k, -100.0)), k, 1.0));
                            	elseif (t_0 <= 1e+301)
                            		tmp = Float64(a / fma(Float64(10.0 + k), k, 1.0));
                            	elseif (t_0 <= Inf)
                            		tmp = Float64(a / Float64(k * k));
                            	else
                            		tmp = fma(fma(-10.0, a, Float64(Float64(k * a) * 99.0)), k, a);
                            	end
                            	return tmp
                            end
                            
                            code[a_, k_, m_] := Block[{t$95$0 = 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$0, 0.0], N[(a / N[(N[(N[(-1.0 / 10.0), $MachinePrecision] * N[(k * k + -100.0), $MachinePrecision]), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+301], N[(a / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(N[(-10.0 * a + N[(N[(k * a), $MachinePrecision] * 99.0), $MachinePrecision]), $MachinePrecision] * k + a), $MachinePrecision]]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := \frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k}\\
                            \mathbf{if}\;t\_0 \leq 0:\\
                            \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{-1}{10} \cdot \mathsf{fma}\left(k, k, -100\right), k, 1\right)}\\
                            
                            \mathbf{elif}\;t\_0 \leq 10^{+301}:\\
                            \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
                            
                            \mathbf{elif}\;t\_0 \leq \infty:\\
                            \;\;\;\;\frac{a}{k \cdot k}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-10, a, \left(k \cdot a\right) \cdot 99\right), k, a\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 4 regimes
                            2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

                              1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  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 rewrites97.6%

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

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

                                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    1. Initial program 0.0%

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

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

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

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k} \leq 0:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(\frac{-1}{10} \cdot \mathsf{fma}\left(k, k, -100\right), k, 1\right)}\\ \mathbf{elif}\;\frac{{k}^{m} \cdot a}{\left(10 \cdot k + 1\right) + k \cdot k} \leq 10^{+301}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \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(\mathsf{fma}\left(-10, a, \left(k \cdot a\right) \cdot 99\right), k, a\right)\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 6: 97.6% accurate, 1.0× speedup?

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

                                      1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 3 < m

                                      1. Initial program 72.2%

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

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

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

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

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

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

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

                                    Alternative 7: 97.1% accurate, 1.0× speedup?

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

                                        \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{{k}^{2}}} \]
                                      4. Step-by-step derivation
                                        1. unpow2N/A

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

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

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

                                      if -5.3000000000000001e-5 < m < 3.60000000000000023e-4

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

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

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

                                        if 3.60000000000000023e-4 < m

                                        1. Initial program 72.2%

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

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

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

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

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

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

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

                                      Alternative 8: 97.0% accurate, 1.1× speedup?

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

                                        1. Initial program 84.5%

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

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

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

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

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

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

                                        if -28 < m < 3.60000000000000023e-4

                                        1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{a}{\mathsf{fma}\left(\frac{1}{\frac{1}{10 + k}}, k, 1\right)} \]
                                        7. Recombined 2 regimes into one program.
                                        8. Add Preprocessing

                                        Alternative 9: 60.5% accurate, 3.8× speedup?

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

                                          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 rewrites38.9%

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

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

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

                                            if -28 < m < 2.5

                                            1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if 2.5 < m

                                            1. Initial program 72.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}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites29.6%

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

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

                                            Alternative 10: 58.3% accurate, 4.1× speedup?

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

                                              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 rewrites38.9%

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

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

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

                                                if -28 < m < 0.650000000000000022

                                                1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if 0.650000000000000022 < m

                                                1. Initial program 72.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.5%

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

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

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

                                                  Alternative 11: 47.6% accurate, 4.5× speedup?

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

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

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

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

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

                                                      if -5.4e-46 < m < 0.650000000000000022

                                                      1. Initial program 96.7%

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

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

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

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

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

                                                        if 0.650000000000000022 < m

                                                        1. Initial program 72.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.5%

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

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

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

                                                          Alternative 12: 46.7% accurate, 4.6× speedup?

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

                                                            1. Initial program 83.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 rewrites45.0%

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

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

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

                                                              if -5.3999999999999999e-301 < k < 0.10000000000000001

                                                              1. Initial program 100.0%

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

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

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

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

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

                                                                Alternative 13: 25.5% accurate, 7.9× speedup?

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

                                                                  1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                                                                  8. Taylor expanded in m around 0

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

                                                                      \[\leadsto 1 \cdot a \]

                                                                    if 0.55000000000000004 < m

                                                                    1. Initial program 72.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.5%

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

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

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

                                                                      Alternative 14: 19.9% 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 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                                                                      8. Taylor expanded in m around 0

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

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

                                                                        Reproduce

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