Falkner and Boettcher, Appendix A

Percentage Accurate: 89.7% → 97.5%
Time: 13.9s
Alternatives: 19
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 19 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.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-+.f6499.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. Simplified99.4%

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

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

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

    if 2.1e-7 < m

    1. Initial program 85.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-+.f6485.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. Simplified85.3%

      \[\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-*.f6459.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. Simplified59.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{a \cdot \frac{{k}^{m}}{k}}{k}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

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

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

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

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

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

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

Alternative 2: 99.3% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 0.10000000000000001

    1. Initial program 98.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-+.f6498.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. Simplified98.2%

      \[\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}{-10 \cdot \left(a \cdot \left(k \cdot {k}^{m}\right)\right) + a \cdot {k}^{m}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.10000000000000001 < k

    1. Initial program 88.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-+.f6488.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. Simplified88.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{/.f64}\left(\left({k}^{m}\right), k\right)\right), k\right) \]
      6. pow-lowering-pow.f6498.0%

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

      \[\leadsto \color{blue}{\frac{a \cdot \frac{{k}^{m}}{k}}{k}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), k\right), k\right) \]
      4. pow-lowering-pow.f6498.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), k\right), k\right) \]
    11. Applied egg-rr98.1%

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

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

Alternative 3: 99.0% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if m < -5.8000000000000003e-8 or 1.8500000000000001e-11 < m

    1. Initial program 93.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-+.f6493.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. Simplified93.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.f6498.9%

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

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

    if -5.8000000000000003e-8 < m < 1.8500000000000001e-11

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

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

      \[\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-+.f6498.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. Simplified98.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, 10\right)\right)\right), a\right)\right) \]
    9. Applied egg-rr98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.1% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 0.104999999999999996

    1. Initial program 98.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-+.f6498.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. Simplified98.2%

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

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

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

    if 0.104999999999999996 < k

    1. Initial program 88.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-+.f6488.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. Simplified88.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{/.f64}\left(\left({k}^{m}\right), k\right)\right), k\right) \]
      6. pow-lowering-pow.f6498.0%

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

      \[\leadsto \color{blue}{\frac{a \cdot \frac{{k}^{m}}{k}}{k}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \left({k}^{m}\right)\right), k\right), k\right) \]
      4. pow-lowering-pow.f6498.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{pow.f64}\left(k, m\right)\right), k\right), k\right) \]
    11. Applied egg-rr98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 0.105:\\ \;\;\;\;{k}^{m} \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{k}^{m} \cdot a}{k}}{k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.105:\\
\;\;\;\;{k}^{m} \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 0.104999999999999996

    1. Initial program 98.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-+.f6498.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. Simplified98.2%

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

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

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

    if 0.104999999999999996 < k

    1. Initial program 88.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-+.f6488.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. Simplified88.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(a, \mathsf{/.f64}\left(\left({k}^{m}\right), k\right)\right), k\right) \]
      6. pow-lowering-pow.f6498.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 0.105:\\ \;\;\;\;{k}^{m} \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \frac{{k}^{m}}{k}}{k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 97.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.105:\\
\;\;\;\;{k}^{m} \cdot a\\

\mathbf{else}:\\
\;\;\;\;a \cdot {k}^{\left(m - 2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 0.104999999999999996

    1. Initial program 98.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-+.f6498.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. Simplified98.2%

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

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

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

    if 0.104999999999999996 < k

    1. Initial program 88.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-+.f6488.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. Simplified88.6%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{k}^{m}}{k \cdot k}\right), \color{blue}{a}\right) \]
      4. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{k}^{m}}{{k}^{2}}\right), a\right) \]
      5. pow-divN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(k, \left(m - 2\right)\right), a\right) \]
      7. --lowering--.f6496.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(k, \mathsf{\_.f64}\left(m, 2\right)\right), a\right) \]
    9. Applied egg-rr96.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 0.105:\\ \;\;\;\;{k}^{m} \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot {k}^{\left(m - 2\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.9% accurate, 3.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{\frac{\frac{100 + \frac{-1000}{k}}{k} - 10}{k} + 1}{k \cdot k} \cdot \left(k \cdot 10 + 1\right)}\\


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

    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-+.f6426.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. Simplified26.6%

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

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

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

      \[\leadsto \color{blue}{\frac{a - \frac{a \cdot 10 + \frac{-99 \cdot a}{k}}{k}}{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. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{{k}^{2}}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. distribute-lft-neg-inN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\mathsf{neg}\left(-99 \cdot a\right)}{k}}{k}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}}{k}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{99 \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      12. distribute-lft-neg-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(-99 \cdot a\right)\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      14. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(-99\right)\right) \cdot a\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      15. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(a \cdot 99\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      17. *-lowering-*.f6476.1%

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

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

    if -0.20000000000000001 < m < 0.80000000000000004

    1. Initial program 98.8%

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

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

      \[\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-+.f6495.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. Simplified95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.80000000000000004 < m

    1. Initial program 85.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-+.f6485.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. Simplified85.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-+.f643.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. Simplified3.5%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(\left(\frac{1 - \left(k + 10\right) \cdot \left(k \cdot \left(k \cdot \left(k + 10\right)\right)\right)}{{1}^{3} - {\left(k \cdot \left(k + 10\right)\right)}^{3}}\right), \color{blue}{\left(1 \cdot 1 + \left(\left(k \cdot \left(k + 10\right)\right) \cdot \left(k \cdot \left(k + 10\right)\right) + 1 \cdot \left(k \cdot \left(k + 10\right)\right)\right)\right)}\right)\right) \]
    9. Applied egg-rr10.3%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(10, \mathsf{/.f64}\left(\mathsf{+.f64}\left(100, \mathsf{/.f64}\left(-1000, k\right)\right), k\right)\right), k\right)\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(10 \cdot k\right)}\right)\right)\right) \]
    14. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(10, \mathsf{/.f64}\left(\mathsf{+.f64}\left(100, \mathsf{/.f64}\left(-1000, k\right)\right), k\right)\right), k\right)\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{+.f64}\left(1, \left(k \cdot \color{blue}{10}\right)\right)\right)\right) \]
      2. *-lowering-*.f6459.9%

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(10, \mathsf{/.f64}\left(\mathsf{+.f64}\left(100, \mathsf{/.f64}\left(-1000, k\right)\right), k\right)\right), k\right)\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \color{blue}{10}\right)\right)\right)\right) \]
    15. Simplified59.9%

      \[\leadsto \frac{a}{\frac{1 - \frac{10 - \frac{100 + \frac{-1000}{k}}{k}}{k}}{k \cdot k} \cdot \left(1 + \color{blue}{k \cdot 10}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.9%

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

Alternative 8: 67.4% accurate, 3.5× speedup?

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

\\
\begin{array}{l}
t_0 := k \cdot \left(k + 10\right)\\
\mathbf{if}\;m \leq -0.17:\\
\;\;\;\;\frac{\frac{\frac{a \cdot 99}{k}}{k}}{k \cdot k}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{1}{k \cdot k} \cdot \left(t\_0 \cdot \left(t\_0 + 1\right) + 1\right)}\\


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

    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-+.f6426.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. Simplified26.6%

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

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

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

      \[\leadsto \color{blue}{\frac{a - \frac{a \cdot 10 + \frac{-99 \cdot a}{k}}{k}}{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. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{{k}^{2}}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. distribute-lft-neg-inN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\mathsf{neg}\left(-99 \cdot a\right)}{k}}{k}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}}{k}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{99 \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      12. distribute-lft-neg-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(-99 \cdot a\right)\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      14. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(-99\right)\right) \cdot a\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      15. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(a \cdot 99\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      17. *-lowering-*.f6476.1%

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

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

    if -0.170000000000000012 < m < 2.4500000000000001e32

    1. Initial program 95.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-+.f6495.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. Simplified95.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-+.f6487.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. Simplified87.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, 10\right)\right)\right), a\right)\right) \]
    9. Applied egg-rr87.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4500000000000001e32 < m

    1. Initial program 87.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-+.f6487.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. Simplified87.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-+.f643.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. Simplified3.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(a, \mathsf{*.f64}\left(\left(\frac{1 - \left(k + 10\right) \cdot \left(k \cdot \left(k \cdot \left(k + 10\right)\right)\right)}{{1}^{3} - {\left(k \cdot \left(k + 10\right)\right)}^{3}}\right), \color{blue}{\left(1 \cdot 1 + \left(\left(k \cdot \left(k + 10\right)\right) \cdot \left(k \cdot \left(k + 10\right)\right) + 1 \cdot \left(k \cdot \left(k + 10\right)\right)\right)\right)}\right)\right) \]
    9. Applied egg-rr11.3%

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

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

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

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

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

      \[\leadsto \frac{a}{\color{blue}{\frac{1}{k \cdot k}} \cdot \left(1 + \left(k \cdot \left(k + 10\right)\right) \cdot \left(1 + k \cdot \left(k + 10\right)\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.7%

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

Alternative 9: 66.4% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.64:\\ \;\;\;\;\frac{\frac{\frac{a \cdot 99}{k}}{k}}{k \cdot k}\\ \mathbf{elif}\;m \leq 23.5:\\ \;\;\;\;\frac{-1}{\frac{-1}{a} - k \cdot \left(\frac{k}{a} + \frac{10}{a}\right)}\\ \mathbf{else}:\\ \;\;\;\;a + k \cdot \left(k \cdot \left(a \cdot 99\right) + a \cdot -10\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= m -0.64)
   (/ (/ (/ (* a 99.0) k) k) (* k k))
   (if (<= m 23.5)
     (/ -1.0 (- (/ -1.0 a) (* k (+ (/ k a) (/ 10.0 a)))))
     (+ a (* k (+ (* k (* a 99.0)) (* a -10.0)))))))
double code(double a, double k, double m) {
	double tmp;
	if (m <= -0.64) {
		tmp = (((a * 99.0) / k) / k) / (k * k);
	} else if (m <= 23.5) {
		tmp = -1.0 / ((-1.0 / a) - (k * ((k / a) + (10.0 / a))));
	} else {
		tmp = a + (k * ((k * (a * 99.0)) + (a * -10.0)));
	}
	return tmp;
}
real(8) function code(a, k, m)
    real(8), intent (in) :: a
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8) :: tmp
    if (m <= (-0.64d0)) then
        tmp = (((a * 99.0d0) / k) / k) / (k * k)
    else if (m <= 23.5d0) then
        tmp = (-1.0d0) / (((-1.0d0) / a) - (k * ((k / a) + (10.0d0 / a))))
    else
        tmp = a + (k * ((k * (a * 99.0d0)) + (a * (-10.0d0))))
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (m <= -0.64) {
		tmp = (((a * 99.0) / k) / k) / (k * k);
	} else if (m <= 23.5) {
		tmp = -1.0 / ((-1.0 / a) - (k * ((k / a) + (10.0 / a))));
	} else {
		tmp = a + (k * ((k * (a * 99.0)) + (a * -10.0)));
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if m <= -0.64:
		tmp = (((a * 99.0) / k) / k) / (k * k)
	elif m <= 23.5:
		tmp = -1.0 / ((-1.0 / a) - (k * ((k / a) + (10.0 / a))))
	else:
		tmp = a + (k * ((k * (a * 99.0)) + (a * -10.0)))
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (m <= -0.64)
		tmp = Float64(Float64(Float64(Float64(a * 99.0) / k) / k) / Float64(k * k));
	elseif (m <= 23.5)
		tmp = Float64(-1.0 / Float64(Float64(-1.0 / a) - Float64(k * Float64(Float64(k / a) + Float64(10.0 / a)))));
	else
		tmp = Float64(a + Float64(k * Float64(Float64(k * Float64(a * 99.0)) + Float64(a * -10.0))));
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (m <= -0.64)
		tmp = (((a * 99.0) / k) / k) / (k * k);
	elseif (m <= 23.5)
		tmp = -1.0 / ((-1.0 / a) - (k * ((k / a) + (10.0 / a))));
	else
		tmp = a + (k * ((k * (a * 99.0)) + (a * -10.0)));
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[m, -0.64], N[(N[(N[(N[(a * 99.0), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 23.5], N[(-1.0 / N[(N[(-1.0 / a), $MachinePrecision] - N[(k * N[(N[(k / a), $MachinePrecision] + N[(10.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(N[(k * N[(a * 99.0), $MachinePrecision]), $MachinePrecision] + N[(a * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    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-+.f6426.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. Simplified26.6%

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

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

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

      \[\leadsto \color{blue}{\frac{a - \frac{a \cdot 10 + \frac{-99 \cdot a}{k}}{k}}{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. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{{k}^{2}}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. distribute-lft-neg-inN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\mathsf{neg}\left(-99 \cdot a\right)}{k}}{k}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}}{k}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{99 \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      12. distribute-lft-neg-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(-99 \cdot a\right)\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      14. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(-99\right)\right) \cdot a\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      15. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(a \cdot 99\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      17. *-lowering-*.f6476.1%

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

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

    if -0.640000000000000013 < m < 23.5

    1. Initial program 98.8%

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

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

      \[\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-+.f6494.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. Simplified94.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 23.5 < m

    1. Initial program 84.8%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\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(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) + -10 \cdot a\right)\right)\right) \]
      5. +-lowering-+.f64N/A

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, \left(\mathsf{neg}\left(\left(-100 + 1\right) \cdot a\right)\right)\right), \left(-10 \cdot a\right)\right)\right)\right) \]
      10. distribute-lft-neg-inN/A

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

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

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, \left(99 \cdot a\right)\right), \left(-10 \cdot a\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(99, a\right)\right), \left(a \cdot \color{blue}{-10}\right)\right)\right)\right) \]
      17. *-lowering-*.f6423.9%

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(99, a\right)\right), \mathsf{*.f64}\left(a, \color{blue}{-10}\right)\right)\right)\right) \]
    10. Simplified23.9%

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

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

Alternative 10: 64.5% accurate, 4.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -0.175:\\ \;\;\;\;\frac{\frac{\frac{a \cdot 99}{k}}{k}}{k \cdot k}\\ \mathbf{elif}\;m \leq 23.5:\\ \;\;\;\;a \cdot \frac{-1}{-1 - k \cdot \left(k + 10\right)}\\ \mathbf{else}:\\ \;\;\;\;a + k \cdot \left(k \cdot \left(a \cdot 99\right) + a \cdot -10\right)\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= m -0.175)
   (/ (/ (/ (* a 99.0) k) k) (* k k))
   (if (<= m 23.5)
     (* a (/ -1.0 (- -1.0 (* k (+ k 10.0)))))
     (+ a (* k (+ (* k (* a 99.0)) (* a -10.0)))))))
