Falkner and Boettcher, Appendix A

Percentage Accurate: 90.2% → 99.5%
Time: 6.1s
Alternatives: 14
Speedup: 1.3×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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: 90.2% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5999999999999999e-39 < m < 1.9499999999999999e-14

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, 10, k \cdot k + 1\right)} \]
      13. lower-fma.f6445.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{a}{1 + \frac{k \cdot k}{1 + 10 \cdot k}}}{\color{blue}{1 + 10 \cdot k}} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{\frac{a}{1 + \frac{k \cdot k}{1 + 10 \cdot k}}}{\color{blue}{1 + 10 \cdot k}} \]
    8. Applied rewrites45.7%

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

    if 1.9499999999999999e-14 < m

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
      19. lower--.f6445.8

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

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

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

        \[\leadsto a \cdot \color{blue}{{k}^{m}} \]
      2. lower-pow.f6482.4

        \[\leadsto a \cdot {k}^{\color{blue}{m}} \]
    9. Applied rewrites82.4%

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

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

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
      3. lower-*.f6482.4

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
    11. Applied rewrites82.4%

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

Alternative 2: 99.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if m < -3.2e17 or 1.9499999999999999e-14 < m

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
      19. lower--.f6445.8

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

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

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

        \[\leadsto a \cdot \color{blue}{{k}^{m}} \]
      2. lower-pow.f6482.4

        \[\leadsto a \cdot {k}^{\color{blue}{m}} \]
    9. Applied rewrites82.4%

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

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

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
      3. lower-*.f6482.4

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
    11. Applied rewrites82.4%

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

    if -3.2e17 < m < 1.9499999999999999e-14

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k, 10, k \cdot k + 1\right)} \]
      13. lower-fma.f6445.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{a}{1 + \frac{k \cdot k}{1 + 10 \cdot k}}}{\color{blue}{1 + 10 \cdot k}} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{\frac{a}{1 + \frac{k \cdot k}{1 + 10 \cdot k}}}{\color{blue}{1 + 10 \cdot k}} \]
    8. Applied rewrites45.7%

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

Alternative 3: 98.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.95 \cdot 10^{-14}:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k, \frac{k}{\mathsf{fma}\left(10, k, 1\right)}, 1\right)} \cdot \frac{{k}^{m}}{\mathsf{fma}\left(10, k, 1\right)}\\

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{a}{1 + \frac{k \cdot k}{1 + 10 \cdot k}} \cdot \frac{{k}^{m}}{1 + 10 \cdot k}} \]
      7. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9499999999999999e-14 < m

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
      19. lower--.f6445.8

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

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

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

        \[\leadsto a \cdot \color{blue}{{k}^{m}} \]
      2. lower-pow.f6482.4

        \[\leadsto a \cdot {k}^{\color{blue}{m}} \]
    9. Applied rewrites82.4%

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

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

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
      3. lower-*.f6482.4

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
    11. Applied rewrites82.4%

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

Alternative 4: 98.1% accurate, 1.1× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if m < -3.2e17 or 1.9499999999999999e-14 < m

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
      19. lower--.f6445.8

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

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

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

        \[\leadsto a \cdot \color{blue}{{k}^{m}} \]
      2. lower-pow.f6482.4

        \[\leadsto a \cdot {k}^{\color{blue}{m}} \]
    9. Applied rewrites82.4%

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

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

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
      3. lower-*.f6482.4

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
    11. Applied rewrites82.4%

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

    if -3.2e17 < m < 1.9499999999999999e-14

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 96.1% accurate, 1.3× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if m < -3.2e17 or 1.9499999999999999e-14 < m

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
      19. lower--.f6445.8

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

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

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

        \[\leadsto a \cdot \color{blue}{{k}^{m}} \]
      2. lower-pow.f6482.4

        \[\leadsto a \cdot {k}^{\color{blue}{m}} \]
    9. Applied rewrites82.4%

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

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

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
      3. lower-*.f6482.4

        \[\leadsto {k}^{m} \cdot \color{blue}{a} \]
    11. Applied rewrites82.4%

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

    if -3.2e17 < m < 1.9499999999999999e-14

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\left(10 + k\right) \cdot k + 1} \cdot a \]
      16. lower-fma.f6445.5

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(k - \left(\mathsf{neg}\left(10\right)\right), k, 1\right)} \cdot a \]
      21. metadata-eval45.5

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

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

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

