Falkner and Boettcher, Appendix A

Percentage Accurate: 89.9% → 97.0%
Time: 12.0s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 89.9% accurate, 1.0× speedup?

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

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

Alternative 1: 97.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;m \leq 0.44:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\

\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\


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

    1. Initial program 98.7%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6498.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified98.7%

      \[\leadsto \color{blue}{\frac{a \cdot {k}^{m}}{1 + k \cdot \left(k + 10\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(k \cdot \color{blue}{k}\right)\right) \]
      2. *-lowering-*.f6498.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    7. Simplified98.7%

      \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{k \cdot k}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{k \cdot k}{a \cdot {k}^{m}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{k \cdot k}{a}}{\color{blue}{{k}^{m}}}} \]
      3. clear-numN/A

        \[\leadsto \frac{{k}^{m}}{\color{blue}{\frac{k \cdot k}{a}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left({k}^{m}\right), \color{blue}{\left(\frac{k \cdot k}{a}\right)}\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \left(\frac{\color{blue}{k \cdot k}}{a}\right)\right) \]
      6. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \left(k \cdot \color{blue}{\frac{k}{a}}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \left(k \cdot \frac{1}{\color{blue}{\frac{a}{k}}}\right)\right) \]
      8. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \left(\frac{k}{\color{blue}{\frac{a}{k}}}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \mathsf{/.f64}\left(k, \color{blue}{\left(\frac{a}{k}\right)}\right)\right) \]
      10. /-lowering-/.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(a, \color{blue}{k}\right)\right)\right) \]
    9. Applied egg-rr100.0%

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

    if -1.9000000000000001e-5 < m < 0.440000000000000002

    1. Initial program 92.4%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6492.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified92.4%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6492.3%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified92.3%

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

    if 0.440000000000000002 < m

    1. Initial program 71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6471.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified71.0%

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

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

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{m}\right)}\right) \]
      2. pow-lowering-pow.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, \color{blue}{m}\right)\right) \]
    7. Simplified100.0%

      \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 97.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot {k}^{m}\\ \mathbf{if}\;\frac{t\_0}{\left(1 + k \cdot 10\right) + k \cdot k} \leq \infty:\\ \;\;\;\;\frac{t\_0}{1 + k \cdot \left(k + 10\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (* a (pow k m))))
   (if (<= (/ t_0 (+ (+ 1.0 (* k 10.0)) (* k k))) INFINITY)
     (/ t_0 (+ 1.0 (* k (+ k 10.0))))
     (* a (* (* k k) 100.0)))))
double code(double a, double k, double m) {
	double t_0 = a * pow(k, m);
	double tmp;
	if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= ((double) INFINITY)) {
		tmp = t_0 / (1.0 + (k * (k + 10.0)));
	} else {
		tmp = a * ((k * k) * 100.0);
	}
	return tmp;
}
public static double code(double a, double k, double m) {
	double t_0 = a * Math.pow(k, m);
	double tmp;
	if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= Double.POSITIVE_INFINITY) {
		tmp = t_0 / (1.0 + (k * (k + 10.0)));
	} else {
		tmp = a * ((k * k) * 100.0);
	}
	return tmp;
}
def code(a, k, m):
	t_0 = a * math.pow(k, m)
	tmp = 0
	if (t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= math.inf:
		tmp = t_0 / (1.0 + (k * (k + 10.0)))
	else:
		tmp = a * ((k * k) * 100.0)
	return tmp
function code(a, k, m)
	t_0 = Float64(a * (k ^ m))
	tmp = 0.0
	if (Float64(t_0 / Float64(Float64(1.0 + Float64(k * 10.0)) + Float64(k * k))) <= Inf)
		tmp = Float64(t_0 / Float64(1.0 + Float64(k * Float64(k + 10.0))));
	else
		tmp = Float64(a * Float64(Float64(k * k) * 100.0));
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	t_0 = a * (k ^ m);
	tmp = 0.0;
	if ((t_0 / ((1.0 + (k * 10.0)) + (k * k))) <= Inf)
		tmp = t_0 / (1.0 + (k * (k + 10.0)));
	else
		tmp = a * ((k * k) * 100.0);
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(k * k), $MachinePrecision] * 100.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\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 96.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6496.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified96.6%

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

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

    1. Initial program 0.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f640.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified0.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f641.6%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified1.6%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + 10 \cdot k\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{10}\right)\right)\right) \]
      3. *-lowering-*.f641.8%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{10}\right)\right)\right) \]
    10. Simplified1.8%

      \[\leadsto \frac{a}{\color{blue}{1 + k \cdot 10}} \]
    11. Taylor expanded in k around 0

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

        \[\leadsto \mathsf{+.f64}\left(a, \color{blue}{\left(k \cdot \left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{\left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + \color{blue}{\left(\mathsf{neg}\left(10\right)\right) \cdot a}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + -10 \cdot a\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(\left(a \cdot k\right) \cdot 100 + \color{blue}{-10} \cdot a\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + \color{blue}{-10} \cdot a\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + a \cdot \color{blue}{-10}\right)\right)\right) \]
      8. distribute-lft-outN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\left(k \cdot 100\right), \color{blue}{-10}\right)\right)\right)\right) \]
      11. *-lowering-*.f6482.5%

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, 100\right), -10\right)\right)\right)\right) \]
    13. Simplified82.5%

      \[\leadsto \color{blue}{a + k \cdot \left(a \cdot \left(k \cdot 100 + -10\right)\right)} \]
    14. Taylor expanded in k around inf

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

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

        \[\leadsto a \cdot \color{blue}{\left({k}^{2} \cdot 100\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{2} \cdot 100\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left({k}^{2}\right), \color{blue}{100}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left(k \cdot k\right), 100\right)\right) \]
      6. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), 100\right)\right) \]
    16. Simplified100.0%

      \[\leadsto \color{blue}{a \cdot \left(\left(k \cdot k\right) \cdot 100\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.0%

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

Alternative 3: 97.7% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{m}\\


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

    1. Initial program 95.2%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6495.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified95.2%

      \[\leadsto \color{blue}{\frac{a \cdot {k}^{m}}{1 + k \cdot \left(k + 10\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/l*N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({k}^{m}\right), \left(1 + k \cdot \left(k + 10\right)\right)\right), a\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \left(1 + k \cdot \left(k + 10\right)\right)\right), a\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \mathsf{+.f64}\left(1, \left(k \cdot \left(k + 10\right)\right)\right)\right), a\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + 10\right)\right)\right)\right), a\right) \]
      8. +-lowering-+.f6495.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(k, m\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, 10\right)\right)\right)\right), a\right) \]
    6. Applied egg-rr95.2%

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

    if 3.10000000000000009 < m

    1. Initial program 71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6471.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified71.0%

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

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

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{m}\right)}\right) \]
      2. pow-lowering-pow.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, \color{blue}{m}\right)\right) \]
    7. Simplified100.0%

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

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