double code(double a, double k, double m) {
	double tmp;
	if (m <= -0.175) {
		tmp = (((a * 99.0) / k) / k) / (k * k);
	} else if (m <= 23.5) {
		tmp = a * (-1.0 / (-1.0 - (k * (k + 10.0))));
	} else {
		tmp = a + (k * ((k * (a * 99.0)) + (a * -10.0)));
	}
	return tmp;
}
real(8) function code(a, k, m)
    real(8), intent (in) :: a
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8) :: tmp
    if (m <= (-0.175d0)) then
        tmp = (((a * 99.0d0) / k) / k) / (k * k)
    else if (m <= 23.5d0) then
        tmp = a * ((-1.0d0) / ((-1.0d0) - (k * (k + 10.0d0))))
    else
        tmp = a + (k * ((k * (a * 99.0d0)) + (a * (-10.0d0))))
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (m <= -0.175) {
		tmp = (((a * 99.0) / k) / k) / (k * k);
	} else if (m <= 23.5) {
		tmp = a * (-1.0 / (-1.0 - (k * (k + 10.0))));
	} else {
		tmp = a + (k * ((k * (a * 99.0)) + (a * -10.0)));
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if m <= -0.175:
		tmp = (((a * 99.0) / k) / k) / (k * k)
	elif m <= 23.5:
		tmp = a * (-1.0 / (-1.0 - (k * (k + 10.0))))
	else:
		tmp = a + (k * ((k * (a * 99.0)) + (a * -10.0)))
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (m <= -0.175)
		tmp = Float64(Float64(Float64(Float64(a * 99.0) / k) / k) / Float64(k * k));
	elseif (m <= 23.5)
		tmp = Float64(a * Float64(-1.0 / Float64(-1.0 - Float64(k * Float64(k + 10.0)))));
	else
		tmp = Float64(a + Float64(k * Float64(Float64(k * Float64(a * 99.0)) + Float64(a * -10.0))));
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (m <= -0.175)
		tmp = (((a * 99.0) / k) / k) / (k * k);
	elseif (m <= 23.5)
		tmp = a * (-1.0 / (-1.0 - (k * (k + 10.0))));
	else
		tmp = a + (k * ((k * (a * 99.0)) + (a * -10.0)));
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[m, -0.175], N[(N[(N[(N[(a * 99.0), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 23.5], N[(a * N[(-1.0 / N[(-1.0 - N[(k * N[(k + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(k * N[(N[(k * N[(a * 99.0), $MachinePrecision]), $MachinePrecision] + N[(a * -10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    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-+.f6426.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. Simplified26.6%

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

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

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

      \[\leadsto \color{blue}{\frac{a - \frac{a \cdot 10 + \frac{-99 \cdot a}{k}}{k}}{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. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{{k}^{2}}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. distribute-lft-neg-inN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\mathsf{neg}\left(-99 \cdot a\right)}{k}}{k}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}}{k}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{99 \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      12. distribute-lft-neg-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(-99 \cdot a\right)\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      14. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(-99\right)\right) \cdot a\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      15. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(a \cdot 99\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      17. *-lowering-*.f6476.1%

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

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

    if -0.17499999999999999 < m < 23.5

    1. Initial program 98.8%

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

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

      \[\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-+.f6494.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. Simplified94.3%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, 10\right)\right)\right)\right), a\right) \]
    9. Applied egg-rr94.3%

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

    if 23.5 < m

    1. Initial program 84.8%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\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(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) + -10 \cdot a\right)\right)\right) \]
      5. +-lowering-+.f64N/A

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, \left(\mathsf{neg}\left(\left(-100 + 1\right) \cdot a\right)\right)\right), \left(-10 \cdot a\right)\right)\right)\right) \]
      10. distribute-lft-neg-inN/A

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

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

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, \left(99 \cdot a\right)\right), \left(-10 \cdot a\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(99, a\right)\right), \left(a \cdot \color{blue}{-10}\right)\right)\right)\right) \]
      17. *-lowering-*.f6423.9%

        \[\leadsto \mathsf{+.f64}\left(a, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(99, a\right)\right), \mathsf{*.f64}\left(a, \color{blue}{-10}\right)\right)\right)\right) \]
    10. Simplified23.9%

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

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