Alternative 6: 62.3% accurate, 0.3× speedup?

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

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

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
      19. lower--.f6445.8

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

      \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{\color{blue}{10 - k}}} \]
    7. Applied rewrites44.9%

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

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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{\left(10 + k\right) \cdot k + 1} \]
      9. lower-fma.f6445.5

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

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k + 10, k, 1\right)} \]
      12. add-flipN/A

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k - \left(\mathsf{neg}\left(10\right)\right), k, 1\right)} \]
      14. metadata-eval45.5

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

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

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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{{k}^{\color{blue}{2}}} \]
      2. lift-pow.f64N/A

        \[\leadsto \frac{a}{{k}^{2}} \]
      3. pow2N/A

        \[\leadsto \frac{a}{k \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot k} \]
      5. div-flipN/A

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

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
      7. metadata-evalN/A

        \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
      8. lift-*.f64N/A

        \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
      9. frac-timesN/A

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

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

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

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

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

        \[\leadsto \left(\frac{-1}{k} \cdot \frac{-1}{k}\right) \cdot a \]
      15. frac-timesN/A

        \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
      16. metadata-evalN/A

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
      17. lift-*.f64N/A

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
      18. lower-/.f6435.9

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
    9. Applied rewrites35.9%

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

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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\left(10 + k\right) \cdot k + 1} \cdot a \]
      16. lower-fma.f6445.5

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(k - \left(\mathsf{neg}\left(10\right)\right), k, 1\right)} \cdot a \]
      21. metadata-eval45.5

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

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

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

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

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

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

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

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

Alternative 7: 57.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;m \leq 9.5:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k - -10, k, 1\right)}\\

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{{k}^{\color{blue}{2}}} \]
      2. lift-pow.f64N/A

        \[\leadsto \frac{a}{{k}^{2}} \]
      3. pow2N/A

        \[\leadsto \frac{a}{k \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot k} \]
      5. div-flipN/A

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

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
      7. metadata-evalN/A

        \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
      8. lift-*.f64N/A

        \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
      9. frac-timesN/A

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

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

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

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

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

        \[\leadsto \left(\frac{-1}{k} \cdot \frac{-1}{k}\right) \cdot a \]
      15. frac-timesN/A

        \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
      16. metadata-evalN/A

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
      17. lift-*.f64N/A

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
      18. lower-/.f6435.9

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
    9. Applied rewrites35.9%

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

    if -3.2e17 < m < 9.5

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{\left(10 + k\right) \cdot k + 1} \]
      9. lower-fma.f6445.5

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

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k + 10, k, 1\right)} \]
      12. add-flipN/A

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k - \left(\mathsf{neg}\left(10\right)\right), k, 1\right)} \]
      14. metadata-eval45.5

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

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

    if 9.5 < m

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\left(10 + k\right) \cdot k + 1} \cdot a \]
      16. lower-fma.f6445.5

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(k - \left(\mathsf{neg}\left(10\right)\right), k, 1\right)} \cdot a \]
      21. metadata-eval45.5

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

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

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

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

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

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

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

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