Alternative 4: 97.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot {k}^{m}\\ \mathbf{if}\;m \leq -1.4 \cdot 10^{-7}:\\ \;\;\;\;\frac{t\_0}{k \cdot k}\\ \mathbf{elif}\;m \leq 0.0029:\\ \;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (* a (pow k m))))
   (if (<= m -1.4e-7)
     (/ t_0 (* k k))
     (if (<= m 0.0029) (/ a (+ 1.0 (* k (+ k 10.0)))) t_0))))
double code(double a, double k, double m) {
	double t_0 = a * pow(k, m);
	double tmp;
	if (m <= -1.4e-7) {
		tmp = t_0 / (k * k);
	} else if (m <= 0.0029) {
		tmp = a / (1.0 + (k * (k + 10.0)));
	} else {
		tmp = t_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 ** m)
    if (m <= (-1.4d-7)) then
        tmp = t_0 / (k * k)
    else if (m <= 0.0029d0) then
        tmp = a / (1.0d0 + (k * (k + 10.0d0)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double t_0 = a * Math.pow(k, m);
	double tmp;
	if (m <= -1.4e-7) {
		tmp = t_0 / (k * k);
	} else if (m <= 0.0029) {
		tmp = a / (1.0 + (k * (k + 10.0)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, k, m):
	t_0 = a * math.pow(k, m)
	tmp = 0
	if m <= -1.4e-7:
		tmp = t_0 / (k * k)
	elif m <= 0.0029:
		tmp = a / (1.0 + (k * (k + 10.0)))
	else:
		tmp = t_0
	return tmp
function code(a, k, m)
	t_0 = Float64(a * (k ^ m))
	tmp = 0.0
	if (m <= -1.4e-7)
		tmp = Float64(t_0 / Float64(k * k));
	elseif (m <= 0.0029)
		tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	t_0 = a * (k ^ m);
	tmp = 0.0;
	if (m <= -1.4e-7)
		tmp = t_0 / (k * k);
	elseif (m <= 0.0029)
		tmp = a / (1.0 + (k * (k + 10.0)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -1.4e-7], N[(t$95$0 / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.0029], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq -1.4 \cdot 10^{-7}:\\
\;\;\;\;\frac{t\_0}{k \cdot k}\\

\mathbf{elif}\;m \leq 0.0029:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\

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


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

    1. Initial program 98.7%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6498.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified98.7%

      \[\leadsto \color{blue}{\frac{a \cdot {k}^{m}}{1 + k \cdot \left(k + 10\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(k \cdot \color{blue}{k}\right)\right) \]
      2. *-lowering-*.f6498.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    7. Simplified98.7%

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

    if -1.4000000000000001e-7 < m < 0.0029

    1. Initial program 92.4%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6492.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified92.4%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6492.3%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified92.3%

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

    if 0.0029 < m

    1. Initial program 71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6471.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified71.0%

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

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

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{m}\right)}\right) \]
      2. pow-lowering-pow.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, \color{blue}{m}\right)\right) \]
    7. Simplified100.0%

      \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 97.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot {k}^{m}\\ \mathbf{if}\;m \leq -0.06:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;m \leq 0.0028:\\ \;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (let* ((t_0 (* a (pow k m))))
   (if (<= m -0.06)
     t_0
     (if (<= m 0.0028) (/ a (+ 1.0 (* k (+ k 10.0)))) t_0))))
double code(double a, double k, double m) {
	double t_0 = a * pow(k, m);
	double tmp;
	if (m <= -0.06) {
		tmp = t_0;
	} else if (m <= 0.0028) {
		tmp = a / (1.0 + (k * (k + 10.0)));
	} else {
		tmp = t_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 ** m)
    if (m <= (-0.06d0)) then
        tmp = t_0
    else if (m <= 0.0028d0) then
        tmp = a / (1.0d0 + (k * (k + 10.0d0)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double t_0 = a * Math.pow(k, m);
	double tmp;
	if (m <= -0.06) {
		tmp = t_0;
	} else if (m <= 0.0028) {
		tmp = a / (1.0 + (k * (k + 10.0)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, k, m):
	t_0 = a * math.pow(k, m)
	tmp = 0
	if m <= -0.06:
		tmp = t_0
	elif m <= 0.0028:
		tmp = a / (1.0 + (k * (k + 10.0)))
	else:
		tmp = t_0
	return tmp
function code(a, k, m)
	t_0 = Float64(a * (k ^ m))
	tmp = 0.0
	if (m <= -0.06)
		tmp = t_0;
	elseif (m <= 0.0028)
		tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	t_0 = a * (k ^ m);
	tmp = 0.0;
	if (m <= -0.06)
		tmp = t_0;
	elseif (m <= 0.0028)
		tmp = a / (1.0 + (k * (k + 10.0)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := Block[{t$95$0 = N[(a * N[Power[k, m], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -0.06], t$95$0, If[LessEqual[m, 0.0028], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;m \leq -0.06:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;m \leq 0.0028:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if m < -0.059999999999999998 or 0.00279999999999999997 < m

    1. Initial program 83.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6483.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified83.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{m}\right)}\right) \]
      2. pow-lowering-pow.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, \color{blue}{m}\right)\right) \]
    7. Simplified100.0%

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

    if -0.059999999999999998 < m < 0.00279999999999999997

    1. Initial program 91.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6491.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified91.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6491.4%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified91.4%

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

Alternative 6: 76.4% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.0021:\\ \;\;\;\;\frac{\frac{a}{k \cdot k} \cdot 99}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.22:\\ \;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= m -0.0021)
   (/ (* (/ a (* k k)) 99.0) (* k k))
   (if (<= m 1.22) (/ a (+ 1.0 (* k (+ k 10.0)))) (* a (* (* k k) 100.0)))))
double code(double a, double k, double m) {
	double tmp;
	if (m <= -0.0021) {
		tmp = ((a / (k * k)) * 99.0) / (k * k);
	} else if (m <= 1.22) {
		tmp = a / (1.0 + (k * (k + 10.0)));
	} else {
		tmp = a * ((k * k) * 100.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.0021d0)) then
        tmp = ((a / (k * k)) * 99.0d0) / (k * k)
    else if (m <= 1.22d0) then
        tmp = a / (1.0d0 + (k * (k + 10.0d0)))
    else
        tmp = a * ((k * k) * 100.0d0)
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (m <= -0.0021) {
		tmp = ((a / (k * k)) * 99.0) / (k * k);
	} else if (m <= 1.22) {
		tmp = a / (1.0 + (k * (k + 10.0)));
	} else {
		tmp = a * ((k * k) * 100.0);
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if m <= -0.0021:
		tmp = ((a / (k * k)) * 99.0) / (k * k)
	elif m <= 1.22:
		tmp = a / (1.0 + (k * (k + 10.0)))
	else:
		tmp = a * ((k * k) * 100.0)
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (m <= -0.0021)
		tmp = Float64(Float64(Float64(a / Float64(k * k)) * 99.0) / Float64(k * k));
	elseif (m <= 1.22)
		tmp = Float64(a / Float64(1.0 + Float64(k * Float64(k + 10.0))));
	else
		tmp = Float64(a * Float64(Float64(k * k) * 100.0));
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (m <= -0.0021)
		tmp = ((a / (k * k)) * 99.0) / (k * k);
	elseif (m <= 1.22)
		tmp = a / (1.0 + (k * (k + 10.0)));
	else
		tmp = a * ((k * k) * 100.0);
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[m, -0.0021], N[(N[(N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision] * 99.0), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.22], N[(a / N[(1.0 + N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(k * k), $MachinePrecision] * 100.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.0021:\\
\;\;\;\;\frac{\frac{a}{k \cdot k} \cdot 99}{k \cdot k}\\

\mathbf{elif}\;m \leq 1.22:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\


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

    1. Initial program 98.7%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6498.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified98.7%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6440.2%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified40.2%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(a + -1 \cdot \frac{a + -100 \cdot a}{{k}^{2}}\right) - 10 \cdot \frac{a}{k}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    10. Simplified66.6%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(99 \cdot \frac{a}{{k}^{2}}\right)}, \mathsf{*.f64}\left(k, k\right)\right) \]
    12. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{a}{{k}^{2}} \cdot 99\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{a}{{k}^{2}}\right), 99\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(a, \left({k}^{2}\right)\right), 99\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(a, \left(k \cdot k\right)\right), 99\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      5. *-lowering-*.f6477.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(a, \mathsf{*.f64}\left(k, k\right)\right), 99\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    13. Simplified77.7%

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

    if -0.00209999999999999987 < m < 1.21999999999999997

    1. Initial program 92.4%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6492.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified92.4%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6492.3%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified92.3%

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

    if 1.21999999999999997 < m

    1. Initial program 71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6471.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified2.5%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + 10 \cdot k\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{10}\right)\right)\right) \]
      3. *-lowering-*.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{10}\right)\right)\right) \]
    10. Simplified2.5%

      \[\leadsto \frac{a}{\color{blue}{1 + k \cdot 10}} \]
    11. Taylor expanded in k around 0

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

        \[\leadsto \mathsf{+.f64}\left(a, \color{blue}{\left(k \cdot \left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{\left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + \color{blue}{\left(\mathsf{neg}\left(10\right)\right) \cdot a}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + -10 \cdot a\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(\left(a \cdot k\right) \cdot 100 + \color{blue}{-10} \cdot a\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + \color{blue}{-10} \cdot a\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + a \cdot \color{blue}{-10}\right)\right)\right) \]
      8. distribute-lft-outN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\left(k \cdot 100\right), \color{blue}{-10}\right)\right)\right)\right) \]
      11. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, 100\right), -10\right)\right)\right)\right) \]
    13. Simplified31.8%

      \[\leadsto \color{blue}{a + k \cdot \left(a \cdot \left(k \cdot 100 + -10\right)\right)} \]
    14. Taylor expanded in k around inf

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

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

        \[\leadsto a \cdot \color{blue}{\left({k}^{2} \cdot 100\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{2} \cdot 100\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left({k}^{2}\right), \color{blue}{100}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left(k \cdot k\right), 100\right)\right) \]
      6. *-lowering-*.f6461.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), 100\right)\right) \]
    16. Simplified61.0%

      \[\leadsto \color{blue}{a \cdot \left(\left(k \cdot k\right) \cdot 100\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 72.7% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.55:\\
\;\;\;\;\frac{a}{k \cdot k}\\

\mathbf{elif}\;m \leq 1.55:\\
\;\;\;\;\frac{a}{1 + k \cdot \left(k + 10\right)}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\


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

    1. Initial program 100.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified100.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6440.6%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified40.6%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left({k}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(a, \left(k \cdot \color{blue}{k}\right)\right) \]
      2. *-lowering-*.f6461.1%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    10. Simplified61.1%

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

    if -0.55000000000000004 < m < 1.55000000000000004

    1. Initial program 91.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6491.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified91.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6491.4%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified91.4%

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

    if 1.55000000000000004 < m

    1. Initial program 71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6471.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified2.5%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + 10 \cdot k\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{10}\right)\right)\right) \]
      3. *-lowering-*.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{10}\right)\right)\right) \]
    10. Simplified2.5%

      \[\leadsto \frac{a}{\color{blue}{1 + k \cdot 10}} \]
    11. Taylor expanded in k around 0

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

        \[\leadsto \mathsf{+.f64}\left(a, \color{blue}{\left(k \cdot \left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{\left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + \color{blue}{\left(\mathsf{neg}\left(10\right)\right) \cdot a}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + -10 \cdot a\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(\left(a \cdot k\right) \cdot 100 + \color{blue}{-10} \cdot a\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + \color{blue}{-10} \cdot a\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + a \cdot \color{blue}{-10}\right)\right)\right) \]
      8. distribute-lft-outN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\left(k \cdot 100\right), \color{blue}{-10}\right)\right)\right)\right) \]
      11. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, 100\right), -10\right)\right)\right)\right) \]
    13. Simplified31.8%

      \[\leadsto \color{blue}{a + k \cdot \left(a \cdot \left(k \cdot 100 + -10\right)\right)} \]
    14. Taylor expanded in k around inf

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

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

        \[\leadsto a \cdot \color{blue}{\left({k}^{2} \cdot 100\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{2} \cdot 100\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left({k}^{2}\right), \color{blue}{100}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left(k \cdot k\right), 100\right)\right) \]
      6. *-lowering-*.f6461.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), 100\right)\right) \]
    16. Simplified61.0%

      \[\leadsto \color{blue}{a \cdot \left(\left(k \cdot k\right) \cdot 100\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 71.8% accurate, 6.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.5:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 0.98:\\ \;\;\;\;\frac{a}{1 + k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= m -0.5)
   (/ a (* k k))
   (if (<= m 0.98) (/ a (+ 1.0 (* k k))) (* a (* (* k k) 100.0)))))
double code(double a, double k, double m) {
	double tmp;
	if (m <= -0.5) {
		tmp = a / (k * k);
	} else if (m <= 0.98) {
		tmp = a / (1.0 + (k * k));
	} else {
		tmp = a * ((k * k) * 100.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.5d0)) then
        tmp = a / (k * k)
    else if (m <= 0.98d0) then
        tmp = a / (1.0d0 + (k * k))
    else
        tmp = a * ((k * k) * 100.0d0)
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (m <= -0.5) {
		tmp = a / (k * k);
	} else if (m <= 0.98) {
		tmp = a / (1.0 + (k * k));
	} else {
		tmp = a * ((k * k) * 100.0);
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if m <= -0.5:
		tmp = a / (k * k)
	elif m <= 0.98:
		tmp = a / (1.0 + (k * k))
	else:
		tmp = a * ((k * k) * 100.0)
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (m <= -0.5)
		tmp = Float64(a / Float64(k * k));
	elseif (m <= 0.98)
		tmp = Float64(a / Float64(1.0 + Float64(k * k)));
	else
		tmp = Float64(a * Float64(Float64(k * k) * 100.0));
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (m <= -0.5)
		tmp = a / (k * k);
	elseif (m <= 0.98)
		tmp = a / (1.0 + (k * k));
	else
		tmp = a * ((k * k) * 100.0);
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[m, -0.5], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.98], N[(a / N[(1.0 + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(k * k), $MachinePrecision] * 100.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;m \leq -0.5:\\
\;\;\;\;\frac{a}{k \cdot k}\\

\mathbf{elif}\;m \leq 0.98:\\
\;\;\;\;\frac{a}{1 + k \cdot k}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\


\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. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified100.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6440.6%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified40.6%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left({k}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(a, \left(k \cdot \color{blue}{k}\right)\right) \]
      2. *-lowering-*.f6461.1%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    10. Simplified61.1%

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

    if -0.5 < m < 0.97999999999999998

    1. Initial program 91.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6491.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified91.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6491.4%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified91.4%

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

      \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left({k}^{2}\right)}\right)\right) \]
    9. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{k}\right)\right)\right) \]
      2. *-lowering-*.f6489.2%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right)\right) \]
    10. Simplified89.2%

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

    if 0.97999999999999998 < m

    1. Initial program 71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6471.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified2.5%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + 10 \cdot k\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{10}\right)\right)\right) \]
      3. *-lowering-*.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{10}\right)\right)\right) \]
    10. Simplified2.5%

      \[\leadsto \frac{a}{\color{blue}{1 + k \cdot 10}} \]
    11. Taylor expanded in k around 0

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

        \[\leadsto \mathsf{+.f64}\left(a, \color{blue}{\left(k \cdot \left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{\left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + \color{blue}{\left(\mathsf{neg}\left(10\right)\right) \cdot a}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + -10 \cdot a\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(\left(a \cdot k\right) \cdot 100 + \color{blue}{-10} \cdot a\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + \color{blue}{-10} \cdot a\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + a \cdot \color{blue}{-10}\right)\right)\right) \]
      8. distribute-lft-outN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\left(k \cdot 100\right), \color{blue}{-10}\right)\right)\right)\right) \]
      11. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, 100\right), -10\right)\right)\right)\right) \]
    13. Simplified31.8%

      \[\leadsto \color{blue}{a + k \cdot \left(a \cdot \left(k \cdot 100 + -10\right)\right)} \]
    14. Taylor expanded in k around inf

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

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

        \[\leadsto a \cdot \color{blue}{\left({k}^{2} \cdot 100\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{2} \cdot 100\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left({k}^{2}\right), \color{blue}{100}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left(k \cdot k\right), 100\right)\right) \]
      6. *-lowering-*.f6461.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), 100\right)\right) \]
    16. Simplified61.0%

      \[\leadsto \color{blue}{a \cdot \left(\left(k \cdot k\right) \cdot 100\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 9: 61.4% accurate, 6.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -3.1 \cdot 10^{-100}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.56:\\ \;\;\;\;\frac{a}{1 + k \cdot 10}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= m -3.1e-100)
   (/ a (* k k))
   (if (<= m 1.56) (/ a (+ 1.0 (* k 10.0))) (* a (* (* k k) 100.0)))))
