Falkner and Boettcher, Appendix A

Percentage Accurate: 90.2% → 98.0%
Time: 10.0s
Alternatives: 13
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 90.2% accurate, 1.0× speedup?

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

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

Alternative 1: 98.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {k}^{m} \cdot a\\ \mathbf{if}\;\frac{t\_0}{k \cdot k + \left(10 \cdot k + 1\right)} \leq \infty:\\ \;\;\;\;\frac{t\_0}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \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)))
   (if (<= (/ t_0 (+ (* k k) (+ (* 10.0 k) 1.0))) INFINITY)
     (/ t_0 (fma (+ 10.0 k) k 1.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;
	double tmp;
	if ((t_0 / ((k * k) + ((10.0 * k) + 1.0))) <= ((double) INFINITY)) {
		tmp = t_0 / fma((10.0 + k), k, 1.0);
	} else {
		tmp = fma((fma(99.0, k, -10.0) * k), a, a);
	}
	return tmp;
}
function code(a, k, m)
	t_0 = Float64((k ^ m) * a)
	tmp = 0.0
	if (Float64(t_0 / Float64(Float64(k * k) + Float64(Float64(10.0 * k) + 1.0))) <= Inf)
		tmp = Float64(t_0 / fma(Float64(10.0 + k), k, 1.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[Power[k, m], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(k * k), $MachinePrecision] + N[(N[(10.0 * k), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(99.0 * k + -10.0), $MachinePrecision] * k), $MachinePrecision] * a + a), $MachinePrecision]]]
\begin{array}{l}

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