Alternative 8: 57.1% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;m \leq 1.92:\\
\;\;\;\;\frac{a}{\mathsf{fma}\left(k - -10, k, 1\right)}\\

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{{k}^{\color{blue}{2}}} \]
      2. lift-pow.f64N/A

        \[\leadsto \frac{a}{{k}^{2}} \]
      3. pow2N/A

        \[\leadsto \frac{a}{k \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{a}{k \cdot k} \]
      5. div-flipN/A

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

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
      7. metadata-evalN/A

        \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
      8. lift-*.f64N/A

        \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
      9. frac-timesN/A

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

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

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

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

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

        \[\leadsto \left(\frac{-1}{k} \cdot \frac{-1}{k}\right) \cdot a \]
      15. frac-timesN/A

        \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
      16. metadata-evalN/A

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
      17. lift-*.f64N/A

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
      18. lower-/.f6435.9

        \[\leadsto \frac{1}{k \cdot k} \cdot a \]
    9. Applied rewrites35.9%

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

    if -1.26e20 < m < 1.9199999999999999

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{\left(10 + k\right) \cdot k + 1} \]
      9. lower-fma.f6445.5

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

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k + 10, k, 1\right)} \]
      12. add-flipN/A

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

        \[\leadsto \frac{a}{\mathsf{fma}\left(k - \left(\mathsf{neg}\left(10\right)\right), k, 1\right)} \]
      14. metadata-eval45.5

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

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

    if 1.9199999999999999 < m

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot k\right) \cdot -10 + a \]
      5. lower-fma.f6421.3

        \[\leadsto \mathsf{fma}\left(a \cdot k, -10, a\right) \]
      6. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto -10 \cdot \left(a \cdot k\right) \]
      2. lower-*.f647.7

        \[\leadsto -10 \cdot \left(a \cdot k\right) \]
    12. Applied rewrites7.7%

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

Alternative 9: 47.6% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;m \leq 9.8 \cdot 10^{-80}:\\
\;\;\;\;\frac{a}{1}\\