Alternative 11: 46.8% accurate, 6.7× speedup?

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

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

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

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


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

    1. Initial program 95.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-+.f6495.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. Simplified95.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-+.f6412.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. Simplified12.0%

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

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

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

    if -4.7999999999999999e-283 < k < 5.5e5

    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-+.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 \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-*.f6444.2%

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

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

    if 5.5e5 < k

    1. Initial program 87.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-+.f6487.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. Simplified87.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-+.f6465.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. Simplified65.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, 10\right)\right)\right), a\right)\right) \]
    9. Applied egg-rr65.4%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{a}{k}\right), \color{blue}{k}\right) \]
      4. /-lowering-/.f6464.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(a, k\right), k\right) \]
    12. Simplified64.9%

      \[\leadsto \color{blue}{\frac{\frac{a}{k}}{k}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq -4.8 \cdot 10^{-283}:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{elif}\;k \leq 550000:\\ \;\;\;\;\frac{a}{k \cdot 10 + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{a}{k}}{k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 46.8% accurate, 6.7× speedup?

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

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

\mathbf{elif}\;k \leq 0.106:\\
\;\;\;\;a + a \cdot \left(k \cdot -10\right)\\

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


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

    1. Initial program 95.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-+.f6495.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. Simplified95.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-+.f6412.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. Simplified12.0%

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

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

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

    if -4.7999999999999999e-283 < k < 0.105999999999999997

    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-+.f6445.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. Simplified45.7%

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

      \[\leadsto \color{blue}{a + -10 \cdot \left(a \cdot k\right)} \]
    9. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

    if 0.105999999999999997 < k

    1. Initial program 88.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-+.f6488.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. Simplified88.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-+.f6463.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. Simplified63.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{a}{k}\right), \color{blue}{k}\right) \]
      4. /-lowering-/.f6462.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(a, k\right), k\right) \]
    12. Simplified62.2%

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