double code(double a, double k, double m) {
	double tmp;
	if (m <= -3.1e-100) {
		tmp = a / (k * k);
	} else if (m <= 1.56) {
		tmp = a / (1.0 + (k * 10.0));
	} else {
		tmp = a * ((k * k) * 100.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 <= (-3.1d-100)) then
        tmp = a / (k * k)
    else if (m <= 1.56d0) then
        tmp = a / (1.0d0 + (k * 10.0d0))
    else
        tmp = a * ((k * k) * 100.0d0)
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (m <= -3.1e-100) {
		tmp = a / (k * k);
	} else if (m <= 1.56) {
		tmp = a / (1.0 + (k * 10.0));
	} else {
		tmp = a * ((k * k) * 100.0);
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if m <= -3.1e-100:
		tmp = a / (k * k)
	elif m <= 1.56:
		tmp = a / (1.0 + (k * 10.0))
	else:
		tmp = a * ((k * k) * 100.0)
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (m <= -3.1e-100)
		tmp = Float64(a / Float64(k * k));
	elseif (m <= 1.56)
		tmp = Float64(a / Float64(1.0 + Float64(k * 10.0)));
	else
		tmp = Float64(a * Float64(Float64(k * k) * 100.0));
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (m <= -3.1e-100)
		tmp = a / (k * k);
	elseif (m <= 1.56)
		tmp = a / (1.0 + (k * 10.0));
	else
		tmp = a * ((k * k) * 100.0);
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[m, -3.1e-100], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.56], N[(a / N[(1.0 + N[(k * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(k * k), $MachinePrecision] * 100.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.1 \cdot 10^{-100}:\\
\;\;\;\;\frac{a}{k \cdot k}\\

\mathbf{elif}\;m \leq 1.56:\\
\;\;\;\;\frac{a}{1 + k \cdot 10}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\


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

    1. Initial program 97.9%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6497.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified97.9%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6450.4%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified50.4%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left({k}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(a, \left(k \cdot \color{blue}{k}\right)\right) \]
      2. *-lowering-*.f6460.3%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    10. Simplified60.3%

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

    if -3.0999999999999999e-100 < m < 1.5600000000000001

    1. Initial program 92.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6492.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified92.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6492.0%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified92.0%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + 10 \cdot k\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{10}\right)\right)\right) \]
      3. *-lowering-*.f6467.3%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{10}\right)\right)\right) \]
    10. Simplified67.3%

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

    if 1.5600000000000001 < m

    1. Initial program 71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6471.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified2.5%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + 10 \cdot k\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{10}\right)\right)\right) \]
      3. *-lowering-*.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{10}\right)\right)\right) \]
    10. Simplified2.5%

      \[\leadsto \frac{a}{\color{blue}{1 + k \cdot 10}} \]
    11. Taylor expanded in k around 0

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

        \[\leadsto \mathsf{+.f64}\left(a, \color{blue}{\left(k \cdot \left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{\left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + \color{blue}{\left(\mathsf{neg}\left(10\right)\right) \cdot a}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + -10 \cdot a\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(\left(a \cdot k\right) \cdot 100 + \color{blue}{-10} \cdot a\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + \color{blue}{-10} \cdot a\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + a \cdot \color{blue}{-10}\right)\right)\right) \]
      8. distribute-lft-outN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\left(k \cdot 100\right), \color{blue}{-10}\right)\right)\right)\right) \]
      11. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, 100\right), -10\right)\right)\right)\right) \]
    13. Simplified31.8%

      \[\leadsto \color{blue}{a + k \cdot \left(a \cdot \left(k \cdot 100 + -10\right)\right)} \]
    14. Taylor expanded in k around inf

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

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

        \[\leadsto a \cdot \color{blue}{\left({k}^{2} \cdot 100\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{2} \cdot 100\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left({k}^{2}\right), \color{blue}{100}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left(k \cdot k\right), 100\right)\right) \]
      6. *-lowering-*.f6461.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), 100\right)\right) \]
    16. Simplified61.0%

      \[\leadsto \color{blue}{a \cdot \left(\left(k \cdot k\right) \cdot 100\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 57.9% accurate, 6.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -2 \cdot 10^{+61}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;m \leq 0.74:\\ \;\;\;\;\frac{\frac{a}{k}}{k}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= m -2e+61)
   (/ a (* k k))
   (if (<= m 0.74) (/ (/ a k) k) (* a (* (* k k) 100.0)))))
