Falkner and Boettcher, Appendix A

Percentage Accurate: 91.0% → 97.6%
Time: 7.7s
Alternatives: 14
Speedup: 1.1×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 91.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 97.6% accurate, 1.0× speedup?

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

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

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

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

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


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

    1. Initial program 96.8%

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

    if 4.4e-17 < m

    1. Initial program 74.4%

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

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

        \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{1}} \]
      2. Taylor expanded in k around inf

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

          \[\leadsto \frac{\color{blue}{e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)} \cdot a}}{{k}^{2}} \]
        2. unpow2N/A

          \[\leadsto \frac{e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)} \cdot a}{\color{blue}{k \cdot k}} \]
        3. times-fracN/A

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

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

          \[\leadsto \color{blue}{\frac{e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}}{k}} \cdot \frac{a}{k} \]
        6. associate-*r*N/A

          \[\leadsto \frac{e^{\color{blue}{\left(-1 \cdot m\right) \cdot \log \left(\frac{1}{k}\right)}}}{k} \cdot \frac{a}{k} \]
        7. exp-prodN/A

          \[\leadsto \frac{\color{blue}{{\left(e^{-1 \cdot m}\right)}^{\log \left(\frac{1}{k}\right)}}}{k} \cdot \frac{a}{k} \]
        8. lower-pow.f64N/A

          \[\leadsto \frac{\color{blue}{{\left(e^{-1 \cdot m}\right)}^{\log \left(\frac{1}{k}\right)}}}{k} \cdot \frac{a}{k} \]
        9. mul-1-negN/A

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

          \[\leadsto \frac{{\color{blue}{\left(e^{\mathsf{neg}\left(m\right)}\right)}}^{\log \left(\frac{1}{k}\right)}}{k} \cdot \frac{a}{k} \]
        11. lower-neg.f64N/A

          \[\leadsto \frac{{\left(e^{\color{blue}{-m}}\right)}^{\log \left(\frac{1}{k}\right)}}{k} \cdot \frac{a}{k} \]
        12. log-recN/A

          \[\leadsto \frac{{\left(e^{-m}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\log k\right)\right)}}}{k} \cdot \frac{a}{k} \]
        13. lower-neg.f64N/A

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

          \[\leadsto \frac{{\left(e^{-m}\right)}^{\left(-\color{blue}{\log k}\right)}}{k} \cdot \frac{a}{k} \]
        15. lower-/.f6441.1

          \[\leadsto \frac{{\left(e^{-m}\right)}^{\left(-\log k\right)}}{k} \cdot \color{blue}{\frac{a}{k}} \]
      4. Applied rewrites41.1%

        \[\leadsto \color{blue}{\frac{{\left(e^{-m}\right)}^{\left(-\log k\right)}}{k} \cdot \frac{a}{k}} \]
      5. Taylor expanded in k around 0

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

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

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

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

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

    Alternative 2: 97.2% accurate, 1.1× speedup?

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

      1. Initial program 87.2%

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

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

          \[\leadsto \frac{a \cdot {k}^{m}}{\color{blue}{1}} \]
        2. Taylor expanded in k around inf

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

            \[\leadsto \frac{\color{blue}{e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)} \cdot a}}{{k}^{2}} \]
          2. unpow2N/A

            \[\leadsto \frac{e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)} \cdot a}{\color{blue}{k \cdot k}} \]
          3. times-fracN/A

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

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

            \[\leadsto \color{blue}{\frac{e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}}{k}} \cdot \frac{a}{k} \]
          6. associate-*r*N/A

            \[\leadsto \frac{e^{\color{blue}{\left(-1 \cdot m\right) \cdot \log \left(\frac{1}{k}\right)}}}{k} \cdot \frac{a}{k} \]
          7. exp-prodN/A

            \[\leadsto \frac{\color{blue}{{\left(e^{-1 \cdot m}\right)}^{\log \left(\frac{1}{k}\right)}}}{k} \cdot \frac{a}{k} \]
          8. lower-pow.f64N/A

            \[\leadsto \frac{\color{blue}{{\left(e^{-1 \cdot m}\right)}^{\log \left(\frac{1}{k}\right)}}}{k} \cdot \frac{a}{k} \]
          9. mul-1-negN/A

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

            \[\leadsto \frac{{\color{blue}{\left(e^{\mathsf{neg}\left(m\right)}\right)}}^{\log \left(\frac{1}{k}\right)}}{k} \cdot \frac{a}{k} \]
          11. lower-neg.f64N/A

            \[\leadsto \frac{{\left(e^{\color{blue}{-m}}\right)}^{\log \left(\frac{1}{k}\right)}}{k} \cdot \frac{a}{k} \]
          12. log-recN/A

            \[\leadsto \frac{{\left(e^{-m}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\log k\right)\right)}}}{k} \cdot \frac{a}{k} \]
          13. lower-neg.f64N/A

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

            \[\leadsto \frac{{\left(e^{-m}\right)}^{\left(-\color{blue}{\log k}\right)}}{k} \cdot \frac{a}{k} \]
          15. lower-/.f6449.5

            \[\leadsto \frac{{\left(e^{-m}\right)}^{\left(-\log k\right)}}{k} \cdot \color{blue}{\frac{a}{k}} \]
        4. Applied rewrites49.5%

          \[\leadsto \color{blue}{\frac{{\left(e^{-m}\right)}^{\left(-\log k\right)}}{k} \cdot \frac{a}{k}} \]
        5. Taylor expanded in k around 0

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

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

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

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

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

        if -5.39999999999999977e-18 < m < 4.4e-17

        1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 73.9% accurate, 3.0× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{99}{{k}^{2}} \cdot a}{k \cdot k} \]
            3. Step-by-step derivation
              1. Applied rewrites74.6%

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

              if -0.440000000000000002 < m < 0.47999999999999998

              1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 0.47999999999999998 < m

              1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 4: 68.9% accurate, 3.3× speedup?

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

                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{a + -10 \cdot \frac{a}{k}}{\color{blue}{{k}^{2}}} \]
                    7. Step-by-step derivation
                      1. Applied rewrites45.0%

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

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

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

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

                          if -0.440000000000000002 < m < 0.47999999999999998

                          1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 0.47999999999999998 < m

                          1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 5: 54.2% accurate, 3.8× speedup?

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

                                1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if -1.69999999999999986e-178 < m < 4.3999999999999998e-78

                                  1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 4.4e-17 < m

                                      1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 6: 70.0% accurate, 4.1× speedup?

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

                                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              if -0.440000000000000002 < m < 0.47999999999999998

                                              1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              if 0.47999999999999998 < m

                                              1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  Alternative 7: 60.2% accurate, 4.5× speedup?

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

                                                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      if -2.70000000000000003e-4 < m < 0.47999999999999998

                                                      1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        if 0.47999999999999998 < m

                                                        1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            Alternative 8: 54.8% accurate, 4.5× speedup?

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

                                                              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                if -1.69999999999999986e-178 < m < 0.26000000000000001

                                                                1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if 0.26000000000000001 < m

                                                                      1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          Alternative 9: 54.8% accurate, 4.5× speedup?

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

                                                                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                              if -1.69999999999999986e-178 < m < 0.26000000000000001

                                                                              1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                    if 0.26000000000000001 < m

                                                                                    1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                        Alternative 10: 37.0% accurate, 6.1× speedup?

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

                                                                                          1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \frac{a}{1} \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites27.6%

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

                                                                                              if 0.26000000000000001 < m

                                                                                              1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  Alternative 11: 26.4% accurate, 7.4× speedup?

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

                                                                                                    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                        \[\leadsto \frac{a}{1} \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites27.3%

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

                                                                                                        if 5.5e15 < m

                                                                                                        1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                            Alternative 12: 26.0% accurate, 7.4× speedup?

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

                                                                                                              1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                if 0.26000000000000001 < m

                                                                                                                1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                    Alternative 13: 25.9% accurate, 7.4× speedup?

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

                                                                                                                      1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                          if 0.26000000000000001 < m

                                                                                                                          1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                              Alternative 14: 8.9% accurate, 12.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                    Reproduce

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