Alternative 13: 56.2% accurate, 7.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;a \cdot \frac{-1}{-1 - k \cdot \left(k + 10\right)}\\


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

    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-+.f6426.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. Simplified26.6%

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

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

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

      \[\leadsto \color{blue}{\frac{a - \frac{a \cdot 10 + \frac{-99 \cdot a}{k}}{k}}{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. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{{k}^{2}}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      3. distribute-lft-neg-inN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\mathsf{neg}\left(-99 \cdot a\right)}{k}}{k}\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}}{k}\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      7. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{99 \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-99\right)\right) \cdot a}{k}\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      12. distribute-lft-neg-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(-99 \cdot a\right)\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      14. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(-99\right)\right) \cdot a\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      15. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(a \cdot 99\right), k\right), k\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      17. *-lowering-*.f6476.1%

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

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

    if -0.39000000000000001 < m

    1. Initial program 92.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-+.f6492.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. Simplified92.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-+.f6451.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. Simplified51.3%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, 10\right)\right)\right)\right), a\right) \]
    9. Applied egg-rr51.3%

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

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

Alternative 14: 52.4% accurate, 7.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;a \cdot \frac{-1}{-1 - k \cdot \left(k + 10\right)}\\


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

    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-+.f6426.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. Simplified26.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-*.f6462.5%

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

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

    if -0.640000000000000013 < m

    1. Initial program 92.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-+.f6492.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. Simplified92.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-+.f6451.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. Simplified51.3%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(k, \mathsf{+.f64}\left(k, 10\right)\right)\right)\right), a\right) \]
    9. Applied egg-rr51.3%

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

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

