Falkner and Boettcher, Appendix A

Percentage Accurate: 90.2% → 97.7%
Time: 10.8s
Alternatives: 15
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
	return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, k, m)
use fmin_fmax_functions
    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 15 alternatives:

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

Initial Program: 90.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
	return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, k, m)
use fmin_fmax_functions
    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.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq 0.21:\\ \;\;\;\;\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;{k}^{m} \cdot a\\ \end{array} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (if (<= m 0.21)
   (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))
   (* (pow k m) a)))
double code(double a, double k, double m) {
	double tmp;
	if (m <= 0.21) {
		tmp = (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
	} else {
		tmp = pow(k, m) * a;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, k, m)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: k
    real(8), intent (in) :: m
    real(8) :: tmp
    if (m <= 0.21d0) then
        tmp = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
    else
        tmp = (k ** m) * a
    end if
    code = tmp
end function
public static double code(double a, double k, double m) {
	double tmp;
	if (m <= 0.21) {
		tmp = (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
	} else {
		tmp = Math.pow(k, m) * a;
	}
	return tmp;
}
def code(a, k, m):
	tmp = 0
	if m <= 0.21:
		tmp = (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
	else:
		tmp = math.pow(k, m) * a
	return tmp
function code(a, k, m)
	tmp = 0.0
	if (m <= 0.21)
		tmp = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)));
	else
		tmp = Float64((k ^ m) * a);
	end
	return tmp
end
function tmp_2 = code(a, k, m)
	tmp = 0.0;
	if (m <= 0.21)
		tmp = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k));
	else
		tmp = (k ^ m) * a;
	end
	tmp_2 = tmp;
