Falkner and Boettcher, Appendix A

Percentage Accurate: 91.0% → 97.5%
Time: 4.8s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 91.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 97.5% accurate, 0.5× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{a\_m \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 5 \cdot 10^{+208}:\\ \;\;\;\;{k}^{m} \cdot \frac{a\_m}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;{k}^{m} \cdot a\_m\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
(FPCore (a_s a_m k m)
 :precision binary64
 (*
  a_s
  (if (<= (/ (* a_m (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))) 5e+208)
    (* (pow k m) (/ a_m (fma (+ 10.0 k) k 1.0)))
    (* (pow k m) a_m))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
double code(double a_s, double a_m, double k, double m) {
	double tmp;
	if (((a_m * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 5e+208) {
		tmp = pow(k, m) * (a_m / fma((10.0 + k), k, 1.0));
	} else {
		tmp = pow(k, m) * a_m;
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0, a)
function code(a_s, a_m, k, m)
	tmp = 0.0
	if (Float64(Float64(a_m * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) <= 5e+208)
		tmp = Float64((k ^ m) * Float64(a_m / fma(Float64(10.0 + k), k, 1.0)));
	else
		tmp = Float64((k ^ m) * a_m);
	end
	return Float64(a_s * tmp)
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+208], N[(N[Power[k, m], $MachinePrecision] * N[(a$95$m / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)

\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{a\_m \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 5 \cdot 10^{+208}:\\
\;\;\;\;{k}^{m} \cdot \frac{a\_m}{\mathsf{fma}\left(10 + k, k, 1\right)}\\

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


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

    1. Initial program 91.0%

      \[\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. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e208 < (/.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 91.0%

      \[\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. pow2N/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{a}{1} \]
      2. Taylor expanded in k around 0

        \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
      3. Step-by-step derivation
        1. sqr-powN/A

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

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

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

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

          \[\leadsto \left({k}^{\left(\frac{m}{2}\right)} \cdot {k}^{\left(\frac{m}{2}\right)}\right) \cdot a \]
        6. sqr-powN/A

          \[\leadsto {k}^{m} \cdot a \]
        7. lower-pow.f6482.7

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

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

    Alternative 2: 97.4% accurate, 1.0× speedup?

    \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;m \leq -5.4 \cdot 10^{-10}:\\ \;\;\;\;{k}^{m} \cdot \frac{a\_m}{k \cdot k}\\ \mathbf{elif}\;m \leq 5 \cdot 10^{-7}:\\ \;\;\;\;\frac{\mathsf{fma}\left(a\_m \cdot m, \log k, a\_m\right)}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;{k}^{m} \cdot a\_m\\ \end{array} \end{array} \]
    a\_m = (fabs.f64 a)
    a\_s = (copysign.f64 #s(literal 1 binary64) a)
    (FPCore (a_s a_m k m)
     :precision binary64
     (*
      a_s
      (if (<= m -5.4e-10)
        (* (pow k m) (/ a_m (* k k)))
        (if (<= m 5e-7)
          (/ (fma (* a_m m) (log k) a_m) (fma (+ 10.0 k) k 1.0))
          (* (pow k m) a_m)))))
    a\_m = fabs(a);
    a\_s = copysign(1.0, a);
    double code(double a_s, double a_m, double k, double m) {
    	double tmp;
    	if (m <= -5.4e-10) {
    		tmp = pow(k, m) * (a_m / (k * k));
    	} else if (m <= 5e-7) {
    		tmp = fma((a_m * m), log(k), a_m) / fma((10.0 + k), k, 1.0);
    	} else {
    		tmp = pow(k, m) * a_m;
    	}
    	return a_s * tmp;
    }
    
    a\_m = abs(a)
    a\_s = copysign(1.0, a)
    function code(a_s, a_m, k, m)
    	tmp = 0.0
    	if (m <= -5.4e-10)
    		tmp = Float64((k ^ m) * Float64(a_m / Float64(k * k)));
    	elseif (m <= 5e-7)
    		tmp = Float64(fma(Float64(a_m * m), log(k), a_m) / fma(Float64(10.0 + k), k, 1.0));
    	else
    		tmp = Float64((k ^ m) * a_m);
    	end
    	return Float64(a_s * tmp)
    end
    
    a\_m = N[Abs[a], $MachinePrecision]
    a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -5.4e-10], N[(N[Power[k, m], $MachinePrecision] * N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5e-7], N[(N[(N[(a$95$m * m), $MachinePrecision] * N[Log[k], $MachinePrecision] + a$95$m), $MachinePrecision] / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]]]), $MachinePrecision]
    
    \begin{array}{l}
    a\_m = \left|a\right|
    \\
    a\_s = \mathsf{copysign}\left(1, a\right)
    
    \\
    a\_s \cdot \begin{array}{l}
    \mathbf{if}\;m \leq -5.4 \cdot 10^{-10}:\\
    \;\;\;\;{k}^{m} \cdot \frac{a\_m}{k \cdot k}\\
    
    \mathbf{elif}\;m \leq 5 \cdot 10^{-7}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(a\_m \cdot m, \log k, a\_m\right)}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;{k}^{m} \cdot a\_m\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if m < -5.4e-10

      1. Initial program 91.0%

        \[\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. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{{k}^{m} \cdot a}{\color{blue}{{k}^{2}}} \]
      5. Step-by-step derivation
        1. pow2N/A

          \[\leadsto \frac{{k}^{m} \cdot a}{k \cdot \color{blue}{k}} \]
        2. lower-*.f6465.4

          \[\leadsto \frac{{k}^{m} \cdot a}{k \cdot \color{blue}{k}} \]
      6. Applied rewrites65.4%

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

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

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

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

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

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

          \[\leadsto \color{blue}{{k}^{m} \cdot \frac{a}{k \cdot k}} \]
        7. lift-pow.f6460.9

          \[\leadsto \color{blue}{{k}^{m}} \cdot \frac{a}{k \cdot k} \]
      8. Applied rewrites60.9%

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

      if -5.4e-10 < m < 4.99999999999999977e-7

      1. Initial program 91.0%

        \[\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)} + \frac{a \cdot \left(m \cdot \log k\right)}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
      3. Step-by-step derivation
        1. div-add-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(a \cdot m, \log k, a\right)}{\mathsf{fma}\left(\color{blue}{10} + k, k, 1\right)} \]
        9. lift-log.f6440.5

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

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

      if 4.99999999999999977e-7 < m

      1. Initial program 91.0%

        \[\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. pow2N/A

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

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

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

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

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

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

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

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

          \[\leadsto \frac{a}{1} \]
        2. Taylor expanded in k around 0

          \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
        3. Step-by-step derivation
          1. sqr-powN/A

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

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

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

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

            \[\leadsto \left({k}^{\left(\frac{m}{2}\right)} \cdot {k}^{\left(\frac{m}{2}\right)}\right) \cdot a \]
          6. sqr-powN/A

            \[\leadsto {k}^{m} \cdot a \]
          7. lower-pow.f6482.7

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

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

      Alternative 3: 97.2% accurate, 1.0× speedup?

      \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ \begin{array}{l} t_0 := {k}^{m} \cdot a\_m\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;m \leq -8.5 \cdot 10^{-5}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;m \leq 5 \cdot 10^{-7}:\\ \;\;\;\;\frac{\mathsf{fma}\left(a\_m \cdot m, \log k, a\_m\right)}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
      a\_m = (fabs.f64 a)
      a\_s = (copysign.f64 #s(literal 1 binary64) a)
      (FPCore (a_s a_m k m)
       :precision binary64
       (let* ((t_0 (* (pow k m) a_m)))
         (*
          a_s
          (if (<= m -8.5e-5)
            t_0
            (if (<= m 5e-7)
              (/ (fma (* a_m m) (log k) a_m) (fma (+ 10.0 k) k 1.0))
              t_0)))))
      a\_m = fabs(a);
      a\_s = copysign(1.0, a);
      double code(double a_s, double a_m, double k, double m) {
      	double t_0 = pow(k, m) * a_m;
      	double tmp;
      	if (m <= -8.5e-5) {
      		tmp = t_0;
      	} else if (m <= 5e-7) {
      		tmp = fma((a_m * m), log(k), a_m) / fma((10.0 + k), k, 1.0);
      	} else {
      		tmp = t_0;
      	}
      	return a_s * tmp;
      }
      
      a\_m = abs(a)
      a\_s = copysign(1.0, a)
      function code(a_s, a_m, k, m)
      	t_0 = Float64((k ^ m) * a_m)
      	tmp = 0.0
      	if (m <= -8.5e-5)
      		tmp = t_0;
      	elseif (m <= 5e-7)
      		tmp = Float64(fma(Float64(a_m * m), log(k), a_m) / fma(Float64(10.0 + k), k, 1.0));
      	else
      		tmp = t_0;
      	end
      	return Float64(a_s * tmp)
      end
      
      a\_m = N[Abs[a], $MachinePrecision]
      a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]}, N[(a$95$s * If[LessEqual[m, -8.5e-5], t$95$0, If[LessEqual[m, 5e-7], N[(N[(N[(a$95$m * m), $MachinePrecision] * N[Log[k], $MachinePrecision] + a$95$m), $MachinePrecision] / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
      
      \begin{array}{l}
      a\_m = \left|a\right|
      \\
      a\_s = \mathsf{copysign}\left(1, a\right)
      
      \\
      \begin{array}{l}
      t_0 := {k}^{m} \cdot a\_m\\
      a\_s \cdot \begin{array}{l}
      \mathbf{if}\;m \leq -8.5 \cdot 10^{-5}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;m \leq 5 \cdot 10^{-7}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(a\_m \cdot m, \log k, a\_m\right)}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if m < -8.500000000000001e-5 or 4.99999999999999977e-7 < m

        1. Initial program 91.0%

          \[\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. pow2N/A

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

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

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

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

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

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

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

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

            \[\leadsto \frac{a}{1} \]
          2. Taylor expanded in k around 0

            \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
          3. Step-by-step derivation
            1. sqr-powN/A

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

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

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

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

              \[\leadsto \left({k}^{\left(\frac{m}{2}\right)} \cdot {k}^{\left(\frac{m}{2}\right)}\right) \cdot a \]
            6. sqr-powN/A

              \[\leadsto {k}^{m} \cdot a \]
            7. lower-pow.f6482.7

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

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

          if -8.500000000000001e-5 < m < 4.99999999999999977e-7

          1. Initial program 91.0%

            \[\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)} + \frac{a \cdot \left(m \cdot \log k\right)}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. div-add-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\mathsf{fma}\left(a \cdot m, \log k, a\right)}{\mathsf{fma}\left(\color{blue}{10} + k, k, 1\right)} \]
            9. lift-log.f6440.5

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

            \[\leadsto \frac{\mathsf{fma}\left(a \cdot m, \log k, a\right)}{\mathsf{fma}\left(\color{blue}{10 + k}, k, 1\right)} \]
        7. Recombined 2 regimes into one program.
        8. Add Preprocessing

        Alternative 4: 97.1% accurate, 1.3× speedup?

        \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ \begin{array}{l} t_0 := {k}^{m} \cdot a\_m\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;m \leq -8.5 \cdot 10^{-5}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;m \leq 4 \cdot 10^{-9}:\\ \;\;\;\;\frac{a\_m}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
        a\_m = (fabs.f64 a)
        a\_s = (copysign.f64 #s(literal 1 binary64) a)
        (FPCore (a_s a_m k m)
         :precision binary64
         (let* ((t_0 (* (pow k m) a_m)))
           (*
            a_s
            (if (<= m -8.5e-5)
              t_0
              (if (<= m 4e-9) (/ a_m (fma (+ 10.0 k) k 1.0)) t_0)))))
        a\_m = fabs(a);
        a\_s = copysign(1.0, a);
        double code(double a_s, double a_m, double k, double m) {
        	double t_0 = pow(k, m) * a_m;
        	double tmp;
        	if (m <= -8.5e-5) {
        		tmp = t_0;
        	} else if (m <= 4e-9) {
        		tmp = a_m / fma((10.0 + k), k, 1.0);
        	} else {
        		tmp = t_0;
        	}
        	return a_s * tmp;
        }
        
        a\_m = abs(a)
        a\_s = copysign(1.0, a)
        function code(a_s, a_m, k, m)
        	t_0 = Float64((k ^ m) * a_m)
        	tmp = 0.0
        	if (m <= -8.5e-5)
        		tmp = t_0;
        	elseif (m <= 4e-9)
        		tmp = Float64(a_m / fma(Float64(10.0 + k), k, 1.0));
        	else
        		tmp = t_0;
        	end
        	return Float64(a_s * tmp)
        end
        
        a\_m = N[Abs[a], $MachinePrecision]
        a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(N[Power[k, m], $MachinePrecision] * a$95$m), $MachinePrecision]}, N[(a$95$s * If[LessEqual[m, -8.5e-5], t$95$0, If[LessEqual[m, 4e-9], N[(a$95$m / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
        
        \begin{array}{l}
        a\_m = \left|a\right|
        \\
        a\_s = \mathsf{copysign}\left(1, a\right)
        
        \\
        \begin{array}{l}
        t_0 := {k}^{m} \cdot a\_m\\
        a\_s \cdot \begin{array}{l}
        \mathbf{if}\;m \leq -8.5 \cdot 10^{-5}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;m \leq 4 \cdot 10^{-9}:\\
        \;\;\;\;\frac{a\_m}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if m < -8.500000000000001e-5 or 4.00000000000000025e-9 < m

          1. Initial program 91.0%

            \[\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. pow2N/A

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

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

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

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

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

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

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

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

              \[\leadsto \frac{a}{1} \]
            2. Taylor expanded in k around 0

              \[\leadsto \color{blue}{a \cdot {k}^{m}} \]
            3. Step-by-step derivation
              1. sqr-powN/A

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

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

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

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

                \[\leadsto \left({k}^{\left(\frac{m}{2}\right)} \cdot {k}^{\left(\frac{m}{2}\right)}\right) \cdot a \]
              6. sqr-powN/A

                \[\leadsto {k}^{m} \cdot a \]
              7. lower-pow.f6482.7

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

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

            if -8.500000000000001e-5 < m < 4.00000000000000025e-9

            1. Initial program 91.0%

              \[\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. pow2N/A

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

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

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

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

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

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

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

          Alternative 5: 72.2% accurate, 1.8× speedup?

          \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;m \leq -0.22:\\ \;\;\;\;\frac{a\_m}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.3:\\ \;\;\;\;\frac{a\_m}{\mathsf{fma}\left(10 + k, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(k \cdot k\right) \cdot a\_m\right) \cdot 99\\ \end{array} \end{array} \]
          a\_m = (fabs.f64 a)
          a\_s = (copysign.f64 #s(literal 1 binary64) a)
          (FPCore (a_s a_m k m)
           :precision binary64
           (*
            a_s
            (if (<= m -0.22)
              (/ a_m (* k k))
              (if (<= m 1.3) (/ a_m (fma (+ 10.0 k) k 1.0)) (* (* (* k k) a_m) 99.0)))))
          a\_m = fabs(a);
          a\_s = copysign(1.0, a);
          double code(double a_s, double a_m, double k, double m) {
          	double tmp;
          	if (m <= -0.22) {
          		tmp = a_m / (k * k);
          	} else if (m <= 1.3) {
          		tmp = a_m / fma((10.0 + k), k, 1.0);
          	} else {
          		tmp = ((k * k) * a_m) * 99.0;
          	}
          	return a_s * tmp;
          }
          
          a\_m = abs(a)
          a\_s = copysign(1.0, a)
          function code(a_s, a_m, k, m)
          	tmp = 0.0
          	if (m <= -0.22)
          		tmp = Float64(a_m / Float64(k * k));
          	elseif (m <= 1.3)
          		tmp = Float64(a_m / fma(Float64(10.0 + k), k, 1.0));
          	else
          		tmp = Float64(Float64(Float64(k * k) * a_m) * 99.0);
          	end
          	return Float64(a_s * tmp)
          end
          
          a\_m = N[Abs[a], $MachinePrecision]
          a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -0.22], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.3], N[(a$95$m / N[(N[(10.0 + k), $MachinePrecision] * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(k * k), $MachinePrecision] * a$95$m), $MachinePrecision] * 99.0), $MachinePrecision]]]), $MachinePrecision]
          
          \begin{array}{l}
          a\_m = \left|a\right|
          \\
          a\_s = \mathsf{copysign}\left(1, a\right)
          
          \\
          a\_s \cdot \begin{array}{l}
          \mathbf{if}\;m \leq -0.22:\\
          \;\;\;\;\frac{a\_m}{k \cdot k}\\
          
          \mathbf{elif}\;m \leq 1.3:\\
          \;\;\;\;\frac{a\_m}{\mathsf{fma}\left(10 + k, k, 1\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(\left(k \cdot k\right) \cdot a\_m\right) \cdot 99\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if m < -0.220000000000000001

            1. Initial program 91.0%

              \[\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. pow2N/A

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

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

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

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

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

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

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

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

                \[\leadsto \frac{a}{k \cdot k} \]
              2. lower-*.f6435.9

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

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

            if -0.220000000000000001 < m < 1.30000000000000004

            1. Initial program 91.0%

              \[\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. pow2N/A

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

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

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

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

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

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

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

            if 1.30000000000000004 < m

            1. Initial program 91.0%

              \[\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. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a, k, a\right) \]
              5. mul-1-negN/A

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

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

                \[\leadsto \mathsf{fma}\left(\left(-\left(a + -100 \cdot a\right) \cdot k\right) - 10 \cdot a, k, a\right) \]
              8. lower-*.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \left(a \cdot {k}^{2}\right) \cdot 99 \]
              2. lower-*.f64N/A

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

                \[\leadsto \left({k}^{2} \cdot a\right) \cdot 99 \]
              4. lower-*.f64N/A

                \[\leadsto \left({k}^{2} \cdot a\right) \cdot 99 \]
              5. pow2N/A

                \[\leadsto \left(\left(k \cdot k\right) \cdot a\right) \cdot 99 \]
              6. lift-*.f6422.3

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

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

          Alternative 6: 61.8% accurate, 2.0× speedup?

          \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;m \leq -5.9 \cdot 10^{-18}:\\ \;\;\;\;\frac{a\_m}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.3:\\ \;\;\;\;\frac{a\_m}{\mathsf{fma}\left(10, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(k \cdot k\right) \cdot a\_m\right) \cdot 99\\ \end{array} \end{array} \]
          a\_m = (fabs.f64 a)
          a\_s = (copysign.f64 #s(literal 1 binary64) a)
          (FPCore (a_s a_m k m)
           :precision binary64
           (*
            a_s
            (if (<= m -5.9e-18)
              (/ a_m (* k k))
              (if (<= m 1.3) (/ a_m (fma 10.0 k 1.0)) (* (* (* k k) a_m) 99.0)))))
          a\_m = fabs(a);
          a\_s = copysign(1.0, a);
          double code(double a_s, double a_m, double k, double m) {
          	double tmp;
          	if (m <= -5.9e-18) {
          		tmp = a_m / (k * k);
          	} else if (m <= 1.3) {
          		tmp = a_m / fma(10.0, k, 1.0);
          	} else {
          		tmp = ((k * k) * a_m) * 99.0;
          	}
          	return a_s * tmp;
          }
          
          a\_m = abs(a)
          a\_s = copysign(1.0, a)
          function code(a_s, a_m, k, m)
          	tmp = 0.0
          	if (m <= -5.9e-18)
          		tmp = Float64(a_m / Float64(k * k));
          	elseif (m <= 1.3)
          		tmp = Float64(a_m / fma(10.0, k, 1.0));
          	else
          		tmp = Float64(Float64(Float64(k * k) * a_m) * 99.0);
          	end
          	return Float64(a_s * tmp)
          end
          
          a\_m = N[Abs[a], $MachinePrecision]
          a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -5.9e-18], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.3], N[(a$95$m / N[(10.0 * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(k * k), $MachinePrecision] * a$95$m), $MachinePrecision] * 99.0), $MachinePrecision]]]), $MachinePrecision]
          
          \begin{array}{l}
          a\_m = \left|a\right|
          \\
          a\_s = \mathsf{copysign}\left(1, a\right)
          
          \\
          a\_s \cdot \begin{array}{l}
          \mathbf{if}\;m \leq -5.9 \cdot 10^{-18}:\\
          \;\;\;\;\frac{a\_m}{k \cdot k}\\
          
          \mathbf{elif}\;m \leq 1.3:\\
          \;\;\;\;\frac{a\_m}{\mathsf{fma}\left(10, k, 1\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(\left(k \cdot k\right) \cdot a\_m\right) \cdot 99\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if m < -5.90000000000000019e-18

            1. Initial program 91.0%

              \[\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. pow2N/A

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

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

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

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

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

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

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

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

                \[\leadsto \frac{a}{k \cdot k} \]
              2. lower-*.f6435.9

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

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

            if -5.90000000000000019e-18 < m < 1.30000000000000004

            1. Initial program 91.0%

              \[\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. pow2N/A

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

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

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

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

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

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

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

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

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

              if 1.30000000000000004 < m

              1. Initial program 91.0%

                \[\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. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a, k, a\right) \]
                5. mul-1-negN/A

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

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

                  \[\leadsto \mathsf{fma}\left(\left(-\left(a + -100 \cdot a\right) \cdot k\right) - 10 \cdot a, k, a\right) \]
                8. lower-*.f64N/A

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

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

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

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

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

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

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

                  \[\leadsto \left(a \cdot {k}^{2}\right) \cdot 99 \]
                2. lower-*.f64N/A

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

                  \[\leadsto \left({k}^{2} \cdot a\right) \cdot 99 \]
                4. lower-*.f64N/A

                  \[\leadsto \left({k}^{2} \cdot a\right) \cdot 99 \]
                5. pow2N/A

                  \[\leadsto \left(\left(k \cdot k\right) \cdot a\right) \cdot 99 \]
                6. lift-*.f6422.3

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

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

            Alternative 7: 47.1% accurate, 0.3× speedup?

            \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ \begin{array}{l} t_0 := \frac{a\_m}{k \cdot k}\\ t_1 := \frac{a\_m \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 10^{+299}:\\ \;\;\;\;\frac{a\_m}{1}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-10 \cdot a\_m, k, a\_m\right)\\ \end{array} \end{array} \end{array} \]
            a\_m = (fabs.f64 a)
            a\_s = (copysign.f64 #s(literal 1 binary64) a)
            (FPCore (a_s a_m k m)
             :precision binary64
             (let* ((t_0 (/ a_m (* k k)))
                    (t_1 (/ (* a_m (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))))
               (*
                a_s
                (if (<= t_1 0.0)
                  t_0
                  (if (<= t_1 1e+299)
                    (/ a_m 1.0)
                    (if (<= t_1 INFINITY) t_0 (fma (* -10.0 a_m) k a_m)))))))
            a\_m = fabs(a);
            a\_s = copysign(1.0, a);
            double code(double a_s, double a_m, double k, double m) {
            	double t_0 = a_m / (k * k);
            	double t_1 = (a_m * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
            	double tmp;
            	if (t_1 <= 0.0) {
            		tmp = t_0;
            	} else if (t_1 <= 1e+299) {
            		tmp = a_m / 1.0;
            	} else if (t_1 <= ((double) INFINITY)) {
            		tmp = t_0;
            	} else {
            		tmp = fma((-10.0 * a_m), k, a_m);
            	}
            	return a_s * tmp;
            }
            
            a\_m = abs(a)
            a\_s = copysign(1.0, a)
            function code(a_s, a_m, k, m)
            	t_0 = Float64(a_m / Float64(k * k))
            	t_1 = Float64(Float64(a_m * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
            	tmp = 0.0
            	if (t_1 <= 0.0)
            		tmp = t_0;
            	elseif (t_1 <= 1e+299)
            		tmp = Float64(a_m / 1.0);
            	elseif (t_1 <= Inf)
            		tmp = t_0;
            	else
            		tmp = fma(Float64(-10.0 * a_m), k, a_m);
            	end
            	return Float64(a_s * tmp)
            end
            
            a\_m = N[Abs[a], $MachinePrecision]
            a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$1, 0.0], t$95$0, If[LessEqual[t$95$1, 1e+299], N[(a$95$m / 1.0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$0, N[(N[(-10.0 * a$95$m), $MachinePrecision] * k + a$95$m), $MachinePrecision]]]]), $MachinePrecision]]]
            
            \begin{array}{l}
            a\_m = \left|a\right|
            \\
            a\_s = \mathsf{copysign}\left(1, a\right)
            
            \\
            \begin{array}{l}
            t_0 := \frac{a\_m}{k \cdot k}\\
            t_1 := \frac{a\_m \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
            a\_s \cdot \begin{array}{l}
            \mathbf{if}\;t\_1 \leq 0:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;t\_1 \leq 10^{+299}:\\
            \;\;\;\;\frac{a\_m}{1}\\
            
            \mathbf{elif}\;t\_1 \leq \infty:\\
            \;\;\;\;t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(-10 \cdot a\_m, k, a\_m\right)\\
            
            
            \end{array}
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0 or 1.0000000000000001e299 < (/.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 91.0%

                \[\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. pow2N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{a}{k \cdot k} \]
                2. lower-*.f6435.9

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

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

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

              1. Initial program 91.0%

                \[\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. pow2N/A

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

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

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

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

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

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

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

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

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

                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 91.0%

                  \[\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. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a, k, a\right) \]
                  5. mul-1-negN/A

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

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

                    \[\leadsto \mathsf{fma}\left(\left(-\left(a + -100 \cdot a\right) \cdot k\right) - 10 \cdot a, k, a\right) \]
                  8. lower-*.f64N/A

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(-10 \cdot a, k, a\right) \]
                9. Step-by-step derivation
                  1. lower-*.f6421.0

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

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

              Alternative 8: 46.0% accurate, 2.0× speedup?

              \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;m \leq -5.9 \cdot 10^{-18}:\\ \;\;\;\;\frac{a\_m}{k \cdot k}\\ \mathbf{elif}\;m \leq 1.3 \cdot 10^{+31}:\\ \;\;\;\;\frac{a\_m}{\mathsf{fma}\left(10, k, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-10 \cdot a\_m, k, a\_m\right)\\ \end{array} \end{array} \]
              a\_m = (fabs.f64 a)
              a\_s = (copysign.f64 #s(literal 1 binary64) a)
              (FPCore (a_s a_m k m)
               :precision binary64
               (*
                a_s
                (if (<= m -5.9e-18)
                  (/ a_m (* k k))
                  (if (<= m 1.3e+31) (/ a_m (fma 10.0 k 1.0)) (fma (* -10.0 a_m) k a_m)))))
              a\_m = fabs(a);
              a\_s = copysign(1.0, a);
              double code(double a_s, double a_m, double k, double m) {
              	double tmp;
              	if (m <= -5.9e-18) {
              		tmp = a_m / (k * k);
              	} else if (m <= 1.3e+31) {
              		tmp = a_m / fma(10.0, k, 1.0);
              	} else {
              		tmp = fma((-10.0 * a_m), k, a_m);
              	}
              	return a_s * tmp;
              }
              
              a\_m = abs(a)
              a\_s = copysign(1.0, a)
              function code(a_s, a_m, k, m)
              	tmp = 0.0
              	if (m <= -5.9e-18)
              		tmp = Float64(a_m / Float64(k * k));
              	elseif (m <= 1.3e+31)
              		tmp = Float64(a_m / fma(10.0, k, 1.0));
              	else
              		tmp = fma(Float64(-10.0 * a_m), k, a_m);
              	end
              	return Float64(a_s * tmp)
              end
              
              a\_m = N[Abs[a], $MachinePrecision]
              a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
              code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * If[LessEqual[m, -5.9e-18], N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.3e+31], N[(a$95$m / N[(10.0 * k + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(-10.0 * a$95$m), $MachinePrecision] * k + a$95$m), $MachinePrecision]]]), $MachinePrecision]
              
              \begin{array}{l}
              a\_m = \left|a\right|
              \\
              a\_s = \mathsf{copysign}\left(1, a\right)
              
              \\
              a\_s \cdot \begin{array}{l}
              \mathbf{if}\;m \leq -5.9 \cdot 10^{-18}:\\
              \;\;\;\;\frac{a\_m}{k \cdot k}\\
              
              \mathbf{elif}\;m \leq 1.3 \cdot 10^{+31}:\\
              \;\;\;\;\frac{a\_m}{\mathsf{fma}\left(10, k, 1\right)}\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(-10 \cdot a\_m, k, a\_m\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if m < -5.90000000000000019e-18

                1. Initial program 91.0%

                  \[\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. pow2N/A

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{a}{k \cdot k} \]
                  2. lower-*.f6435.9

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

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

                if -5.90000000000000019e-18 < m < 1.3e31

                1. Initial program 91.0%

                  \[\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. pow2N/A

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

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

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

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

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

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

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

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

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

                  if 1.3e31 < m

                  1. Initial program 91.0%

                    \[\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. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a, k, a\right) \]
                    5. mul-1-negN/A

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

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

                      \[\leadsto \mathsf{fma}\left(\left(-\left(a + -100 \cdot a\right) \cdot k\right) - 10 \cdot a, k, a\right) \]
                    8. lower-*.f64N/A

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(-10 \cdot a, k, a\right) \]
                  9. Step-by-step derivation
                    1. lower-*.f6421.0

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

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

                Alternative 9: 44.2% accurate, 0.4× speedup?

                \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ \begin{array}{l} t_0 := \frac{a\_m}{k \cdot k}\\ t_1 := \frac{a\_m \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 10^{+299}:\\ \;\;\;\;\frac{a\_m}{1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
                a\_m = (fabs.f64 a)
                a\_s = (copysign.f64 #s(literal 1 binary64) a)
                (FPCore (a_s a_m k m)
                 :precision binary64
                 (let* ((t_0 (/ a_m (* k k)))
                        (t_1 (/ (* a_m (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))))
                   (* a_s (if (<= t_1 0.0) t_0 (if (<= t_1 1e+299) (/ a_m 1.0) t_0)))))
                a\_m = fabs(a);
                a\_s = copysign(1.0, a);
                double code(double a_s, double a_m, double k, double m) {
                	double t_0 = a_m / (k * k);
                	double t_1 = (a_m * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
                	double tmp;
                	if (t_1 <= 0.0) {
                		tmp = t_0;
                	} else if (t_1 <= 1e+299) {
                		tmp = a_m / 1.0;
                	} else {
                		tmp = t_0;
                	}
                	return a_s * tmp;
                }
                
                a\_m =     private
                a\_s =     private
                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_s, a_m, k, m)
                use fmin_fmax_functions
                    real(8), intent (in) :: a_s
                    real(8), intent (in) :: a_m
                    real(8), intent (in) :: k
                    real(8), intent (in) :: m
                    real(8) :: t_0
                    real(8) :: t_1
                    real(8) :: tmp
                    t_0 = a_m / (k * k)
                    t_1 = (a_m * (k ** m)) / ((1.0d0 + (10.0d0 * k)) + (k * k))
                    if (t_1 <= 0.0d0) then
                        tmp = t_0
                    else if (t_1 <= 1d+299) then
                        tmp = a_m / 1.0d0
                    else
                        tmp = t_0
                    end if
                    code = a_s * tmp
                end function
                
                a\_m = Math.abs(a);
                a\_s = Math.copySign(1.0, a);
                public static double code(double a_s, double a_m, double k, double m) {
                	double t_0 = a_m / (k * k);
                	double t_1 = (a_m * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
                	double tmp;
                	if (t_1 <= 0.0) {
                		tmp = t_0;
                	} else if (t_1 <= 1e+299) {
                		tmp = a_m / 1.0;
                	} else {
                		tmp = t_0;
                	}
                	return a_s * tmp;
                }
                
                a\_m = math.fabs(a)
                a\_s = math.copysign(1.0, a)
                def code(a_s, a_m, k, m):
                	t_0 = a_m / (k * k)
                	t_1 = (a_m * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
                	tmp = 0
                	if t_1 <= 0.0:
                		tmp = t_0
                	elif t_1 <= 1e+299:
                		tmp = a_m / 1.0
                	else:
                		tmp = t_0
                	return a_s * tmp
                
                a\_m = abs(a)
                a\_s = copysign(1.0, a)
                function code(a_s, a_m, k, m)
                	t_0 = Float64(a_m / Float64(k * k))
                	t_1 = Float64(Float64(a_m * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
                	tmp = 0.0
                	if (t_1 <= 0.0)
                		tmp = t_0;
                	elseif (t_1 <= 1e+299)
                		tmp = Float64(a_m / 1.0);
                	else
                		tmp = t_0;
                	end
                	return Float64(a_s * tmp)
                end
                
                a\_m = abs(a);
                a\_s = sign(a) * abs(1.0);
                function tmp_2 = code(a_s, a_m, k, m)
                	t_0 = a_m / (k * k);
                	t_1 = (a_m * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k));
                	tmp = 0.0;
                	if (t_1 <= 0.0)
                		tmp = t_0;
                	elseif (t_1 <= 1e+299)
                		tmp = a_m / 1.0;
                	else
                		tmp = t_0;
                	end
                	tmp_2 = a_s * tmp;
                end
                
                a\_m = N[Abs[a], $MachinePrecision]
                a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                code[a$95$s_, a$95$m_, k_, m_] := Block[{t$95$0 = N[(a$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a$95$m * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[t$95$1, 0.0], t$95$0, If[LessEqual[t$95$1, 1e+299], N[(a$95$m / 1.0), $MachinePrecision], t$95$0]]), $MachinePrecision]]]
                
                \begin{array}{l}
                a\_m = \left|a\right|
                \\
                a\_s = \mathsf{copysign}\left(1, a\right)
                
                \\
                \begin{array}{l}
                t_0 := \frac{a\_m}{k \cdot k}\\
                t_1 := \frac{a\_m \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
                a\_s \cdot \begin{array}{l}
                \mathbf{if}\;t\_1 \leq 0:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;t\_1 \leq 10^{+299}:\\
                \;\;\;\;\frac{a\_m}{1}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0 or 1.0000000000000001e299 < (/.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 91.0%

                    \[\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. pow2N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{a}{k \cdot k} \]
                    2. lower-*.f6435.9

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

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

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

                  1. Initial program 91.0%

                    \[\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. pow2N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{a}{1} \]
                  7. Recombined 2 regimes into one program.
                  8. Add Preprocessing

                  Alternative 10: 20.2% accurate, 7.9× speedup?

                  \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ a\_s \cdot \frac{a\_m}{1} \end{array} \]
                  a\_m = (fabs.f64 a)
                  a\_s = (copysign.f64 #s(literal 1 binary64) a)
                  (FPCore (a_s a_m k m) :precision binary64 (* a_s (/ a_m 1.0)))
                  a\_m = fabs(a);
                  a\_s = copysign(1.0, a);
                  double code(double a_s, double a_m, double k, double m) {
                  	return a_s * (a_m / 1.0);
                  }
                  
                  a\_m =     private
                  a\_s =     private
                  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_s, a_m, k, m)
                  use fmin_fmax_functions
                      real(8), intent (in) :: a_s
                      real(8), intent (in) :: a_m
                      real(8), intent (in) :: k
                      real(8), intent (in) :: m
                      code = a_s * (a_m / 1.0d0)
                  end function
                  
                  a\_m = Math.abs(a);
                  a\_s = Math.copySign(1.0, a);
                  public static double code(double a_s, double a_m, double k, double m) {
                  	return a_s * (a_m / 1.0);
                  }
                  
                  a\_m = math.fabs(a)
                  a\_s = math.copysign(1.0, a)
                  def code(a_s, a_m, k, m):
                  	return a_s * (a_m / 1.0)
                  
                  a\_m = abs(a)
                  a\_s = copysign(1.0, a)
                  function code(a_s, a_m, k, m)
                  	return Float64(a_s * Float64(a_m / 1.0))
                  end
                  
                  a\_m = abs(a);
                  a\_s = sign(a) * abs(1.0);
                  function tmp = code(a_s, a_m, k, m)
                  	tmp = a_s * (a_m / 1.0);
                  end
                  
                  a\_m = N[Abs[a], $MachinePrecision]
                  a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                  code[a$95$s_, a$95$m_, k_, m_] := N[(a$95$s * N[(a$95$m / 1.0), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  a\_m = \left|a\right|
                  \\
                  a\_s = \mathsf{copysign}\left(1, a\right)
                  
                  \\
                  a\_s \cdot \frac{a\_m}{1}
                  \end{array}
                  
                  Derivation
                  1. Initial program 91.0%

                    \[\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. pow2N/A

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

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

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

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

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

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

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

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

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

                    Reproduce

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