double code(double a, double k, double m) {
	double tmp;
	if (m <= -2e+61) {
		tmp = a / (k * k);
	} else if (m <= 0.74) {
		tmp = (a / k) / k;
	} else {
		tmp = a * ((k * k) * 100.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 <= (-2d+61)) then
        tmp = a / (k * k)
    else if (m <= 0.74d0) then
        tmp = (a / k) / k
    else
        tmp = a * ((k * k) * 100.0d0)
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (m <= -2e+61) {
		tmp = a / (k * k);
	} else if (m <= 0.74) {
		tmp = (a / k) / k;
	} else {
		tmp = a * ((k * k) * 100.0);
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if m <= -2e+61:
		tmp = a / (k * k)
	elif m <= 0.74:
		tmp = (a / k) / k
	else:
		tmp = a * ((k * k) * 100.0)
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (m <= -2e+61)
		tmp = Float64(a / Float64(k * k));
	elseif (m <= 0.74)
		tmp = Float64(Float64(a / k) / k);
	else
		tmp = Float64(a * Float64(Float64(k * k) * 100.0));
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (m <= -2e+61)
		tmp = a / (k * k);
	elseif (m <= 0.74)
		tmp = (a / k) / k;
	else
		tmp = a * ((k * k) * 100.0);
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[m, -2e+61], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 0.74], N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision], N[(a * N[(N[(k * k), $MachinePrecision] * 100.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;m \leq -2 \cdot 10^{+61}:\\
\;\;\;\;\frac{a}{k \cdot k}\\

\mathbf{elif}\;m \leq 0.74:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(k \cdot k\right) \cdot 100\right)\\


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

    1. Initial program 100.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified100.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6441.8%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified41.8%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left({k}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(a, \left(k \cdot \color{blue}{k}\right)\right) \]
      2. *-lowering-*.f6460.9%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    10. Simplified60.9%

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

    if -1.9999999999999999e61 < m < 0.73999999999999999

    1. Initial program 92.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6492.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified92.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6485.7%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified85.7%

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

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

        \[\leadsto \frac{a + -10 \cdot \frac{a}{k}}{k \cdot \color{blue}{k}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{\frac{a + -10 \cdot \frac{a}{k}}{k}}{\color{blue}{k}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{a + -10 \cdot \frac{a}{k}}{k}\right), \color{blue}{k}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(a + -10 \cdot \frac{a}{k}\right), k\right), k\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \left(-10 \cdot \frac{a}{k}\right)\right), k\right), k\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \left(\frac{-10 \cdot a}{k}\right)\right), k\right), k\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \mathsf{/.f64}\left(\left(-10 \cdot a\right), k\right)\right), k\right), k\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \mathsf{/.f64}\left(\left(a \cdot -10\right), k\right)\right), k\right), k\right) \]
      9. *-lowering-*.f6454.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, -10\right), k\right)\right), k\right), k\right) \]
    10. Simplified54.3%

      \[\leadsto \color{blue}{\frac{\frac{a + \frac{a \cdot -10}{k}}{k}}{k}} \]
    11. Taylor expanded in k around inf

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{a}{k}\right)}, k\right) \]
    12. Step-by-step derivation
      1. /-lowering-/.f6456.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(a, k\right), k\right) \]
    13. Simplified56.1%

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

    if 0.73999999999999999 < m

    1. Initial program 71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6471.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified71.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified2.5%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + 10 \cdot k\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{10}\right)\right)\right) \]
      3. *-lowering-*.f642.5%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{10}\right)\right)\right) \]
    10. Simplified2.5%

      \[\leadsto \frac{a}{\color{blue}{1 + k \cdot 10}} \]
    11. Taylor expanded in k around 0

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

        \[\leadsto \mathsf{+.f64}\left(a, \color{blue}{\left(k \cdot \left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{\left(100 \cdot \left(a \cdot k\right) - 10 \cdot a\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + \color{blue}{\left(\mathsf{neg}\left(10\right)\right) \cdot a}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(100 \cdot \left(a \cdot k\right) + -10 \cdot a\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(\left(a \cdot k\right) \cdot 100 + \color{blue}{-10} \cdot a\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + \color{blue}{-10} \cdot a\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \left(k \cdot 100\right) + a \cdot \color{blue}{-10}\right)\right)\right) \]
      8. distribute-lft-outN/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(a \cdot \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \color{blue}{\left(k \cdot 100 + -10\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\left(k \cdot 100\right), \color{blue}{-10}\right)\right)\right)\right) \]
      11. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, 100\right), -10\right)\right)\right)\right) \]
    13. Simplified31.8%

      \[\leadsto \color{blue}{a + k \cdot \left(a \cdot \left(k \cdot 100 + -10\right)\right)} \]
    14. Taylor expanded in k around inf

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

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

        \[\leadsto a \cdot \color{blue}{\left({k}^{2} \cdot 100\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left({k}^{2} \cdot 100\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left({k}^{2}\right), \color{blue}{100}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left(k \cdot k\right), 100\right)\right) \]
      6. *-lowering-*.f6461.0%

        \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), 100\right)\right) \]
    16. Simplified61.0%

      \[\leadsto \color{blue}{a \cdot \left(\left(k \cdot k\right) \cdot 100\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 11: 46.0% accurate, 7.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq -4.5 \cdot 10^{-299}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;k \leq 1.06 \cdot 10^{-46}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{a}{k}}{k}\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= k -4.5e-299) (/ a (* k k)) (if (<= k 1.06e-46) a (/ (/ a k) k))))
