Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B

Percentage Accurate: 99.8% → 99.8%
Time: 22.7s
Alternatives: 24
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i):
	return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

\[\begin{array}{l} \\ \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i):
	return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}

Alternative 1: 99.8% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right) \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (fma (- b 0.5) (log c) (+ (+ (fma (log y) x z) a) (fma i y t))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fma((b - 0.5), log(c), ((fma(log(y), x, z) + a) + fma(i, y, t)));
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	return fma(Float64(b - 0.5), log(c), Float64(Float64(fma(log(y), x, z) + a) + fma(i, y, t)))
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision] + a), $MachinePrecision] + N[(i * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Applied rewrites99.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)} \]
  3. Add Preprocessing

Alternative 2: 93.5% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a\\ \mathbf{if}\;x \leq -1.7 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 8.6 \cdot 10^{+164}:\\ \;\;\;\;\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (fma i y (fma (log c) (- b 0.5) (fma (log y) x t))) a)))
   (if (<= x -1.7e+160)
     t_1
     (if (<= x 8.6e+164)
       (+ (+ (fma i y z) (fma (log c) (- b 0.5) t)) a)
       t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = fma(i, y, fma(log(c), (b - 0.5), fma(log(y), x, t))) + a;
	double tmp;
	if (x <= -1.7e+160) {
		tmp = t_1;
	} else if (x <= 8.6e+164) {
		tmp = (fma(i, y, z) + fma(log(c), (b - 0.5), t)) + a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), fma(log(y), x, t))) + a)
	tmp = 0.0
	if (x <= -1.7e+160)
		tmp = t_1;
	elseif (x <= 8.6e+164)
		tmp = Float64(Float64(fma(i, y, z) + fma(log(c), Float64(b - 0.5), t)) + a);
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[x, -1.7e+160], t$95$1, If[LessEqual[x, 8.6e+164], N[(N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 8.6 \cdot 10^{+164}:\\
\;\;\;\;\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.70000000000000015e160 or 8.6e164 < x

    1. Initial program 99.5%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in z around 0

      \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
    3. Applied rewrites86.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]

    if -1.70000000000000015e160 < x < 8.6e164

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in x around 0

      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
      2. lower-+.f64N/A

        \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
      3. +-commutativeN/A

        \[\leadsto \left(\left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + t\right) + a \]
      4. associate-+r+N/A

        \[\leadsto \left(\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right) + t\right) + a \]
      5. associate-+l+N/A

        \[\leadsto \left(\left(z + i \cdot y\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
      6. lower-+.f64N/A

        \[\leadsto \left(\left(z + i \cdot y\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
      7. +-commutativeN/A

        \[\leadsto \left(\left(i \cdot y + z\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
      9. lower-fma.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - \frac{1}{2}, t\right)\right) + a \]
      10. lift-log.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - \frac{1}{2}, t\right)\right) + a \]
      11. lift--.f6495.7

        \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a \]
    4. Applied rewrites95.7%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 91.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;i \leq -2.8 \cdot 10^{-44}:\\ \;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{elif}\;i \leq 2200000000000:\\ \;\;\;\;\left(\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\right) + t\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= i -2.8e-44)
   (+ (+ (+ z a) (* (- b 0.5) (log c))) (* y i))
   (if (<= i 2200000000000.0)
     (+ (+ (fma (log y) x (fma (log c) (- b 0.5) z)) a) t)
     (+ (+ (fma i y z) (fma (log c) (- b 0.5) t)) a))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (i <= -2.8e-44) {
		tmp = ((z + a) + ((b - 0.5) * log(c))) + (y * i);
	} else if (i <= 2200000000000.0) {
		tmp = (fma(log(y), x, fma(log(c), (b - 0.5), z)) + a) + t;
	} else {
		tmp = (fma(i, y, z) + fma(log(c), (b - 0.5), t)) + a;
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (i <= -2.8e-44)
		tmp = Float64(Float64(Float64(z + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i));
	elseif (i <= 2200000000000.0)
		tmp = Float64(Float64(fma(log(y), x, fma(log(c), Float64(b - 0.5), z)) + a) + t);
	else
		tmp = Float64(Float64(fma(i, y, z) + fma(log(c), Float64(b - 0.5), t)) + a);
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, -2.8e-44], N[(N[(N[(z + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2200000000000.0], N[(N[(N[(N[Log[y], $MachinePrecision] * x + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision], N[(N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.8 \cdot 10^{-44}:\\
\;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\

\mathbf{elif}\;i \leq 2200000000000:\\
\;\;\;\;\left(\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\right) + t\\

\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -2.8e-44

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in z around inf

      \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
    3. Step-by-step derivation
      1. Applied rewrites86.5%

        \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]

      if -2.8e-44 < i < 2.2e12

      1. Initial program 99.8%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Taylor expanded in y around 0

        \[\leadsto \color{blue}{a + \left(t + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
      3. Applied rewrites95.5%

        \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\right) + t} \]

      if 2.2e12 < i

      1. Initial program 99.8%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Taylor expanded in x around 0

        \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
      3. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
        2. lower-+.f64N/A

          \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
        3. +-commutativeN/A

          \[\leadsto \left(\left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + t\right) + a \]
        4. associate-+r+N/A

          \[\leadsto \left(\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right) + t\right) + a \]
        5. associate-+l+N/A

          \[\leadsto \left(\left(z + i \cdot y\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        6. lower-+.f64N/A

          \[\leadsto \left(\left(z + i \cdot y\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        7. +-commutativeN/A

          \[\leadsto \left(\left(i \cdot y + z\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        8. lower-fma.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        9. lower-fma.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - \frac{1}{2}, t\right)\right) + a \]
        10. lift-log.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - \frac{1}{2}, t\right)\right) + a \]
        11. lift--.f6488.3

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a \]
      4. Applied rewrites88.3%

        \[\leadsto \color{blue}{\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a} \]
    4. Recombined 3 regimes into one program.
    5. Add Preprocessing

    Alternative 4: 91.2% accurate, 1.0× speedup?

    \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -2.35 \cdot 10^{+160}:\\ \;\;\;\;\mathsf{fma}\left(i, y, t\_1\right) + a\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+207}:\\ \;\;\;\;\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;\left(t\_1 + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* (log y) x)))
       (if (<= x -2.35e+160)
         (+ (fma i y t_1) a)
         (if (<= x 7.5e+207)
           (+ (+ (fma i y z) (fma (log c) (- b 0.5) t)) a)
           (+ (+ t_1 (* (- b 0.5) (log c))) (* y i))))))
    assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = log(y) * x;
    	double tmp;
    	if (x <= -2.35e+160) {
    		tmp = fma(i, y, t_1) + a;
    	} else if (x <= 7.5e+207) {
    		tmp = (fma(i, y, z) + fma(log(c), (b - 0.5), t)) + a;
    	} else {
    		tmp = (t_1 + ((b - 0.5) * log(c))) + (y * i);
    	}
    	return tmp;
    }
    
    x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(log(y) * x)
    	tmp = 0.0
    	if (x <= -2.35e+160)
    		tmp = Float64(fma(i, y, t_1) + a);
    	elseif (x <= 7.5e+207)
    		tmp = Float64(Float64(fma(i, y, z) + fma(log(c), Float64(b - 0.5), t)) + a);
    	else
    		tmp = Float64(Float64(t_1 + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i));
    	end
    	return tmp
    end
    
    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -2.35e+160], N[(N[(i * y + t$95$1), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[x, 7.5e+207], N[(N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(t$95$1 + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
    \\
    \begin{array}{l}
    t_1 := \log y \cdot x\\
    \mathbf{if}\;x \leq -2.35 \cdot 10^{+160}:\\
    \;\;\;\;\mathsf{fma}\left(i, y, t\_1\right) + a\\
    
    \mathbf{elif}\;x \leq 7.5 \cdot 10^{+207}:\\
    \;\;\;\;\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(t\_1 + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -2.34999999999999985e160

      1. Initial program 99.6%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Taylor expanded in z around 0

        \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
      3. Applied rewrites87.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]
      4. Taylor expanded in x around inf

        \[\leadsto \mathsf{fma}\left(i, y, x \cdot \log y\right) + a \]
      5. Step-by-step derivation
        1. remove-double-negN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot \log y\right)\right)\right)\right) + a \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot x\right)\right)\right)\right) + a \]
        3. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\log y \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right) + a \]
        4. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right) + a \]
        5. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log y\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right) + a \]
        6. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(-1 \cdot \log y\right) \cdot x\right)\right) + a \]
        7. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(-1 \cdot \log y\right)\right) \cdot x\right) + a \]
        8. distribute-rgt-neg-outN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \left(\mathsf{neg}\left(\log y\right)\right)\right) \cdot x\right) + a \]
        9. log-recN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right) + a \]
        10. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right) + a \]
        11. log-recN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \left(\mathsf{neg}\left(\log y\right)\right)\right) \cdot x\right) + a \]
        12. distribute-rgt-neg-outN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(-1 \cdot \log y\right)\right) \cdot x\right) + a \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(\log y \cdot -1\right)\right) \cdot x\right) + a \]
        14. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\log y \cdot \left(\mathsf{neg}\left(-1\right)\right)\right) \cdot x\right) + a \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\log y \cdot 1\right) \cdot x\right) + a \]
        16. *-rgt-identityN/A

          \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]
        17. lift-log.f6477.6

          \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]
      6. Applied rewrites77.6%

        \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]

      if -2.34999999999999985e160 < x < 7.49999999999999986e207

      1. Initial program 99.8%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Taylor expanded in x around 0

        \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
      3. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
        2. lower-+.f64N/A

          \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
        3. +-commutativeN/A

          \[\leadsto \left(\left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + t\right) + a \]
        4. associate-+r+N/A

          \[\leadsto \left(\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right) + t\right) + a \]
        5. associate-+l+N/A

          \[\leadsto \left(\left(z + i \cdot y\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        6. lower-+.f64N/A

          \[\leadsto \left(\left(z + i \cdot y\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        7. +-commutativeN/A

          \[\leadsto \left(\left(i \cdot y + z\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        8. lower-fma.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        9. lower-fma.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - \frac{1}{2}, t\right)\right) + a \]
        10. lift-log.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - \frac{1}{2}, t\right)\right) + a \]
        11. lift--.f6494.3

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a \]
      4. Applied rewrites94.3%

        \[\leadsto \color{blue}{\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a} \]

      if 7.49999999999999986e207 < x

      1. Initial program 99.2%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Taylor expanded in x around inf

        \[\leadsto \left(\color{blue}{x \cdot \log y} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\log y \cdot \color{blue}{x} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
        2. lower-*.f64N/A

          \[\leadsto \left(\log y \cdot \color{blue}{x} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
        3. lift-log.f6480.9

          \[\leadsto \left(\log y \cdot x + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      4. Applied rewrites80.9%

        \[\leadsto \left(\color{blue}{\log y \cdot x} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 5: 91.2% accurate, 1.2× speedup?

    \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(i, y, \log y \cdot x\right) + a\\ \mathbf{if}\;x \leq -2.35 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+216}:\\ \;\;\;\;\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (+ (fma i y (* (log y) x)) a)))
       (if (<= x -2.35e+160)
         t_1
         (if (<= x 2.1e+216)
           (+ (+ (fma i y z) (fma (log c) (- b 0.5) t)) a)
           t_1))))
    assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = fma(i, y, (log(y) * x)) + a;
    	double tmp;
    	if (x <= -2.35e+160) {
    		tmp = t_1;
    	} else if (x <= 2.1e+216) {
    		tmp = (fma(i, y, z) + fma(log(c), (b - 0.5), t)) + a;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(fma(i, y, Float64(log(y) * x)) + a)
    	tmp = 0.0
    	if (x <= -2.35e+160)
    		tmp = t_1;
    	elseif (x <= 2.1e+216)
    		tmp = Float64(Float64(fma(i, y, z) + fma(log(c), Float64(b - 0.5), t)) + a);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[x, -2.35e+160], t$95$1, If[LessEqual[x, 2.1e+216], N[(N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(i, y, \log y \cdot x\right) + a\\
    \mathbf{if}\;x \leq -2.35 \cdot 10^{+160}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 2.1 \cdot 10^{+216}:\\
    \;\;\;\;\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -2.34999999999999985e160 or 2.10000000000000001e216 < x

      1. Initial program 99.5%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Taylor expanded in z around 0

        \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
      3. Applied rewrites88.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]
      4. Taylor expanded in x around inf

        \[\leadsto \mathsf{fma}\left(i, y, x \cdot \log y\right) + a \]
      5. Step-by-step derivation
        1. remove-double-negN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot \log y\right)\right)\right)\right) + a \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot x\right)\right)\right)\right) + a \]
        3. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\log y \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right) + a \]
        4. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right) + a \]
        5. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log y\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right) + a \]
        6. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(-1 \cdot \log y\right) \cdot x\right)\right) + a \]
        7. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(-1 \cdot \log y\right)\right) \cdot x\right) + a \]
        8. distribute-rgt-neg-outN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \left(\mathsf{neg}\left(\log y\right)\right)\right) \cdot x\right) + a \]
        9. log-recN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right) + a \]
        10. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right) + a \]
        11. log-recN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \left(\mathsf{neg}\left(\log y\right)\right)\right) \cdot x\right) + a \]
        12. distribute-rgt-neg-outN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(-1 \cdot \log y\right)\right) \cdot x\right) + a \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(\log y \cdot -1\right)\right) \cdot x\right) + a \]
        14. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\log y \cdot \left(\mathsf{neg}\left(-1\right)\right)\right) \cdot x\right) + a \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\log y \cdot 1\right) \cdot x\right) + a \]
        16. *-rgt-identityN/A

          \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]
        17. lift-log.f6479.9

          \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]
      6. Applied rewrites79.9%

        \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]

      if -2.34999999999999985e160 < x < 2.10000000000000001e216

      1. Initial program 99.8%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Taylor expanded in x around 0

        \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
      3. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
        2. lower-+.f64N/A

          \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
        3. +-commutativeN/A

          \[\leadsto \left(\left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + t\right) + a \]
        4. associate-+r+N/A

          \[\leadsto \left(\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right) + t\right) + a \]
        5. associate-+l+N/A

          \[\leadsto \left(\left(z + i \cdot y\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        6. lower-+.f64N/A

          \[\leadsto \left(\left(z + i \cdot y\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        7. +-commutativeN/A

          \[\leadsto \left(\left(i \cdot y + z\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        8. lower-fma.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + t\right)\right) + a \]
        9. lower-fma.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - \frac{1}{2}, t\right)\right) + a \]
        10. lift-log.f64N/A

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - \frac{1}{2}, t\right)\right) + a \]
        11. lift--.f6494.0

          \[\leadsto \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a \]
      4. Applied rewrites94.0%

        \[\leadsto \color{blue}{\left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 6: 90.7% accurate, 1.2× speedup?

    \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(i, y, \log y \cdot x\right) + a\\ \mathbf{if}\;x \leq -2.35 \cdot 10^{+160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+216}:\\ \;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (+ (fma i y (* (log y) x)) a)))
       (if (<= x -2.35e+160)
         t_1
         (if (<= x 2.1e+216) (+ (+ (+ z a) (* (- b 0.5) (log c))) (* y i)) t_1))))
    assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = fma(i, y, (log(y) * x)) + a;
    	double tmp;
    	if (x <= -2.35e+160) {
    		tmp = t_1;
    	} else if (x <= 2.1e+216) {
    		tmp = ((z + a) + ((b - 0.5) * log(c))) + (y * i);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(fma(i, y, Float64(log(y) * x)) + a)
    	tmp = 0.0
    	if (x <= -2.35e+160)
    		tmp = t_1;
    	elseif (x <= 2.1e+216)
    		tmp = Float64(Float64(Float64(z + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[x, -2.35e+160], t$95$1, If[LessEqual[x, 2.1e+216], N[(N[(N[(z + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(i, y, \log y \cdot x\right) + a\\
    \mathbf{if}\;x \leq -2.35 \cdot 10^{+160}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 2.1 \cdot 10^{+216}:\\
    \;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -2.34999999999999985e160 or 2.10000000000000001e216 < x

      1. Initial program 99.5%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Taylor expanded in z around 0

        \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
      3. Applied rewrites88.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]
      4. Taylor expanded in x around inf

        \[\leadsto \mathsf{fma}\left(i, y, x \cdot \log y\right) + a \]
      5. Step-by-step derivation
        1. remove-double-negN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot \log y\right)\right)\right)\right) + a \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot x\right)\right)\right)\right) + a \]
        3. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\log y \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right) + a \]
        4. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right) + a \]
        5. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log y\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right) + a \]
        6. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(-1 \cdot \log y\right) \cdot x\right)\right) + a \]
        7. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(-1 \cdot \log y\right)\right) \cdot x\right) + a \]
        8. distribute-rgt-neg-outN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \left(\mathsf{neg}\left(\log y\right)\right)\right) \cdot x\right) + a \]
        9. log-recN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right) + a \]
        10. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right) + a \]
        11. log-recN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \left(\mathsf{neg}\left(\log y\right)\right)\right) \cdot x\right) + a \]
        12. distribute-rgt-neg-outN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(-1 \cdot \log y\right)\right) \cdot x\right) + a \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(\log y \cdot -1\right)\right) \cdot x\right) + a \]
        14. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\log y \cdot \left(\mathsf{neg}\left(-1\right)\right)\right) \cdot x\right) + a \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(i, y, \left(\log y \cdot 1\right) \cdot x\right) + a \]
        16. *-rgt-identityN/A

          \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]
        17. lift-log.f6479.9

          \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]
      6. Applied rewrites79.9%

        \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]

      if -2.34999999999999985e160 < x < 2.10000000000000001e216

      1. Initial program 99.8%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Taylor expanded in z around inf

        \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
      3. Step-by-step derivation
        1. Applied rewrites93.2%

          \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      4. Recombined 2 regimes into one program.
      5. Add Preprocessing

      Alternative 7: 83.2% accurate, 0.6× speedup?

      \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(b - 0.5\right) \cdot \log c\\ \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i \leq -1000000:\\ \;\;\;\;\left(z + t\_1\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(\left(t + a\right) + t\_1\right) + y \cdot i\\ \end{array} \end{array} \]
      NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
      (FPCore (x y z t a b c i)
       :precision binary64
       (let* ((t_1 (* (- b 0.5) (log c))))
         (if (<= (+ (+ (+ (+ (+ (* x (log y)) z) t) a) t_1) (* y i)) -1000000.0)
           (+ (+ z t_1) (* y i))
           (+ (+ (+ t a) t_1) (* y i)))))
      assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = (b - 0.5) * log(c);
      	double tmp;
      	if (((((((x * log(y)) + z) + t) + a) + t_1) + (y * i)) <= -1000000.0) {
      		tmp = (z + t_1) + (y * i);
      	} else {
      		tmp = ((t + a) + t_1) + (y * i);
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
      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(x, y, z, t, a, b, c, i)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: c
          real(8), intent (in) :: i
          real(8) :: t_1
          real(8) :: tmp
          t_1 = (b - 0.5d0) * log(c)
          if (((((((x * log(y)) + z) + t) + a) + t_1) + (y * i)) <= (-1000000.0d0)) then
              tmp = (z + t_1) + (y * i)
          else
              tmp = ((t + a) + t_1) + (y * i)
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double t_1 = (b - 0.5) * Math.log(c);
      	double tmp;
      	if (((((((x * Math.log(y)) + z) + t) + a) + t_1) + (y * i)) <= -1000000.0) {
      		tmp = (z + t_1) + (y * i);
      	} else {
      		tmp = ((t + a) + t_1) + (y * i);
      	}
      	return tmp;
      }
      
      [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
      def code(x, y, z, t, a, b, c, i):
      	t_1 = (b - 0.5) * math.log(c)
      	tmp = 0
      	if ((((((x * math.log(y)) + z) + t) + a) + t_1) + (y * i)) <= -1000000.0:
      		tmp = (z + t_1) + (y * i)
      	else:
      		tmp = ((t + a) + t_1) + (y * i)
      	return tmp
      
      x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
      function code(x, y, z, t, a, b, c, i)
      	t_1 = Float64(Float64(b - 0.5) * log(c))
      	tmp = 0.0
      	if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + t_1) + Float64(y * i)) <= -1000000.0)
      		tmp = Float64(Float64(z + t_1) + Float64(y * i));
      	else
      		tmp = Float64(Float64(Float64(t + a) + t_1) + Float64(y * i));
      	end
      	return tmp
      end
      
      x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
      function tmp_2 = code(x, y, z, t, a, b, c, i)
      	t_1 = (b - 0.5) * log(c);
      	tmp = 0.0;
      	if (((((((x * log(y)) + z) + t) + a) + t_1) + (y * i)) <= -1000000.0)
      		tmp = (z + t_1) + (y * i);
      	else
      		tmp = ((t + a) + t_1) + (y * i);
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -1000000.0], N[(N[(z + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t + a), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
      \\
      \begin{array}{l}
      t_1 := \left(b - 0.5\right) \cdot \log c\\
      \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i \leq -1000000:\\
      \;\;\;\;\left(z + t\_1\right) + y \cdot i\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(\left(t + a\right) + t\_1\right) + y \cdot i\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1e6

        1. Initial program 99.9%

          \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
        2. Taylor expanded in z around inf

          \[\leadsto \left(\color{blue}{z} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
        3. Step-by-step derivation
          1. Applied rewrites82.5%

            \[\leadsto \left(\color{blue}{z} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]

          if -1e6 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

          1. Initial program 99.7%

            \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
          2. Taylor expanded in t around inf

            \[\leadsto \left(\left(\color{blue}{t} + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
          3. Step-by-step derivation
            1. Applied rewrites83.8%

              \[\leadsto \left(\left(\color{blue}{t} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 8: 82.8% accurate, 0.6× speedup?

          \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(b - 0.5\right) \cdot \log c\\ \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i \leq -1000000:\\ \;\;\;\;\left(z + t\_1\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\_1\right) + y \cdot i\\ \end{array} \end{array} \]
          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
          (FPCore (x y z t a b c i)
           :precision binary64
           (let* ((t_1 (* (- b 0.5) (log c))))
             (if (<= (+ (+ (+ (+ (+ (* x (log y)) z) t) a) t_1) (* y i)) -1000000.0)
               (+ (+ z t_1) (* y i))
               (+ (+ a t_1) (* y i)))))
          assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
          	double t_1 = (b - 0.5) * log(c);
          	double tmp;
          	if (((((((x * log(y)) + z) + t) + a) + t_1) + (y * i)) <= -1000000.0) {
          		tmp = (z + t_1) + (y * i);
          	} else {
          		tmp = (a + t_1) + (y * i);
          	}
          	return tmp;
          }
          
          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
          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(x, y, z, t, a, b, c, i)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8), intent (in) :: a
              real(8), intent (in) :: b
              real(8), intent (in) :: c
              real(8), intent (in) :: i
              real(8) :: t_1
              real(8) :: tmp
              t_1 = (b - 0.5d0) * log(c)
              if (((((((x * log(y)) + z) + t) + a) + t_1) + (y * i)) <= (-1000000.0d0)) then
                  tmp = (z + t_1) + (y * i)
              else
                  tmp = (a + t_1) + (y * i)
              end if
              code = tmp
          end function
          
          assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
          public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
          	double t_1 = (b - 0.5) * Math.log(c);
          	double tmp;
          	if (((((((x * Math.log(y)) + z) + t) + a) + t_1) + (y * i)) <= -1000000.0) {
          		tmp = (z + t_1) + (y * i);
          	} else {
          		tmp = (a + t_1) + (y * i);
          	}
          	return tmp;
          }
          
          [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
          def code(x, y, z, t, a, b, c, i):
          	t_1 = (b - 0.5) * math.log(c)
          	tmp = 0
          	if ((((((x * math.log(y)) + z) + t) + a) + t_1) + (y * i)) <= -1000000.0:
          		tmp = (z + t_1) + (y * i)
          	else:
          		tmp = (a + t_1) + (y * i)
          	return tmp
          
          x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
          function code(x, y, z, t, a, b, c, i)
          	t_1 = Float64(Float64(b - 0.5) * log(c))
          	tmp = 0.0
          	if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + t_1) + Float64(y * i)) <= -1000000.0)
          		tmp = Float64(Float64(z + t_1) + Float64(y * i));
          	else
          		tmp = Float64(Float64(a + t_1) + Float64(y * i));
          	end
          	return tmp
          end
          
          x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
          function tmp_2 = code(x, y, z, t, a, b, c, i)
          	t_1 = (b - 0.5) * log(c);
          	tmp = 0.0;
          	if (((((((x * log(y)) + z) + t) + a) + t_1) + (y * i)) <= -1000000.0)
          		tmp = (z + t_1) + (y * i);
          	else
          		tmp = (a + t_1) + (y * i);
          	end
          	tmp_2 = tmp;
          end
          
          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -1000000.0], N[(N[(z + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(a + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
          \\
          \begin{array}{l}
          t_1 := \left(b - 0.5\right) \cdot \log c\\
          \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i \leq -1000000:\\
          \;\;\;\;\left(z + t\_1\right) + y \cdot i\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(a + t\_1\right) + y \cdot i\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1e6

            1. Initial program 99.9%

              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
            2. Taylor expanded in z around inf

              \[\leadsto \left(\color{blue}{z} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
            3. Step-by-step derivation
              1. Applied rewrites82.5%

                \[\leadsto \left(\color{blue}{z} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]

              if -1e6 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

              1. Initial program 99.7%

                \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
              2. Taylor expanded in a around inf

                \[\leadsto \left(\color{blue}{a} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
              3. Step-by-step derivation
                1. Applied rewrites83.1%

                  \[\leadsto \left(\color{blue}{a} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 9: 76.8% accurate, 0.7× speedup?

              \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(b - 0.5\right) \cdot \log c\\ t_2 := \left(a + t\_1\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+217}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+201}:\\ \;\;\;\;\left(\left(z + a\right) + \left(-\log \left(\sqrt{c}\right)\right)\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
              NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
              (FPCore (x y z t a b c i)
               :precision binary64
               (let* ((t_1 (* (- b 0.5) (log c))) (t_2 (+ (+ a t_1) (* y i))))
                 (if (<= t_1 -2e+217)
                   t_2
                   (if (<= t_1 5e+201) (+ (+ (+ z a) (- (log (sqrt c)))) (* y i)) t_2))))
              assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
              	double t_1 = (b - 0.5) * log(c);
              	double t_2 = (a + t_1) + (y * i);
              	double tmp;
              	if (t_1 <= -2e+217) {
              		tmp = t_2;
              	} else if (t_1 <= 5e+201) {
              		tmp = ((z + a) + -log(sqrt(c))) + (y * i);
              	} else {
              		tmp = t_2;
              	}
              	return tmp;
              }
              
              NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
              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(x, y, z, t, a, b, c, i)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8), intent (in) :: a
                  real(8), intent (in) :: b
                  real(8), intent (in) :: c
                  real(8), intent (in) :: i
                  real(8) :: t_1
                  real(8) :: t_2
                  real(8) :: tmp
                  t_1 = (b - 0.5d0) * log(c)
                  t_2 = (a + t_1) + (y * i)
                  if (t_1 <= (-2d+217)) then
                      tmp = t_2
                  else if (t_1 <= 5d+201) then
                      tmp = ((z + a) + -log(sqrt(c))) + (y * i)
                  else
                      tmp = t_2
                  end if
                  code = tmp
              end function
              
              assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
              public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
              	double t_1 = (b - 0.5) * Math.log(c);
              	double t_2 = (a + t_1) + (y * i);
              	double tmp;
              	if (t_1 <= -2e+217) {
              		tmp = t_2;
              	} else if (t_1 <= 5e+201) {
              		tmp = ((z + a) + -Math.log(Math.sqrt(c))) + (y * i);
              	} else {
              		tmp = t_2;
              	}
              	return tmp;
              }
              
              [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
              def code(x, y, z, t, a, b, c, i):
              	t_1 = (b - 0.5) * math.log(c)
              	t_2 = (a + t_1) + (y * i)
              	tmp = 0
              	if t_1 <= -2e+217:
              		tmp = t_2
              	elif t_1 <= 5e+201:
              		tmp = ((z + a) + -math.log(math.sqrt(c))) + (y * i)
              	else:
              		tmp = t_2
              	return tmp
              
              x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
              function code(x, y, z, t, a, b, c, i)
              	t_1 = Float64(Float64(b - 0.5) * log(c))
              	t_2 = Float64(Float64(a + t_1) + Float64(y * i))
              	tmp = 0.0
              	if (t_1 <= -2e+217)
              		tmp = t_2;
              	elseif (t_1 <= 5e+201)
              		tmp = Float64(Float64(Float64(z + a) + Float64(-log(sqrt(c)))) + Float64(y * i));
              	else
              		tmp = t_2;
              	end
              	return tmp
              end
              
              x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
              function tmp_2 = code(x, y, z, t, a, b, c, i)
              	t_1 = (b - 0.5) * log(c);
              	t_2 = (a + t_1) + (y * i);
              	tmp = 0.0;
              	if (t_1 <= -2e+217)
              		tmp = t_2;
              	elseif (t_1 <= 5e+201)
              		tmp = ((z + a) + -log(sqrt(c))) + (y * i);
              	else
              		tmp = t_2;
              	end
              	tmp_2 = tmp;
              end
              
              NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+217], t$95$2, If[LessEqual[t$95$1, 5e+201], N[(N[(N[(z + a), $MachinePrecision] + (-N[Log[N[Sqrt[c], $MachinePrecision]], $MachinePrecision])), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
              
              \begin{array}{l}
              [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
              \\
              \begin{array}{l}
              t_1 := \left(b - 0.5\right) \cdot \log c\\
              t_2 := \left(a + t\_1\right) + y \cdot i\\
              \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+217}:\\
              \;\;\;\;t\_2\\
              
              \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+201}:\\
              \;\;\;\;\left(\left(z + a\right) + \left(-\log \left(\sqrt{c}\right)\right)\right) + y \cdot i\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_2\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1.99999999999999992e217 or 4.9999999999999995e201 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

                1. Initial program 99.4%

                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                2. Taylor expanded in a around inf

                  \[\leadsto \left(\color{blue}{a} + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                3. Step-by-step derivation
                  1. Applied rewrites85.0%

                    \[\leadsto \left(\color{blue}{a} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]

                  if -1.99999999999999992e217 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.9999999999999995e201

                  1. Initial program 99.8%

                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                  2. Taylor expanded in z around inf

                    \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                  3. Step-by-step derivation
                    1. Applied rewrites81.8%

                      \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                    2. Taylor expanded in b around 0

                      \[\leadsto \left(\left(z + a\right) + \color{blue}{\frac{-1}{2} \cdot \log c}\right) + y \cdot i \]
                    3. Step-by-step derivation
                      1. metadata-evalN/A

                        \[\leadsto \left(\left(z + a\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \log \color{blue}{c}\right) + y \cdot i \]
                      2. distribute-lft-neg-outN/A

                        \[\leadsto \left(\left(z + a\right) + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \log c\right)\right)\right) + y \cdot i \]
                      3. lower-neg.f64N/A

                        \[\leadsto \left(\left(z + a\right) + \left(-\frac{1}{2} \cdot \log c\right)\right) + y \cdot i \]
                      4. log-pow-revN/A

                        \[\leadsto \left(\left(z + a\right) + \left(-\log \left({c}^{\frac{1}{2}}\right)\right)\right) + y \cdot i \]
                      5. lower-log.f64N/A

                        \[\leadsto \left(\left(z + a\right) + \left(-\log \left({c}^{\frac{1}{2}}\right)\right)\right) + y \cdot i \]
                      6. unpow1/2N/A

                        \[\leadsto \left(\left(z + a\right) + \left(-\log \left(\sqrt{c}\right)\right)\right) + y \cdot i \]
                      7. lower-sqrt.f6475.2

                        \[\leadsto \left(\left(z + a\right) + \left(-\log \left(\sqrt{c}\right)\right)\right) + y \cdot i \]
                    4. Applied rewrites75.2%

                      \[\leadsto \left(\left(z + a\right) + \color{blue}{\left(-\log \left(\sqrt{c}\right)\right)}\right) + y \cdot i \]
                  4. Recombined 2 regimes into one program.
                  5. Add Preprocessing

                  Alternative 10: 75.6% accurate, 0.2× speedup?

                  \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(i, y, \log y \cdot x\right) + a\\ t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_2 \leq -1.1 \cdot 10^{+306}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;t\_2 \leq 200:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+256}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+296}:\\ \;\;\;\;\left(\log c \cdot b + t\right) + a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                  (FPCore (x y z t a b c i)
                   :precision binary64
                   (let* ((t_1 (+ (fma i y (* (log y) x)) a))
                          (t_2
                           (+
                            (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                            (* y i))))
                     (if (<= t_2 -1.1e+306)
                       (+ z (* y i))
                       (if (<= t_2 200.0)
                         (fma (- b 0.5) (log c) z)
                         (if (<= t_2 5e+256)
                           t_1
                           (if (<= t_2 2e+296) (+ (+ (* (log c) b) t) a) t_1))))))
                  assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                  	double t_1 = fma(i, y, (log(y) * x)) + a;
                  	double t_2 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                  	double tmp;
                  	if (t_2 <= -1.1e+306) {
                  		tmp = z + (y * i);
                  	} else if (t_2 <= 200.0) {
                  		tmp = fma((b - 0.5), log(c), z);
                  	} else if (t_2 <= 5e+256) {
                  		tmp = t_1;
                  	} else if (t_2 <= 2e+296) {
                  		tmp = ((log(c) * b) + t) + a;
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                  function code(x, y, z, t, a, b, c, i)
                  	t_1 = Float64(fma(i, y, Float64(log(y) * x)) + a)
                  	t_2 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                  	tmp = 0.0
                  	if (t_2 <= -1.1e+306)
                  		tmp = Float64(z + Float64(y * i));
                  	elseif (t_2 <= 200.0)
                  		tmp = fma(Float64(b - 0.5), log(c), z);
                  	elseif (t_2 <= 5e+256)
                  		tmp = t_1;
                  	elseif (t_2 <= 2e+296)
                  		tmp = Float64(Float64(Float64(log(c) * b) + t) + a);
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                  code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1.1e+306], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 200.0], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision], If[LessEqual[t$95$2, 5e+256], t$95$1, If[LessEqual[t$95$2, 2e+296], N[(N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]]]]
                  
                  \begin{array}{l}
                  [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                  \\
                  \begin{array}{l}
                  t_1 := \mathsf{fma}\left(i, y, \log y \cdot x\right) + a\\
                  t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                  \mathbf{if}\;t\_2 \leq -1.1 \cdot 10^{+306}:\\
                  \;\;\;\;z + y \cdot i\\
                  
                  \mathbf{elif}\;t\_2 \leq 200:\\
                  \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\
                  
                  \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+256}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+296}:\\
                  \;\;\;\;\left(\log c \cdot b + t\right) + a\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.1e306

                    1. Initial program 100.0%

                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                    2. Taylor expanded in z around inf

                      \[\leadsto \color{blue}{z} + y \cdot i \]
                    3. Step-by-step derivation
                      1. Applied rewrites91.0%

                        \[\leadsto \color{blue}{z} + y \cdot i \]

                      if -1.1e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 200

                      1. Initial program 99.8%

                        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                      2. Applied rewrites99.8%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)} \]
                      3. Taylor expanded in z around inf

                        \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{z}\right) \]
                      4. Step-by-step derivation
                        1. Applied rewrites68.9%

                          \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{z}\right) \]

                        if 200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 5.00000000000000015e256 or 1.99999999999999996e296 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                        1. Initial program 99.6%

                          \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                        2. Taylor expanded in z around 0

                          \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                        3. Applied rewrites98.4%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]
                        4. Taylor expanded in x around inf

                          \[\leadsto \mathsf{fma}\left(i, y, x \cdot \log y\right) + a \]
                        5. Step-by-step derivation
                          1. remove-double-negN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot \log y\right)\right)\right)\right) + a \]
                          2. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(\mathsf{neg}\left(\log y \cdot x\right)\right)\right)\right) + a \]
                          3. distribute-rgt-neg-inN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\log y \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right) + a \]
                          4. distribute-lft-neg-inN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(\log y\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right) + a \]
                          5. mul-1-negN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log y\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right) + a \]
                          6. distribute-rgt-neg-inN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \mathsf{neg}\left(\left(-1 \cdot \log y\right) \cdot x\right)\right) + a \]
                          7. distribute-lft-neg-inN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(-1 \cdot \log y\right)\right) \cdot x\right) + a \]
                          8. distribute-rgt-neg-outN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \left(\mathsf{neg}\left(\log y\right)\right)\right) \cdot x\right) + a \]
                          9. log-recN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right) + a \]
                          10. lower-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot x\right) + a \]
                          11. log-recN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(-1 \cdot \left(\mathsf{neg}\left(\log y\right)\right)\right) \cdot x\right) + a \]
                          12. distribute-rgt-neg-outN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(-1 \cdot \log y\right)\right) \cdot x\right) + a \]
                          13. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(\mathsf{neg}\left(\log y \cdot -1\right)\right) \cdot x\right) + a \]
                          14. distribute-rgt-neg-inN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(\log y \cdot \left(\mathsf{neg}\left(-1\right)\right)\right) \cdot x\right) + a \]
                          15. metadata-evalN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \left(\log y \cdot 1\right) \cdot x\right) + a \]
                          16. *-rgt-identityN/A

                            \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]
                          17. lift-log.f6481.8

                            \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]
                        6. Applied rewrites81.8%

                          \[\leadsto \mathsf{fma}\left(i, y, \log y \cdot x\right) + a \]

                        if 5.00000000000000015e256 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1.99999999999999996e296

                        1. Initial program 99.8%

                          \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                        2. Taylor expanded in a around inf

                          \[\leadsto \color{blue}{a} \]
                        3. Step-by-step derivation
                          1. Applied rewrites51.4%

                            \[\leadsto \color{blue}{a} \]
                          2. Taylor expanded in x around 0

                            \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                          3. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                            2. lower-+.f64N/A

                              \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                          4. Applied rewrites82.1%

                            \[\leadsto \color{blue}{\left(\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + t\right) + a} \]
                          5. Taylor expanded in b around inf

                            \[\leadsto \left(b \cdot \log c + t\right) + a \]
                          6. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \left(\log c \cdot b + t\right) + a \]
                            2. lower-*.f64N/A

                              \[\leadsto \left(\log c \cdot b + t\right) + a \]
                            3. lift-log.f6470.1

                              \[\leadsto \left(\log c \cdot b + t\right) + a \]
                          7. Applied rewrites70.1%

                            \[\leadsto \left(\log c \cdot b + t\right) + a \]
                        4. Recombined 4 regimes into one program.
                        5. Add Preprocessing

                        Alternative 11: 75.6% accurate, 0.7× speedup?

                        \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, \log c, y \cdot i\right)\\ t_2 := \left(b - 0.5\right) \cdot \log c\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+217}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+201}:\\ \;\;\;\;\left(\left(z + a\right) + \left(-\log \left(\sqrt{c}\right)\right)\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                        (FPCore (x y z t a b c i)
                         :precision binary64
                         (let* ((t_1 (fma b (log c) (* y i))) (t_2 (* (- b 0.5) (log c))))
                           (if (<= t_2 -2e+217)
                             t_1
                             (if (<= t_2 5e+201) (+ (+ (+ z a) (- (log (sqrt c)))) (* y i)) t_1))))
                        assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                        	double t_1 = fma(b, log(c), (y * i));
                        	double t_2 = (b - 0.5) * log(c);
                        	double tmp;
                        	if (t_2 <= -2e+217) {
                        		tmp = t_1;
                        	} else if (t_2 <= 5e+201) {
                        		tmp = ((z + a) + -log(sqrt(c))) + (y * i);
                        	} else {
                        		tmp = t_1;
                        	}
                        	return tmp;
                        }
                        
                        x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                        function code(x, y, z, t, a, b, c, i)
                        	t_1 = fma(b, log(c), Float64(y * i))
                        	t_2 = Float64(Float64(b - 0.5) * log(c))
                        	tmp = 0.0
                        	if (t_2 <= -2e+217)
                        		tmp = t_1;
                        	elseif (t_2 <= 5e+201)
                        		tmp = Float64(Float64(Float64(z + a) + Float64(-log(sqrt(c)))) + Float64(y * i));
                        	else
                        		tmp = t_1;
                        	end
                        	return tmp
                        end
                        
                        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                        code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * N[Log[c], $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+217], t$95$1, If[LessEqual[t$95$2, 5e+201], N[(N[(N[(z + a), $MachinePrecision] + (-N[Log[N[Sqrt[c], $MachinePrecision]], $MachinePrecision])), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
                        
                        \begin{array}{l}
                        [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                        \\
                        \begin{array}{l}
                        t_1 := \mathsf{fma}\left(b, \log c, y \cdot i\right)\\
                        t_2 := \left(b - 0.5\right) \cdot \log c\\
                        \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+217}:\\
                        \;\;\;\;t\_1\\
                        
                        \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+201}:\\
                        \;\;\;\;\left(\left(z + a\right) + \left(-\log \left(\sqrt{c}\right)\right)\right) + y \cdot i\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_1\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1.99999999999999992e217 or 4.9999999999999995e201 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

                          1. Initial program 99.4%

                            \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                          2. Applied rewrites99.7%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)} \]
                          3. Taylor expanded in y around inf

                            \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y}\right) \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, y \cdot \color{blue}{i}\right) \]
                            2. lift-*.f6477.9

                              \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, y \cdot \color{blue}{i}\right) \]
                          5. Applied rewrites77.9%

                            \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{y \cdot i}\right) \]
                          6. Taylor expanded in b around inf

                            \[\leadsto \mathsf{fma}\left(\color{blue}{b}, \log c, y \cdot i\right) \]
                          7. Step-by-step derivation
                            1. Applied rewrites77.9%

                              \[\leadsto \mathsf{fma}\left(\color{blue}{b}, \log c, y \cdot i\right) \]

                            if -1.99999999999999992e217 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.9999999999999995e201

                            1. Initial program 99.8%

                              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                            2. Taylor expanded in z around inf

                              \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                            3. Step-by-step derivation
                              1. Applied rewrites81.8%

                                \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                              2. Taylor expanded in b around 0

                                \[\leadsto \left(\left(z + a\right) + \color{blue}{\frac{-1}{2} \cdot \log c}\right) + y \cdot i \]
                              3. Step-by-step derivation
                                1. metadata-evalN/A

                                  \[\leadsto \left(\left(z + a\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \log \color{blue}{c}\right) + y \cdot i \]
                                2. distribute-lft-neg-outN/A

                                  \[\leadsto \left(\left(z + a\right) + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \log c\right)\right)\right) + y \cdot i \]
                                3. lower-neg.f64N/A

                                  \[\leadsto \left(\left(z + a\right) + \left(-\frac{1}{2} \cdot \log c\right)\right) + y \cdot i \]
                                4. log-pow-revN/A

                                  \[\leadsto \left(\left(z + a\right) + \left(-\log \left({c}^{\frac{1}{2}}\right)\right)\right) + y \cdot i \]
                                5. lower-log.f64N/A

                                  \[\leadsto \left(\left(z + a\right) + \left(-\log \left({c}^{\frac{1}{2}}\right)\right)\right) + y \cdot i \]
                                6. unpow1/2N/A

                                  \[\leadsto \left(\left(z + a\right) + \left(-\log \left(\sqrt{c}\right)\right)\right) + y \cdot i \]
                                7. lower-sqrt.f6475.2

                                  \[\leadsto \left(\left(z + a\right) + \left(-\log \left(\sqrt{c}\right)\right)\right) + y \cdot i \]
                              4. Applied rewrites75.2%

                                \[\leadsto \left(\left(z + a\right) + \color{blue}{\left(-\log \left(\sqrt{c}\right)\right)}\right) + y \cdot i \]
                            4. Recombined 2 regimes into one program.
                            5. Add Preprocessing

                            Alternative 12: 72.5% accurate, 0.3× speedup?

                            \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;t\_1 \leq 200:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;\left(\log c \cdot b + t\right) + a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, \log c, y \cdot i\right)\\ \end{array} \end{array} \]
                            NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                            (FPCore (x y z t a b c i)
                             :precision binary64
                             (let* ((t_1
                                     (+
                                      (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                      (* y i))))
                               (if (<= t_1 -1.1e+306)
                                 (+ z (* y i))
                                 (if (<= t_1 200.0)
                                   (fma (- b 0.5) (log c) z)
                                   (if (<= t_1 1e+308)
                                     (+ (+ (* (log c) b) t) a)
                                     (fma b (log c) (* y i)))))))
                            assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                            	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                            	double tmp;
                            	if (t_1 <= -1.1e+306) {
                            		tmp = z + (y * i);
                            	} else if (t_1 <= 200.0) {
                            		tmp = fma((b - 0.5), log(c), z);
                            	} else if (t_1 <= 1e+308) {
                            		tmp = ((log(c) * b) + t) + a;
                            	} else {
                            		tmp = fma(b, log(c), (y * i));
                            	}
                            	return tmp;
                            }
                            
                            x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                            function code(x, y, z, t, a, b, c, i)
                            	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                            	tmp = 0.0
                            	if (t_1 <= -1.1e+306)
                            		tmp = Float64(z + Float64(y * i));
                            	elseif (t_1 <= 200.0)
                            		tmp = fma(Float64(b - 0.5), log(c), z);
                            	elseif (t_1 <= 1e+308)
                            		tmp = Float64(Float64(Float64(log(c) * b) + t) + a);
                            	else
                            		tmp = fma(b, log(c), Float64(y * i));
                            	end
                            	return tmp
                            end
                            
                            NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                            code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.1e+306], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 200.0], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision], N[(b * N[Log[c], $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
                            
                            \begin{array}{l}
                            [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                            \\
                            \begin{array}{l}
                            t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                            \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\
                            \;\;\;\;z + y \cdot i\\
                            
                            \mathbf{elif}\;t\_1 \leq 200:\\
                            \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\
                            
                            \mathbf{elif}\;t\_1 \leq 10^{+308}:\\
                            \;\;\;\;\left(\log c \cdot b + t\right) + a\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(b, \log c, y \cdot i\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 4 regimes
                            2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.1e306

                              1. Initial program 100.0%

                                \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                              2. Taylor expanded in z around inf

                                \[\leadsto \color{blue}{z} + y \cdot i \]
                              3. Step-by-step derivation
                                1. Applied rewrites91.0%

                                  \[\leadsto \color{blue}{z} + y \cdot i \]

                                if -1.1e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 200

                                1. Initial program 99.8%

                                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                2. Applied rewrites99.8%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)} \]
                                3. Taylor expanded in z around inf

                                  \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{z}\right) \]
                                4. Step-by-step derivation
                                  1. Applied rewrites68.9%

                                    \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{z}\right) \]

                                  if 200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1e308

                                  1. Initial program 99.8%

                                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                  2. Taylor expanded in a around inf

                                    \[\leadsto \color{blue}{a} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites51.0%

                                      \[\leadsto \color{blue}{a} \]
                                    2. Taylor expanded in x around 0

                                      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                    3. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                      2. lower-+.f64N/A

                                        \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                    4. Applied rewrites82.6%

                                      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + t\right) + a} \]
                                    5. Taylor expanded in b around inf

                                      \[\leadsto \left(b \cdot \log c + t\right) + a \]
                                    6. Step-by-step derivation
                                      1. *-commutativeN/A

                                        \[\leadsto \left(\log c \cdot b + t\right) + a \]
                                      2. lower-*.f64N/A

                                        \[\leadsto \left(\log c \cdot b + t\right) + a \]
                                      3. lift-log.f6469.0

                                        \[\leadsto \left(\log c \cdot b + t\right) + a \]
                                    7. Applied rewrites69.0%

                                      \[\leadsto \left(\log c \cdot b + t\right) + a \]

                                    if 1e308 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                    1. Initial program 98.7%

                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                    2. Applied rewrites99.5%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)} \]
                                    3. Taylor expanded in y around inf

                                      \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y}\right) \]
                                    4. Step-by-step derivation
                                      1. *-commutativeN/A

                                        \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, y \cdot \color{blue}{i}\right) \]
                                      2. lift-*.f6496.0

                                        \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, y \cdot \color{blue}{i}\right) \]
                                    5. Applied rewrites96.0%

                                      \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{y \cdot i}\right) \]
                                    6. Taylor expanded in b around inf

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{b}, \log c, y \cdot i\right) \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites96.0%

                                        \[\leadsto \mathsf{fma}\left(\color{blue}{b}, \log c, y \cdot i\right) \]
                                    8. Recombined 4 regimes into one program.
                                    9. Add Preprocessing

                                    Alternative 13: 72.2% accurate, 0.3× speedup?

                                    \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;t\_1 \leq 200:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;\log c \cdot b + a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, \log c, y \cdot i\right)\\ \end{array} \end{array} \]
                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                    (FPCore (x y z t a b c i)
                                     :precision binary64
                                     (let* ((t_1
                                             (+
                                              (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                              (* y i))))
                                       (if (<= t_1 -1.1e+306)
                                         (+ z (* y i))
                                         (if (<= t_1 200.0)
                                           (fma (- b 0.5) (log c) z)
                                           (if (<= t_1 1e+308) (+ (* (log c) b) a) (fma b (log c) (* y i)))))))
                                    assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                    	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                    	double tmp;
                                    	if (t_1 <= -1.1e+306) {
                                    		tmp = z + (y * i);
                                    	} else if (t_1 <= 200.0) {
                                    		tmp = fma((b - 0.5), log(c), z);
                                    	} else if (t_1 <= 1e+308) {
                                    		tmp = (log(c) * b) + a;
                                    	} else {
                                    		tmp = fma(b, log(c), (y * i));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                    function code(x, y, z, t, a, b, c, i)
                                    	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                    	tmp = 0.0
                                    	if (t_1 <= -1.1e+306)
                                    		tmp = Float64(z + Float64(y * i));
                                    	elseif (t_1 <= 200.0)
                                    		tmp = fma(Float64(b - 0.5), log(c), z);
                                    	elseif (t_1 <= 1e+308)
                                    		tmp = Float64(Float64(log(c) * b) + a);
                                    	else
                                    		tmp = fma(b, log(c), Float64(y * i));
                                    	end
                                    	return tmp
                                    end
                                    
                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.1e+306], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 200.0], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + a), $MachinePrecision], N[(b * N[Log[c], $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
                                    
                                    \begin{array}{l}
                                    [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                    \\
                                    \begin{array}{l}
                                    t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                    \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\
                                    \;\;\;\;z + y \cdot i\\
                                    
                                    \mathbf{elif}\;t\_1 \leq 200:\\
                                    \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\
                                    
                                    \mathbf{elif}\;t\_1 \leq 10^{+308}:\\
                                    \;\;\;\;\log c \cdot b + a\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\mathsf{fma}\left(b, \log c, y \cdot i\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 4 regimes
                                    2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.1e306

                                      1. Initial program 100.0%

                                        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                      2. Taylor expanded in z around inf

                                        \[\leadsto \color{blue}{z} + y \cdot i \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites91.0%

                                          \[\leadsto \color{blue}{z} + y \cdot i \]

                                        if -1.1e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 200

                                        1. Initial program 99.8%

                                          \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                        2. Applied rewrites99.8%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)} \]
                                        3. Taylor expanded in z around inf

                                          \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{z}\right) \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites68.9%

                                            \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{z}\right) \]

                                          if 200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1e308

                                          1. Initial program 99.8%

                                            \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                          2. Taylor expanded in z around 0

                                            \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                          3. Applied rewrites98.3%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]
                                          4. Taylor expanded in b around inf

                                            \[\leadsto b \cdot \log c + a \]
                                          5. Step-by-step derivation
                                            1. *-commutativeN/A

                                              \[\leadsto \log c \cdot b + a \]
                                            2. lift-log.f64N/A

                                              \[\leadsto \log c \cdot b + a \]
                                            3. lift-*.f6468.3

                                              \[\leadsto \log c \cdot b + a \]
                                          6. Applied rewrites68.3%

                                            \[\leadsto \log c \cdot b + a \]

                                          if 1e308 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                          1. Initial program 98.7%

                                            \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                          2. Applied rewrites99.5%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)} \]
                                          3. Taylor expanded in y around inf

                                            \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y}\right) \]
                                          4. Step-by-step derivation
                                            1. *-commutativeN/A

                                              \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, y \cdot \color{blue}{i}\right) \]
                                            2. lift-*.f6496.0

                                              \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, y \cdot \color{blue}{i}\right) \]
                                          5. Applied rewrites96.0%

                                            \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{y \cdot i}\right) \]
                                          6. Taylor expanded in b around inf

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{b}, \log c, y \cdot i\right) \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites96.0%

                                              \[\leadsto \mathsf{fma}\left(\color{blue}{b}, \log c, y \cdot i\right) \]
                                          8. Recombined 4 regimes into one program.
                                          9. Add Preprocessing

                                          Alternative 14: 72.2% accurate, 0.3× speedup?

                                          \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := \left(\left(\left(\left(t\_1 + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_2 \leq -1.1 \cdot 10^{+306}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;t\_2 \leq 200:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+308}:\\ \;\;\;\;\log c \cdot b + a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, t\_1\right)\\ \end{array} \end{array} \]
                                          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                          (FPCore (x y z t a b c i)
                                           :precision binary64
                                           (let* ((t_1 (* x (log y)))
                                                  (t_2 (+ (+ (+ (+ (+ t_1 z) t) a) (* (- b 0.5) (log c))) (* y i))))
                                             (if (<= t_2 -1.1e+306)
                                               (+ z (* y i))
                                               (if (<= t_2 200.0)
                                                 (fma (- b 0.5) (log c) z)
                                                 (if (<= t_2 1e+308) (+ (* (log c) b) a) (fma y i t_1))))))
                                          assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                          	double t_1 = x * log(y);
                                          	double t_2 = ((((t_1 + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                          	double tmp;
                                          	if (t_2 <= -1.1e+306) {
                                          		tmp = z + (y * i);
                                          	} else if (t_2 <= 200.0) {
                                          		tmp = fma((b - 0.5), log(c), z);
                                          	} else if (t_2 <= 1e+308) {
                                          		tmp = (log(c) * b) + a;
                                          	} else {
                                          		tmp = fma(y, i, t_1);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                          function code(x, y, z, t, a, b, c, i)
                                          	t_1 = Float64(x * log(y))
                                          	t_2 = Float64(Float64(Float64(Float64(Float64(t_1 + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                          	tmp = 0.0
                                          	if (t_2 <= -1.1e+306)
                                          		tmp = Float64(z + Float64(y * i));
                                          	elseif (t_2 <= 200.0)
                                          		tmp = fma(Float64(b - 0.5), log(c), z);
                                          	elseif (t_2 <= 1e+308)
                                          		tmp = Float64(Float64(log(c) * b) + a);
                                          	else
                                          		tmp = fma(y, i, t_1);
                                          	end
                                          	return tmp
                                          end
                                          
                                          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t$95$1 + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1.1e+306], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 200.0], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision], If[LessEqual[t$95$2, 1e+308], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + a), $MachinePrecision], N[(y * i + t$95$1), $MachinePrecision]]]]]]
                                          
                                          \begin{array}{l}
                                          [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                          \\
                                          \begin{array}{l}
                                          t_1 := x \cdot \log y\\
                                          t_2 := \left(\left(\left(\left(t\_1 + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                          \mathbf{if}\;t\_2 \leq -1.1 \cdot 10^{+306}:\\
                                          \;\;\;\;z + y \cdot i\\
                                          
                                          \mathbf{elif}\;t\_2 \leq 200:\\
                                          \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\
                                          
                                          \mathbf{elif}\;t\_2 \leq 10^{+308}:\\
                                          \;\;\;\;\log c \cdot b + a\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\mathsf{fma}\left(y, i, t\_1\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 4 regimes
                                          2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.1e306

                                            1. Initial program 100.0%

                                              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                            2. Taylor expanded in z around inf

                                              \[\leadsto \color{blue}{z} + y \cdot i \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites91.0%

                                                \[\leadsto \color{blue}{z} + y \cdot i \]

                                              if -1.1e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 200

                                              1. Initial program 99.8%

                                                \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                              2. Applied rewrites99.8%

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)} \]
                                              3. Taylor expanded in z around inf

                                                \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{z}\right) \]
                                              4. Step-by-step derivation
                                                1. Applied rewrites68.9%

                                                  \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{z}\right) \]

                                                if 200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1e308

                                                1. Initial program 99.8%

                                                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                2. Taylor expanded in z around 0

                                                  \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                                3. Applied rewrites98.3%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]
                                                4. Taylor expanded in b around inf

                                                  \[\leadsto b \cdot \log c + a \]
                                                5. Step-by-step derivation
                                                  1. *-commutativeN/A

                                                    \[\leadsto \log c \cdot b + a \]
                                                  2. lift-log.f64N/A

                                                    \[\leadsto \log c \cdot b + a \]
                                                  3. lift-*.f6468.3

                                                    \[\leadsto \log c \cdot b + a \]
                                                6. Applied rewrites68.3%

                                                  \[\leadsto \log c \cdot b + a \]

                                                if 1e308 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                1. Initial program 98.7%

                                                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                2. Taylor expanded in x around inf

                                                  \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
                                                3. Step-by-step derivation
                                                  1. *-commutativeN/A

                                                    \[\leadsto \log y \cdot \color{blue}{x} + y \cdot i \]
                                                  2. lower-*.f64N/A

                                                    \[\leadsto \log y \cdot \color{blue}{x} + y \cdot i \]
                                                  3. lift-log.f6495.7

                                                    \[\leadsto \log y \cdot x + y \cdot i \]
                                                4. Applied rewrites95.7%

                                                  \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
                                                5. Step-by-step derivation
                                                  1. lift-+.f64N/A

                                                    \[\leadsto \color{blue}{\log y \cdot x + y \cdot i} \]
                                                  2. lift-*.f64N/A

                                                    \[\leadsto \log y \cdot x + \color{blue}{y \cdot i} \]
                                                  3. *-commutativeN/A

                                                    \[\leadsto \log y \cdot x + \color{blue}{i \cdot y} \]
                                                  4. +-commutativeN/A

                                                    \[\leadsto \color{blue}{i \cdot y + \log y \cdot x} \]
                                                  5. *-commutativeN/A

                                                    \[\leadsto \color{blue}{y \cdot i} + \log y \cdot x \]
                                                  6. lower-fma.f6495.7

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]
                                                  7. lift-*.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(y, i, \log y \cdot \color{blue}{x}\right) \]
                                                  8. lift-log.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(y, i, \log y \cdot x\right) \]
                                                  9. *-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(y, i, x \cdot \color{blue}{\log y}\right) \]
                                                  10. lower-*.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(y, i, x \cdot \color{blue}{\log y}\right) \]
                                                  11. lift-log.f6495.7

                                                    \[\leadsto \mathsf{fma}\left(y, i, x \cdot \log y\right) \]
                                                6. Applied rewrites95.7%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, x \cdot \log y\right)} \]
                                              5. Recombined 4 regimes into one program.
                                              6. Add Preprocessing

                                              Alternative 15: 72.0% accurate, 0.3× speedup?

                                              \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;t\_1 \leq 200:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;\log c \cdot b + a\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
                                              NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                              (FPCore (x y z t a b c i)
                                               :precision binary64
                                               (let* ((t_1
                                                       (+
                                                        (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                                        (* y i))))
                                                 (if (<= t_1 -1.1e+306)
                                                   (+ z (* y i))
                                                   (if (<= t_1 200.0)
                                                     (fma (- b 0.5) (log c) z)
                                                     (if (<= t_1 1e+308) (+ (* (log c) b) a) (* i y))))))
                                              assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                              	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                              	double tmp;
                                              	if (t_1 <= -1.1e+306) {
                                              		tmp = z + (y * i);
                                              	} else if (t_1 <= 200.0) {
                                              		tmp = fma((b - 0.5), log(c), z);
                                              	} else if (t_1 <= 1e+308) {
                                              		tmp = (log(c) * b) + a;
                                              	} else {
                                              		tmp = i * y;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                              function code(x, y, z, t, a, b, c, i)
                                              	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                              	tmp = 0.0
                                              	if (t_1 <= -1.1e+306)
                                              		tmp = Float64(z + Float64(y * i));
                                              	elseif (t_1 <= 200.0)
                                              		tmp = fma(Float64(b - 0.5), log(c), z);
                                              	elseif (t_1 <= 1e+308)
                                              		tmp = Float64(Float64(log(c) * b) + a);
                                              	else
                                              		tmp = Float64(i * y);
                                              	end
                                              	return tmp
                                              end
                                              
                                              NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.1e+306], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 200.0], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + a), $MachinePrecision], N[(i * y), $MachinePrecision]]]]]
                                              
                                              \begin{array}{l}
                                              [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                              \\
                                              \begin{array}{l}
                                              t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                              \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\
                                              \;\;\;\;z + y \cdot i\\
                                              
                                              \mathbf{elif}\;t\_1 \leq 200:\\
                                              \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right)\\
                                              
                                              \mathbf{elif}\;t\_1 \leq 10^{+308}:\\
                                              \;\;\;\;\log c \cdot b + a\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;i \cdot y\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 4 regimes
                                              2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.1e306

                                                1. Initial program 100.0%

                                                  \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                2. Taylor expanded in z around inf

                                                  \[\leadsto \color{blue}{z} + y \cdot i \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites91.0%

                                                    \[\leadsto \color{blue}{z} + y \cdot i \]

                                                  if -1.1e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 200

                                                  1. Initial program 99.8%

                                                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                  2. Applied rewrites99.8%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(\log y, x, z\right) + a\right) + \mathsf{fma}\left(i, y, t\right)\right)} \]
                                                  3. Taylor expanded in z around inf

                                                    \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{z}\right) \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites68.9%

                                                      \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{z}\right) \]

                                                    if 200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1e308

                                                    1. Initial program 99.8%

                                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                    2. Taylor expanded in z around 0

                                                      \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                                    3. Applied rewrites98.3%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]
                                                    4. Taylor expanded in b around inf

                                                      \[\leadsto b \cdot \log c + a \]
                                                    5. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \log c \cdot b + a \]
                                                      2. lift-log.f64N/A

                                                        \[\leadsto \log c \cdot b + a \]
                                                      3. lift-*.f6468.3

                                                        \[\leadsto \log c \cdot b + a \]
                                                    6. Applied rewrites68.3%

                                                      \[\leadsto \log c \cdot b + a \]

                                                    if 1e308 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                    1. Initial program 98.7%

                                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                    2. Taylor expanded in y around inf

                                                      \[\leadsto \color{blue}{i \cdot y} \]
                                                    3. Step-by-step derivation
                                                      1. lower-*.f6493.5

                                                        \[\leadsto i \cdot \color{blue}{y} \]
                                                    4. Applied rewrites93.5%

                                                      \[\leadsto \color{blue}{i \cdot y} \]
                                                  5. Recombined 4 regimes into one program.
                                                  6. Add Preprocessing

                                                  Alternative 16: 68.4% accurate, 0.4× speedup?

                                                  \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -200:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;\log c \cdot b + a\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
                                                  NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                  (FPCore (x y z t a b c i)
                                                   :precision binary64
                                                   (let* ((t_1
                                                           (+
                                                            (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                                            (* y i))))
                                                     (if (<= t_1 -200.0)
                                                       (+ z (* y i))
                                                       (if (<= t_1 1e+308) (+ (* (log c) b) a) (* i y)))))
                                                  assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                  	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                  	double tmp;
                                                  	if (t_1 <= -200.0) {
                                                  		tmp = z + (y * i);
                                                  	} else if (t_1 <= 1e+308) {
                                                  		tmp = (log(c) * b) + a;
                                                  	} else {
                                                  		tmp = i * y;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                  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(x, y, z, t, a, b, c, i)
                                                  use fmin_fmax_functions
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      real(8), intent (in) :: z
                                                      real(8), intent (in) :: t
                                                      real(8), intent (in) :: a
                                                      real(8), intent (in) :: b
                                                      real(8), intent (in) :: c
                                                      real(8), intent (in) :: i
                                                      real(8) :: t_1
                                                      real(8) :: tmp
                                                      t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
                                                      if (t_1 <= (-200.0d0)) then
                                                          tmp = z + (y * i)
                                                      else if (t_1 <= 1d+308) then
                                                          tmp = (log(c) * b) + a
                                                      else
                                                          tmp = i * y
                                                      end if
                                                      code = tmp
                                                  end function
                                                  
                                                  assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
                                                  public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                  	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
                                                  	double tmp;
                                                  	if (t_1 <= -200.0) {
                                                  		tmp = z + (y * i);
                                                  	} else if (t_1 <= 1e+308) {
                                                  		tmp = (Math.log(c) * b) + a;
                                                  	} else {
                                                  		tmp = i * y;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
                                                  def code(x, y, z, t, a, b, c, i):
                                                  	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
                                                  	tmp = 0
                                                  	if t_1 <= -200.0:
                                                  		tmp = z + (y * i)
                                                  	elif t_1 <= 1e+308:
                                                  		tmp = (math.log(c) * b) + a
                                                  	else:
                                                  		tmp = i * y
                                                  	return tmp
                                                  
                                                  x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                  function code(x, y, z, t, a, b, c, i)
                                                  	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                                  	tmp = 0.0
                                                  	if (t_1 <= -200.0)
                                                  		tmp = Float64(z + Float64(y * i));
                                                  	elseif (t_1 <= 1e+308)
                                                  		tmp = Float64(Float64(log(c) * b) + a);
                                                  	else
                                                  		tmp = Float64(i * y);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
                                                  function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                  	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                  	tmp = 0.0;
                                                  	if (t_1 <= -200.0)
                                                  		tmp = z + (y * i);
                                                  	elseif (t_1 <= 1e+308)
                                                  		tmp = (log(c) * b) + a;
                                                  	else
                                                  		tmp = i * y;
                                                  	end
                                                  	tmp_2 = tmp;
                                                  end
                                                  
                                                  NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -200.0], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + a), $MachinePrecision], N[(i * y), $MachinePrecision]]]]
                                                  
                                                  \begin{array}{l}
                                                  [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                                  \\
                                                  \begin{array}{l}
                                                  t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                                  \mathbf{if}\;t\_1 \leq -200:\\
                                                  \;\;\;\;z + y \cdot i\\
                                                  
                                                  \mathbf{elif}\;t\_1 \leq 10^{+308}:\\
                                                  \;\;\;\;\log c \cdot b + a\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;i \cdot y\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -200

                                                    1. Initial program 99.9%

                                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                    2. Taylor expanded in z around inf

                                                      \[\leadsto \color{blue}{z} + y \cdot i \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites66.2%

                                                        \[\leadsto \color{blue}{z} + y \cdot i \]

                                                      if -200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1e308

                                                      1. Initial program 99.8%

                                                        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                      2. Taylor expanded in z around 0

                                                        \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                                      3. Applied rewrites98.3%

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]
                                                      4. Taylor expanded in b around inf

                                                        \[\leadsto b \cdot \log c + a \]
                                                      5. Step-by-step derivation
                                                        1. *-commutativeN/A

                                                          \[\leadsto \log c \cdot b + a \]
                                                        2. lift-log.f64N/A

                                                          \[\leadsto \log c \cdot b + a \]
                                                        3. lift-*.f6466.9

                                                          \[\leadsto \log c \cdot b + a \]
                                                      6. Applied rewrites66.9%

                                                        \[\leadsto \log c \cdot b + a \]

                                                      if 1e308 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                      1. Initial program 98.7%

                                                        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                      2. Taylor expanded in y around inf

                                                        \[\leadsto \color{blue}{i \cdot y} \]
                                                      3. Step-by-step derivation
                                                        1. lower-*.f6493.5

                                                          \[\leadsto i \cdot \color{blue}{y} \]
                                                      4. Applied rewrites93.5%

                                                        \[\leadsto \color{blue}{i \cdot y} \]
                                                    4. Recombined 3 regimes into one program.
                                                    5. Add Preprocessing

                                                    Alternative 17: 56.6% accurate, 3.6× speedup?

                                                    \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq 3.4 \cdot 10^{+164}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(z + t\right) + a\\ \end{array} \end{array} \]
                                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                    (FPCore (x y z t a b c i)
                                                     :precision binary64
                                                     (if (<= a 3.4e+164) (+ z (* y i)) (+ (+ z t) a)))
                                                    assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                    	double tmp;
                                                    	if (a <= 3.4e+164) {
                                                    		tmp = z + (y * i);
                                                    	} else {
                                                    		tmp = (z + t) + a;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                    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(x, y, z, t, a, b, c, i)
                                                    use fmin_fmax_functions
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        real(8), intent (in) :: z
                                                        real(8), intent (in) :: t
                                                        real(8), intent (in) :: a
                                                        real(8), intent (in) :: b
                                                        real(8), intent (in) :: c
                                                        real(8), intent (in) :: i
                                                        real(8) :: tmp
                                                        if (a <= 3.4d+164) then
                                                            tmp = z + (y * i)
                                                        else
                                                            tmp = (z + t) + a
                                                        end if
                                                        code = tmp
                                                    end function
                                                    
                                                    assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
                                                    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                    	double tmp;
                                                    	if (a <= 3.4e+164) {
                                                    		tmp = z + (y * i);
                                                    	} else {
                                                    		tmp = (z + t) + a;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
                                                    def code(x, y, z, t, a, b, c, i):
                                                    	tmp = 0
                                                    	if a <= 3.4e+164:
                                                    		tmp = z + (y * i)
                                                    	else:
                                                    		tmp = (z + t) + a
                                                    	return tmp
                                                    
                                                    x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                    function code(x, y, z, t, a, b, c, i)
                                                    	tmp = 0.0
                                                    	if (a <= 3.4e+164)
                                                    		tmp = Float64(z + Float64(y * i));
                                                    	else
                                                    		tmp = Float64(Float64(z + t) + a);
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
                                                    function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                    	tmp = 0.0;
                                                    	if (a <= 3.4e+164)
                                                    		tmp = z + (y * i);
                                                    	else
                                                    		tmp = (z + t) + a;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                    code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 3.4e+164], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]]
                                                    
                                                    \begin{array}{l}
                                                    [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;a \leq 3.4 \cdot 10^{+164}:\\
                                                    \;\;\;\;z + y \cdot i\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\left(z + t\right) + a\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 2 regimes
                                                    2. if a < 3.4000000000000001e164

                                                      1. Initial program 99.8%

                                                        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                      2. Taylor expanded in z around inf

                                                        \[\leadsto \color{blue}{z} + y \cdot i \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites52.7%

                                                          \[\leadsto \color{blue}{z} + y \cdot i \]

                                                        if 3.4000000000000001e164 < a

                                                        1. Initial program 99.7%

                                                          \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                        2. Taylor expanded in a around inf

                                                          \[\leadsto \color{blue}{a} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites55.8%

                                                            \[\leadsto \color{blue}{a} \]
                                                          2. Taylor expanded in x around 0

                                                            \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                                          3. Step-by-step derivation
                                                            1. +-commutativeN/A

                                                              \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                            2. lower-+.f64N/A

                                                              \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                          4. Applied rewrites91.6%

                                                            \[\leadsto \color{blue}{\left(\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + t\right) + a} \]
                                                          5. Taylor expanded in z around inf

                                                            \[\leadsto \left(z + t\right) + a \]
                                                          6. Step-by-step derivation
                                                            1. Applied rewrites65.2%

                                                              \[\leadsto \left(z + t\right) + a \]
                                                          7. Recombined 2 regimes into one program.
                                                          8. Add Preprocessing

                                                          Alternative 18: 56.0% accurate, 0.4× speedup?

                                                          \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\ \;\;\;\;t + y \cdot i\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;\left(z + t\right) + a\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
                                                          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                          (FPCore (x y z t a b c i)
                                                           :precision binary64
                                                           (let* ((t_1
                                                                   (+
                                                                    (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                                                    (* y i))))
                                                             (if (<= t_1 -1.1e+306)
                                                               (+ t (* y i))
                                                               (if (<= t_1 1e+308) (+ (+ z t) a) (* i y)))))
                                                          assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                          	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                          	double tmp;
                                                          	if (t_1 <= -1.1e+306) {
                                                          		tmp = t + (y * i);
                                                          	} else if (t_1 <= 1e+308) {
                                                          		tmp = (z + t) + a;
                                                          	} else {
                                                          		tmp = i * y;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                          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(x, y, z, t, a, b, c, i)
                                                          use fmin_fmax_functions
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              real(8), intent (in) :: z
                                                              real(8), intent (in) :: t
                                                              real(8), intent (in) :: a
                                                              real(8), intent (in) :: b
                                                              real(8), intent (in) :: c
                                                              real(8), intent (in) :: i
                                                              real(8) :: t_1
                                                              real(8) :: tmp
                                                              t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
                                                              if (t_1 <= (-1.1d+306)) then
                                                                  tmp = t + (y * i)
                                                              else if (t_1 <= 1d+308) then
                                                                  tmp = (z + t) + a
                                                              else
                                                                  tmp = i * y
                                                              end if
                                                              code = tmp
                                                          end function
                                                          
                                                          assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
                                                          public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                          	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
                                                          	double tmp;
                                                          	if (t_1 <= -1.1e+306) {
                                                          		tmp = t + (y * i);
                                                          	} else if (t_1 <= 1e+308) {
                                                          		tmp = (z + t) + a;
                                                          	} else {
                                                          		tmp = i * y;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
                                                          def code(x, y, z, t, a, b, c, i):
                                                          	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
                                                          	tmp = 0
                                                          	if t_1 <= -1.1e+306:
                                                          		tmp = t + (y * i)
                                                          	elif t_1 <= 1e+308:
                                                          		tmp = (z + t) + a
                                                          	else:
                                                          		tmp = i * y
                                                          	return tmp
                                                          
                                                          x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                          function code(x, y, z, t, a, b, c, i)
                                                          	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                                          	tmp = 0.0
                                                          	if (t_1 <= -1.1e+306)
                                                          		tmp = Float64(t + Float64(y * i));
                                                          	elseif (t_1 <= 1e+308)
                                                          		tmp = Float64(Float64(z + t) + a);
                                                          	else
                                                          		tmp = Float64(i * y);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
                                                          function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                          	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                          	tmp = 0.0;
                                                          	if (t_1 <= -1.1e+306)
                                                          		tmp = t + (y * i);
                                                          	elseif (t_1 <= 1e+308)
                                                          		tmp = (z + t) + a;
                                                          	else
                                                          		tmp = i * y;
                                                          	end
                                                          	tmp_2 = tmp;
                                                          end
                                                          
                                                          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.1e+306], N[(t + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision], N[(i * y), $MachinePrecision]]]]
                                                          
                                                          \begin{array}{l}
                                                          [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                                          \\
                                                          \begin{array}{l}
                                                          t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                                          \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\
                                                          \;\;\;\;t + y \cdot i\\
                                                          
                                                          \mathbf{elif}\;t\_1 \leq 10^{+308}:\\
                                                          \;\;\;\;\left(z + t\right) + a\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;i \cdot y\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 3 regimes
                                                          2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.1e306

                                                            1. Initial program 100.0%

                                                              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                            2. Taylor expanded in t around inf

                                                              \[\leadsto \color{blue}{t} + y \cdot i \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites81.6%

                                                                \[\leadsto \color{blue}{t} + y \cdot i \]

                                                              if -1.1e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1e308

                                                              1. Initial program 99.8%

                                                                \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                              2. Taylor expanded in a around inf

                                                                \[\leadsto \color{blue}{a} \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites26.3%

                                                                  \[\leadsto \color{blue}{a} \]
                                                                2. Taylor expanded in x around 0

                                                                  \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                                                3. Step-by-step derivation
                                                                  1. +-commutativeN/A

                                                                    \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                                  2. lower-+.f64N/A

                                                                    \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                                4. Applied rewrites82.5%

                                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + t\right) + a} \]
                                                                5. Taylor expanded in z around inf

                                                                  \[\leadsto \left(z + t\right) + a \]
                                                                6. Step-by-step derivation
                                                                  1. Applied rewrites50.7%

                                                                    \[\leadsto \left(z + t\right) + a \]

                                                                  if 1e308 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                                  1. Initial program 98.7%

                                                                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                  2. Taylor expanded in y around inf

                                                                    \[\leadsto \color{blue}{i \cdot y} \]
                                                                  3. Step-by-step derivation
                                                                    1. lower-*.f6493.5

                                                                      \[\leadsto i \cdot \color{blue}{y} \]
                                                                  4. Applied rewrites93.5%

                                                                    \[\leadsto \color{blue}{i \cdot y} \]
                                                                7. Recombined 3 regimes into one program.
                                                                8. Add Preprocessing

                                                                Alternative 19: 56.0% accurate, 0.4× speedup?

                                                                \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;\left(z + t\right) + a\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
                                                                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                (FPCore (x y z t a b c i)
                                                                 :precision binary64
                                                                 (let* ((t_1
                                                                         (+
                                                                          (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                                                          (* y i))))
                                                                   (if (<= t_1 -1.1e+306) (* i y) (if (<= t_1 1e+308) (+ (+ z t) a) (* i y)))))
                                                                assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                                	double tmp;
                                                                	if (t_1 <= -1.1e+306) {
                                                                		tmp = i * y;
                                                                	} else if (t_1 <= 1e+308) {
                                                                		tmp = (z + t) + a;
                                                                	} else {
                                                                		tmp = i * y;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                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(x, y, z, t, a, b, c, i)
                                                                use fmin_fmax_functions
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    real(8), intent (in) :: z
                                                                    real(8), intent (in) :: t
                                                                    real(8), intent (in) :: a
                                                                    real(8), intent (in) :: b
                                                                    real(8), intent (in) :: c
                                                                    real(8), intent (in) :: i
                                                                    real(8) :: t_1
                                                                    real(8) :: tmp
                                                                    t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
                                                                    if (t_1 <= (-1.1d+306)) then
                                                                        tmp = i * y
                                                                    else if (t_1 <= 1d+308) then
                                                                        tmp = (z + t) + a
                                                                    else
                                                                        tmp = i * y
                                                                    end if
                                                                    code = tmp
                                                                end function
                                                                
                                                                assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
                                                                public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
                                                                	double tmp;
                                                                	if (t_1 <= -1.1e+306) {
                                                                		tmp = i * y;
                                                                	} else if (t_1 <= 1e+308) {
                                                                		tmp = (z + t) + a;
                                                                	} else {
                                                                		tmp = i * y;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
                                                                def code(x, y, z, t, a, b, c, i):
                                                                	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
                                                                	tmp = 0
                                                                	if t_1 <= -1.1e+306:
                                                                		tmp = i * y
                                                                	elif t_1 <= 1e+308:
                                                                		tmp = (z + t) + a
                                                                	else:
                                                                		tmp = i * y
                                                                	return tmp
                                                                
                                                                x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                                function code(x, y, z, t, a, b, c, i)
                                                                	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                                                	tmp = 0.0
                                                                	if (t_1 <= -1.1e+306)
                                                                		tmp = Float64(i * y);
                                                                	elseif (t_1 <= 1e+308)
                                                                		tmp = Float64(Float64(z + t) + a);
                                                                	else
                                                                		tmp = Float64(i * y);
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
                                                                function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                                	tmp = 0.0;
                                                                	if (t_1 <= -1.1e+306)
                                                                		tmp = i * y;
                                                                	elseif (t_1 <= 1e+308)
                                                                		tmp = (z + t) + a;
                                                                	else
                                                                		tmp = i * y;
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.1e+306], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision], N[(i * y), $MachinePrecision]]]]
                                                                
                                                                \begin{array}{l}
                                                                [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                                                \\
                                                                \begin{array}{l}
                                                                t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                                                \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\
                                                                \;\;\;\;i \cdot y\\
                                                                
                                                                \mathbf{elif}\;t\_1 \leq 10^{+308}:\\
                                                                \;\;\;\;\left(z + t\right) + a\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;i \cdot y\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 2 regimes
                                                                2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.1e306 or 1e308 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                                  1. Initial program 99.4%

                                                                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                  2. Taylor expanded in y around inf

                                                                    \[\leadsto \color{blue}{i \cdot y} \]
                                                                  3. Step-by-step derivation
                                                                    1. lower-*.f6487.2

                                                                      \[\leadsto i \cdot \color{blue}{y} \]
                                                                  4. Applied rewrites87.2%

                                                                    \[\leadsto \color{blue}{i \cdot y} \]

                                                                  if -1.1e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1e308

                                                                  1. Initial program 99.8%

                                                                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                  2. Taylor expanded in a around inf

                                                                    \[\leadsto \color{blue}{a} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites26.3%

                                                                      \[\leadsto \color{blue}{a} \]
                                                                    2. Taylor expanded in x around 0

                                                                      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                                                    3. Step-by-step derivation
                                                                      1. +-commutativeN/A

                                                                        \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                                      2. lower-+.f64N/A

                                                                        \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                                    4. Applied rewrites82.5%

                                                                      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + t\right) + a} \]
                                                                    5. Taylor expanded in z around inf

                                                                      \[\leadsto \left(z + t\right) + a \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites50.7%

                                                                        \[\leadsto \left(z + t\right) + a \]
                                                                    7. Recombined 2 regimes into one program.
                                                                    8. Add Preprocessing

                                                                    Alternative 20: 55.4% accurate, 0.4× speedup?

                                                                    \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq 10^{+308}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
                                                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                    (FPCore (x y z t a b c i)
                                                                     :precision binary64
                                                                     (let* ((t_1
                                                                             (+
                                                                              (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                                                                              (* y i))))
                                                                       (if (<= t_1 -1.1e+306) (* i y) (if (<= t_1 1e+308) (+ z a) (* i y)))))
                                                                    assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                                    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                    	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                                    	double tmp;
                                                                    	if (t_1 <= -1.1e+306) {
                                                                    		tmp = i * y;
                                                                    	} else if (t_1 <= 1e+308) {
                                                                    		tmp = z + a;
                                                                    	} else {
                                                                    		tmp = i * y;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                    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(x, y, z, t, a, b, c, i)
                                                                    use fmin_fmax_functions
                                                                        real(8), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        real(8), intent (in) :: z
                                                                        real(8), intent (in) :: t
                                                                        real(8), intent (in) :: a
                                                                        real(8), intent (in) :: b
                                                                        real(8), intent (in) :: c
                                                                        real(8), intent (in) :: i
                                                                        real(8) :: t_1
                                                                        real(8) :: tmp
                                                                        t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
                                                                        if (t_1 <= (-1.1d+306)) then
                                                                            tmp = i * y
                                                                        else if (t_1 <= 1d+308) then
                                                                            tmp = z + a
                                                                        else
                                                                            tmp = i * y
                                                                        end if
                                                                        code = tmp
                                                                    end function
                                                                    
                                                                    assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
                                                                    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                    	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
                                                                    	double tmp;
                                                                    	if (t_1 <= -1.1e+306) {
                                                                    		tmp = i * y;
                                                                    	} else if (t_1 <= 1e+308) {
                                                                    		tmp = z + a;
                                                                    	} else {
                                                                    		tmp = i * y;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
                                                                    def code(x, y, z, t, a, b, c, i):
                                                                    	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
                                                                    	tmp = 0
                                                                    	if t_1 <= -1.1e+306:
                                                                    		tmp = i * y
                                                                    	elif t_1 <= 1e+308:
                                                                    		tmp = z + a
                                                                    	else:
                                                                    		tmp = i * y
                                                                    	return tmp
                                                                    
                                                                    x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                                    function code(x, y, z, t, a, b, c, i)
                                                                    	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                                                                    	tmp = 0.0
                                                                    	if (t_1 <= -1.1e+306)
                                                                    		tmp = Float64(i * y);
                                                                    	elseif (t_1 <= 1e+308)
                                                                    		tmp = Float64(z + a);
                                                                    	else
                                                                    		tmp = Float64(i * y);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
                                                                    function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                    	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                                                                    	tmp = 0.0;
                                                                    	if (t_1 <= -1.1e+306)
                                                                    		tmp = i * y;
                                                                    	elseif (t_1 <= 1e+308)
                                                                    		tmp = z + a;
                                                                    	else
                                                                    		tmp = i * y;
                                                                    	end
                                                                    	tmp_2 = tmp;
                                                                    end
                                                                    
                                                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.1e+306], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(z + a), $MachinePrecision], N[(i * y), $MachinePrecision]]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                                                    \mathbf{if}\;t\_1 \leq -1.1 \cdot 10^{+306}:\\
                                                                    \;\;\;\;i \cdot y\\
                                                                    
                                                                    \mathbf{elif}\;t\_1 \leq 10^{+308}:\\
                                                                    \;\;\;\;z + a\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;i \cdot y\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.1e306 or 1e308 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                                      1. Initial program 99.4%

                                                                        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                      2. Taylor expanded in y around inf

                                                                        \[\leadsto \color{blue}{i \cdot y} \]
                                                                      3. Step-by-step derivation
                                                                        1. lower-*.f6487.2

                                                                          \[\leadsto i \cdot \color{blue}{y} \]
                                                                      4. Applied rewrites87.2%

                                                                        \[\leadsto \color{blue}{i \cdot y} \]

                                                                      if -1.1e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1e308

                                                                      1. Initial program 99.8%

                                                                        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                      2. Taylor expanded in a around inf

                                                                        \[\leadsto \color{blue}{a} \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites26.3%

                                                                          \[\leadsto \color{blue}{a} \]
                                                                        2. Taylor expanded in x around 0

                                                                          \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                                                        3. Step-by-step derivation
                                                                          1. +-commutativeN/A

                                                                            \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                                          2. lower-+.f64N/A

                                                                            \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                                        4. Applied rewrites82.5%

                                                                          \[\leadsto \color{blue}{\left(\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + t\right) + a} \]
                                                                        5. Taylor expanded in z around inf

                                                                          \[\leadsto z + a \]
                                                                        6. Step-by-step derivation
                                                                          1. Applied rewrites50.0%

                                                                            \[\leadsto z + a \]
                                                                        7. Recombined 2 regimes into one program.
                                                                        8. Add Preprocessing

                                                                        Alternative 21: 44.4% accurate, 0.9× speedup?

                                                                        \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -200:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;t + a\\ \end{array} \end{array} \]
                                                                        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                        (FPCore (x y z t a b c i)
                                                                         :precision binary64
                                                                         (if (<=
                                                                              (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
                                                                              -200.0)
                                                                           z
                                                                           (+ t a)))
                                                                        assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                        	double tmp;
                                                                        	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -200.0) {
                                                                        		tmp = z;
                                                                        	} else {
                                                                        		tmp = t + a;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                        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(x, y, z, t, a, b, c, i)
                                                                        use fmin_fmax_functions
                                                                            real(8), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            real(8), intent (in) :: z
                                                                            real(8), intent (in) :: t
                                                                            real(8), intent (in) :: a
                                                                            real(8), intent (in) :: b
                                                                            real(8), intent (in) :: c
                                                                            real(8), intent (in) :: i
                                                                            real(8) :: tmp
                                                                            if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)) <= (-200.0d0)) then
                                                                                tmp = z
                                                                            else
                                                                                tmp = t + a
                                                                            end if
                                                                            code = tmp
                                                                        end function
                                                                        
                                                                        assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
                                                                        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                        	double tmp;
                                                                        	if (((((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i)) <= -200.0) {
                                                                        		tmp = z;
                                                                        	} else {
                                                                        		tmp = t + a;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
                                                                        def code(x, y, z, t, a, b, c, i):
                                                                        	tmp = 0
                                                                        	if ((((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)) <= -200.0:
                                                                        		tmp = z
                                                                        	else:
                                                                        		tmp = t + a
                                                                        	return tmp
                                                                        
                                                                        x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                                        function code(x, y, z, t, a, b, c, i)
                                                                        	tmp = 0.0
                                                                        	if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= -200.0)
                                                                        		tmp = z;
                                                                        	else
                                                                        		tmp = Float64(t + a);
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
                                                                        function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                        	tmp = 0.0;
                                                                        	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -200.0)
                                                                        		tmp = z;
                                                                        	else
                                                                        		tmp = t + a;
                                                                        	end
                                                                        	tmp_2 = tmp;
                                                                        end
                                                                        
                                                                        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                        code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -200.0], z, N[(t + a), $MachinePrecision]]
                                                                        
                                                                        \begin{array}{l}
                                                                        [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                                                        \\
                                                                        \begin{array}{l}
                                                                        \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -200:\\
                                                                        \;\;\;\;z\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;t + a\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 2 regimes
                                                                        2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -200

                                                                          1. Initial program 99.9%

                                                                            \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                          2. Taylor expanded in z around inf

                                                                            \[\leadsto \color{blue}{z} \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites44.3%

                                                                              \[\leadsto \color{blue}{z} \]

                                                                            if -200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                                            1. Initial program 99.7%

                                                                              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                            2. Taylor expanded in z around 0

                                                                              \[\leadsto \color{blue}{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                                                            3. Applied rewrites98.3%

                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a} \]
                                                                            4. Taylor expanded in t around inf

                                                                              \[\leadsto t + a \]
                                                                            5. Step-by-step derivation
                                                                              1. Applied rewrites44.4%

                                                                                \[\leadsto t + a \]
                                                                            6. Recombined 2 regimes into one program.
                                                                            7. Add Preprocessing

                                                                            Alternative 22: 44.1% accurate, 10.1× speedup?

                                                                            \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ z + a \end{array} \]
                                                                            NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                            (FPCore (x y z t a b c i) :precision binary64 (+ z a))
                                                                            assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                                            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                            	return z + a;
                                                                            }
                                                                            
                                                                            NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                            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(x, y, z, t, a, b, c, i)
                                                                            use fmin_fmax_functions
                                                                                real(8), intent (in) :: x
                                                                                real(8), intent (in) :: y
                                                                                real(8), intent (in) :: z
                                                                                real(8), intent (in) :: t
                                                                                real(8), intent (in) :: a
                                                                                real(8), intent (in) :: b
                                                                                real(8), intent (in) :: c
                                                                                real(8), intent (in) :: i
                                                                                code = z + a
                                                                            end function
                                                                            
                                                                            assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
                                                                            public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                            	return z + a;
                                                                            }
                                                                            
                                                                            [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
                                                                            def code(x, y, z, t, a, b, c, i):
                                                                            	return z + a
                                                                            
                                                                            x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                                            function code(x, y, z, t, a, b, c, i)
                                                                            	return Float64(z + a)
                                                                            end
                                                                            
                                                                            x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
                                                                            function tmp = code(x, y, z, t, a, b, c, i)
                                                                            	tmp = z + a;
                                                                            end
                                                                            
                                                                            NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                            code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z + a), $MachinePrecision]
                                                                            
                                                                            \begin{array}{l}
                                                                            [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                                                            \\
                                                                            z + a
                                                                            \end{array}
                                                                            
                                                                            Derivation
                                                                            1. Initial program 99.8%

                                                                              \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                            2. Taylor expanded in a around inf

                                                                              \[\leadsto \color{blue}{a} \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites22.9%

                                                                                \[\leadsto \color{blue}{a} \]
                                                                              2. Taylor expanded in x around 0

                                                                                \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                                                              3. Step-by-step derivation
                                                                                1. +-commutativeN/A

                                                                                  \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                                                2. lower-+.f64N/A

                                                                                  \[\leadsto \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + \color{blue}{a} \]
                                                                              4. Applied rewrites84.4%

                                                                                \[\leadsto \color{blue}{\left(\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + t\right) + a} \]
                                                                              5. Taylor expanded in z around inf

                                                                                \[\leadsto z + a \]
                                                                              6. Step-by-step derivation
                                                                                1. Applied rewrites44.0%

                                                                                  \[\leadsto z + a \]
                                                                                2. Add Preprocessing

                                                                                Alternative 23: 44.0% accurate, 0.9× speedup?

                                                                                \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -200:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
                                                                                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                (FPCore (x y z t a b c i)
                                                                                 :precision binary64
                                                                                 (if (<=
                                                                                      (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
                                                                                      -200.0)
                                                                                   z
                                                                                   a))
                                                                                assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                                                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                	double tmp;
                                                                                	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -200.0) {
                                                                                		tmp = z;
                                                                                	} else {
                                                                                		tmp = a;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                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(x, y, z, t, a, b, c, i)
                                                                                use fmin_fmax_functions
                                                                                    real(8), intent (in) :: x
                                                                                    real(8), intent (in) :: y
                                                                                    real(8), intent (in) :: z
                                                                                    real(8), intent (in) :: t
                                                                                    real(8), intent (in) :: a
                                                                                    real(8), intent (in) :: b
                                                                                    real(8), intent (in) :: c
                                                                                    real(8), intent (in) :: i
                                                                                    real(8) :: tmp
                                                                                    if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)) <= (-200.0d0)) then
                                                                                        tmp = z
                                                                                    else
                                                                                        tmp = a
                                                                                    end if
                                                                                    code = tmp
                                                                                end function
                                                                                
                                                                                assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
                                                                                public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                	double tmp;
                                                                                	if (((((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i)) <= -200.0) {
                                                                                		tmp = z;
                                                                                	} else {
                                                                                		tmp = a;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
                                                                                def code(x, y, z, t, a, b, c, i):
                                                                                	tmp = 0
                                                                                	if ((((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)) <= -200.0:
                                                                                		tmp = z
                                                                                	else:
                                                                                		tmp = a
                                                                                	return tmp
                                                                                
                                                                                x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                                                function code(x, y, z, t, a, b, c, i)
                                                                                	tmp = 0.0
                                                                                	if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= -200.0)
                                                                                		tmp = z;
                                                                                	else
                                                                                		tmp = a;
                                                                                	end
                                                                                	return tmp
                                                                                end
                                                                                
                                                                                x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
                                                                                function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                                	tmp = 0.0;
                                                                                	if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -200.0)
                                                                                		tmp = z;
                                                                                	else
                                                                                		tmp = a;
                                                                                	end
                                                                                	tmp_2 = tmp;
                                                                                end
                                                                                
                                                                                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -200.0], z, a]
                                                                                
                                                                                \begin{array}{l}
                                                                                [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                                                                \\
                                                                                \begin{array}{l}
                                                                                \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -200:\\
                                                                                \;\;\;\;z\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;a\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 2 regimes
                                                                                2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -200

                                                                                  1. Initial program 99.9%

                                                                                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                                  2. Taylor expanded in z around inf

                                                                                    \[\leadsto \color{blue}{z} \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites44.3%

                                                                                      \[\leadsto \color{blue}{z} \]

                                                                                    if -200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i))

                                                                                    1. Initial program 99.7%

                                                                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                                    2. Taylor expanded in a around inf

                                                                                      \[\leadsto \color{blue}{a} \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites43.9%

                                                                                        \[\leadsto \color{blue}{a} \]
                                                                                    4. Recombined 2 regimes into one program.
                                                                                    5. Add Preprocessing

                                                                                    Alternative 24: 22.9% accurate, 37.6× speedup?

                                                                                    \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ a \end{array} \]
                                                                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                    (FPCore (x y z t a b c i) :precision binary64 a)
                                                                                    assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                                                    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                    	return a;
                                                                                    }
                                                                                    
                                                                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                    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(x, y, z, t, a, b, c, i)
                                                                                    use fmin_fmax_functions
                                                                                        real(8), intent (in) :: x
                                                                                        real(8), intent (in) :: y
                                                                                        real(8), intent (in) :: z
                                                                                        real(8), intent (in) :: t
                                                                                        real(8), intent (in) :: a
                                                                                        real(8), intent (in) :: b
                                                                                        real(8), intent (in) :: c
                                                                                        real(8), intent (in) :: i
                                                                                        code = a
                                                                                    end function
                                                                                    
                                                                                    assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
                                                                                    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                    	return a;
                                                                                    }
                                                                                    
                                                                                    [x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
                                                                                    def code(x, y, z, t, a, b, c, i):
                                                                                    	return a
                                                                                    
                                                                                    x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                                                    function code(x, y, z, t, a, b, c, i)
                                                                                    	return a
                                                                                    end
                                                                                    
                                                                                    x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
                                                                                    function tmp = code(x, y, z, t, a, b, c, i)
                                                                                    	tmp = a;
                                                                                    end
                                                                                    
                                                                                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                    code[x_, y_, z_, t_, a_, b_, c_, i_] := a
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                                                                    \\
                                                                                    a
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Initial program 99.8%

                                                                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                                    2. Taylor expanded in a around inf

                                                                                      \[\leadsto \color{blue}{a} \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites22.9%

                                                                                        \[\leadsto \color{blue}{a} \]
                                                                                      2. Add Preprocessing

                                                                                      Reproduce

                                                                                      ?
                                                                                      herbie shell --seed 2025130 
                                                                                      (FPCore (x y z t a b c i)
                                                                                        :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
                                                                                        :precision binary64
                                                                                        (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))