end
code[a_, k_, m_] := If[LessEqual[m, 0.21], 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], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 95.8%

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

    if 0.209999999999999992 < m

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 60.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{{k}^{-1}}{k} \cdot a\\

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
      9. fp-cancel-sign-sub-invN/A

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

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
      12. lower--.f6455.2

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

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

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

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

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

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

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

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
          9. fp-cancel-sign-sub-invN/A

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

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

            \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
          12. lower--.f6496.6

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

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

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \cdot a \]
          7. fp-cancel-sign-sub-invN/A

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

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

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

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

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

          \[\leadsto \frac{1}{\color{blue}{{k}^{2}}} \cdot a \]
        9. Step-by-step derivation
          1. Applied rewrites52.8%

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

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

          1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \cdot a \]
            7. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

          Alternative 3: 61.5% accurate, 0.3× speedup?

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

            1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
              9. fp-cancel-sign-sub-invN/A

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

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

                \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
              12. lower--.f6455.2

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

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

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

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

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

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

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

                1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                  9. fp-cancel-sign-sub-invN/A

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

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

                    \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
                  12. lower--.f6496.6

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

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

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

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{1}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \cdot a \]
                  7. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

                  1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{1}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \cdot a \]
                    7. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

                  Alternative 4: 47.8% accurate, 0.3× speedup?

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

                    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                      9. fp-cancel-sign-sub-invN/A

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

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

                        \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
                      12. lower--.f6448.8

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

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

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

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

                      if 4.00000000000000022e-279 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 5.00000000000000016e281

                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                        9. fp-cancel-sign-sub-invN/A

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

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

                          \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
                        12. lower--.f6496.2

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

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

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

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

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

                        1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{1}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \cdot a \]
                          7. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(99, k, -10\right), \color{blue}{k}, 1\right) \cdot a \]
                        10. Recombined 3 regimes into one program.
                        11. Add Preprocessing

                        Alternative 5: 40.4% accurate, 0.5× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 4 \cdot 10^{-279} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+281}\right):\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(10, k, 1\right)}\\ \end{array} \end{array} \]
                        (FPCore (a k m)
                         :precision binary64
                         (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))))
                           (if (or (<= t_0 4e-279) (not (<= t_0 5e+281)))
                             (/ a (* k k))
                             (/ a (fma 10.0 k 1.0)))))
                        double code(double a, double k, double m) {
                        	double t_0 = (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
                        	double tmp;
                        	if ((t_0 <= 4e-279) || !(t_0 <= 5e+281)) {
                        		tmp = a / (k * k);
                        	} else {
                        		tmp = a / fma(10.0, k, 1.0);
                        	}
                        	return tmp;
                        }
                        
                        function code(a, k, m)
                        	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
                        	tmp = 0.0
                        	if ((t_0 <= 4e-279) || !(t_0 <= 5e+281))
                        		tmp = Float64(a / Float64(k * k));
                        	else
                        		tmp = Float64(a / fma(10.0, k, 1.0));
                        	end
                        	return tmp
                        end
                        
                        code[a_, k_, m_] := Block[{t$95$0 = 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]}, If[Or[LessEqual[t$95$0, 4e-279], N[Not[LessEqual[t$95$0, 5e+281]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a / N[(10.0 * k + 1.0), $MachinePrecision]), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
                        \mathbf{if}\;t\_0 \leq 4 \cdot 10^{-279} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+281}\right):\\
                        \;\;\;\;\frac{a}{k \cdot k}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{a}{\mathsf{fma}\left(10, k, 1\right)}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 4.00000000000000022e-279 or 5.00000000000000016e281 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

                          1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                            9. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                            if 4.00000000000000022e-279 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 5.00000000000000016e281

                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                              9. fp-cancel-sign-sub-invN/A

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

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

                                \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
                              12. lower--.f6496.2

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

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

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

                                \[\leadsto \frac{a}{\mathsf{fma}\left(10, k, 1\right)} \]
                            8. Recombined 2 regimes into one program.
                            9. Final simplification46.2%

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

                            Alternative 6: 40.2% accurate, 0.5× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\ \mathbf{if}\;t\_0 \leq 4 \cdot 10^{-279} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+281}\right):\\ \;\;\;\;\frac{a}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{1}\\ \end{array} \end{array} \]
                            (FPCore (a k m)
                             :precision binary64
                             (let* ((t_0 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))))
                               (if (or (<= t_0 4e-279) (not (<= t_0 5e+281))) (/ a (* k k)) (/ a 1.0))))
                            double code(double a, double k, double m) {
                            	double t_0 = (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
                            	double tmp;
                            	if ((t_0 <= 4e-279) || !(t_0 <= 5e+281)) {
                            		tmp = a / (k * k);
                            	} else {
                            		tmp = a / 1.0;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(a, k, m)
                            use fmin_fmax_functions
                                real(8), intent (in) :: a
                                real(8), intent (in) :: k
                                real(8), intent (in) :: m
                                real(8) :: t_0
                                real(8) :: tmp
                                t_0 = (a * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
                                if ((t_0 <= 4d-279) .or. (.not. (t_0 <= 5d+281))) then
                                    tmp = a / (k * k)
                                else
                                    tmp = a / 1.0d0
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double a, double k, double m) {
                            	double t_0 = (a * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
                            	double tmp;
                            	if ((t_0 <= 4e-279) || !(t_0 <= 5e+281)) {
                            		tmp = a / (k * k);
                            	} else {
                            		tmp = a / 1.0;
                            	}
                            	return tmp;
                            }
                            
                            def code(a, k, m):
                            	t_0 = (a * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
                            	tmp = 0
                            	if (t_0 <= 4e-279) or not (t_0 <= 5e+281):
                            		tmp = a / (k * k)
                            	else:
                            		tmp = a / 1.0
                            	return tmp
                            
                            function code(a, k, m)
                            	t_0 = Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
                            	tmp = 0.0
                            	if ((t_0 <= 4e-279) || !(t_0 <= 5e+281))
                            		tmp = Float64(a / Float64(k * k));
                            	else
                            		tmp = Float64(a / 1.0);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(a, k, m)
                            	t_0 = (a * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k));
                            	tmp = 0.0;
                            	if ((t_0 <= 4e-279) || ~((t_0 <= 5e+281)))
                            		tmp = a / (k * k);
                            	else
                            		tmp = a / 1.0;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[a_, k_, m_] := Block[{t$95$0 = 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]}, If[Or[LessEqual[t$95$0, 4e-279], N[Not[LessEqual[t$95$0, 5e+281]], $MachinePrecision]], N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(a / 1.0), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
                            \mathbf{if}\;t\_0 \leq 4 \cdot 10^{-279} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+281}\right):\\
                            \;\;\;\;\frac{a}{k \cdot k}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{a}{1}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 4.00000000000000022e-279 or 5.00000000000000016e281 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

                              1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                9. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                                if 4.00000000000000022e-279 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 5.00000000000000016e281

                                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                  9. fp-cancel-sign-sub-invN/A

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

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

                                    \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
                                  12. lower--.f6496.2

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

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

                                  \[\leadsto \frac{a}{1} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites65.0%

                                    \[\leadsto \frac{a}{1} \]
                                8. Recombined 2 regimes into one program.
                                9. Final simplification46.1%

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

                                Alternative 7: 97.7% accurate, 1.0× speedup?

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

                                  1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 0.209999999999999992 < m

                                  1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 8: 62.5% accurate, 1.1× speedup?

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

                                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{1}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \cdot a \]
                                    7. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                                    if -0.28999999999999998 < m < 0.209999999999999992

                                    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                      9. fp-cancel-sign-sub-invN/A

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

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

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

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

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

                                    if 0.209999999999999992 < m

                                    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{1}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \cdot a \]
                                      7. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

                                    Alternative 9: 97.1% accurate, 1.1× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq -7.4 \cdot 10^{-7} \lor \neg \left(m \leq 0.00045\right):\\ \;\;\;\;{k}^{m} \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k - -10, k, 1\right)}\\ \end{array} \end{array} \]
                                    (FPCore (a k m)
                                     :precision binary64
                                     (if (or (<= m -7.4e-7) (not (<= m 0.00045)))
                                       (* (pow k m) a)
                                       (/ a (fma (- k -10.0) k 1.0))))
                                    double code(double a, double k, double m) {
                                    	double tmp;
                                    	if ((m <= -7.4e-7) || !(m <= 0.00045)) {
                                    		tmp = pow(k, m) * a;
                                    	} else {
                                    		tmp = a / fma((k - -10.0), k, 1.0);
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(a, k, m)
                                    	tmp = 0.0
                                    	if ((m <= -7.4e-7) || !(m <= 0.00045))
                                    		tmp = Float64((k ^ m) * a);
                                    	else
                                    		tmp = Float64(a / fma(Float64(k - -10.0), k, 1.0));
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[a_, k_, m_] := If[Or[LessEqual[m, -7.4e-7], N[Not[LessEqual[m, 0.00045]], $MachinePrecision]], N[(N[Power[k, m], $MachinePrecision] * a), $MachinePrecision], N[(a / N[(N[(k - -10.0), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;m \leq -7.4 \cdot 10^{-7} \lor \neg \left(m \leq 0.00045\right):\\
                                    \;\;\;\;{k}^{m} \cdot a\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{a}{\mathsf{fma}\left(k - -10, k, 1\right)}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if m < -7.40000000000000009e-7 or 4.4999999999999999e-4 < m

                                      1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if -7.40000000000000009e-7 < m < 4.4999999999999999e-4

                                      1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                        9. fp-cancel-sign-sub-invN/A

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

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

                                          \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
                                        12. lower--.f6492.2

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

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

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

                                    Alternative 10: 62.6% accurate, 4.1× speedup?

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

                                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                        9. fp-cancel-sign-sub-invN/A

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

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

                                          \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
                                        12. lower--.f6443.0

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

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

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

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

                                        if -0.28999999999999998 < m < 0.209999999999999992

                                        1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                          9. fp-cancel-sign-sub-invN/A

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

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

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

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

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

                                        if 0.209999999999999992 < m

                                        1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{1}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \cdot a \]
                                          7. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(99, k, -10\right), \color{blue}{k}, 1\right) \cdot a \]
                                        10. Recombined 3 regimes into one program.
                                        11. Add Preprocessing

                                        Alternative 11: 24.9% accurate, 7.4× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq 1.2 \cdot 10^{+29}:\\ \;\;\;\;\frac{a}{1}\\ \mathbf{else}:\\ \;\;\;\;\left(k \cdot a\right) \cdot -10\\ \end{array} \end{array} \]
                                        (FPCore (a k m)
                                         :precision binary64
                                         (if (<= m 1.2e+29) (/ a 1.0) (* (* k a) -10.0)))
                                        double code(double a, double k, double m) {
                                        	double tmp;
                                        	if (m <= 1.2e+29) {
                                        		tmp = a / 1.0;
                                        	} else {
                                        		tmp = (k * a) * -10.0;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        module fmin_fmax_functions
                                            implicit none
                                            private
                                            public fmax
                                            public fmin
                                        
                                            interface fmax
                                                module procedure fmax88
                                                module procedure fmax44
                                                module procedure fmax84
                                                module procedure fmax48
                                            end interface
                                            interface fmin
                                                module procedure fmin88
                                                module procedure fmin44
                                                module procedure fmin84
                                                module procedure fmin48
                                            end interface
                                        contains
                                            real(8) function fmax88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmax44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmax84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmax48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmin44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmin48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                            end function
                                        end module
                                        
                                        real(8) function code(a, k, m)
                                        use fmin_fmax_functions
                                            real(8), intent (in) :: a
                                            real(8), intent (in) :: k
                                            real(8), intent (in) :: m
                                            real(8) :: tmp
                                            if (m <= 1.2d+29) then
                                                tmp = a / 1.0d0
                                            else
                                                tmp = (k * a) * (-10.0d0)
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double a, double k, double m) {
                                        	double tmp;
                                        	if (m <= 1.2e+29) {
                                        		tmp = a / 1.0;
                                        	} else {
                                        		tmp = (k * a) * -10.0;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(a, k, m):
                                        	tmp = 0
                                        	if m <= 1.2e+29:
                                        		tmp = a / 1.0
                                        	else:
                                        		tmp = (k * a) * -10.0
                                        	return tmp
                                        
                                        function code(a, k, m)
                                        	tmp = 0.0
                                        	if (m <= 1.2e+29)
                                        		tmp = Float64(a / 1.0);
                                        	else
                                        		tmp = Float64(Float64(k * a) * -10.0);
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(a, k, m)
                                        	tmp = 0.0;
                                        	if (m <= 1.2e+29)
                                        		tmp = a / 1.0;
                                        	else
                                        		tmp = (k * a) * -10.0;
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[a_, k_, m_] := If[LessEqual[m, 1.2e+29], N[(a / 1.0), $MachinePrecision], N[(N[(k * a), $MachinePrecision] * -10.0), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;m \leq 1.2 \cdot 10^{+29}:\\
                                        \;\;\;\;\frac{a}{1}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\left(k \cdot a\right) \cdot -10\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if m < 1.2e29

                                          1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                            9. fp-cancel-sign-sub-invN/A

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

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

                                              \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
                                            12. lower--.f6464.9

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

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

                                            \[\leadsto \frac{a}{1} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites26.0%

                                              \[\leadsto \frac{a}{1} \]

                                            if 1.2e29 < m

                                            1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                              9. fp-cancel-sign-sub-invN/A

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

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

                                                \[\leadsto \frac{a}{\mathsf{fma}\left(k - \color{blue}{-10}, k, 1\right)} \]
                                              12. lower--.f642.4

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

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

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

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

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

                                                  \[\leadsto \left(-10 \cdot a\right) \cdot k \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites15.0%

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

                                                Alternative 12: 20.4% accurate, 11.2× speedup?

                                                \[\begin{array}{l} \\ \mathsf{fma}\left(k \cdot a, -10, a\right) \end{array} \]
                                                (FPCore (a k m) :precision binary64 (fma (* k a) -10.0 a))
                                                double code(double a, double k, double m) {
                                                	return fma((k * a), -10.0, a);
                                                }
                                                
                                                function code(a, k, m)
                                                	return fma(Float64(k * a), -10.0, a)
                                                end
                                                
                                                code[a_, k_, m_] := N[(N[(k * a), $MachinePrecision] * -10.0 + a), $MachinePrecision]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \mathsf{fma}\left(k \cdot a, -10, a\right)
                                                \end{array}
                                                
                                                Derivation
                                                1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                                  9. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

                                                    \[\leadsto \mathsf{fma}\left(k \cdot a, \color{blue}{-10}, a\right) \]
                                                  2. Add Preprocessing

                                                  Alternative 13: 20.4% accurate, 11.2× speedup?

                                                  \[\begin{array}{l} \\ \mathsf{fma}\left(-10, k, 1\right) \cdot a \end{array} \]
                                                  (FPCore (a k m) :precision binary64 (* (fma -10.0 k 1.0) a))
                                                  double code(double a, double k, double m) {
                                                  	return fma(-10.0, k, 1.0) * a;
                                                  }
                                                  
                                                  function code(a, k, m)
                                                  	return Float64(fma(-10.0, k, 1.0) * a)
                                                  end
                                                  
                                                  code[a_, k_, m_] := N[(N[(-10.0 * k + 1.0), $MachinePrecision] * a), $MachinePrecision]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \mathsf{fma}\left(-10, k, 1\right) \cdot a
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                                    9. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

                                                        \[\leadsto \mathsf{fma}\left(-10, k, 1\right) \cdot \color{blue}{a} \]
                                                      2. Add Preprocessing

                                                      Alternative 14: 8.6% accurate, 12.2× speedup?

                                                      \[\begin{array}{l} \\ \left(k \cdot a\right) \cdot -10 \end{array} \]
                                                      (FPCore (a k m) :precision binary64 (* (* k a) -10.0))
                                                      double code(double a, double k, double m) {
                                                      	return (k * a) * -10.0;
                                                      }
                                                      
                                                      module fmin_fmax_functions
                                                          implicit none
                                                          private
                                                          public fmax
                                                          public fmin
                                                      
                                                          interface fmax
                                                              module procedure fmax88
                                                              module procedure fmax44
                                                              module procedure fmax84
                                                              module procedure fmax48
                                                          end interface
                                                          interface fmin
                                                              module procedure fmin88
                                                              module procedure fmin44
                                                              module procedure fmin84
                                                              module procedure fmin48
                                                          end interface
                                                      contains
                                                          real(8) function fmax88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmax44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmin44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                          end function
                                                      end module
                                                      
                                                      real(8) function code(a, k, m)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: a
                                                          real(8), intent (in) :: k
                                                          real(8), intent (in) :: m
                                                          code = (k * a) * (-10.0d0)
                                                      end function
                                                      
                                                      public static double code(double a, double k, double m) {
                                                      	return (k * a) * -10.0;
                                                      }
                                                      
                                                      def code(a, k, m):
                                                      	return (k * a) * -10.0
                                                      
                                                      function code(a, k, m)
                                                      	return Float64(Float64(k * a) * -10.0)
                                                      end
                                                      
                                                      function tmp = code(a, k, m)
                                                      	tmp = (k * a) * -10.0;
                                                      end
                                                      
                                                      code[a_, k_, m_] := N[(N[(k * a), $MachinePrecision] * -10.0), $MachinePrecision]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \left(k \cdot a\right) \cdot -10
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                                        9. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

                                                            \[\leadsto \left(-10 \cdot a\right) \cdot k \]
                                                          2. Step-by-step derivation
                                                            1. Applied rewrites5.4%

                                                              \[\leadsto \color{blue}{\left(k \cdot a\right) \cdot -10} \]
                                                            2. Add Preprocessing

                                                            Alternative 15: 8.6% accurate, 12.2× speedup?

                                                            \[\begin{array}{l} \\ \left(-10 \cdot a\right) \cdot k \end{array} \]
                                                            (FPCore (a k m) :precision binary64 (* (* -10.0 a) k))
                                                            double code(double a, double k, double m) {
                                                            	return (-10.0 * a) * k;
                                                            }
                                                            
                                                            module fmin_fmax_functions
                                                                implicit none
                                                                private
                                                                public fmax
                                                                public fmin
                                                            
                                                                interface fmax
                                                                    module procedure fmax88
                                                                    module procedure fmax44
                                                                    module procedure fmax84
                                                                    module procedure fmax48
                                                                end interface
                                                                interface fmin
                                                                    module procedure fmin88
                                                                    module procedure fmin44
                                                                    module procedure fmin84
                                                                    module procedure fmin48
                                                                end interface
                                                            contains
                                                                real(8) function fmax88(x, y) result (res)
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                end function
                                                                real(4) function fmax44(x, y) result (res)
                                                                    real(4), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmax84(x, y) result(res)
                                                                    real(8), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmax48(x, y) result(res)
                                                                    real(4), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmin88(x, y) result (res)
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                end function
                                                                real(4) function fmin44(x, y) result (res)
                                                                    real(4), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmin84(x, y) result(res)
                                                                    real(8), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmin48(x, y) result(res)
                                                                    real(4), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                end function
                                                            end module
                                                            
                                                            real(8) function code(a, k, m)
                                                            use fmin_fmax_functions
                                                                real(8), intent (in) :: a
                                                                real(8), intent (in) :: k
                                                                real(8), intent (in) :: m
                                                                code = ((-10.0d0) * a) * k
                                                            end function
                                                            
                                                            public static double code(double a, double k, double m) {
                                                            	return (-10.0 * a) * k;
                                                            }
                                                            
                                                            def code(a, k, m):
                                                            	return (-10.0 * a) * k
                                                            
                                                            function code(a, k, m)
                                                            	return Float64(Float64(-10.0 * a) * k)
                                                            end
                                                            
                                                            function tmp = code(a, k, m)
                                                            	tmp = (-10.0 * a) * k;
                                                            end
                                                            
                                                            code[a_, k_, m_] := N[(N[(-10.0 * a), $MachinePrecision] * k), $MachinePrecision]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \left(-10 \cdot a\right) \cdot k
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \frac{a}{\mathsf{fma}\left(k + \color{blue}{10 \cdot 1}, k, 1\right)} \]
                                                              9. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \left(-10 \cdot a\right) \cdot k \]
                                                                2. Add Preprocessing

                                                                Reproduce

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