double code(double a, double k, double m) {
	double tmp;
	if (k <= -4.5e-299) {
		tmp = a / (k * k);
	} else if (k <= 1.06e-46) {
		tmp = a;
	} else {
		tmp = (a / k) / k;
	}
	return tmp;
}
real(8) function code(a, k, m)
    real(8), intent (in) :: a
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8) :: tmp
    if (k <= (-4.5d-299)) then
        tmp = a / (k * k)
    else if (k <= 1.06d-46) then
        tmp = a
    else
        tmp = (a / k) / k
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (k <= -4.5e-299) {
		tmp = a / (k * k);
	} else if (k <= 1.06e-46) {
		tmp = a;
	} else {
		tmp = (a / k) / k;
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if k <= -4.5e-299:
		tmp = a / (k * k)
	elif k <= 1.06e-46:
		tmp = a
	else:
		tmp = (a / k) / k
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (k <= -4.5e-299)
		tmp = Float64(a / Float64(k * k));
	elseif (k <= 1.06e-46)
		tmp = a;
	else
		tmp = Float64(Float64(a / k) / k);
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (k <= -4.5e-299)
		tmp = a / (k * k);
	elseif (k <= 1.06e-46)
		tmp = a;
	else
		tmp = (a / k) / k;
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[k, -4.5e-299], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.06e-46], a, N[(N[(a / k), $MachinePrecision] / k), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq -4.5 \cdot 10^{-299}:\\
\;\;\;\;\frac{a}{k \cdot k}\\

\mathbf{elif}\;k \leq 1.06 \cdot 10^{-46}:\\
\;\;\;\;a\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < -4.50000000000000003e-299

    1. Initial program 86.2%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f6486.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified86.2%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6424.8%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified24.8%

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

      \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left({k}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(a, \left(k \cdot \color{blue}{k}\right)\right) \]
      2. *-lowering-*.f6436.0%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
    10. Simplified36.0%

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

    if -4.50000000000000003e-299 < k < 1.06e-46

    1. Initial program 100.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
      4. associate-+l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      9. +-lowering-+.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    3. Simplified100.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
      5. +-lowering-+.f6453.0%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    7. Simplified53.0%

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

      \[\leadsto \color{blue}{a} \]
    9. Step-by-step derivation
      1. Simplified53.0%

        \[\leadsto \color{blue}{a} \]

      if 1.06e-46 < k

      1. Initial program 78.0%

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
        3. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
        4. associate-+l+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
        8. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
        9. +-lowering-+.f6478.0%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
      3. Simplified78.0%

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

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

          \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
        4. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
        5. +-lowering-+.f6449.7%

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
      7. Simplified49.7%

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

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

          \[\leadsto \frac{a + -10 \cdot \frac{a}{k}}{k \cdot \color{blue}{k}} \]
        2. associate-/r*N/A

          \[\leadsto \frac{\frac{a + -10 \cdot \frac{a}{k}}{k}}{\color{blue}{k}} \]
        3. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{a + -10 \cdot \frac{a}{k}}{k}\right), \color{blue}{k}\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(a + -10 \cdot \frac{a}{k}\right), k\right), k\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \left(-10 \cdot \frac{a}{k}\right)\right), k\right), k\right) \]
        6. associate-*r/N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \left(\frac{-10 \cdot a}{k}\right)\right), k\right), k\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \mathsf{/.f64}\left(\left(-10 \cdot a\right), k\right)\right), k\right), k\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \mathsf{/.f64}\left(\left(a \cdot -10\right), k\right)\right), k\right), k\right) \]
        9. *-lowering-*.f6450.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(a, \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, -10\right), k\right)\right), k\right), k\right) \]
      10. Simplified50.5%

        \[\leadsto \color{blue}{\frac{\frac{a + \frac{a \cdot -10}{k}}{k}}{k}} \]
      11. Taylor expanded in k around inf

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{a}{k}\right)}, k\right) \]
      12. Step-by-step derivation
        1. /-lowering-/.f6452.0%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(a, k\right), k\right) \]
      13. Simplified52.0%

        \[\leadsto \frac{\color{blue}{\frac{a}{k}}}{k} \]
    10. Recombined 3 regimes into one program.
    11. Add Preprocessing

    Alternative 12: 44.9% accurate, 7.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a}{k \cdot k}\\ \mathbf{if}\;k \leq -4.5 \cdot 10^{-299}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;k \leq 1.1 \cdot 10^{-46}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (a k m)
     :precision binary64
     (let* ((t_0 (/ a (* k k))))
       (if (<= k -4.5e-299) t_0 (if (<= k 1.1e-46) a t_0))))
    double code(double a, double k, double m) {
    	double t_0 = a / (k * k);
    	double tmp;
    	if (k <= -4.5e-299) {
    		tmp = t_0;
    	} else if (k <= 1.1e-46) {
    		tmp = a;
    	} else {
    		tmp = t_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 (k <= (-4.5d-299)) then
            tmp = t_0
        else if (k <= 1.1d-46) then
            tmp = a
        else
            tmp = t_0
        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 (k <= -4.5e-299) {
    		tmp = t_0;
    	} else if (k <= 1.1e-46) {
    		tmp = a;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(a, k, m):
    	t_0 = a / (k * k)
    	tmp = 0
    	if k <= -4.5e-299:
    		tmp = t_0
    	elif k <= 1.1e-46:
    		tmp = a
    	else:
    		tmp = t_0
    	return tmp
    
    function code(a, k, m)
    	t_0 = Float64(a / Float64(k * k))
    	tmp = 0.0
    	if (k <= -4.5e-299)
    		tmp = t_0;
    	elseif (k <= 1.1e-46)
    		tmp = a;
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, k, m)
    	t_0 = a / (k * k);
    	tmp = 0.0;
    	if (k <= -4.5e-299)
    		tmp = t_0;
    	elseif (k <= 1.1e-46)
    		tmp = a;
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -4.5e-299], t$95$0, If[LessEqual[k, 1.1e-46], a, t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{a}{k \cdot k}\\
    \mathbf{if}\;k \leq -4.5 \cdot 10^{-299}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;k \leq 1.1 \cdot 10^{-46}:\\
    \;\;\;\;a\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < -4.50000000000000003e-299 or 1.1e-46 < k

      1. Initial program 80.7%

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
        3. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
        4. associate-+l+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
        8. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
        9. +-lowering-+.f6480.7%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
      3. Simplified80.7%

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

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

          \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
        4. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
        5. +-lowering-+.f6441.7%

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
      7. Simplified41.7%

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

        \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left({k}^{2}\right)}\right) \]
      9. Step-by-step derivation
        1. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(a, \left(k \cdot \color{blue}{k}\right)\right) \]
        2. *-lowering-*.f6444.4%

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right) \]
      10. Simplified44.4%

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

      if -4.50000000000000003e-299 < k < 1.1e-46

      1. Initial program 100.0%

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
        3. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
        4. associate-+l+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
        6. distribute-rgt-outN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
        8. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
        9. +-lowering-+.f64100.0%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
      3. Simplified100.0%

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

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

          \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
        4. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
        5. +-lowering-+.f6453.0%

          \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
      7. Simplified53.0%

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

        \[\leadsto \color{blue}{a} \]
      9. Step-by-step derivation
        1. Simplified53.0%

          \[\leadsto \color{blue}{a} \]
      10. Recombined 2 regimes into one program.
      11. Add Preprocessing

      Alternative 13: 24.6% accurate, 11.4× speedup?

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

        1. Initial program 94.0%

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
          3. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
          4. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
          6. distribute-rgt-outN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
          8. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
          9. +-lowering-+.f6494.0%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
        3. Simplified94.0%

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

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

            \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
          4. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
          5. +-lowering-+.f6440.8%

            \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
        7. Simplified40.8%

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

          \[\leadsto \color{blue}{a} \]
        9. Step-by-step derivation
          1. Simplified31.6%

            \[\leadsto \color{blue}{a} \]

          if 1.1e-46 < k

          1. Initial program 78.0%

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
            3. pow-lowering-pow.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
            4. associate-+l+N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
            5. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
            6. distribute-rgt-outN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
            7. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
            8. +-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
            9. +-lowering-+.f6478.0%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
          3. Simplified78.0%

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

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

              \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
            2. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
            3. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
            4. +-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
            5. +-lowering-+.f6449.7%

              \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
          7. Simplified49.7%

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

            \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + 10 \cdot k\right)}\right) \]
          9. Step-by-step derivation
            1. +-lowering-+.f64N/A

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

              \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{10}\right)\right)\right) \]
            3. *-lowering-*.f6422.8%

              \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{10}\right)\right)\right) \]
          10. Simplified22.8%

            \[\leadsto \frac{a}{\color{blue}{1 + k \cdot 10}} \]
          11. Taylor expanded in k around inf

            \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(10 \cdot k\right)}\right) \]
          12. Step-by-step derivation
            1. *-lowering-*.f6422.8%

              \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(10, \color{blue}{k}\right)\right) \]
          13. Simplified22.8%

            \[\leadsto \frac{a}{\color{blue}{10 \cdot k}} \]
        10. Recombined 2 regimes into one program.
        11. Final simplification27.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.1 \cdot 10^{-46}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{k \cdot 10}\\ \end{array} \]
        12. Add Preprocessing

        Alternative 14: 19.7% accurate, 114.0× speedup?

        \[\begin{array}{l} \\ a \end{array} \]
        (FPCore (a k m) :precision binary64 a)
        double code(double a, double k, double m) {
        	return a;
        }
        
        real(8) function code(a, k, m)
            real(8), intent (in) :: a
            real(8), intent (in) :: k
            real(8), intent (in) :: m
            code = a
        end function
        
        public static double code(double a, double k, double m) {
        	return a;
        }
        
        def code(a, k, m):
        	return a
        
        function code(a, k, m)
        	return a
        end
        
        function tmp = code(a, k, m)
        	tmp = a;
        end
        
        code[a_, k_, m_] := a
        
        \begin{array}{l}
        
        \\
        a
        \end{array}
        
        Derivation
        1. Initial program 86.4%

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), \left(\color{blue}{\left(1 + 10 \cdot k\right)} + k \cdot k\right)\right) \]
          3. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(\left(1 + \color{blue}{10 \cdot k}\right) + k \cdot k\right)\right) \]
          4. associate-+l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \left(1 + \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k + k \cdot k\right)}\right)\right) \]
          6. distribute-rgt-outN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
          8. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
          9. +-lowering-+.f6486.4%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
        3. Simplified86.4%

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

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

            \[\leadsto \mathsf{/.f64}\left(a, \color{blue}{\left(1 + k \cdot \left(10 + k\right)\right)}\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(k \cdot \left(10 + k\right)\right)}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{\left(10 + k\right)}\right)\right)\right) \]
          4. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \left(k + \color{blue}{10}\right)\right)\right)\right) \]
          5. +-lowering-+.f6445.0%

            \[\leadsto \mathsf{/.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
        7. Simplified45.0%

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

          \[\leadsto \color{blue}{a} \]
        9. Step-by-step derivation
          1. Simplified18.8%

            \[\leadsto \color{blue}{a} \]
          2. Add Preprocessing

          Reproduce

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