Falkner and Boettcher, Appendix A

Percentage Accurate: 89.6% → 99.7%
Time: 5.2s
Alternatives: 12
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \end{array} \]
(FPCore (a k m)
 :precision binary64
 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
double code(double a, double k, double m) {
	return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 89.6% 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: 99.7% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 89.6%

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

      \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{1}} \]
    3. Step-by-step derivation
      1. Applied rewrites83.0%

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

      if 1e-26 < k

      1. Initial program 89.6%

        \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
      2. 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. div-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{k - \left(\mathsf{neg}\left(10\right)\right)}, k, 1\right)}{a \cdot {k}^{m}}} \]
        23. metadata-eval89.6

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(k - -10, k, 1\right)}{{k}^{m} \cdot a}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

    Alternative 2: 98.9% accurate, 0.5× speedup?

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

      1. Initial program 89.6%

        \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
      2. 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. div-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{k - \left(\mathsf{neg}\left(10\right)\right)}, k, 1\right)}{a \cdot {k}^{m}}} \]
        23. metadata-eval89.6

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(k - -10, k, 1\right)}{{k}^{m} \cdot a}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(\frac{k - -10}{{k}^{m} \cdot a}, k, \frac{{k}^{\left(-m\right)}}{a}\right)}} \]
      6. Step-by-step derivation
        1. lift-/.f64N/A

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

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

          \[\leadsto \frac{1}{\mathsf{fma}\left(\color{blue}{\frac{1}{\frac{{k}^{m} \cdot a}{k - -10}}}, k, \frac{{k}^{\left(-m\right)}}{a}\right)} \]
        4. lower-unsound-/.f6489.4

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(\frac{1}{\color{blue}{\frac{a}{10 + k}}}, k, \frac{{k}^{\left(-m\right)}}{a}\right)} \]
      9. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{1}{\mathsf{fma}\left(\frac{1}{\frac{a}{\color{blue}{10 + k}}}, k, \frac{{k}^{\left(-m\right)}}{a}\right)} \]
        2. lower-+.f6471.9

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

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

      if 5.0000000000000003e240 < (/.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 89.6%

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

        \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{1}} \]
      3. Step-by-step derivation
        1. Applied rewrites83.0%

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

      Alternative 3: 89.7% accurate, 1.1× speedup?

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

        1. Initial program 89.6%

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

          \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{1}} \]
        3. Step-by-step derivation
          1. Applied rewrites83.0%

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

          if -0.00419999999999999974 < m < 7.19999999999999962e-8

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

              \[\leadsto \frac{1}{\color{blue}{\frac{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}{a}}} \]
            3. lift-+.f64N/A

              \[\leadsto \frac{1}{\frac{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}{a}} \]
            4. lift-fma.f64N/A

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\left(1 + 10 \cdot k\right) + k \cdot k}{a}} \]
            12. lower-unsound-/.f32N/A

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

              \[\leadsto \frac{1}{\frac{\left(1 + 10 \cdot k\right) + k \cdot k}{\color{blue}{a}}} \]
          6. Applied rewrites45.1%

            \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(k - -10, k, 1\right)}{a}}} \]
          7. Step-by-step derivation
            1. lift-/.f64N/A

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

              \[\leadsto \frac{1}{\frac{\left(k - -10\right) \cdot k + 1}{a}} \]
            3. div-addN/A

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

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

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

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

              \[\leadsto \frac{1}{\mathsf{fma}\left(k - -10, \frac{k}{a}, \frac{1}{a}\right)} \]
          8. Applied rewrites45.3%

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

        Alternative 4: 64.8% accurate, 1.3× speedup?

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

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

              \[\leadsto \frac{a}{{k}^{\color{blue}{2}}} \]
            2. lower-pow.f6434.7

              \[\leadsto \frac{a}{{k}^{2}} \]
          7. Applied rewrites34.7%

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

          if -0.27000000000000002 < m < 2.2999999999999998

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

              \[\leadsto \frac{1}{\color{blue}{\frac{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}{a}}} \]
            3. lift-+.f64N/A

              \[\leadsto \frac{1}{\frac{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}{a}} \]
            4. lift-fma.f64N/A

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\left(1 + 10 \cdot k\right) + k \cdot k}{a}} \]
            12. lower-unsound-/.f32N/A

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

              \[\leadsto \frac{1}{\frac{\left(1 + 10 \cdot k\right) + k \cdot k}{\color{blue}{a}}} \]
          6. Applied rewrites45.1%

            \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(k - -10, k, 1\right)}{a}}} \]
          7. Step-by-step derivation
            1. lift-/.f64N/A

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

              \[\leadsto \frac{1}{\frac{\left(k - -10\right) \cdot k + 1}{a}} \]
            3. div-addN/A

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

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

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

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

              \[\leadsto \frac{1}{\mathsf{fma}\left(k - -10, \frac{k}{a}, \frac{1}{a}\right)} \]
          8. Applied rewrites45.3%

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

          if 2.2999999999999998 < m

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot \color{blue}{a} \]
          6. Applied rewrites45.1%

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

            \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
          8. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            2. lower-*.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            3. lower--.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            4. lower-*.f6430.7

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
          9. Applied rewrites30.7%

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

        Alternative 5: 54.8% accurate, 0.4× 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 5 \cdot 10^{+287}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(k - -10, \frac{k}{a}, \frac{1}{a}\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + k \cdot \left(99 \cdot k - 10\right)\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 5e+287)
             (/ 1.0 (fma (- k -10.0) (/ k a) (/ 1.0 a)))
             (if (<= t_0 INFINITY)
               (* k (fma -10.0 a (/ a k)))
               (* (+ 1.0 (* k (- (* 99.0 k) 10.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 <= 5e+287) {
        		tmp = 1.0 / fma((k - -10.0), (k / a), (1.0 / a));
        	} else if (t_0 <= ((double) INFINITY)) {
        		tmp = k * fma(-10.0, a, (a / k));
        	} else {
        		tmp = (1.0 + (k * ((99.0 * k) - 10.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 <= 5e+287)
        		tmp = Float64(1.0 / fma(Float64(k - -10.0), Float64(k / a), Float64(1.0 / a)));
        	elseif (t_0 <= Inf)
        		tmp = Float64(k * fma(-10.0, a, Float64(a / k)));
        	else
        		tmp = Float64(Float64(1.0 + Float64(k * Float64(Float64(99.0 * k) - 10.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, 5e+287], N[(1.0 / N[(N[(k - -10.0), $MachinePrecision] * N[(k / a), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(k * N[(-10.0 * a + N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(k * N[(N[(99.0 * k), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $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 5 \cdot 10^{+287}:\\
        \;\;\;\;\frac{1}{\mathsf{fma}\left(k - -10, \frac{k}{a}, \frac{1}{a}\right)}\\
        
        \mathbf{elif}\;t\_0 \leq \infty:\\
        \;\;\;\;k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(1 + k \cdot \left(99 \cdot k - 10\right)\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))) < 5e287

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

              \[\leadsto \frac{1}{\color{blue}{\frac{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}{a}}} \]
            3. lift-+.f64N/A

              \[\leadsto \frac{1}{\frac{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}{a}} \]
            4. lift-fma.f64N/A

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\left(1 + 10 \cdot k\right) + k \cdot k}{a}} \]
            12. lower-unsound-/.f32N/A

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

              \[\leadsto \frac{1}{\frac{\left(1 + 10 \cdot k\right) + k \cdot k}{\color{blue}{a}}} \]
          6. Applied rewrites45.1%

            \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(k - -10, k, 1\right)}{a}}} \]
          7. Step-by-step derivation
            1. lift-/.f64N/A

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

              \[\leadsto \frac{1}{\frac{\left(k - -10\right) \cdot k + 1}{a}} \]
            3. div-addN/A

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

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

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

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

              \[\leadsto \frac{1}{\mathsf{fma}\left(k - -10, \frac{k}{a}, \frac{1}{a}\right)} \]
          8. Applied rewrites45.3%

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

          if 5e287 < (/.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 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6422.3

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites22.3%

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

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

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

              \[\leadsto k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right) \]
            3. lower-/.f6421.5

              \[\leadsto k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right) \]
          10. Applied rewrites21.5%

            \[\leadsto k \cdot \mathsf{fma}\left(-10, \color{blue}{a}, \frac{a}{k}\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 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot \color{blue}{a} \]
          6. Applied rewrites45.1%

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

            \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
          8. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            2. lower-*.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            3. lower--.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            4. lower-*.f6430.7

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
          9. Applied rewrites30.7%

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

        Alternative 6: 54.5% accurate, 0.4× 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 5 \cdot 10^{+287}:\\ \;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(k - -10, k, 1\right)}{a}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + k \cdot \left(99 \cdot k - 10\right)\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 5e+287)
             (/ 1.0 (/ (fma (- k -10.0) k 1.0) a))
             (if (<= t_0 INFINITY)
               (* k (fma -10.0 a (/ a k)))
               (* (+ 1.0 (* k (- (* 99.0 k) 10.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 <= 5e+287) {
        		tmp = 1.0 / (fma((k - -10.0), k, 1.0) / a);
        	} else if (t_0 <= ((double) INFINITY)) {
        		tmp = k * fma(-10.0, a, (a / k));
        	} else {
        		tmp = (1.0 + (k * ((99.0 * k) - 10.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 <= 5e+287)
        		tmp = Float64(1.0 / Float64(fma(Float64(k - -10.0), k, 1.0) / a));
        	elseif (t_0 <= Inf)
        		tmp = Float64(k * fma(-10.0, a, Float64(a / k)));
        	else
        		tmp = Float64(Float64(1.0 + Float64(k * Float64(Float64(99.0 * k) - 10.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, 5e+287], N[(1.0 / N[(N[(N[(k - -10.0), $MachinePrecision] * k + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(k * N[(-10.0 * a + N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(k * N[(N[(99.0 * k), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $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 5 \cdot 10^{+287}:\\
        \;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(k - -10, k, 1\right)}{a}}\\
        
        \mathbf{elif}\;t\_0 \leq \infty:\\
        \;\;\;\;k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(1 + k \cdot \left(99 \cdot k - 10\right)\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))) < 5e287

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

              \[\leadsto \frac{1}{\color{blue}{\frac{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}{a}}} \]
            3. lift-+.f64N/A

              \[\leadsto \frac{1}{\frac{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}{a}} \]
            4. lift-fma.f64N/A

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\left(1 + 10 \cdot k\right) + k \cdot k}{a}} \]
            12. lower-unsound-/.f32N/A

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

              \[\leadsto \frac{1}{\frac{\left(1 + 10 \cdot k\right) + k \cdot k}{\color{blue}{a}}} \]
          6. Applied rewrites45.1%

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

          if 5e287 < (/.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 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6422.3

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites22.3%

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

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

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

              \[\leadsto k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right) \]
            3. lower-/.f6421.5

              \[\leadsto k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right) \]
          10. Applied rewrites21.5%

            \[\leadsto k \cdot \mathsf{fma}\left(-10, \color{blue}{a}, \frac{a}{k}\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 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot \color{blue}{a} \]
          6. Applied rewrites45.1%

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

            \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
          8. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            2. lower-*.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            3. lower--.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            4. lower-*.f6430.7

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
          9. Applied rewrites30.7%

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

        Alternative 7: 54.5% accurate, 0.4× 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 5 \cdot 10^{+287}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k - -10, k, 1\right)}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + k \cdot \left(99 \cdot k - 10\right)\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 5e+287)
             (/ a (fma (- k -10.0) k 1.0))
             (if (<= t_0 INFINITY)
               (* k (fma -10.0 a (/ a k)))
               (* (+ 1.0 (* k (- (* 99.0 k) 10.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 <= 5e+287) {
        		tmp = a / fma((k - -10.0), k, 1.0);
        	} else if (t_0 <= ((double) INFINITY)) {
        		tmp = k * fma(-10.0, a, (a / k));
        	} else {
        		tmp = (1.0 + (k * ((99.0 * k) - 10.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 <= 5e+287)
        		tmp = Float64(a / fma(Float64(k - -10.0), k, 1.0));
        	elseif (t_0 <= Inf)
        		tmp = Float64(k * fma(-10.0, a, Float64(a / k)));
        	else
        		tmp = Float64(Float64(1.0 + Float64(k * Float64(Float64(99.0 * k) - 10.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, 5e+287], N[(a / N[(N[(k - -10.0), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(k * N[(-10.0 * a + N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(k * N[(N[(99.0 * k), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $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 5 \cdot 10^{+287}:\\
        \;\;\;\;\frac{a}{\mathsf{fma}\left(k - -10, k, 1\right)}\\
        
        \mathbf{elif}\;t\_0 \leq \infty:\\
        \;\;\;\;k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(1 + k \cdot \left(99 \cdot k - 10\right)\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))) < 5e287

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(k\right)\right)\right)\right) \cdot \left(k + \left(\mathsf{neg}\left(-10\right)\right)\right)} \]
            9. sub-flipN/A

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

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

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

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

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

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k + \color{blue}{1}} \]
            15. lift-fma.f6445.1

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

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

          if 5e287 < (/.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 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6422.3

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites22.3%

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

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

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

              \[\leadsto k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right) \]
            3. lower-/.f6421.5

              \[\leadsto k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right) \]
          10. Applied rewrites21.5%

            \[\leadsto k \cdot \mathsf{fma}\left(-10, \color{blue}{a}, \frac{a}{k}\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 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot \color{blue}{a} \]
          6. Applied rewrites45.1%

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

            \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
          8. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            2. lower-*.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            3. lower--.f64N/A

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
            4. lower-*.f6430.7

              \[\leadsto \left(1 + k \cdot \left(99 \cdot k - 10\right)\right) \cdot a \]
          9. Applied rewrites30.7%

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

        Alternative 8: 47.9% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 5 \cdot 10^{+287}:\\ \;\;\;\;\frac{a}{\mathsf{fma}\left(k - -10, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right)\\ \end{array} \end{array} \]
        (FPCore (a k m)
         :precision binary64
         (if (<= (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))) 5e+287)
           (/ a (fma (- k -10.0) k 1.0))
           (* k (fma -10.0 a (/ a k)))))
        double code(double a, double k, double m) {
        	double tmp;
        	if (((a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 5e+287) {
        		tmp = a / fma((k - -10.0), k, 1.0);
        	} else {
        		tmp = k * fma(-10.0, a, (a / k));
        	}
        	return tmp;
        }
        
        function code(a, k, m)
        	tmp = 0.0
        	if (Float64(Float64(a * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) <= 5e+287)
        		tmp = Float64(a / fma(Float64(k - -10.0), k, 1.0));
        	else
        		tmp = Float64(k * fma(-10.0, a, Float64(a / k)));
        	end
        	return tmp
        end
        
        code[a_, k_, m_] := If[LessEqual[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], 5e+287], N[(a / N[(N[(k - -10.0), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(-10.0 * a + N[(a / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 5 \cdot 10^{+287}:\\
        \;\;\;\;\frac{a}{\mathsf{fma}\left(k - -10, k, 1\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\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))) < 5e287

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(k\right)\right)\right)\right) \cdot \left(k + \left(\mathsf{neg}\left(-10\right)\right)\right)} \]
            9. sub-flipN/A

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

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

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

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

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

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k + \color{blue}{1}} \]
            15. lift-fma.f6445.1

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

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

          if 5e287 < (/.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 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6422.3

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites22.3%

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

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

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

              \[\leadsto k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right) \]
            3. lower-/.f6421.5

              \[\leadsto k \cdot \mathsf{fma}\left(-10, a, \frac{a}{k}\right) \]
          10. Applied rewrites21.5%

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

        Alternative 9: 46.8% accurate, 2.2× speedup?

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

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(k\right)\right)\right)\right) \cdot \left(k + \left(\mathsf{neg}\left(-10\right)\right)\right)} \]
            9. sub-flipN/A

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

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

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

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

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

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k + \color{blue}{1}} \]
            15. lift-fma.f6445.1

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

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

          if 1.60000000000000007e43 < m

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6422.3

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites22.3%

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

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

              \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
            3. lift-*.f64N/A

              \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
            4. lift-*.f64N/A

              \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
            5. *-commutativeN/A

              \[\leadsto -10 \cdot \left(k \cdot a\right) + a \]
            6. associate-*r*N/A

              \[\leadsto \left(-10 \cdot k\right) \cdot a + a \]
            7. metadata-evalN/A

              \[\leadsto \left(\left(\mathsf{neg}\left(10\right)\right) \cdot k\right) \cdot a + a \]
            8. distribute-lft-neg-outN/A

              \[\leadsto \left(\mathsf{neg}\left(10 \cdot k\right)\right) \cdot a + a \]
            9. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(10 \cdot k\right), a, a\right) \]
            10. distribute-lft-neg-outN/A

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

              \[\leadsto \mathsf{fma}\left(-10 \cdot k, a, a\right) \]
            12. lower-*.f6422.3

              \[\leadsto \mathsf{fma}\left(-10 \cdot k, a, a\right) \]
          9. Applied rewrites22.3%

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

        Alternative 10: 31.3% accurate, 2.6× speedup?

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

          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(k\right)\right)\right)\right) \cdot \left(k + \left(\mathsf{neg}\left(-10\right)\right)\right)} \]
            9. sub-flipN/A

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

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

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

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

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

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k + \color{blue}{1}} \]
            15. lift-fma.f6445.1

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

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

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

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

            if 4.4000000000000003e42 < m

            1. Initial program 89.6%

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

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

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

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

                \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
              4. lower-pow.f6445.1

                \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
            4. Applied rewrites45.1%

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

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

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

                \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
              3. lower-*.f6422.3

                \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
            7. Applied rewrites22.3%

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

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

                \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
              3. lift-*.f64N/A

                \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
              4. lift-*.f64N/A

                \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
              5. *-commutativeN/A

                \[\leadsto -10 \cdot \left(k \cdot a\right) + a \]
              6. associate-*r*N/A

                \[\leadsto \left(-10 \cdot k\right) \cdot a + a \]
              7. metadata-evalN/A

                \[\leadsto \left(\left(\mathsf{neg}\left(10\right)\right) \cdot k\right) \cdot a + a \]
              8. distribute-lft-neg-outN/A

                \[\leadsto \left(\mathsf{neg}\left(10 \cdot k\right)\right) \cdot a + a \]
              9. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(10 \cdot k\right), a, a\right) \]
              10. distribute-lft-neg-outN/A

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

                \[\leadsto \mathsf{fma}\left(-10 \cdot k, a, a\right) \]
              12. lower-*.f6422.3

                \[\leadsto \mathsf{fma}\left(-10 \cdot k, a, a\right) \]
            9. Applied rewrites22.3%

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

          Alternative 11: 22.3% accurate, 3.9× speedup?

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6422.3

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites22.3%

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

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

              \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
            3. lift-*.f64N/A

              \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
            4. lift-*.f64N/A

              \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
            5. *-commutativeN/A

              \[\leadsto -10 \cdot \left(k \cdot a\right) + a \]
            6. associate-*r*N/A

              \[\leadsto \left(-10 \cdot k\right) \cdot a + a \]
            7. metadata-evalN/A

              \[\leadsto \left(\left(\mathsf{neg}\left(10\right)\right) \cdot k\right) \cdot a + a \]
            8. distribute-lft-neg-outN/A

              \[\leadsto \left(\mathsf{neg}\left(10 \cdot k\right)\right) \cdot a + a \]
            9. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(10 \cdot k\right), a, a\right) \]
            10. distribute-lft-neg-outN/A

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

              \[\leadsto \mathsf{fma}\left(-10 \cdot k, a, a\right) \]
            12. lower-*.f6422.3

              \[\leadsto \mathsf{fma}\left(-10 \cdot k, a, a\right) \]
          9. Applied rewrites22.3%

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

          Alternative 12: 21.2% accurate, 7.9× speedup?

          \[\begin{array}{l} \\ \frac{a}{1} \end{array} \]
          (FPCore (a k m) :precision binary64 (/ a 1.0))
          double code(double a, double k, double m) {
          	return a / 1.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 = a / 1.0d0
          end function
          
          public static double code(double a, double k, double m) {
          	return a / 1.0;
          }
          
          def code(a, k, m):
          	return a / 1.0
          
          function code(a, k, m)
          	return Float64(a / 1.0)
          end
          
          function tmp = code(a, k, m)
          	tmp = a / 1.0;
          end
          
          code[a_, k_, m_] := N[(a / 1.0), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \frac{a}{1}
          \end{array}
          
          Derivation
          1. Initial program 89.6%

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

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

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

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

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.1

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.1%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(k\right)\right)\right)\right) \cdot \left(k + \left(\mathsf{neg}\left(-10\right)\right)\right)} \]
            9. sub-flipN/A

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

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

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

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

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

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k + \color{blue}{1}} \]
            15. lift-fma.f6445.1

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

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

            \[\leadsto \frac{a}{1} \]
          8. Step-by-step derivation
            1. Applied rewrites21.2%

              \[\leadsto \frac{a}{1} \]
            2. Add Preprocessing

            Reproduce

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