Falkner and Boettcher, Appendix A

Percentage Accurate: 90.3% → 97.5%
Time: 9.3s
Alternatives: 12
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 12 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.3% 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.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.1%

      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
    2. Add Preprocessing

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

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

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

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

      Alternative 2: 96.8% accurate, 1.0× speedup?

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

        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-*.f64100.0

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

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

        if -1.29999999999999989e-4 < m < 3.1e-4

        1. Initial program 97.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 rewrites96.2%

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

        if 3.1e-4 < m

        1. Initial program 70.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.f6496.9

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

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

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

      Alternative 3: 96.8% accurate, 1.1× speedup?

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

        1. Initial program 84.9%

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

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

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

        if -0.13 < m < 3.1e-4

        1. Initial program 97.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 rewrites96.2%

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

      Alternative 4: 69.3% accurate, 2.4× speedup?

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

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

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

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

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

          if -2.25e8 < m < 1.6000000000000001

          1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.6000000000000001 < m

          1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto a + \color{blue}{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 rewrites36.9%

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

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

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

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

            Alternative 5: 67.4% accurate, 3.2× speedup?

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

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

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

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

                if -2.25e8 < m < 1.6000000000000001

                1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 1.6000000000000001 < m

                1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto a + \color{blue}{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 rewrites36.9%

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

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

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

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

                  Alternative 6: 68.1% accurate, 4.1× speedup?

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

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

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

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

                      if -2.25e8 < m < 1.3500000000000001

                      1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 1.3500000000000001 < m

                      1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto a + \color{blue}{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 rewrites36.9%

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

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

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

                        Alternative 7: 57.8% accurate, 4.5× speedup?

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

                          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 rewrites42.8%

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

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

                            if -4.19999999999999977e-48 < m < 1.3500000000000001

                            1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 1.3500000000000001 < m

                              1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto a + \color{blue}{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 rewrites36.9%

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

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

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

                                Alternative 8: 53.4% accurate, 4.5× speedup?

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

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

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

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

                                    if -2.24999999999999992e-53 < m < 0.0259999999999999988

                                    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{a}{\color{blue}{\mathsf{fma}\left(\left(1 + 10 \cdot \frac{1}{k}\right) \cdot k, k, 1\right)}} \]
                                    5. Applied rewrites94.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 rewrites56.4%

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

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

                                        if 0.0259999999999999988 < m

                                        1. Initial program 70.2%

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

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

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

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

                                          \[\leadsto a + \color{blue}{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 rewrites36.2%

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

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

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

                                          Alternative 9: 53.6% accurate, 4.8× speedup?

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

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

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

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

                                              if -2.24999999999999992e-53 < m < 0.450000000000000011

                                              1. Initial program 97.1%

                                                \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in 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.f6456.2

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

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

                                                \[\leadsto 1 \cdot a \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites54.7%

                                                  \[\leadsto 1 \cdot a \]

                                                if 0.450000000000000011 < m

                                                1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto a + \color{blue}{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 rewrites36.9%

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

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

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

                                                  Alternative 10: 36.1% accurate, 6.1× speedup?

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

                                                    1. Initial program 98.8%

                                                      \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in 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.f6478.7

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

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

                                                      \[\leadsto 1 \cdot a \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites25.7%

                                                        \[\leadsto 1 \cdot a \]

                                                      if 0.450000000000000011 < m

                                                      1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto a + \color{blue}{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 rewrites36.9%

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

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

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

                                                        Alternative 11: 26.4% accurate, 7.9× speedup?

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

                                                          1. Initial program 98.8%

                                                            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in 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.f6478.7

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

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

                                                            \[\leadsto 1 \cdot a \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites25.7%

                                                              \[\leadsto 1 \cdot a \]

                                                            if 0.450000000000000011 < m

                                                            1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                Alternative 12: 20.8% 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 88.3%

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

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

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

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

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

                                                                  Reproduce

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