Alternative 15: 46.6% accurate, 7.6× speedup?

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

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

\mathbf{elif}\;k \leq 1:\\
\;\;\;\;a\\

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


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

    1. Initial program 95.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-+.f6495.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. Simplified95.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-+.f6412.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. Simplified12.0%

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

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

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

    if -4.7999999999999999e-283 < k < 1

    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-+.f6445.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. Simplified45.7%

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

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

      if 1 < k

      1. Initial program 88.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-+.f6488.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. Simplified88.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-+.f6463.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. Simplified63.7%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{a}{k}\right), \color{blue}{k}\right) \]
        4. /-lowering-/.f6462.2%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(a, k\right), k\right) \]
      12. Simplified62.2%

        \[\leadsto \color{blue}{\frac{\frac{a}{k}}{k}} \]
    10. Recombined 3 regimes into one program.
    11. Add Preprocessing

    Alternative 16: 45.7% accurate, 7.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a}{k \cdot k}\\ \mathbf{if}\;k \leq -4.8 \cdot 10^{-283}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;k \leq 1:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (a k m)
     :precision binary64
     (let* ((t_0 (/ a (* k k)))) (if (<= k -4.8e-283) t_0 (if (<= k 1.0) a t_0))))
    double code(double a, double k, double m) {
    	double t_0 = a / (k * k);
    	double tmp;
    	if (k <= -4.8e-283) {
    		tmp = t_0;
    	} else if (k <= 1.0) {
    		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.8d-283)) then
            tmp = t_0
        else if (k <= 1.0d0) 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.8e-283) {
    		tmp = t_0;
    	} else if (k <= 1.0) {
    		tmp = a;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(a, k, m):
    	t_0 = a / (k * k)
    	tmp = 0
    	if k <= -4.8e-283:
    		tmp = t_0
    	elif k <= 1.0:
    		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.8e-283)
    		tmp = t_0;
    	elseif (k <= 1.0)
    		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.8e-283)
    		tmp = t_0;
    	elseif (k <= 1.0)
    		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.8e-283], t$95$0, If[LessEqual[k, 1.0], a, t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{a}{k \cdot k}\\
    \mathbf{if}\;k \leq -4.8 \cdot 10^{-283}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;k \leq 1:\\
    \;\;\;\;a\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < -4.7999999999999999e-283 or 1 < k

      1. Initial program 91.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-+.f6491.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. Simplified91.6%

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

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

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

      if -4.7999999999999999e-283 < k < 1

      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-+.f6445.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. Simplified45.7%

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

          \[\leadsto \color{blue}{a} \]
      10. Recombined 2 regimes into one program.
      11. Add Preprocessing

      Alternative 17: 52.4% accurate, 8.1× speedup?

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

        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-+.f6426.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. Simplified26.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-*.f6462.5%

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

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

        if -0.044999999999999998 < m

        1. Initial program 92.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-+.f6492.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. Simplified92.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-+.f6451.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. Simplified51.3%

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

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

      Alternative 18: 51.7% accurate, 9.5× speedup?

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

        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-+.f6426.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. Simplified26.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-*.f6462.5%

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

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

        if -0.26000000000000001 < m

        1. Initial program 92.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-+.f6492.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. Simplified92.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-+.f6451.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. Simplified51.3%

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

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

          \[\leadsto \frac{a}{1 + \color{blue}{k \cdot k}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification54.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;m \leq -0.26:\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{k \cdot k + 1}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 19: 20.2% 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 94.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-+.f6494.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. Simplified94.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-+.f6442.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. Simplified42.7%

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

          \[\leadsto \color{blue}{a} \]
        2. Add Preprocessing

        Reproduce

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