\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 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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 rewrites91.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 simplification98.9%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{k}^{m} \cdot a}{k \cdot k + \left(10 \cdot k + 1\right)} \leq \infty:\\ \;\;\;\;\frac{{k}^{m} \cdot a}{\mathsf{fma}\left(10 + k, k, 1\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: 97.5% accurate, 1.1× speedup?

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

        1. Initial program 87.7%

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

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

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

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

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

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

        if -4.80000000000000012e-4 < m < 1.6500000000000001e-7

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

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

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

        Alternative 3: 71.8% accurate, 2.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.5:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{k}, 10 - \frac{99}{k}, -1\right)}{k \cdot k} \cdot \left(-a\right)\\ \mathbf{elif}\;m \leq 1.3:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\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 -0.5)
           (* (/ (fma (/ 1.0 k) (- 10.0 (/ 99.0 k)) -1.0) (* k k)) (- a))
           (if (<= m 1.3) (/ a (fma k 10.0 (fma k k 1.0))) (* (* (* k a) k) 99.0))))
        double code(double a, double k, double m) {
        	double tmp;
        	if (m <= -0.5) {
        		tmp = (fma((1.0 / k), (10.0 - (99.0 / k)), -1.0) / (k * k)) * -a;
        	} else if (m <= 1.3) {
        		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
        	} else {
        		tmp = ((k * a) * k) * 99.0;
        	}
        	return tmp;
        }
        
        function code(a, k, m)
        	tmp = 0.0
        	if (m <= -0.5)
        		tmp = Float64(Float64(fma(Float64(1.0 / k), Float64(10.0 - Float64(99.0 / k)), -1.0) / Float64(k * k)) * Float64(-a));
        	elseif (m <= 1.3)
        		tmp = Float64(a / fma(k, 10.0, fma(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, -0.5], N[(N[(N[(N[(1.0 / k), $MachinePrecision] * N[(10.0 - N[(99.0 / k), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * (-a)), $MachinePrecision], If[LessEqual[m, 1.3], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(k * a), $MachinePrecision] * k), $MachinePrecision] * 99.0), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;m \leq -0.5:\\
        \;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{k}, 10 - \frac{99}{k}, -1\right)}{k \cdot k} \cdot \left(-a\right)\\
        
        \mathbf{elif}\;m \leq 1.3:\\
        \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\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 < -0.5

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -0.5 < m < 1.30000000000000004

              1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 1.30000000000000004 < m

                1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 4: 71.1% accurate, 2.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.5:\\ \;\;\;\;\frac{a - \left(\frac{-99}{k} - -10\right) \cdot \frac{a}{k}}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.3:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\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 -0.5)
                     (/ (- a (* (- (/ -99.0 k) -10.0) (/ a k))) (* k k))
                     (if (<= m 1.3) (/ a (fma k 10.0 (fma k k 1.0))) (* (* (* k a) k) 99.0))))
                  double code(double a, double k, double m) {
                  	double tmp;
                  	if (m <= -0.5) {
                  		tmp = (a - (((-99.0 / k) - -10.0) * (a / k))) / (k * k);
                  	} else if (m <= 1.3) {
                  		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
                  	} else {
                  		tmp = ((k * a) * k) * 99.0;
                  	}
                  	return tmp;
                  }
                  
                  function code(a, k, m)
                  	tmp = 0.0
                  	if (m <= -0.5)
                  		tmp = Float64(Float64(a - Float64(Float64(Float64(-99.0 / k) - -10.0) * Float64(a / k))) / Float64(k * k));
                  	elseif (m <= 1.3)
                  		tmp = Float64(a / fma(k, 10.0, fma(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, -0.5], 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.3], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(k * a), $MachinePrecision] * k), $MachinePrecision] * 99.0), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;m \leq -0.5:\\
                  \;\;\;\;\frac{a - \left(\frac{-99}{k} - -10\right) \cdot \frac{a}{k}}{k \cdot k}\\
                  
                  \mathbf{elif}\;m \leq 1.3:\\
                  \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\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 < -0.5

                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -0.5 < m < 1.30000000000000004

                      1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 1.30000000000000004 < m

                        1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 5: 69.2% accurate, 3.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.5:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.3:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\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 -0.5)
                             (/ a (* k k))
                             (if (<= m 1.3) (/ a (fma k 10.0 (fma k k 1.0))) (* (* (* k a) k) 99.0))))
                          double code(double a, double k, double m) {
                          	double tmp;
                          	if (m <= -0.5) {
                          		tmp = a / (k * k);
                          	} else if (m <= 1.3) {
                          		tmp = a / fma(k, 10.0, fma(k, k, 1.0));
                          	} else {
                          		tmp = ((k * a) * k) * 99.0;
                          	}
                          	return tmp;
                          }
                          
                          function code(a, k, m)
                          	tmp = 0.0
                          	if (m <= -0.5)
                          		tmp = Float64(a / Float64(k * k));
                          	elseif (m <= 1.3)
                          		tmp = Float64(a / fma(k, 10.0, fma(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, -0.5], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.3], N[(a / N[(k * 10.0 + N[(k * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(k * a), $MachinePrecision] * k), $MachinePrecision] * 99.0), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;m \leq -0.5:\\
                          \;\;\;\;\frac{a}{k \cdot k}\\
                          
                          \mathbf{elif}\;m \leq 1.3:\\
                          \;\;\;\;\frac{a}{\mathsf{fma}\left(k, 10, \mathsf{fma}\left(k, k, 1\right)\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 < -0.5

                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if -0.5 < m < 1.30000000000000004

                              1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if 1.30000000000000004 < m

                                1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  Alternative 6: 54.3% accurate, 3.8× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a}{k \cdot k}\\ \mathbf{if}\;m \leq -1.26 \cdot 10^{-9}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;m \leq 3.8 \cdot 10^{-81}:\\ \;\;\;\;1 \cdot a\\ \mathbf{elif}\;m \leq 0.00105:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(k \cdot a\right) \cdot k\right) \cdot 99\\ \end{array} \end{array} \]
                                  (FPCore (a k m)
                                   :precision binary64
                                   (let* ((t_0 (/ a (* k k))))
                                     (if (<= m -1.26e-9)
                                       t_0
                                       (if (<= m 3.8e-81)
                                         (* 1.0 a)
                                         (if (<= m 0.00105) t_0 (* (* (* k a) k) 99.0))))))
                                  double code(double a, double k, double m) {
                                  	double t_0 = a / (k * k);
                                  	double tmp;
                                  	if (m <= -1.26e-9) {
                                  		tmp = t_0;
                                  	} else if (m <= 3.8e-81) {
                                  		tmp = 1.0 * a;
                                  	} else if (m <= 0.00105) {
                                  		tmp = t_0;
                                  	} 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) :: t_0
                                      real(8) :: tmp
                                      t_0 = a / (k * k)
                                      if (m <= (-1.26d-9)) then
                                          tmp = t_0
                                      else if (m <= 3.8d-81) then
                                          tmp = 1.0d0 * a
                                      else if (m <= 0.00105d0) then
                                          tmp = t_0
                                      else
                                          tmp = ((k * a) * k) * 99.0d0
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double a, double k, double m) {
                                  	double t_0 = a / (k * k);
                                  	double tmp;
                                  	if (m <= -1.26e-9) {
                                  		tmp = t_0;
                                  	} else if (m <= 3.8e-81) {
                                  		tmp = 1.0 * a;
                                  	} else if (m <= 0.00105) {
                                  		tmp = t_0;
                                  	} else {
                                  		tmp = ((k * a) * k) * 99.0;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(a, k, m):
                                  	t_0 = a / (k * k)
                                  	tmp = 0
                                  	if m <= -1.26e-9:
                                  		tmp = t_0
                                  	elif m <= 3.8e-81:
                                  		tmp = 1.0 * a
                                  	elif m <= 0.00105:
                                  		tmp = t_0
                                  	else:
                                  		tmp = ((k * a) * k) * 99.0
                                  	return tmp
                                  
                                  function code(a, k, m)
                                  	t_0 = Float64(a / Float64(k * k))
                                  	tmp = 0.0
                                  	if (m <= -1.26e-9)
                                  		tmp = t_0;
                                  	elseif (m <= 3.8e-81)
                                  		tmp = Float64(1.0 * a);
                                  	elseif (m <= 0.00105)
                                  		tmp = t_0;
                                  	else
                                  		tmp = Float64(Float64(Float64(k * a) * k) * 99.0);
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(a, k, m)
                                  	t_0 = a / (k * k);
                                  	tmp = 0.0;
                                  	if (m <= -1.26e-9)
                                  		tmp = t_0;
                                  	elseif (m <= 3.8e-81)
                                  		tmp = 1.0 * a;
                                  	elseif (m <= 0.00105)
                                  		tmp = t_0;
                                  	else
                                  		tmp = ((k * a) * k) * 99.0;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -1.26e-9], t$95$0, If[LessEqual[m, 3.8e-81], N[(1.0 * a), $MachinePrecision], If[LessEqual[m, 0.00105], t$95$0, N[(N[(N[(k * a), $MachinePrecision] * k), $MachinePrecision] * 99.0), $MachinePrecision]]]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_0 := \frac{a}{k \cdot k}\\
                                  \mathbf{if}\;m \leq -1.26 \cdot 10^{-9}:\\
                                  \;\;\;\;t\_0\\
                                  
                                  \mathbf{elif}\;m \leq 3.8 \cdot 10^{-81}:\\
                                  \;\;\;\;1 \cdot a\\
                                  
                                  \mathbf{elif}\;m \leq 0.00105:\\
                                  \;\;\;\;t\_0\\
                                  
                                  \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 < -1.25999999999999999e-9 or 3.7999999999999999e-81 < m < 0.00104999999999999994

                                    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 rewrites44.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 rewrites65.6%

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

                                      if -1.25999999999999999e-9 < m < 3.7999999999999999e-81

                                      1. Initial program 96.0%

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

                                        \[\leadsto \color{blue}{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.f6457.2

                                          \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                                      5. Applied rewrites57.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 rewrites56.9%

                                          \[\leadsto 1 \cdot a \]

                                        if 0.00104999999999999994 < m

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

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

                                          \[\leadsto a + \color{blue}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites31.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 rewrites62.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: 69.2% accurate, 4.1× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.5:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.3:\\ \;\;\;\;\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 -0.5)
                                             (/ a (* k k))
                                             (if (<= m 1.3) (/ 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 <= -0.5) {
                                          		tmp = a / (k * k);
                                          	} else if (m <= 1.3) {
                                          		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 <= -0.5)
                                          		tmp = Float64(a / Float64(k * k));
                                          	elseif (m <= 1.3)
                                          		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, -0.5], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.3], 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 -0.5:\\
                                          \;\;\;\;\frac{a}{k \cdot k}\\
                                          
                                          \mathbf{elif}\;m \leq 1.3:\\
                                          \;\;\;\;\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 < -0.5

                                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              if -0.5 < m < 1.30000000000000004

                                              1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              if 1.30000000000000004 < m

                                              1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                Alternative 8: 59.1% accurate, 4.5× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -1.5 \cdot 10^{-9}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.46:\\ \;\;\;\;\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 -1.5e-9)
                                                   (/ a (* k k))
                                                   (if (<= m 1.46) (/ a (fma 10.0 k 1.0)) (* (* (* k a) k) 99.0))))
                                                double code(double a, double k, double m) {
                                                	double tmp;
                                                	if (m <= -1.5e-9) {
                                                		tmp = a / (k * k);
                                                	} else if (m <= 1.46) {
                                                		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 <= -1.5e-9)
                                                		tmp = Float64(a / Float64(k * k));
                                                	elseif (m <= 1.46)
                                                		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, -1.5e-9], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.46], 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 -1.5 \cdot 10^{-9}:\\
                                                \;\;\;\;\frac{a}{k \cdot k}\\
                                                
                                                \mathbf{elif}\;m \leq 1.46:\\
                                                \;\;\;\;\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 < -1.49999999999999999e-9

                                                  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 rewrites39.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 rewrites63.6%

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

                                                    if -1.49999999999999999e-9 < m < 1.46

                                                    1. Initial program 96.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 rewrites95.1%

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

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

                                                      if 1.46 < m

                                                      1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        Alternative 9: 42.4% accurate, 4.8× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -1.16 \cdot 10^{-8}:\\ \;\;\;\;\frac{a}{10 \cdot k}\\ \mathbf{elif}\;m \leq 0.34:\\ \;\;\;\;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 -1.16e-8)
                                                           (/ a (* 10.0 k))
                                                           (if (<= m 0.34) (* 1.0 a) (* (* (* k a) k) 99.0))))
                                                        double code(double a, double k, double m) {
                                                        	double tmp;
                                                        	if (m <= -1.16e-8) {
                                                        		tmp = a / (10.0 * k);
                                                        	} else if (m <= 0.34) {
                                                        		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 <= (-1.16d-8)) then
                                                                tmp = a / (10.0d0 * k)
                                                            else if (m <= 0.34d0) 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 <= -1.16e-8) {
                                                        		tmp = a / (10.0 * k);
                                                        	} else if (m <= 0.34) {
                                                        		tmp = 1.0 * a;
                                                        	} else {
                                                        		tmp = ((k * a) * k) * 99.0;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(a, k, m):
                                                        	tmp = 0
                                                        	if m <= -1.16e-8:
                                                        		tmp = a / (10.0 * k)
                                                        	elif m <= 0.34:
                                                        		tmp = 1.0 * a
                                                        	else:
                                                        		tmp = ((k * a) * k) * 99.0
                                                        	return tmp
                                                        
                                                        function code(a, k, m)
                                                        	tmp = 0.0
                                                        	if (m <= -1.16e-8)
                                                        		tmp = Float64(a / Float64(10.0 * k));
                                                        	elseif (m <= 0.34)
                                                        		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 <= -1.16e-8)
                                                        		tmp = a / (10.0 * k);
                                                        	elseif (m <= 0.34)
                                                        		tmp = 1.0 * a;
                                                        	else
                                                        		tmp = ((k * a) * k) * 99.0;
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[a_, k_, m_] := If[LessEqual[m, -1.16e-8], N[(a / N[(10.0 * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.34], 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 -1.16 \cdot 10^{-8}:\\
                                                        \;\;\;\;\frac{a}{10 \cdot k}\\
                                                        
                                                        \mathbf{elif}\;m \leq 0.34:\\
                                                        \;\;\;\;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 < -1.15999999999999996e-8

                                                          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 rewrites39.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}^{2} \cdot \color{blue}{\left(1 + 10 \cdot \frac{1}{k}\right)}} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites46.8%

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

                                                              \[\leadsto \frac{a}{10 \cdot k} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites23.9%

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

                                                              if -1.15999999999999996e-8 < m < 0.340000000000000024

                                                              1. Initial program 96.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.f6453.8

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

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

                                                                  \[\leadsto 1 \cdot a \]

                                                                if 0.340000000000000024 < m

                                                                1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      \[\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.34:\\ \;\;\;\;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.34) (* 1.0 a) (* (* (* k a) k) 99.0)))
                                                                  double code(double a, double k, double m) {
                                                                  	double tmp;
                                                                  	if (m <= 0.34) {
                                                                  		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.34d0) 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.34) {
                                                                  		tmp = 1.0 * a;
                                                                  	} else {
                                                                  		tmp = ((k * a) * k) * 99.0;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  def code(a, k, m):
                                                                  	tmp = 0
                                                                  	if m <= 0.34:
                                                                  		tmp = 1.0 * a
                                                                  	else:
                                                                  		tmp = ((k * a) * k) * 99.0
                                                                  	return tmp
                                                                  
                                                                  function code(a, k, m)
                                                                  	tmp = 0.0
                                                                  	if (m <= 0.34)
                                                                  		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.34)
                                                                  		tmp = 1.0 * a;
                                                                  	else
                                                                  		tmp = ((k * a) * k) * 99.0;
                                                                  	end
                                                                  	tmp_2 = tmp;
                                                                  end
                                                                  
                                                                  code[a_, k_, m_] := If[LessEqual[m, 0.34], 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.34:\\
                                                                  \;\;\;\;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.340000000000000024

                                                                    1. Initial program 98.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.f6475.9

                                                                        \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                                                                    5. Applied rewrites75.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 rewrites27.5%

                                                                        \[\leadsto 1 \cdot a \]

                                                                      if 0.340000000000000024 < m

                                                                      1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        Alternative 11: 24.6% accurate, 7.4× speedup?

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

                                                                          1. Initial program 87.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 rewrites24.4%

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

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

                                                                                \[\leadsto \left(-10 \cdot a\right) \cdot k \]

                                                                              if 1.32000000000000008e-297 < k

                                                                              1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                Alternative 12: 25.3% accurate, 7.9× speedup?

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

                                                                                  1. Initial program 97.7%

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

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

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

                                                                                      \[\leadsto 1 \cdot a \]

                                                                                    if 1.02e9 < m

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

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

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

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

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

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

                                                                                      Alternative 13: 19.9% accurate, 22.3× speedup?

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

                                                                                          \[\leadsto \color{blue}{{k}^{m}} \cdot a \]
                                                                                      5. Applied rewrites83.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 rewrites19.6%

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

                                                                                        Reproduce

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