\mathbf{elif}\;m \leq 1.95 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{a}{k}}{k}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if m < -4.8e-51

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{{k}^{2}} \]
      2. pow2N/A

        \[\leadsto \frac{a}{k \cdot k} \]
      3. lift-*.f6435.8

        \[\leadsto \frac{a}{k \cdot k} \]
    9. Applied rewrites35.8%

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

    if -4.8e-51 < m < 9.79999999999999981e-80

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
      19. lower--.f6445.8

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

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

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

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

      if 9.79999999999999981e-80 < m < 1.9499999999999999e-14

      1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{a}{{k}^{\color{blue}{2}}} \]
        2. lift-pow.f64N/A

          \[\leadsto \frac{a}{{k}^{2}} \]
        3. pow2N/A

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

          \[\leadsto \frac{\frac{a}{k}}{k} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{\frac{a}{k}}{k} \]
        6. lower-/.f6434.5

          \[\leadsto \frac{\frac{a}{k}}{k} \]
      9. Applied rewrites34.5%

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

      if 1.9499999999999999e-14 < m

      1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(a \cdot k\right) \cdot -10 + a \]
        5. lower-fma.f6421.3

          \[\leadsto \mathsf{fma}\left(a \cdot k, -10, a\right) \]
        6. lift-*.f64N/A

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

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

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

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

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

          \[\leadsto -10 \cdot \left(a \cdot k\right) \]
        2. lower-*.f647.7

          \[\leadsto -10 \cdot \left(a \cdot k\right) \]
      12. Applied rewrites7.7%

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

    Alternative 10: 47.5% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{a}{k \cdot k}\\ \mathbf{if}\;m \leq -4.8 \cdot 10^{-51}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;m \leq 2.95 \cdot 10^{-78}:\\ \;\;\;\;\frac{a}{1}\\ \mathbf{elif}\;m \leq 1.95 \cdot 10^{-14}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;-10 \cdot \left(a \cdot k\right)\\ \end{array} \end{array} \]
    (FPCore (a k m)
     :precision binary64
     (let* ((t_0 (/ a (* k k))))
       (if (<= m -4.8e-51)
         t_0
         (if (<= m 2.95e-78)
           (/ a 1.0)
           (if (<= m 1.95e-14) t_0 (* -10.0 (* a k)))))))
    double code(double a, double k, double m) {
    	double t_0 = a / (k * k);
    	double tmp;
    	if (m <= -4.8e-51) {
    		tmp = t_0;
    	} else if (m <= 2.95e-78) {
    		tmp = a / 1.0;
    	} else if (m <= 1.95e-14) {
    		tmp = t_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) :: t_0
        real(8) :: tmp
        t_0 = a / (k * k)
        if (m <= (-4.8d-51)) then
            tmp = t_0
        else if (m <= 2.95d-78) then
            tmp = a / 1.0d0
        else if (m <= 1.95d-14) then
            tmp = t_0
        else
            tmp = (-10.0d0) * (a * k)
        end if
        code = tmp
    end function
    
    public static double code(double a, double k, double m) {
    	double t_0 = a / (k * k);
    	double tmp;
    	if (m <= -4.8e-51) {
    		tmp = t_0;
    	} else if (m <= 2.95e-78) {
    		tmp = a / 1.0;
    	} else if (m <= 1.95e-14) {
    		tmp = t_0;
    	} else {
    		tmp = -10.0 * (a * k);
    	}
    	return tmp;
    }
    
    def code(a, k, m):
    	t_0 = a / (k * k)
    	tmp = 0
    	if m <= -4.8e-51:
    		tmp = t_0
    	elif m <= 2.95e-78:
    		tmp = a / 1.0
    	elif m <= 1.95e-14:
    		tmp = t_0
    	else:
    		tmp = -10.0 * (a * k)
    	return tmp
    
    function code(a, k, m)
    	t_0 = Float64(a / Float64(k * k))
    	tmp = 0.0
    	if (m <= -4.8e-51)
    		tmp = t_0;
    	elseif (m <= 2.95e-78)
    		tmp = Float64(a / 1.0);
    	elseif (m <= 1.95e-14)
    		tmp = t_0;
    	else
    		tmp = Float64(-10.0 * Float64(a * k));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, k, m)
    	t_0 = a / (k * k);
    	tmp = 0.0;
    	if (m <= -4.8e-51)
    		tmp = t_0;
    	elseif (m <= 2.95e-78)
    		tmp = a / 1.0;
    	elseif (m <= 1.95e-14)
    		tmp = t_0;
    	else
    		tmp = -10.0 * (a * k);
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, k_, m_] := Block[{t$95$0 = N[(a / N[(k * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -4.8e-51], t$95$0, If[LessEqual[m, 2.95e-78], N[(a / 1.0), $MachinePrecision], If[LessEqual[m, 1.95e-14], t$95$0, N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{a}{k \cdot k}\\
    \mathbf{if}\;m \leq -4.8 \cdot 10^{-51}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;m \leq 2.95 \cdot 10^{-78}:\\
    \;\;\;\;\frac{a}{1}\\
    
    \mathbf{elif}\;m \leq 1.95 \cdot 10^{-14}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;-10 \cdot \left(a \cdot k\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if m < -4.8e-51 or 2.9500000000000002e-78 < m < 1.9499999999999999e-14

      1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{a}{{k}^{2}} \]
        2. pow2N/A

          \[\leadsto \frac{a}{k \cdot k} \]
        3. lift-*.f6435.8

          \[\leadsto \frac{a}{k \cdot k} \]
      9. Applied rewrites35.8%

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

      if -4.8e-51 < m < 2.9500000000000002e-78

      1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
        19. lower--.f6445.8

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

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

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

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

        if 1.9499999999999999e-14 < m

        1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(a \cdot k\right) \cdot -10 + a \]
          5. lower-fma.f6421.3

            \[\leadsto \mathsf{fma}\left(a \cdot k, -10, a\right) \]
          6. lift-*.f64N/A

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

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

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

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

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

            \[\leadsto -10 \cdot \left(a \cdot k\right) \]
          2. lower-*.f647.7

            \[\leadsto -10 \cdot \left(a \cdot k\right) \]
        12. Applied rewrites7.7%

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

      Alternative 11: 42.8% accurate, 2.0× speedup?

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

        1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{a}{{k}^{\color{blue}{2}}} \]
          2. lift-pow.f64N/A

            \[\leadsto \frac{a}{{k}^{2}} \]
          3. pow2N/A

            \[\leadsto \frac{a}{k \cdot k} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{a}{k \cdot k} \]
          5. div-flipN/A

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

            \[\leadsto \frac{1}{k \cdot k} \cdot a \]
          7. metadata-evalN/A

            \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
          8. lift-*.f64N/A

            \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
          9. frac-timesN/A

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

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

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

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

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

            \[\leadsto \left(\frac{-1}{k} \cdot \frac{-1}{k}\right) \cdot a \]
          15. frac-timesN/A

            \[\leadsto \frac{-1 \cdot -1}{k \cdot k} \cdot a \]
          16. metadata-evalN/A

            \[\leadsto \frac{1}{k \cdot k} \cdot a \]
          17. lift-*.f64N/A

            \[\leadsto \frac{1}{k \cdot k} \cdot a \]
          18. lower-/.f6435.9

            \[\leadsto \frac{1}{k \cdot k} \cdot a \]
        9. Applied rewrites35.9%

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

        if -1.6200000000000001e-50 < m < 1.9199999999999999

        1. Initial program 90.2%

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

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

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

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

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

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

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

          \[\leadsto \frac{a}{1 + 10 \cdot \color{blue}{k}} \]
        6. Step-by-step derivation
          1. lower-*.f6428.9

            \[\leadsto \frac{a}{1 + 10 \cdot k} \]
        7. Applied rewrites28.9%

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

        if 1.9199999999999999 < m

        1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(a \cdot k\right) \cdot -10 + a \]
          5. lower-fma.f6421.3

            \[\leadsto \mathsf{fma}\left(a \cdot k, -10, a\right) \]
          6. lift-*.f64N/A

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

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

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

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

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

            \[\leadsto -10 \cdot \left(a \cdot k\right) \]
          2. lower-*.f647.7

            \[\leadsto -10 \cdot \left(a \cdot k\right) \]
        12. Applied rewrites7.7%

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

      Alternative 12: 42.6% accurate, 2.0× speedup?

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

        1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{a}{{k}^{2}} \]
          2. pow2N/A

            \[\leadsto \frac{a}{k \cdot k} \]
          3. lift-*.f6435.8

            \[\leadsto \frac{a}{k \cdot k} \]
        9. Applied rewrites35.8%

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

        if -1.6200000000000001e-50 < m < 1.9199999999999999

        1. Initial program 90.2%

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

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

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

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

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

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

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

          \[\leadsto \frac{a}{1 + 10 \cdot \color{blue}{k}} \]
        6. Step-by-step derivation
          1. lower-*.f6428.9

            \[\leadsto \frac{a}{1 + 10 \cdot k} \]
        7. Applied rewrites28.9%

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

        if 1.9199999999999999 < m

        1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(a \cdot k\right) \cdot -10 + a \]
          5. lower-fma.f6421.3

            \[\leadsto \mathsf{fma}\left(a \cdot k, -10, a\right) \]
          6. lift-*.f64N/A

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

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

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

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

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

            \[\leadsto -10 \cdot \left(a \cdot k\right) \]
          2. lower-*.f647.7

            \[\leadsto -10 \cdot \left(a \cdot k\right) \]
        12. Applied rewrites7.7%

          \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
      3. Recombined 3 regimes into one program.
      4. Add Preprocessing

      Alternative 13: 25.4% accurate, 3.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;m \leq 1.92:\\ \;\;\;\;\frac{a}{1}\\ \mathbf{else}:\\ \;\;\;\;-10 \cdot \left(a \cdot k\right)\\ \end{array} \end{array} \]
      (FPCore (a k m)
       :precision binary64
       (if (<= m 1.92) (/ a 1.0) (* -10.0 (* a k))))
      double code(double a, double k, double m) {
      	double tmp;
      	if (m <= 1.92) {
      		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 <= 1.92d0) 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 <= 1.92) {
      		tmp = a / 1.0;
      	} else {
      		tmp = -10.0 * (a * k);
      	}
      	return tmp;
      }
      
      def code(a, k, m):
      	tmp = 0
      	if m <= 1.92:
      		tmp = a / 1.0
      	else:
      		tmp = -10.0 * (a * k)
      	return tmp
      
      function code(a, k, m)
      	tmp = 0.0
      	if (m <= 1.92)
      		tmp = Float64(a / 1.0);
      	else
      		tmp = Float64(-10.0 * Float64(a * k));
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, k, m)
      	tmp = 0.0;
      	if (m <= 1.92)
      		tmp = a / 1.0;
      	else
      		tmp = -10.0 * (a * k);
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, k_, m_] := If[LessEqual[m, 1.92], N[(a / 1.0), $MachinePrecision], N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;m \leq 1.92:\\
      \;\;\;\;\frac{a}{1}\\
      
      \mathbf{else}:\\
      \;\;\;\;-10 \cdot \left(a \cdot k\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if m < 1.9199999999999999

        1. Initial program 90.2%

          \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
        2. Taylor expanded in m around 0

          \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          2. lower-+.f64N/A

            \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
          3. lower-fma.f64N/A

            \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
          4. lower-pow.f6445.5

            \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
        4. Applied rewrites45.5%

          \[\leadsto \color{blue}{\frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}} \]
        5. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
          2. lift-pow.f64N/A

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          3. pow2N/A

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + k \cdot \color{blue}{k}\right)} \]
          4. distribute-rgt-inN/A

            \[\leadsto \frac{a}{1 + k \cdot \color{blue}{\left(10 + k\right)}} \]
          5. lift-+.f64N/A

            \[\leadsto \frac{a}{1 + k \cdot \left(10 + \color{blue}{k}\right)} \]
          6. *-commutativeN/A

            \[\leadsto \frac{a}{1 + \left(10 + k\right) \cdot \color{blue}{k}} \]
          7. lift-+.f64N/A

            \[\leadsto \frac{a}{1 + \left(10 + k\right) \cdot k} \]
          8. flip-+N/A

            \[\leadsto \frac{a}{1 + \frac{10 \cdot 10 - k \cdot k}{10 - k} \cdot k} \]
          9. associate-*l/N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - k \cdot k\right) \cdot k}{\color{blue}{10 - k}}} \]
          10. lower-/.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - k \cdot k\right) \cdot k}{\color{blue}{10 - k}}} \]
          11. lower-*.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - k \cdot k\right) \cdot k}{\color{blue}{10} - k}} \]
          12. pow2N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - {k}^{2}\right) \cdot k}{10 - k}} \]
          13. lift-pow.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - {k}^{2}\right) \cdot k}{10 - k}} \]
          14. lower--.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - {k}^{2}\right) \cdot k}{10 - k}} \]
          15. metadata-evalN/A

            \[\leadsto \frac{a}{1 + \frac{\left(100 - {k}^{2}\right) \cdot k}{10 - k}} \]
          16. lift-pow.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(100 - {k}^{2}\right) \cdot k}{10 - k}} \]
          17. pow2N/A

            \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
          18. lower-*.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
          19. lower--.f6445.8

            \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - \color{blue}{k}}} \]
        6. Applied rewrites45.8%

          \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{\color{blue}{10 - k}}} \]
        7. Taylor expanded in k around 0

          \[\leadsto \frac{a}{1} \]
        8. Step-by-step derivation
          1. Applied rewrites20.5%

            \[\leadsto \frac{a}{1} \]

          if 1.9199999999999999 < m

          1. Initial program 90.2%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-fma.f64N/A

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
            4. lower-pow.f6445.5

              \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
          4. Applied rewrites45.5%

            \[\leadsto \color{blue}{\frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}} \]
          5. Taylor expanded in k around 0

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          6. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6421.3

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites21.3%

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          8. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
            2. +-commutativeN/A

              \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
            3. lift-*.f64N/A

              \[\leadsto -10 \cdot \left(a \cdot k\right) + a \]
            4. *-commutativeN/A

              \[\leadsto \left(a \cdot k\right) \cdot -10 + a \]
            5. lower-fma.f6421.3

              \[\leadsto \mathsf{fma}\left(a \cdot k, -10, a\right) \]
            6. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(a \cdot k, -10, a\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(k \cdot a, -10, a\right) \]
            8. lower-*.f6421.3

              \[\leadsto \mathsf{fma}\left(k \cdot a, -10, a\right) \]
          9. Applied rewrites21.3%

            \[\leadsto \mathsf{fma}\left(k \cdot a, \color{blue}{-10}, a\right) \]
          10. Taylor expanded in k around inf

            \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
          11. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto -10 \cdot \left(a \cdot k\right) \]
            2. lower-*.f647.7

              \[\leadsto -10 \cdot \left(a \cdot k\right) \]
          12. Applied rewrites7.7%

            \[\leadsto -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
        9. Recombined 2 regimes into one program.
        10. Add Preprocessing

        Alternative 14: 20.5% accurate, 7.9× speedup?

        \[\begin{array}{l} \\ \frac{a}{1} \end{array} \]
        (FPCore (a k m) :precision binary64 (/ a 1.0))
        double code(double a, double k, double m) {
        	return a / 1.0;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(a, k, m)
        use fmin_fmax_functions
            real(8), intent (in) :: a
            real(8), intent (in) :: k
            real(8), intent (in) :: m
            code = a / 1.0d0
        end function
        
        public static double code(double a, double k, double m) {
        	return a / 1.0;
        }
        
        def code(a, k, m):
        	return a / 1.0
        
        function code(a, k, m)
        	return Float64(a / 1.0)
        end
        
        function tmp = code(a, k, m)
        	tmp = a / 1.0;
        end
        
        code[a_, k_, m_] := N[(a / 1.0), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \frac{a}{1}
        \end{array}
        
        Derivation
        1. Initial program 90.2%

          \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
        2. Taylor expanded in m around 0

          \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          2. lower-+.f64N/A

            \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
          3. lower-fma.f64N/A

            \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, \color{blue}{k}, {k}^{2}\right)} \]
          4. lower-pow.f6445.5

            \[\leadsto \frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)} \]
        4. Applied rewrites45.5%

          \[\leadsto \color{blue}{\frac{a}{1 + \mathsf{fma}\left(10, k, {k}^{2}\right)}} \]
        5. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
          2. lift-pow.f64N/A

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          3. pow2N/A

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + k \cdot \color{blue}{k}\right)} \]
          4. distribute-rgt-inN/A

            \[\leadsto \frac{a}{1 + k \cdot \color{blue}{\left(10 + k\right)}} \]
          5. lift-+.f64N/A

            \[\leadsto \frac{a}{1 + k \cdot \left(10 + \color{blue}{k}\right)} \]
          6. *-commutativeN/A

            \[\leadsto \frac{a}{1 + \left(10 + k\right) \cdot \color{blue}{k}} \]
          7. lift-+.f64N/A

            \[\leadsto \frac{a}{1 + \left(10 + k\right) \cdot k} \]
          8. flip-+N/A

            \[\leadsto \frac{a}{1 + \frac{10 \cdot 10 - k \cdot k}{10 - k} \cdot k} \]
          9. associate-*l/N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - k \cdot k\right) \cdot k}{\color{blue}{10 - k}}} \]
          10. lower-/.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - k \cdot k\right) \cdot k}{\color{blue}{10 - k}}} \]
          11. lower-*.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - k \cdot k\right) \cdot k}{\color{blue}{10} - k}} \]
          12. pow2N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - {k}^{2}\right) \cdot k}{10 - k}} \]
          13. lift-pow.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - {k}^{2}\right) \cdot k}{10 - k}} \]
          14. lower--.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(10 \cdot 10 - {k}^{2}\right) \cdot k}{10 - k}} \]
          15. metadata-evalN/A

            \[\leadsto \frac{a}{1 + \frac{\left(100 - {k}^{2}\right) \cdot k}{10 - k}} \]
          16. lift-pow.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(100 - {k}^{2}\right) \cdot k}{10 - k}} \]
          17. pow2N/A

            \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
          18. lower-*.f64N/A

            \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - k}} \]
          19. lower--.f6445.8

            \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{10 - \color{blue}{k}}} \]
        6. Applied rewrites45.8%

          \[\leadsto \frac{a}{1 + \frac{\left(100 - k \cdot k\right) \cdot k}{\color{blue}{10 - k}}} \]
        7. Taylor expanded in k around 0

          \[\leadsto \frac{a}{1} \]
        8. Step-by-step derivation
          1. Applied rewrites20.5%

            \[\leadsto \frac{a}{1} \]
          2. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2025142 
          (FPCore (a k m)
            :name "Falkner and Boettcher, Appendix A"
            :precision binary64
            (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))