Falkner and Boettcher, Appendix A

Percentage Accurate: 90.4% → 99.7%
Time: 5.5s
Alternatives: 14
Speedup: 1.1×

Specification

?
\[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
(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]
\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 90.4% accurate, 1.0× speedup?

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

Alternative 1: 99.7% accurate, 0.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{t\_0}{a} + \left(k - -10\right) \cdot \frac{k}{a \cdot {k}^{m}}}\\


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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{a}{\color{blue}{1} \cdot {k}^{\left(-m\right)}} \]
    7. Step-by-step derivation
      1. Applied rewrites82.8%

        \[\leadsto \frac{a}{\color{blue}{1} \cdot {k}^{\left(-m\right)}} \]

      if 4.9999999999999998e-95 < k

      1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
        20. metadata-eval90.3%

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{{k}^{\left(-m\right)}}{a} + \left(k - -10\right) \cdot \frac{k}{a \cdot {k}^{m}}}} \]
    8. Recombined 2 regimes into one program.
    9. Add Preprocessing

    Alternative 2: 99.3% accurate, 1.0× speedup?

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

      1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.3500000000000001e-25 < m < 1.85e-7

      1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
        20. metadata-eval90.3%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
        4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
        7. lower-/.f6446.0%

          \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
      9. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
        10. mult-flip-revN/A

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

          \[\leadsto \frac{1}{\left(\frac{10}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
        12. div-add-revN/A

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

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
        19. distribute-neg-fracN/A

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

          \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
        21. lower-/.f6446.0%

          \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
      11. Applied rewrites46.0%

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

      if 1.85e-7 < m

      1. Initial program 90.4%

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

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

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

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

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

          \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
        5. lower-pow.f6446.0%

          \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
      4. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
      10. Taylor expanded in k around 0

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

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

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

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

    Alternative 3: 99.3% accurate, 1.0× speedup?

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

      1. Initial program 90.4%

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

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

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

        if -1.3500000000000001e-25 < m < 1.85e-7

        1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
          20. metadata-eval90.3%

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
          4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
          7. lower-/.f6446.0%

            \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
        9. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
          10. mult-flip-revN/A

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

            \[\leadsto \frac{1}{\left(\frac{10}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
          12. div-add-revN/A

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

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

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

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

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

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

            \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
          19. distribute-neg-fracN/A

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

            \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
          21. lower-/.f6446.0%

            \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
        11. Applied rewrites46.0%

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

        if 1.85e-7 < m

        1. Initial program 90.4%

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

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

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

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

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

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
          5. lower-pow.f6446.0%

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
        4. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
        10. Taylor expanded in k around 0

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

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

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

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

      Alternative 4: 98.9% accurate, 1.1× speedup?

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

        1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{a}{\color{blue}{1} \cdot {k}^{\left(-m\right)}} \]
        7. Step-by-step derivation
          1. Applied rewrites82.8%

            \[\leadsto \frac{a}{\color{blue}{1} \cdot {k}^{\left(-m\right)}} \]

          if -2.1499999999999999e-13 < m < 1.85e-7

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
            20. metadata-eval90.3%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
            4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
            7. lower-/.f6446.0%

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
          9. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            10. mult-flip-revN/A

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

              \[\leadsto \frac{1}{\left(\frac{10}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            12. div-add-revN/A

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            19. distribute-neg-fracN/A

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

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
            21. lower-/.f6446.0%

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
          11. Applied rewrites46.0%

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

          if 1.85e-7 < m

          1. Initial program 90.4%

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
          10. Taylor expanded in k around 0

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

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

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

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

        Alternative 5: 98.9% accurate, 1.1× speedup?

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

          1. Initial program 90.4%

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
          10. Taylor expanded in k around 0

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

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

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

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

          if -2.1499999999999999e-13 < m < 1.85e-7

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
            20. metadata-eval90.3%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
            4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
            7. lower-/.f6446.0%

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
          9. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            10. mult-flip-revN/A

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

              \[\leadsto \frac{1}{\left(\frac{10}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            12. div-add-revN/A

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            19. distribute-neg-fracN/A

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

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
            21. lower-/.f6446.0%

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
          11. Applied rewrites46.0%

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

        Alternative 6: 59.0% accurate, 0.2× speedup?

        \[\begin{array}{l} t_0 := \frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\ t_1 := \frac{1}{\left|a\right|}\\ \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{1}{k \cdot \left(k \cdot \left(t\_1 + 10 \cdot \frac{1}{\left|a\right| \cdot k}\right)\right) + t\_1}\\ \mathbf{elif}\;t\_0 \leq 10^{+298}:\\ \;\;\;\;\frac{1}{1 + k \cdot \left(10 + k\right)} \cdot \left|a\right|\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{1}{\frac{\left(\left(k - -10\right) \cdot k\right) \cdot \left|a\right| - \left|a\right| \cdot -1}{\left|a\right| \cdot \left|a\right|}}\\ \mathbf{else}:\\ \;\;\;\;\left|a\right| + k \cdot \left(-1 \cdot \left(k \cdot \left(\left|a\right| + -100 \cdot \left|a\right|\right)\right) - 10 \cdot \left|a\right|\right)\\ \end{array} \end{array} \]
        (FPCore (a k m)
          :precision binary64
          (let* ((t_0 (/ (* (fabs a) (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
               (t_1 (/ 1.0 (fabs a))))
          (*
           (copysign 1.0 a)
           (if (<= t_0 0.0)
             (/
              1.0
              (+ (* k (* k (+ t_1 (* 10.0 (/ 1.0 (* (fabs a) k)))))) t_1))
             (if (<= t_0 1e+298)
               (* (/ 1.0 (+ 1.0 (* k (+ 10.0 k)))) (fabs a))
               (if (<= t_0 INFINITY)
                 (/
                  1.0
                  (/
                   (- (* (* (- k -10.0) k) (fabs a)) (* (fabs a) -1.0))
                   (* (fabs a) (fabs a))))
                 (+
                  (fabs a)
                  (*
                   k
                   (-
                    (* -1.0 (* k (+ (fabs a) (* -100.0 (fabs a)))))
                    (* 10.0 (fabs a)))))))))))
        double code(double a, double k, double m) {
        	double t_0 = (fabs(a) * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
        	double t_1 = 1.0 / fabs(a);
        	double tmp;
        	if (t_0 <= 0.0) {
        		tmp = 1.0 / ((k * (k * (t_1 + (10.0 * (1.0 / (fabs(a) * k)))))) + t_1);
        	} else if (t_0 <= 1e+298) {
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * fabs(a);
        	} else if (t_0 <= ((double) INFINITY)) {
        		tmp = 1.0 / (((((k - -10.0) * k) * fabs(a)) - (fabs(a) * -1.0)) / (fabs(a) * fabs(a)));
        	} else {
        		tmp = fabs(a) + (k * ((-1.0 * (k * (fabs(a) + (-100.0 * fabs(a))))) - (10.0 * fabs(a))));
        	}
        	return copysign(1.0, a) * tmp;
        }
        
        public static double code(double a, double k, double m) {
        	double t_0 = (Math.abs(a) * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
        	double t_1 = 1.0 / Math.abs(a);
        	double tmp;
        	if (t_0 <= 0.0) {
        		tmp = 1.0 / ((k * (k * (t_1 + (10.0 * (1.0 / (Math.abs(a) * k)))))) + t_1);
        	} else if (t_0 <= 1e+298) {
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * Math.abs(a);
        	} else if (t_0 <= Double.POSITIVE_INFINITY) {
        		tmp = 1.0 / (((((k - -10.0) * k) * Math.abs(a)) - (Math.abs(a) * -1.0)) / (Math.abs(a) * Math.abs(a)));
        	} else {
        		tmp = Math.abs(a) + (k * ((-1.0 * (k * (Math.abs(a) + (-100.0 * Math.abs(a))))) - (10.0 * Math.abs(a))));
        	}
        	return Math.copySign(1.0, a) * tmp;
        }
        
        def code(a, k, m):
        	t_0 = (math.fabs(a) * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
        	t_1 = 1.0 / math.fabs(a)
        	tmp = 0
        	if t_0 <= 0.0:
        		tmp = 1.0 / ((k * (k * (t_1 + (10.0 * (1.0 / (math.fabs(a) * k)))))) + t_1)
        	elif t_0 <= 1e+298:
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * math.fabs(a)
        	elif t_0 <= math.inf:
        		tmp = 1.0 / (((((k - -10.0) * k) * math.fabs(a)) - (math.fabs(a) * -1.0)) / (math.fabs(a) * math.fabs(a)))
        	else:
        		tmp = math.fabs(a) + (k * ((-1.0 * (k * (math.fabs(a) + (-100.0 * math.fabs(a))))) - (10.0 * math.fabs(a))))
        	return math.copysign(1.0, a) * tmp
        
        function code(a, k, m)
        	t_0 = Float64(Float64(abs(a) * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
        	t_1 = Float64(1.0 / abs(a))
        	tmp = 0.0
        	if (t_0 <= 0.0)
        		tmp = Float64(1.0 / Float64(Float64(k * Float64(k * Float64(t_1 + Float64(10.0 * Float64(1.0 / Float64(abs(a) * k)))))) + t_1));
        	elseif (t_0 <= 1e+298)
        		tmp = Float64(Float64(1.0 / Float64(1.0 + Float64(k * Float64(10.0 + k)))) * abs(a));
        	elseif (t_0 <= Inf)
        		tmp = Float64(1.0 / Float64(Float64(Float64(Float64(Float64(k - -10.0) * k) * abs(a)) - Float64(abs(a) * -1.0)) / Float64(abs(a) * abs(a))));
        	else
        		tmp = Float64(abs(a) + Float64(k * Float64(Float64(-1.0 * Float64(k * Float64(abs(a) + Float64(-100.0 * abs(a))))) - Float64(10.0 * abs(a)))));
        	end
        	return Float64(copysign(1.0, a) * tmp)
        end
        
        function tmp_2 = code(a, k, m)
        	t_0 = (abs(a) * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k));
        	t_1 = 1.0 / abs(a);
        	tmp = 0.0;
        	if (t_0 <= 0.0)
        		tmp = 1.0 / ((k * (k * (t_1 + (10.0 * (1.0 / (abs(a) * k)))))) + t_1);
        	elseif (t_0 <= 1e+298)
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * abs(a);
        	elseif (t_0 <= Inf)
        		tmp = 1.0 / (((((k - -10.0) * k) * abs(a)) - (abs(a) * -1.0)) / (abs(a) * abs(a)));
        	else
        		tmp = abs(a) + (k * ((-1.0 * (k * (abs(a) + (-100.0 * abs(a))))) - (10.0 * abs(a))));
        	end
        	tmp_2 = (sign(a) * abs(1.0)) * tmp;
        end
        
        code[a_, k_, m_] := Block[{t$95$0 = N[(N[(N[Abs[a], $MachinePrecision] * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Abs[a], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$0, 0.0], N[(1.0 / N[(N[(k * N[(k * N[(t$95$1 + N[(10.0 * N[(1.0 / N[(N[Abs[a], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+298], N[(N[(1.0 / N[(1.0 + N[(k * N[(10.0 + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[a], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(1.0 / N[(N[(N[(N[(N[(k - -10.0), $MachinePrecision] * k), $MachinePrecision] * N[Abs[a], $MachinePrecision]), $MachinePrecision] - N[(N[Abs[a], $MachinePrecision] * -1.0), $MachinePrecision]), $MachinePrecision] / N[(N[Abs[a], $MachinePrecision] * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[a], $MachinePrecision] + N[(k * N[(N[(-1.0 * N[(k * N[(N[Abs[a], $MachinePrecision] + N[(-100.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(10.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
        
        \begin{array}{l}
        t_0 := \frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
        t_1 := \frac{1}{\left|a\right|}\\
        \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
        \mathbf{if}\;t\_0 \leq 0:\\
        \;\;\;\;\frac{1}{k \cdot \left(k \cdot \left(t\_1 + 10 \cdot \frac{1}{\left|a\right| \cdot k}\right)\right) + t\_1}\\
        
        \mathbf{elif}\;t\_0 \leq 10^{+298}:\\
        \;\;\;\;\frac{1}{1 + k \cdot \left(10 + k\right)} \cdot \left|a\right|\\
        
        \mathbf{elif}\;t\_0 \leq \infty:\\
        \;\;\;\;\frac{1}{\frac{\left(\left(k - -10\right) \cdot k\right) \cdot \left|a\right| - \left|a\right| \cdot -1}{\left|a\right| \cdot \left|a\right|}}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|a\right| + k \cdot \left(-1 \cdot \left(k \cdot \left(\left|a\right| + -100 \cdot \left|a\right|\right)\right) - 10 \cdot \left|a\right|\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < 0.0

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
            20. metadata-eval90.3%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
            4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
            7. lower-/.f6446.0%

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
          9. Applied rewrites46.0%

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

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

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

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

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

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

              \[\leadsto \frac{1}{k \cdot \left(k \cdot \left(\frac{1}{a} + 10 \cdot \frac{1}{a \cdot k}\right)\right) + \frac{1}{a}} \]
            6. lower-*.f6446.0%

              \[\leadsto \frac{1}{k \cdot \left(k \cdot \left(\frac{1}{a} + 10 \cdot \frac{1}{a \cdot k}\right)\right) + \frac{1}{a}} \]
          12. Applied rewrites46.0%

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

          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))) < 9.9999999999999996e297

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{1 + k \cdot \color{blue}{\left(10 + k\right)}} \cdot a \]
            4. lower-+.f6446.1%

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

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

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

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
            20. metadata-eval90.3%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
            4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\left(\left(k - -10\right) \cdot k\right) \cdot a - a \cdot -1}{a \cdot a}} \]
            20. lower-*.f6440.3%

              \[\leadsto \frac{1}{\frac{\left(\left(k - -10\right) \cdot k\right) \cdot a - a \cdot -1}{a \cdot \color{blue}{a}}} \]
          8. Applied rewrites40.3%

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

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

          1. Initial program 90.4%

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
          10. 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)} \]
          11. Step-by-step derivation
            1. lower-+.f64N/A

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

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

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

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

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

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

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            8. lower-*.f6427.8%

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
          12. Applied rewrites27.8%

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

        Alternative 7: 57.3% accurate, 2.3× speedup?

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

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
            20. metadata-eval90.3%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
            4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\left(\left(k - -10\right) \cdot k\right) \cdot a - a \cdot -1}{a \cdot a}} \]
            20. lower-*.f6440.3%

              \[\leadsto \frac{1}{\frac{\left(\left(k - -10\right) \cdot k\right) \cdot a - a \cdot -1}{a \cdot \color{blue}{a}}} \]
          8. Applied rewrites40.3%

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

          if -2.5e17 < m < 6.3999999999999997e-5

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
            20. metadata-eval90.3%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
            4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
            7. lower-/.f6446.0%

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
          9. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            10. mult-flip-revN/A

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

              \[\leadsto \frac{1}{\left(\frac{10}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            12. div-add-revN/A

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            19. distribute-neg-fracN/A

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

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
            21. lower-/.f6446.0%

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
          11. Applied rewrites46.0%

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

          if 6.3999999999999997e-5 < m

          1. Initial program 90.4%

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
          10. 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)} \]
          11. Step-by-step derivation
            1. lower-+.f64N/A

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

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

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

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

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

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

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            8. lower-*.f6427.8%

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
          12. Applied rewrites27.8%

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

        Alternative 8: 54.7% accurate, 2.3× speedup?

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

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
            20. metadata-eval90.3%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
            4. lower-+.f6446.0%

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

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

            \[\leadsto \frac{1}{\frac{1 + 10 \cdot k}{a}} \]
          8. Step-by-step derivation
            1. lower-*.f6429.4%

              \[\leadsto \frac{1}{\frac{1 + 10 \cdot k}{a}} \]
          9. Applied rewrites29.4%

            \[\leadsto \frac{1}{\frac{1 + 10 \cdot k}{a}} \]
          10. Step-by-step derivation
            1. lift-/.f64N/A

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

              \[\leadsto \frac{1}{\frac{1 + 10 \cdot k}{a}} \]
            3. +-commutativeN/A

              \[\leadsto \frac{1}{\frac{10 \cdot k + 1}{a}} \]
            4. div-addN/A

              \[\leadsto \frac{1}{\frac{10 \cdot k}{a} + \color{blue}{\frac{1}{a}}} \]
            5. frac-addN/A

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

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

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

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

              \[\leadsto \frac{1}{\frac{\left(10 \cdot k\right) \cdot a + a \cdot 1}{a \cdot a}} \]
            10. lower-*.f6431.9%

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

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

          if -8.9999999999999996e23 < m < 6.3999999999999997e-5

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
            20. metadata-eval90.3%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
            4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
            7. lower-/.f6446.0%

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
          9. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            10. mult-flip-revN/A

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

              \[\leadsto \frac{1}{\left(\frac{10}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            12. div-add-revN/A

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            19. distribute-neg-fracN/A

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

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
            21. lower-/.f6446.0%

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
          11. Applied rewrites46.0%

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

          if 6.3999999999999997e-5 < m

          1. Initial program 90.4%

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

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

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

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

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

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
          10. 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)} \]
          11. Step-by-step derivation
            1. lower-+.f64N/A

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

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

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

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

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

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

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            8. lower-*.f6427.8%

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
          12. Applied rewrites27.8%

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

        Alternative 9: 54.6% accurate, 0.3× speedup?

        \[\begin{array}{l} t_0 := \frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\ \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 10^{+298}:\\ \;\;\;\;\frac{1}{\frac{k - -10}{\left|a\right|} \cdot k - \frac{-1}{\left|a\right|}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;k \cdot \left(-10 \cdot \left|a\right| + \frac{\left|a\right|}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\left|a\right| + k \cdot \left(-1 \cdot \left(k \cdot \left(\left|a\right| + -100 \cdot \left|a\right|\right)\right) - 10 \cdot \left|a\right|\right)\\ \end{array} \end{array} \]
        (FPCore (a k m)
          :precision binary64
          (let* ((t_0
                (/ (* (fabs a) (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))))
          (*
           (copysign 1.0 a)
           (if (<= t_0 1e+298)
             (/ 1.0 (- (* (/ (- k -10.0) (fabs a)) k) (/ -1.0 (fabs a))))
             (if (<= t_0 INFINITY)
               (* k (+ (* -10.0 (fabs a)) (/ (fabs a) k)))
               (+
                (fabs a)
                (*
                 k
                 (-
                  (* -1.0 (* k (+ (fabs a) (* -100.0 (fabs a)))))
                  (* 10.0 (fabs a))))))))))
        double code(double a, double k, double m) {
        	double t_0 = (fabs(a) * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
        	double tmp;
        	if (t_0 <= 1e+298) {
        		tmp = 1.0 / ((((k - -10.0) / fabs(a)) * k) - (-1.0 / fabs(a)));
        	} else if (t_0 <= ((double) INFINITY)) {
        		tmp = k * ((-10.0 * fabs(a)) + (fabs(a) / k));
        	} else {
        		tmp = fabs(a) + (k * ((-1.0 * (k * (fabs(a) + (-100.0 * fabs(a))))) - (10.0 * fabs(a))));
        	}
        	return copysign(1.0, a) * tmp;
        }
        
        public static double code(double a, double k, double m) {
        	double t_0 = (Math.abs(a) * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
        	double tmp;
        	if (t_0 <= 1e+298) {
        		tmp = 1.0 / ((((k - -10.0) / Math.abs(a)) * k) - (-1.0 / Math.abs(a)));
        	} else if (t_0 <= Double.POSITIVE_INFINITY) {
        		tmp = k * ((-10.0 * Math.abs(a)) + (Math.abs(a) / k));
        	} else {
        		tmp = Math.abs(a) + (k * ((-1.0 * (k * (Math.abs(a) + (-100.0 * Math.abs(a))))) - (10.0 * Math.abs(a))));
        	}
        	return Math.copySign(1.0, a) * tmp;
        }
        
        def code(a, k, m):
        	t_0 = (math.fabs(a) * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
        	tmp = 0
        	if t_0 <= 1e+298:
        		tmp = 1.0 / ((((k - -10.0) / math.fabs(a)) * k) - (-1.0 / math.fabs(a)))
        	elif t_0 <= math.inf:
        		tmp = k * ((-10.0 * math.fabs(a)) + (math.fabs(a) / k))
        	else:
        		tmp = math.fabs(a) + (k * ((-1.0 * (k * (math.fabs(a) + (-100.0 * math.fabs(a))))) - (10.0 * math.fabs(a))))
        	return math.copysign(1.0, a) * tmp
        
        function code(a, k, m)
        	t_0 = Float64(Float64(abs(a) * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
        	tmp = 0.0
        	if (t_0 <= 1e+298)
        		tmp = Float64(1.0 / Float64(Float64(Float64(Float64(k - -10.0) / abs(a)) * k) - Float64(-1.0 / abs(a))));
        	elseif (t_0 <= Inf)
        		tmp = Float64(k * Float64(Float64(-10.0 * abs(a)) + Float64(abs(a) / k)));
        	else
        		tmp = Float64(abs(a) + Float64(k * Float64(Float64(-1.0 * Float64(k * Float64(abs(a) + Float64(-100.0 * abs(a))))) - Float64(10.0 * abs(a)))));
        	end
        	return Float64(copysign(1.0, a) * tmp)
        end
        
        function tmp_2 = code(a, k, m)
        	t_0 = (abs(a) * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k));
        	tmp = 0.0;
        	if (t_0 <= 1e+298)
        		tmp = 1.0 / ((((k - -10.0) / abs(a)) * k) - (-1.0 / abs(a)));
        	elseif (t_0 <= Inf)
        		tmp = k * ((-10.0 * abs(a)) + (abs(a) / k));
        	else
        		tmp = abs(a) + (k * ((-1.0 * (k * (abs(a) + (-100.0 * abs(a))))) - (10.0 * abs(a))));
        	end
        	tmp_2 = (sign(a) * abs(1.0)) * tmp;
        end
        
        code[a_, k_, m_] := Block[{t$95$0 = N[(N[(N[Abs[a], $MachinePrecision] * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$0, 1e+298], N[(1.0 / N[(N[(N[(N[(k - -10.0), $MachinePrecision] / N[Abs[a], $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] - N[(-1.0 / N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(k * N[(N[(-10.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision] + N[(N[Abs[a], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[a], $MachinePrecision] + N[(k * N[(N[(-1.0 * N[(k * N[(N[Abs[a], $MachinePrecision] + N[(-100.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(10.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
        
        \begin{array}{l}
        t_0 := \frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
        \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
        \mathbf{if}\;t\_0 \leq 10^{+298}:\\
        \;\;\;\;\frac{1}{\frac{k - -10}{\left|a\right|} \cdot k - \frac{-1}{\left|a\right|}}\\
        
        \mathbf{elif}\;t\_0 \leq \infty:\\
        \;\;\;\;k \cdot \left(-10 \cdot \left|a\right| + \frac{\left|a\right|}{k}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|a\right| + k \cdot \left(-1 \cdot \left(k \cdot \left(\left|a\right| + -100 \cdot \left|a\right|\right)\right) - 10 \cdot \left|a\right|\right)\\
        
        
        \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))) < 9.9999999999999996e297

          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{\color{blue}{\left(k - \left(\mathsf{neg}\left(10\right)\right)\right)} \cdot k - -1}{a \cdot {k}^{m}}} \]
            20. metadata-eval90.3%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1 + k \cdot \left(10 + k\right)}{a}} \]
            4. lower-+.f6446.0%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
            7. lower-/.f6446.0%

              \[\leadsto \frac{1}{k \cdot \left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) + \frac{1}{a}} \]
          9. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\left(10 \cdot \frac{1}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            10. mult-flip-revN/A

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

              \[\leadsto \frac{1}{\left(\frac{10}{a} + \frac{k}{a}\right) \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            12. div-add-revN/A

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \left(\mathsf{neg}\left(\frac{1}{a}\right)\right)} \]
            19. distribute-neg-fracN/A

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{\mathsf{neg}\left(1\right)}{a}} \]
            20. metadata-evalN/A

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
            21. lower-/.f6446.0%

              \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{a}} \]
          11. Applied rewrites46.0%

            \[\leadsto \frac{1}{\frac{k - -10}{a} \cdot k - \frac{-1}{\color{blue}{a}}} \]

          if 9.9999999999999996e297 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          5. Taylor expanded in k around 0

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          6. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6421.6%

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites21.6%

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          8. Taylor expanded in k around inf

            \[\leadsto k \cdot \left(-10 \cdot a + \color{blue}{\frac{a}{k}}\right) \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{\color{blue}{k}}\right) \]
            2. lower-+.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
            3. lower-*.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
            4. lower-/.f6420.2%

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
          10. Applied rewrites20.2%

            \[\leadsto k \cdot \left(-10 \cdot a + \color{blue}{\frac{a}{k}}\right) \]

          if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          5. Taylor expanded in k around 0

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          6. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6421.6%

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites21.6%

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          8. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            2. lift-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
            3. associate-*r*N/A

              \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
            4. lower-*.f64N/A

              \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
            5. lower-*.f6421.5%

              \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
          9. Applied rewrites21.5%

            \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
          10. 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)} \]
          11. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + k \cdot \color{blue}{\left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - \color{blue}{10 \cdot a}\right) \]
            3. lower--.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot \color{blue}{a}\right) \]
            4. lower-*.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            5. lower-*.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            6. lower-+.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            7. lower-*.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            8. lower-*.f6427.8%

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
          12. Applied rewrites27.8%

            \[\leadsto a + \color{blue}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
        3. Recombined 3 regimes into one program.
        4. Add Preprocessing

        Alternative 10: 53.9% accurate, 0.3× speedup?

        \[\begin{array}{l} t_0 := \frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\ \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 10^{+298}:\\ \;\;\;\;\frac{1}{1 + k \cdot \left(10 + k\right)} \cdot \left|a\right|\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;k \cdot \left(-10 \cdot \left|a\right| + \frac{\left|a\right|}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\left|a\right| + k \cdot \left(-1 \cdot \left(k \cdot \left(\left|a\right| + -100 \cdot \left|a\right|\right)\right) - 10 \cdot \left|a\right|\right)\\ \end{array} \end{array} \]
        (FPCore (a k m)
          :precision binary64
          (let* ((t_0
                (/ (* (fabs a) (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))))
          (*
           (copysign 1.0 a)
           (if (<= t_0 1e+298)
             (* (/ 1.0 (+ 1.0 (* k (+ 10.0 k)))) (fabs a))
             (if (<= t_0 INFINITY)
               (* k (+ (* -10.0 (fabs a)) (/ (fabs a) k)))
               (+
                (fabs a)
                (*
                 k
                 (-
                  (* -1.0 (* k (+ (fabs a) (* -100.0 (fabs a)))))
                  (* 10.0 (fabs a))))))))))
        double code(double a, double k, double m) {
        	double t_0 = (fabs(a) * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
        	double tmp;
        	if (t_0 <= 1e+298) {
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * fabs(a);
        	} else if (t_0 <= ((double) INFINITY)) {
        		tmp = k * ((-10.0 * fabs(a)) + (fabs(a) / k));
        	} else {
        		tmp = fabs(a) + (k * ((-1.0 * (k * (fabs(a) + (-100.0 * fabs(a))))) - (10.0 * fabs(a))));
        	}
        	return copysign(1.0, a) * tmp;
        }
        
        public static double code(double a, double k, double m) {
        	double t_0 = (Math.abs(a) * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
        	double tmp;
        	if (t_0 <= 1e+298) {
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * Math.abs(a);
        	} else if (t_0 <= Double.POSITIVE_INFINITY) {
        		tmp = k * ((-10.0 * Math.abs(a)) + (Math.abs(a) / k));
        	} else {
        		tmp = Math.abs(a) + (k * ((-1.0 * (k * (Math.abs(a) + (-100.0 * Math.abs(a))))) - (10.0 * Math.abs(a))));
        	}
        	return Math.copySign(1.0, a) * tmp;
        }
        
        def code(a, k, m):
        	t_0 = (math.fabs(a) * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))
        	tmp = 0
        	if t_0 <= 1e+298:
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * math.fabs(a)
        	elif t_0 <= math.inf:
        		tmp = k * ((-10.0 * math.fabs(a)) + (math.fabs(a) / k))
        	else:
        		tmp = math.fabs(a) + (k * ((-1.0 * (k * (math.fabs(a) + (-100.0 * math.fabs(a))))) - (10.0 * math.fabs(a))))
        	return math.copysign(1.0, a) * tmp
        
        function code(a, k, m)
        	t_0 = Float64(Float64(abs(a) * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k)))
        	tmp = 0.0
        	if (t_0 <= 1e+298)
        		tmp = Float64(Float64(1.0 / Float64(1.0 + Float64(k * Float64(10.0 + k)))) * abs(a));
        	elseif (t_0 <= Inf)
        		tmp = Float64(k * Float64(Float64(-10.0 * abs(a)) + Float64(abs(a) / k)));
        	else
        		tmp = Float64(abs(a) + Float64(k * Float64(Float64(-1.0 * Float64(k * Float64(abs(a) + Float64(-100.0 * abs(a))))) - Float64(10.0 * abs(a)))));
        	end
        	return Float64(copysign(1.0, a) * tmp)
        end
        
        function tmp_2 = code(a, k, m)
        	t_0 = (abs(a) * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k));
        	tmp = 0.0;
        	if (t_0 <= 1e+298)
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * abs(a);
        	elseif (t_0 <= Inf)
        		tmp = k * ((-10.0 * abs(a)) + (abs(a) / k));
        	else
        		tmp = abs(a) + (k * ((-1.0 * (k * (abs(a) + (-100.0 * abs(a))))) - (10.0 * abs(a))));
        	end
        	tmp_2 = (sign(a) * abs(1.0)) * tmp;
        end
        
        code[a_, k_, m_] := Block[{t$95$0 = N[(N[(N[Abs[a], $MachinePrecision] * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$0, 1e+298], N[(N[(1.0 / N[(1.0 + N[(k * N[(10.0 + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[a], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(k * N[(N[(-10.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision] + N[(N[Abs[a], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[a], $MachinePrecision] + N[(k * N[(N[(-1.0 * N[(k * N[(N[Abs[a], $MachinePrecision] + N[(-100.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(10.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
        
        \begin{array}{l}
        t_0 := \frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\\
        \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
        \mathbf{if}\;t\_0 \leq 10^{+298}:\\
        \;\;\;\;\frac{1}{1 + k \cdot \left(10 + k\right)} \cdot \left|a\right|\\
        
        \mathbf{elif}\;t\_0 \leq \infty:\\
        \;\;\;\;k \cdot \left(-10 \cdot \left|a\right| + \frac{\left|a\right|}{k}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|a\right| + k \cdot \left(-1 \cdot \left(k \cdot \left(\left|a\right| + -100 \cdot \left|a\right|\right)\right) - 10 \cdot \left|a\right|\right)\\
        
        
        \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))) < 9.9999999999999996e297

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{a \cdot {k}^{m}}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
            3. associate-/l*N/A

              \[\leadsto \color{blue}{a \cdot \frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}} \]
            4. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
            5. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
          3. Applied rewrites90.5%

            \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(k - -10\right) \cdot k - -1} \cdot a} \]
          4. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{1}{1 + k \cdot \left(10 + k\right)}} \cdot a \]
          5. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{1}{\color{blue}{1 + k \cdot \left(10 + k\right)}} \cdot a \]
            2. lower-+.f64N/A

              \[\leadsto \frac{1}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \cdot a \]
            3. lower-*.f64N/A

              \[\leadsto \frac{1}{1 + k \cdot \color{blue}{\left(10 + k\right)}} \cdot a \]
            4. lower-+.f6446.1%

              \[\leadsto \frac{1}{1 + k \cdot \left(10 + \color{blue}{k}\right)} \cdot a \]
          6. Applied rewrites46.1%

            \[\leadsto \color{blue}{\frac{1}{1 + k \cdot \left(10 + k\right)}} \cdot a \]

          if 9.9999999999999996e297 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k))) < +inf.0

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          5. Taylor expanded in k around 0

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          6. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6421.6%

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites21.6%

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          8. Taylor expanded in k around inf

            \[\leadsto k \cdot \left(-10 \cdot a + \color{blue}{\frac{a}{k}}\right) \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{\color{blue}{k}}\right) \]
            2. lower-+.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
            3. lower-*.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
            4. lower-/.f6420.2%

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
          10. Applied rewrites20.2%

            \[\leadsto k \cdot \left(-10 \cdot a + \color{blue}{\frac{a}{k}}\right) \]

          if +inf.0 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          5. Taylor expanded in k around 0

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          6. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6421.6%

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites21.6%

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          8. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            2. lift-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
            3. associate-*r*N/A

              \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
            4. lower-*.f64N/A

              \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
            5. lower-*.f6421.5%

              \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
          9. Applied rewrites21.5%

            \[\leadsto a + \left(-10 \cdot a\right) \cdot k \]
          10. 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)} \]
          11. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + k \cdot \color{blue}{\left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - \color{blue}{10 \cdot a}\right) \]
            3. lower--.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot \color{blue}{a}\right) \]
            4. lower-*.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            5. lower-*.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            6. lower-+.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            7. lower-*.f64N/A

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
            8. lower-*.f6427.8%

              \[\leadsto a + k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right) \]
          12. Applied rewrites27.8%

            \[\leadsto a + \color{blue}{k \cdot \left(-1 \cdot \left(k \cdot \left(a + -100 \cdot a\right)\right) - 10 \cdot a\right)} \]
        3. Recombined 3 regimes into one program.
        4. Add Preprocessing

        Alternative 11: 50.3% accurate, 0.5× speedup?

        \[\mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 10^{+298}:\\ \;\;\;\;\frac{1}{1 + k \cdot \left(10 + k\right)} \cdot \left|a\right|\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(-10 \cdot \left|a\right| + \frac{\left|a\right|}{k}\right)\\ \end{array} \]
        (FPCore (a k m)
          :precision binary64
          (*
         (copysign 1.0 a)
         (if (<=
              (/ (* (fabs a) (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))
              1e+298)
           (* (/ 1.0 (+ 1.0 (* k (+ 10.0 k)))) (fabs a))
           (* k (+ (* -10.0 (fabs a)) (/ (fabs a) k))))))
        double code(double a, double k, double m) {
        	double tmp;
        	if (((fabs(a) * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+298) {
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * fabs(a);
        	} else {
        		tmp = k * ((-10.0 * fabs(a)) + (fabs(a) / k));
        	}
        	return copysign(1.0, a) * tmp;
        }
        
        public static double code(double a, double k, double m) {
        	double tmp;
        	if (((Math.abs(a) * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+298) {
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * Math.abs(a);
        	} else {
        		tmp = k * ((-10.0 * Math.abs(a)) + (Math.abs(a) / k));
        	}
        	return Math.copySign(1.0, a) * tmp;
        }
        
        def code(a, k, m):
        	tmp = 0
        	if ((math.fabs(a) * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+298:
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * math.fabs(a)
        	else:
        		tmp = k * ((-10.0 * math.fabs(a)) + (math.fabs(a) / k))
        	return math.copysign(1.0, a) * tmp
        
        function code(a, k, m)
        	tmp = 0.0
        	if (Float64(Float64(abs(a) * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) <= 1e+298)
        		tmp = Float64(Float64(1.0 / Float64(1.0 + Float64(k * Float64(10.0 + k)))) * abs(a));
        	else
        		tmp = Float64(k * Float64(Float64(-10.0 * abs(a)) + Float64(abs(a) / k)));
        	end
        	return Float64(copysign(1.0, a) * tmp)
        end
        
        function tmp_2 = code(a, k, m)
        	tmp = 0.0;
        	if (((abs(a) * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+298)
        		tmp = (1.0 / (1.0 + (k * (10.0 + k)))) * abs(a);
        	else
        		tmp = k * ((-10.0 * abs(a)) + (abs(a) / k));
        	end
        	tmp_2 = (sign(a) * abs(1.0)) * tmp;
        end
        
        code[a_, k_, m_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Abs[a], $MachinePrecision] * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+298], N[(N[(1.0 / N[(1.0 + N[(k * N[(10.0 + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[a], $MachinePrecision]), $MachinePrecision], N[(k * N[(N[(-10.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision] + N[(N[Abs[a], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
        
        \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
        \mathbf{if}\;\frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 10^{+298}:\\
        \;\;\;\;\frac{1}{1 + k \cdot \left(10 + k\right)} \cdot \left|a\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;k \cdot \left(-10 \cdot \left|a\right| + \frac{\left|a\right|}{k}\right)\\
        
        
        \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))) < 9.9999999999999996e297

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{a \cdot {k}^{m}}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
            3. associate-/l*N/A

              \[\leadsto \color{blue}{a \cdot \frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}} \]
            4. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
            5. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \cdot a} \]
          3. Applied rewrites90.5%

            \[\leadsto \color{blue}{\frac{{k}^{m}}{\left(k - -10\right) \cdot k - -1} \cdot a} \]
          4. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{1}{1 + k \cdot \left(10 + k\right)}} \cdot a \]
          5. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{1}{\color{blue}{1 + k \cdot \left(10 + k\right)}} \cdot a \]
            2. lower-+.f64N/A

              \[\leadsto \frac{1}{1 + \color{blue}{k \cdot \left(10 + k\right)}} \cdot a \]
            3. lower-*.f64N/A

              \[\leadsto \frac{1}{1 + k \cdot \color{blue}{\left(10 + k\right)}} \cdot a \]
            4. lower-+.f6446.1%

              \[\leadsto \frac{1}{1 + k \cdot \left(10 + \color{blue}{k}\right)} \cdot a \]
          6. Applied rewrites46.1%

            \[\leadsto \color{blue}{\frac{1}{1 + k \cdot \left(10 + k\right)}} \cdot a \]

          if 9.9999999999999996e297 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          5. Taylor expanded in k around 0

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          6. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6421.6%

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites21.6%

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          8. Taylor expanded in k around inf

            \[\leadsto k \cdot \left(-10 \cdot a + \color{blue}{\frac{a}{k}}\right) \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{\color{blue}{k}}\right) \]
            2. lower-+.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
            3. lower-*.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
            4. lower-/.f6420.2%

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
          10. Applied rewrites20.2%

            \[\leadsto k \cdot \left(-10 \cdot a + \color{blue}{\frac{a}{k}}\right) \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 12: 50.3% accurate, 0.5× speedup?

        \[\mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 10^{+298}:\\ \;\;\;\;\frac{\left|a\right|}{\left(k - -10\right) \cdot k - -1}\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(-10 \cdot \left|a\right| + \frac{\left|a\right|}{k}\right)\\ \end{array} \]
        (FPCore (a k m)
          :precision binary64
          (*
         (copysign 1.0 a)
         (if (<=
              (/ (* (fabs a) (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))
              1e+298)
           (/ (fabs a) (- (* (- k -10.0) k) -1.0))
           (* k (+ (* -10.0 (fabs a)) (/ (fabs a) k))))))
        double code(double a, double k, double m) {
        	double tmp;
        	if (((fabs(a) * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+298) {
        		tmp = fabs(a) / (((k - -10.0) * k) - -1.0);
        	} else {
        		tmp = k * ((-10.0 * fabs(a)) + (fabs(a) / k));
        	}
        	return copysign(1.0, a) * tmp;
        }
        
        public static double code(double a, double k, double m) {
        	double tmp;
        	if (((Math.abs(a) * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+298) {
        		tmp = Math.abs(a) / (((k - -10.0) * k) - -1.0);
        	} else {
        		tmp = k * ((-10.0 * Math.abs(a)) + (Math.abs(a) / k));
        	}
        	return Math.copySign(1.0, a) * tmp;
        }
        
        def code(a, k, m):
        	tmp = 0
        	if ((math.fabs(a) * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+298:
        		tmp = math.fabs(a) / (((k - -10.0) * k) - -1.0)
        	else:
        		tmp = k * ((-10.0 * math.fabs(a)) + (math.fabs(a) / k))
        	return math.copysign(1.0, a) * tmp
        
        function code(a, k, m)
        	tmp = 0.0
        	if (Float64(Float64(abs(a) * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) <= 1e+298)
        		tmp = Float64(abs(a) / Float64(Float64(Float64(k - -10.0) * k) - -1.0));
        	else
        		tmp = Float64(k * Float64(Float64(-10.0 * abs(a)) + Float64(abs(a) / k)));
        	end
        	return Float64(copysign(1.0, a) * tmp)
        end
        
        function tmp_2 = code(a, k, m)
        	tmp = 0.0;
        	if (((abs(a) * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+298)
        		tmp = abs(a) / (((k - -10.0) * k) - -1.0);
        	else
        		tmp = k * ((-10.0 * abs(a)) + (abs(a) / k));
        	end
        	tmp_2 = (sign(a) * abs(1.0)) * tmp;
        end
        
        code[a_, k_, m_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Abs[a], $MachinePrecision] * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+298], N[(N[Abs[a], $MachinePrecision] / N[(N[(N[(k - -10.0), $MachinePrecision] * k), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(N[(-10.0 * N[Abs[a], $MachinePrecision]), $MachinePrecision] + N[(N[Abs[a], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
        
        \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
        \mathbf{if}\;\frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 10^{+298}:\\
        \;\;\;\;\frac{\left|a\right|}{\left(k - -10\right) \cdot k - -1}\\
        
        \mathbf{else}:\\
        \;\;\;\;k \cdot \left(-10 \cdot \left|a\right| + \frac{\left|a\right|}{k}\right)\\
        
        
        \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))) < 9.9999999999999996e297

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          5. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
            2. pow2N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + k \cdot \color{blue}{k}\right)} \]
            3. lift-*.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + k \cdot \color{blue}{k}\right)} \]
            4. rem-square-sqrtN/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{k \cdot k} \cdot \color{blue}{\sqrt{k \cdot k}}\right)} \]
            5. sqrt-unprodN/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
            6. lower-*.f32N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
            7. lower-unsound-*.f32N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
            8. lower-sqrt.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
            9. lower-unsound-*.f6446.1%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
          6. Applied rewrites46.1%

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
          7. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)}} \]
            2. +-commutativeN/A

              \[\leadsto \frac{a}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right) + \color{blue}{1}} \]
            3. metadata-evalN/A

              \[\leadsto \frac{a}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right)} \]
            4. sub-flip-reverseN/A

              \[\leadsto \frac{a}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right) - \color{blue}{-1}} \]
            5. lift-+.f64N/A

              \[\leadsto \frac{a}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right) - -1} \]
            6. +-commutativeN/A

              \[\leadsto \frac{a}{\left(\sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} + 10 \cdot k\right) - -1} \]
            7. lift-sqrt.f64N/A

              \[\leadsto \frac{a}{\left(\sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} + 10 \cdot k\right) - -1} \]
            8. lift-*.f64N/A

              \[\leadsto \frac{a}{\left(\sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} + 10 \cdot k\right) - -1} \]
            9. sqrt-unprodN/A

              \[\leadsto \frac{a}{\left(\sqrt{k \cdot k} \cdot \sqrt{k \cdot k} + 10 \cdot k\right) - -1} \]
            10. rem-square-sqrtN/A

              \[\leadsto \frac{a}{\left(k \cdot k + 10 \cdot k\right) - -1} \]
            11. +-commutativeN/A

              \[\leadsto \frac{a}{\left(10 \cdot k + k \cdot k\right) - -1} \]
            12. lift-*.f64N/A

              \[\leadsto \frac{a}{\left(10 \cdot k + k \cdot k\right) - -1} \]
            13. lift-*.f64N/A

              \[\leadsto \frac{a}{\left(10 \cdot k + k \cdot k\right) - -1} \]
            14. distribute-rgt-inN/A

              \[\leadsto \frac{a}{k \cdot \left(10 + k\right) - -1} \]
            15. *-commutativeN/A

              \[\leadsto \frac{a}{\left(10 + k\right) \cdot k - -1} \]
            16. +-commutativeN/A

              \[\leadsto \frac{a}{\left(k + 10\right) \cdot k - -1} \]
            17. metadata-evalN/A

              \[\leadsto \frac{a}{\left(k + \left(\mathsf{neg}\left(-10\right)\right)\right) \cdot k - -1} \]
            18. sub-flipN/A

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k - -1} \]
            19. lift--.f64N/A

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k - -1} \]
            20. lift-*.f64N/A

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k - -1} \]
          8. Applied rewrites46.1%

            \[\leadsto \frac{a}{\color{blue}{\left(k - -10\right) \cdot k - -1}} \]

          if 9.9999999999999996e297 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          5. Taylor expanded in k around 0

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          6. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6421.6%

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites21.6%

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          8. Taylor expanded in k around inf

            \[\leadsto k \cdot \left(-10 \cdot a + \color{blue}{\frac{a}{k}}\right) \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{\color{blue}{k}}\right) \]
            2. lower-+.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
            3. lower-*.f64N/A

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
            4. lower-/.f6420.2%

              \[\leadsto k \cdot \left(-10 \cdot a + \frac{a}{k}\right) \]
          10. Applied rewrites20.2%

            \[\leadsto k \cdot \left(-10 \cdot a + \color{blue}{\frac{a}{k}}\right) \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 13: 47.2% accurate, 0.5× speedup?

        \[\mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 10^{+183}:\\ \;\;\;\;\frac{\left|a\right|}{\left(k - -10\right) \cdot k - -1}\\ \mathbf{else}:\\ \;\;\;\;\left|a\right| + -10 \cdot \left(\left|a\right| \cdot k\right)\\ \end{array} \]
        (FPCore (a k m)
          :precision binary64
          (*
         (copysign 1.0 a)
         (if (<=
              (/ (* (fabs a) (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k)))
              1e+183)
           (/ (fabs a) (- (* (- k -10.0) k) -1.0))
           (+ (fabs a) (* -10.0 (* (fabs a) k))))))
        double code(double a, double k, double m) {
        	double tmp;
        	if (((fabs(a) * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+183) {
        		tmp = fabs(a) / (((k - -10.0) * k) - -1.0);
        	} else {
        		tmp = fabs(a) + (-10.0 * (fabs(a) * k));
        	}
        	return copysign(1.0, a) * tmp;
        }
        
        public static double code(double a, double k, double m) {
        	double tmp;
        	if (((Math.abs(a) * Math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+183) {
        		tmp = Math.abs(a) / (((k - -10.0) * k) - -1.0);
        	} else {
        		tmp = Math.abs(a) + (-10.0 * (Math.abs(a) * k));
        	}
        	return Math.copySign(1.0, a) * tmp;
        }
        
        def code(a, k, m):
        	tmp = 0
        	if ((math.fabs(a) * math.pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+183:
        		tmp = math.fabs(a) / (((k - -10.0) * k) - -1.0)
        	else:
        		tmp = math.fabs(a) + (-10.0 * (math.fabs(a) * k))
        	return math.copysign(1.0, a) * tmp
        
        function code(a, k, m)
        	tmp = 0.0
        	if (Float64(Float64(abs(a) * (k ^ m)) / Float64(Float64(1.0 + Float64(10.0 * k)) + Float64(k * k))) <= 1e+183)
        		tmp = Float64(abs(a) / Float64(Float64(Float64(k - -10.0) * k) - -1.0));
        	else
        		tmp = Float64(abs(a) + Float64(-10.0 * Float64(abs(a) * k)));
        	end
        	return Float64(copysign(1.0, a) * tmp)
        end
        
        function tmp_2 = code(a, k, m)
        	tmp = 0.0;
        	if (((abs(a) * (k ^ m)) / ((1.0 + (10.0 * k)) + (k * k))) <= 1e+183)
        		tmp = abs(a) / (((k - -10.0) * k) - -1.0);
        	else
        		tmp = abs(a) + (-10.0 * (abs(a) * k));
        	end
        	tmp_2 = (sign(a) * abs(1.0)) * tmp;
        end
        
        code[a_, k_, m_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Abs[a], $MachinePrecision] * N[Power[k, m], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(10.0 * k), $MachinePrecision]), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+183], N[(N[Abs[a], $MachinePrecision] / N[(N[(N[(k - -10.0), $MachinePrecision] * k), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(N[Abs[a], $MachinePrecision] + N[(-10.0 * N[(N[Abs[a], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
        
        \mathsf{copysign}\left(1, a\right) \cdot \begin{array}{l}
        \mathbf{if}\;\frac{\left|a\right| \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \leq 10^{+183}:\\
        \;\;\;\;\frac{\left|a\right|}{\left(k - -10\right) \cdot k - -1}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|a\right| + -10 \cdot \left(\left|a\right| \cdot k\right)\\
        
        
        \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))) < 9.9999999999999995e182

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          5. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
            2. pow2N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + k \cdot \color{blue}{k}\right)} \]
            3. lift-*.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + k \cdot \color{blue}{k}\right)} \]
            4. rem-square-sqrtN/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{k \cdot k} \cdot \color{blue}{\sqrt{k \cdot k}}\right)} \]
            5. sqrt-unprodN/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
            6. lower-*.f32N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
            7. lower-unsound-*.f32N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
            8. lower-sqrt.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
            9. lower-unsound-*.f6446.1%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
          6. Applied rewrites46.1%

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)} \]
          7. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right)}} \]
            2. +-commutativeN/A

              \[\leadsto \frac{a}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right) + \color{blue}{1}} \]
            3. metadata-evalN/A

              \[\leadsto \frac{a}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right)} \]
            4. sub-flip-reverseN/A

              \[\leadsto \frac{a}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right) - \color{blue}{-1}} \]
            5. lift-+.f64N/A

              \[\leadsto \frac{a}{\left(10 \cdot k + \sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right) - -1} \]
            6. +-commutativeN/A

              \[\leadsto \frac{a}{\left(\sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} + 10 \cdot k\right) - -1} \]
            7. lift-sqrt.f64N/A

              \[\leadsto \frac{a}{\left(\sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} + 10 \cdot k\right) - -1} \]
            8. lift-*.f64N/A

              \[\leadsto \frac{a}{\left(\sqrt{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} + 10 \cdot k\right) - -1} \]
            9. sqrt-unprodN/A

              \[\leadsto \frac{a}{\left(\sqrt{k \cdot k} \cdot \sqrt{k \cdot k} + 10 \cdot k\right) - -1} \]
            10. rem-square-sqrtN/A

              \[\leadsto \frac{a}{\left(k \cdot k + 10 \cdot k\right) - -1} \]
            11. +-commutativeN/A

              \[\leadsto \frac{a}{\left(10 \cdot k + k \cdot k\right) - -1} \]
            12. lift-*.f64N/A

              \[\leadsto \frac{a}{\left(10 \cdot k + k \cdot k\right) - -1} \]
            13. lift-*.f64N/A

              \[\leadsto \frac{a}{\left(10 \cdot k + k \cdot k\right) - -1} \]
            14. distribute-rgt-inN/A

              \[\leadsto \frac{a}{k \cdot \left(10 + k\right) - -1} \]
            15. *-commutativeN/A

              \[\leadsto \frac{a}{\left(10 + k\right) \cdot k - -1} \]
            16. +-commutativeN/A

              \[\leadsto \frac{a}{\left(k + 10\right) \cdot k - -1} \]
            17. metadata-evalN/A

              \[\leadsto \frac{a}{\left(k + \left(\mathsf{neg}\left(-10\right)\right)\right) \cdot k - -1} \]
            18. sub-flipN/A

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k - -1} \]
            19. lift--.f64N/A

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k - -1} \]
            20. lift-*.f64N/A

              \[\leadsto \frac{a}{\left(k - -10\right) \cdot k - -1} \]
          8. Applied rewrites46.1%

            \[\leadsto \frac{a}{\color{blue}{\left(k - -10\right) \cdot k - -1}} \]

          if 9.9999999999999995e182 < (/.f64 (*.f64 a (pow.f64 k m)) (+.f64 (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 10 binary64) k)) (*.f64 k k)))

          1. Initial program 90.4%

            \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
          2. Taylor expanded in m around 0

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
            2. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
            5. lower-pow.f6446.0%

              \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
          4. Applied rewrites46.0%

            \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          5. Taylor expanded in k around 0

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
          6. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
            2. lower-*.f64N/A

              \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
            3. lower-*.f6421.6%

              \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
          7. Applied rewrites21.6%

            \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 14: 21.6% accurate, 9.6× speedup?

        \[a + -10 \cdot \left(a \cdot k\right) \]
        (FPCore (a k m)
          :precision binary64
          (+ a (* -10.0 (* a k))))
        double code(double a, double k, double m) {
        	return a + (-10.0 * (a * k));
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(a, k, m)
        use fmin_fmax_functions
            real(8), intent (in) :: a
            real(8), intent (in) :: k
            real(8), intent (in) :: m
            code = a + ((-10.0d0) * (a * k))
        end function
        
        public static double code(double a, double k, double m) {
        	return a + (-10.0 * (a * k));
        }
        
        def code(a, k, m):
        	return a + (-10.0 * (a * k))
        
        function code(a, k, m)
        	return Float64(a + Float64(-10.0 * Float64(a * k)))
        end
        
        function tmp = code(a, k, m)
        	tmp = a + (-10.0 * (a * k));
        end
        
        code[a_, k_, m_] := N[(a + N[(-10.0 * N[(a * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        a + -10 \cdot \left(a \cdot k\right)
        
        Derivation
        1. Initial program 90.4%

          \[\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k} \]
        2. Taylor expanded in m around 0

          \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{a}{\color{blue}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
          2. lower-+.f64N/A

            \[\leadsto \frac{a}{1 + \color{blue}{\left(10 \cdot k + {k}^{2}\right)}} \]
          3. lower-+.f64N/A

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + \color{blue}{{k}^{2}}\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + {\color{blue}{k}}^{2}\right)} \]
          5. lower-pow.f6446.0%

            \[\leadsto \frac{a}{1 + \left(10 \cdot k + {k}^{\color{blue}{2}}\right)} \]
        4. Applied rewrites46.0%

          \[\leadsto \color{blue}{\frac{a}{1 + \left(10 \cdot k + {k}^{2}\right)}} \]
        5. Taylor expanded in k around 0

          \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
        6. Step-by-step derivation
          1. lower-+.f64N/A

            \[\leadsto a + -10 \cdot \color{blue}{\left(a \cdot k\right)} \]
          2. lower-*.f64N/A

            \[\leadsto a + -10 \cdot \left(a \cdot \color{blue}{k}\right) \]
          3. lower-*.f6421.6%

            \[\leadsto a + -10 \cdot \left(a \cdot k\right) \]
        7. Applied rewrites21.6%

          \[\leadsto a + \color{blue}{-10 \cdot \left(a \cdot k\right)} \]
        8. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2025258 
        (FPCore (a k m)
          :name "Falkner and Boettcher, Appendix A"
          :precision binary64
          (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))