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

Percentage Accurate: 99.8% → 99.8%
Time: 6.6s
Alternatives: 15
Speedup: 1.0×

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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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.0× 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(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(a + t\right) + \mathsf{fma}\left(\log y, x, z\right)\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 y i (fma (log c) (- b 0.5) (+ (+ a t) (fma (log y) x z)))))
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(y, i, fma(log(c), (b - 0.5), ((a + t) + fma(log(y), x, z))));
}
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(y, i, fma(log(c), Float64(b - 0.5), Float64(Float64(a + t) + fma(log(y), x, z))))
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[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[(a + t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $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(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(a + t\right) + \mathsf{fma}\left(\log y, x, z\right)\right)\right)
\end{array}
Derivation
  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. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 55.9% 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 -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq -50:\\ \;\;\;\;z\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\ \;\;\;\;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 (- INFINITY))
     (* i y)
     (if (<= t_1 -50.0) z (if (<= t_1 2e+306) 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 <= -((double) INFINITY)) {
		tmp = i * y;
	} else if (t_1 <= -50.0) {
		tmp = z;
	} else if (t_1 <= 2e+306) {
		tmp = a;
	} else {
		tmp = i * y;
	}
	return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
		tmp = i * y;
	} else if (t_1 <= -50.0) {
		tmp = z;
	} else if (t_1 <= 2e+306) {
		tmp = 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 <= -math.inf:
		tmp = i * y
	elif t_1 <= -50.0:
		tmp = z
	elif t_1 <= 2e+306:
		tmp = 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 <= Float64(-Inf))
		tmp = Float64(i * y);
	elseif (t_1 <= -50.0)
		tmp = z;
	elseif (t_1 <= 2e+306)
		tmp = 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 <= -Inf)
		tmp = i * y;
	elseif (t_1 <= -50.0)
		tmp = z;
	elseif (t_1 <= 2e+306)
		tmp = 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, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -50.0], z, If[LessEqual[t$95$1, 2e+306], a, 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 -\infty:\\
\;\;\;\;i \cdot y\\

\mathbf{elif}\;t\_1 \leq -50:\\
\;\;\;\;z\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;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)) < -inf.0 or 2.00000000000000003e306 < (+.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 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. Add Preprocessing
    3. Taylor expanded in y around inf

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

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

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

    if -inf.0 < (+.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)) < -50

    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. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z} \]
    4. Step-by-step derivation
      1. Applied rewrites14.7%

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

      if -50 < (+.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)) < 2.00000000000000003e306

      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. Add Preprocessing
      3. Taylor expanded in a around inf

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

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

      Alternative 3: 78.3% 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(b - 0.5\right) \cdot \log c\\ t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\ \mathbf{elif}\;t\_2 \leq 400:\\ \;\;\;\;a + \mathsf{fma}\left(\log c, b - 0.5, z\right)\\ \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)))
              (t_2 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) t_1) (* y i))))
         (if (<= t_2 (- INFINITY))
           (fma y i (* (log y) x))
           (if (<= t_2 400.0)
             (+ a (fma (log c) (- b 0.5) z))
             (+ (+ 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 t_2 = (((((x * log(y)) + z) + t) + a) + t_1) + (y * i);
      	double tmp;
      	if (t_2 <= -((double) INFINITY)) {
      		tmp = fma(y, i, (log(y) * x));
      	} else if (t_2 <= 400.0) {
      		tmp = a + fma(log(c), (b - 0.5), z);
      	} 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))
      	t_2 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + t_1) + Float64(y * i))
      	tmp = 0.0
      	if (t_2 <= Float64(-Inf))
      		tmp = fma(y, i, Float64(log(y) * x));
      	elseif (t_2 <= 400.0)
      		tmp = Float64(a + fma(log(c), Float64(b - 0.5), z));
      	else
      		tmp = Float64(Float64(a + t_1) + 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[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, (-Infinity)], N[(y * i + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 400.0], N[(a + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $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\\
      t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i\\
      \mathbf{if}\;t\_2 \leq -\infty:\\
      \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\
      
      \mathbf{elif}\;t\_2 \leq 400:\\
      \;\;\;\;a + \mathsf{fma}\left(\log c, b - 0.5, z\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(a + t\_1\right) + y \cdot i\\
      
      
      \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)) < -inf.0

        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. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, x \cdot \log y\right) \]
          5. associate-+l+N/A

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

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

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

            \[\leadsto \mathsf{fma}\left(y, i, \log y \cdot \color{blue}{x}\right) \]
          9. lift-log.f64100.0

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

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

        if -inf.0 < (+.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)) < 400

        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. Add Preprocessing
        3. 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)} \]
        4. Step-by-step derivation
          1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(\color{blue}{b} - \frac{1}{2}\right)\right) \]
          12. lift--.f6488.0

            \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(b - \color{blue}{0.5}\right)\right) \]
        5. Applied rewrites88.0%

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

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

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

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

            \[\leadsto \left(a + t\right) + \mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right) \]
          4. lift--.f6472.6

            \[\leadsto \left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, z\right) \]
        8. Applied rewrites72.6%

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

          \[\leadsto a + \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right) \]
        10. Step-by-step derivation
          1. Applied rewrites57.0%

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

          if 400 < (+.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.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. Add Preprocessing
          3. Taylor expanded in a around inf

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

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

          Alternative 4: 66.3% 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 -2 \cdot 10^{+55}:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+233}:\\ \;\;\;\;\left(a + t\right) + \log c \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\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 -2e+55)
               (fma y i z)
               (if (<= t_1 5e+233) (+ (+ a t) (* (log c) b)) (fma y i 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 t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
          	double tmp;
          	if (t_1 <= -2e+55) {
          		tmp = fma(y, i, z);
          	} else if (t_1 <= 5e+233) {
          		tmp = (a + t) + (log(c) * b);
          	} else {
          		tmp = fma(y, i, 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)
          	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 <= -2e+55)
          		tmp = fma(y, i, z);
          	elseif (t_1 <= 5e+233)
          		tmp = Float64(Float64(a + t) + Float64(log(c) * b));
          	else
          		tmp = fma(y, i, 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_] := 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, -2e+55], N[(y * i + z), $MachinePrecision], If[LessEqual[t$95$1, 5e+233], N[(N[(a + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(y * i + 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}
          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 -2 \cdot 10^{+55}:\\
          \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
          
          \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+233}:\\
          \;\;\;\;\left(a + t\right) + \log c \cdot b\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
          
          
          \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)) < -2.00000000000000002e55

            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. Add Preprocessing
            3. Taylor expanded in z around inf

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

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

                  \[\leadsto \color{blue}{z + y \cdot i} \]
                2. +-commutativeN/A

                  \[\leadsto \color{blue}{y \cdot i + z} \]
                3. lift-*.f64N/A

                  \[\leadsto \color{blue}{y \cdot i} + z \]
                4. lower-fma.f6433.3

                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, z\right)} \]
              3. Applied rewrites33.3%

                \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, z\right)} \]

              if -2.00000000000000002e55 < (+.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.00000000000000009e233

              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. Add Preprocessing
              3. 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)} \]
              4. Step-by-step derivation
                1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(\color{blue}{b} - \frac{1}{2}\right)\right) \]
                12. lift--.f6487.8

                  \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(b - \color{blue}{0.5}\right)\right) \]
              5. Applied rewrites87.8%

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

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

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

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

                  \[\leadsto \left(a + t\right) + \log c \cdot b \]
              8. Applied rewrites57.2%

                \[\leadsto \left(a + t\right) + \log c \cdot \color{blue}{b} \]

              if 5.00000000000000009e233 < (+.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.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. Add Preprocessing
              3. Step-by-step derivation
                1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
              6. Step-by-step derivation
                1. *-commutative48.8

                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                2. +-commutative48.8

                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                3. *-commutative48.8

                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                4. +-commutative48.8

                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                5. associate-+l+48.8

                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                6. +-commutative48.8

                  \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
              7. Applied rewrites48.8%

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

            Alternative 5: 56.5% accurate, 0.5× 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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + z\\ \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 (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+306)))
                 (* i y)
                 (+ (+ a t) z))))
            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 <= -((double) INFINITY)) || !(t_1 <= 2e+306)) {
            		tmp = i * y;
            	} else {
            		tmp = (a + t) + z;
            	}
            	return tmp;
            }
            
            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 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+306)) {
            		tmp = i * y;
            	} else {
            		tmp = (a + t) + z;
            	}
            	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 <= -math.inf) or not (t_1 <= 2e+306):
            		tmp = i * y
            	else:
            		tmp = (a + t) + z
            	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 <= Float64(-Inf)) || !(t_1 <= 2e+306))
            		tmp = Float64(i * y);
            	else
            		tmp = Float64(Float64(a + t) + z);
            	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 <= -Inf) || ~((t_1 <= 2e+306)))
            		tmp = i * y;
            	else
            		tmp = (a + t) + z;
            	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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+306]], $MachinePrecision]], N[(i * y), $MachinePrecision], N[(N[(a + t), $MachinePrecision] + z), $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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\
            \;\;\;\;i \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(a + t\right) + z\\
            
            
            \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)) < -inf.0 or 2.00000000000000003e306 < (+.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 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. Add Preprocessing
              3. Taylor expanded in y around inf

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

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

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

              if -inf.0 < (+.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)) < 2.00000000000000003e306

              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. Add Preprocessing
              3. 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)} \]
              4. Step-by-step derivation
                1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(\color{blue}{b} - \frac{1}{2}\right)\right) \]
                12. lift--.f6485.2

                  \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(b - \color{blue}{0.5}\right)\right) \]
              5. Applied rewrites85.2%

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

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

                  \[\leadsto \left(a + t\right) + z \]
              8. Recombined 2 regimes into one program.
              9. Final simplification57.7%

                \[\leadsto \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 -\infty \lor \neg \left(\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 2 \cdot 10^{+306}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + z\\ \end{array} \]
              10. Add Preprocessing

              Alternative 6: 61.6% accurate, 0.5× 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 -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;\left(a + t\right) + z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\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 (- INFINITY))
                   (* i y)
                   (if (<= t_1 10.0) (+ (+ a t) z) (fma y i 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 t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
              	double tmp;
              	if (t_1 <= -((double) INFINITY)) {
              		tmp = i * y;
              	} else if (t_1 <= 10.0) {
              		tmp = (a + t) + z;
              	} else {
              		tmp = fma(y, i, 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)
              	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 <= Float64(-Inf))
              		tmp = Float64(i * y);
              	elseif (t_1 <= 10.0)
              		tmp = Float64(Float64(a + t) + z);
              	else
              		tmp = fma(y, i, 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_] := 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, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, 10.0], N[(N[(a + t), $MachinePrecision] + z), $MachinePrecision], N[(y * i + 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}
              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 -\infty:\\
              \;\;\;\;i \cdot y\\
              
              \mathbf{elif}\;t\_1 \leq 10:\\
              \;\;\;\;\left(a + t\right) + z\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
              
              
              \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)) < -inf.0

                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. Add Preprocessing
                3. Taylor expanded in y around inf

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

                    \[\leadsto i \cdot \color{blue}{y} \]
                5. Applied rewrites91.1%

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

                if -inf.0 < (+.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)) < 10

                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. Add Preprocessing
                3. 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)} \]
                4. Step-by-step derivation
                  1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(\color{blue}{b} - \frac{1}{2}\right)\right) \]
                  12. lift--.f6487.7

                    \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(b - \color{blue}{0.5}\right)\right) \]
                5. Applied rewrites87.7%

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

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

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

                  if 10 < (+.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.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. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                  6. Step-by-step derivation
                    1. *-commutative40.6

                      \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                    2. +-commutative40.6

                      \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                    3. *-commutative40.6

                      \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                    4. +-commutative40.6

                      \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                    5. associate-+l+40.6

                      \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                    6. +-commutative40.6

                      \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                  7. Applied rewrites40.6%

                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                8. Recombined 3 regimes into one program.
                9. Add Preprocessing

                Alternative 7: 83.4% 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 400:\\ \;\;\;\;\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)) 400.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)) <= 400.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)) <= 400.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)) <= 400.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)) <= 400.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)) <= 400.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)) <= 400.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], 400.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 400:\\
                \;\;\;\;\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)) < 400

                  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. Add Preprocessing
                  3. Taylor expanded in z around inf

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

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

                    if 400 < (+.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.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. Add Preprocessing
                    3. 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 \]
                    4. Step-by-step derivation
                      1. Applied rewrites77.2%

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

                    Alternative 8: 83.1% 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\\ \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i \leq 400:\\ \;\;\;\;\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)) 400.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)) <= 400.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)) <= 400.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)) <= 400.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)) <= 400.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)) <= 400.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)) <= 400.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], 400.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 400:\\
                    \;\;\;\;\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)) < 400

                      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. Add Preprocessing
                      3. Taylor expanded in z around inf

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

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

                        if 400 < (+.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.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. Add Preprocessing
                        3. Taylor expanded in a around inf

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

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

                        Alternative 9: 66.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} \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 10:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\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
                         (if (<=
                              (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
                              10.0)
                           (fma y i z)
                           (fma y i 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)) <= 10.0) {
                        		tmp = fma(y, i, z);
                        	} else {
                        		tmp = fma(y, i, 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)) <= 10.0)
                        		tmp = fma(y, i, z);
                        	else
                        		tmp = fma(y, i, 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[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], 10.0], N[(y * i + z), $MachinePrecision], N[(y * i + 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 10:\\
                        \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
                        
                        
                        \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)) < 10

                          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. Add Preprocessing
                          3. Taylor expanded in z around inf

                            \[\leadsto \color{blue}{z} + y \cdot i \]
                          4. Step-by-step derivation
                            1. Applied rewrites31.5%

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

                                \[\leadsto \color{blue}{z + y \cdot i} \]
                              2. +-commutativeN/A

                                \[\leadsto \color{blue}{y \cdot i + z} \]
                              3. lift-*.f64N/A

                                \[\leadsto \color{blue}{y \cdot i} + z \]
                              4. lower-fma.f6431.5

                                \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, z\right)} \]
                            3. Applied rewrites31.5%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, z\right)} \]

                            if 10 < (+.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.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. Add Preprocessing
                            3. Step-by-step derivation
                              1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                            6. Step-by-step derivation
                              1. *-commutative40.6

                                \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                              2. +-commutative40.6

                                \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                              3. *-commutative40.6

                                \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                              4. +-commutative40.6

                                \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                              5. associate-+l+40.6

                                \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                              6. +-commutative40.6

                                \[\leadsto \mathsf{fma}\left(y, i, a\right) \]
                            7. Applied rewrites40.6%

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

                          Alternative 10: 44.4% 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}\;\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 -50:\\ \;\;\;\;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))
                                -50.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)) <= -50.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)) <= (-50.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)) <= -50.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)) <= -50.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)) <= -50.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)) <= -50.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], -50.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 -50:\\
                          \;\;\;\;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)) < -50

                            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. Add Preprocessing
                            3. Taylor expanded in z around inf

                              \[\leadsto \color{blue}{z} \]
                            4. Step-by-step derivation
                              1. Applied rewrites13.7%

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

                              if -50 < (+.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.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. Add Preprocessing
                              3. Taylor expanded in a around inf

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

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

                              Alternative 11: 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 -3.15 \cdot 10^{+53}:\\ \;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{elif}\;i \leq 1.55 \cdot 10^{+29}:\\ \;\;\;\;\left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{\log y \cdot x}{i}\right)\right) \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
                               (if (<= i -3.15e+53)
                                 (+ (+ (+ z a) (* (- b 0.5) (log c))) (* y i))
                                 (if (<= i 1.55e+29)
                                   (+ (+ a t) (+ (fma (log y) x z) (* (log c) (- b 0.5))))
                                   (* (+ (+ y (/ a i)) (+ (+ (/ t i) (/ z i)) (/ (* (log y) x) i))) 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 tmp;
                              	if (i <= -3.15e+53) {
                              		tmp = ((z + a) + ((b - 0.5) * log(c))) + (y * i);
                              	} else if (i <= 1.55e+29) {
                              		tmp = (a + t) + (fma(log(y), x, z) + (log(c) * (b - 0.5)));
                              	} else {
                              		tmp = ((y + (a / i)) + (((t / i) + (z / i)) + ((log(y) * x) / i))) * 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)
                              	tmp = 0.0
                              	if (i <= -3.15e+53)
                              		tmp = Float64(Float64(Float64(z + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i));
                              	elseif (i <= 1.55e+29)
                              		tmp = Float64(Float64(a + t) + Float64(fma(log(y), x, z) + Float64(log(c) * Float64(b - 0.5))));
                              	else
                              		tmp = Float64(Float64(Float64(y + Float64(a / i)) + Float64(Float64(Float64(t / i) + Float64(z / i)) + Float64(Float64(log(y) * x) / i))) * 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_] := If[LessEqual[i, -3.15e+53], 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, 1.55e+29], N[(N[(a + t), $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t / i), $MachinePrecision] + N[(z / i), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $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 -3.15 \cdot 10^{+53}:\\
                              \;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                              
                              \mathbf{elif}\;i \leq 1.55 \cdot 10^{+29}:\\
                              \;\;\;\;\left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(b - 0.5\right)\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{\log y \cdot x}{i}\right)\right) \cdot i\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if i < -3.14999999999999987e53

                                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. Add Preprocessing
                                3. 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 \]
                                4. Step-by-step derivation
                                  1. Applied rewrites75.6%

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

                                  if -3.14999999999999987e53 < i < 1.5499999999999999e29

                                  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. Add Preprocessing
                                  3. 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)} \]
                                  4. Step-by-step derivation
                                    1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(\color{blue}{b} - \frac{1}{2}\right)\right) \]
                                    12. lift--.f6494.2

                                      \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(b - \color{blue}{0.5}\right)\right) \]
                                  5. Applied rewrites94.2%

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

                                  if 1.5499999999999999e29 < i

                                  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. Add Preprocessing
                                  3. Taylor expanded in i around inf

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

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

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

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

                                    \[\leadsto \left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{x \cdot \log y}{i}\right)\right) \cdot i \]
                                  7. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{\log y \cdot x}{i}\right)\right) \cdot i \]
                                    2. lift-log.f64N/A

                                      \[\leadsto \left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{\log y \cdot x}{i}\right)\right) \cdot i \]
                                    3. lift-*.f6498.3

                                      \[\leadsto \left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{\log y \cdot x}{i}\right)\right) \cdot i \]
                                  8. Applied rewrites98.3%

                                    \[\leadsto \left(\left(y + \frac{a}{i}\right) + \left(\left(\frac{t}{i} + \frac{z}{i}\right) + \frac{\log y \cdot x}{i}\right)\right) \cdot i \]
                                5. Recombined 3 regimes into one program.
                                6. Add Preprocessing

                                Alternative 12: 89.3% accurate, 1.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} \mathbf{if}\;x \leq -1 \cdot 10^{+247} \lor \neg \left(x \leq 1.9 \cdot 10^{+220}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z + a\right) + \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
                                 (if (or (<= x -1e+247) (not (<= x 1.9e+220)))
                                   (fma y i (* (log y) x))
                                   (+ (+ (+ z a) (* (- 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 tmp;
                                	if ((x <= -1e+247) || !(x <= 1.9e+220)) {
                                		tmp = fma(y, i, (log(y) * x));
                                	} else {
                                		tmp = ((z + a) + ((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)
                                	tmp = 0.0
                                	if ((x <= -1e+247) || !(x <= 1.9e+220))
                                		tmp = fma(y, i, Float64(log(y) * x));
                                	else
                                		tmp = Float64(Float64(Float64(z + a) + 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_] := If[Or[LessEqual[x, -1e+247], N[Not[LessEqual[x, 1.9e+220]], $MachinePrecision]], N[(y * i + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z + a), $MachinePrecision] + 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}
                                \mathbf{if}\;x \leq -1 \cdot 10^{+247} \lor \neg \left(x \leq 1.9 \cdot 10^{+220}\right):\\
                                \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if x < -9.99999999999999952e246 or 1.89999999999999992e220 < x

                                  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. Add Preprocessing
                                  3. Step-by-step derivation
                                    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(y, i, x \cdot \log y\right) \]
                                    5. associate-+l+N/A

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

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

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

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

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

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

                                  if -9.99999999999999952e246 < x < 1.89999999999999992e220

                                  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. Add Preprocessing
                                  3. 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 \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites71.8%

                                      \[\leadsto \left(\left(\color{blue}{z} + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                  5. Recombined 2 regimes into one program.
                                  6. Final simplification74.1%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{+247} \lor \neg \left(x \leq 1.9 \cdot 10^{+220}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \end{array} \]
                                  7. Add Preprocessing

                                  Alternative 13: 76.2% accurate, 1.8× 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 -1.5 \cdot 10^{+33} \lor \neg \left(i \leq 1.55 \cdot 10^{+29}\right):\\ \;\;\;\;\left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, z\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
                                   (if (or (<= i -1.5e+33) (not (<= i 1.55e+29)))
                                     (* (+ (+ y (/ a i)) (/ z i)) i)
                                     (+ (+ a t) (fma (log c) (- b 0.5) z))))
                                  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 <= -1.5e+33) || !(i <= 1.55e+29)) {
                                  		tmp = ((y + (a / i)) + (z / i)) * i;
                                  	} else {
                                  		tmp = (a + t) + fma(log(c), (b - 0.5), z);
                                  	}
                                  	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 <= -1.5e+33) || !(i <= 1.55e+29))
                                  		tmp = Float64(Float64(Float64(y + Float64(a / i)) + Float64(z / i)) * i);
                                  	else
                                  		tmp = Float64(Float64(a + t) + fma(log(c), Float64(b - 0.5), z));
                                  	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[Or[LessEqual[i, -1.5e+33], N[Not[LessEqual[i, 1.55e+29]], $MachinePrecision]], N[(N[(N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision] + N[(z / i), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], N[(N[(a + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $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}
                                  \mathbf{if}\;i \leq -1.5 \cdot 10^{+33} \lor \neg \left(i \leq 1.55 \cdot 10^{+29}\right):\\
                                  \;\;\;\;\left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, z\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if i < -1.49999999999999992e33 or 1.5499999999999999e29 < i

                                    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. Add Preprocessing
                                    3. Taylor expanded in i around inf

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

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

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

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

                                      \[\leadsto \left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i \]
                                    7. Step-by-step derivation
                                      1. lift-/.f6468.4

                                        \[\leadsto \left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i \]
                                    8. Applied rewrites68.4%

                                      \[\leadsto \left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i \]

                                    if -1.49999999999999992e33 < i < 1.5499999999999999e29

                                    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. Add Preprocessing
                                    3. 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)} \]
                                    4. Step-by-step derivation
                                      1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(\color{blue}{b} - \frac{1}{2}\right)\right) \]
                                      12. lift--.f6494.8

                                        \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(b - \color{blue}{0.5}\right)\right) \]
                                    5. Applied rewrites94.8%

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

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

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

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

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.5 \cdot 10^{+33} \lor \neg \left(i \leq 1.55 \cdot 10^{+29}\right):\\ \;\;\;\;\left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, z\right)\\ \end{array} \]
                                  5. Add Preprocessing

                                  Alternative 14: 75.8% accurate, 1.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}\;i \leq -1.5 \cdot 10^{+33} \lor \neg \left(i \leq 1.55 \cdot 10^{+29}\right):\\ \;\;\;\;\left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + \mathsf{fma}\left(\log c, b - 0.5, z\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
                                   (if (or (<= i -1.5e+33) (not (<= i 1.55e+29)))
                                     (* (+ (+ y (/ a i)) (/ z i)) i)
                                     (+ a (fma (log c) (- b 0.5) z))))
                                  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 <= -1.5e+33) || !(i <= 1.55e+29)) {
                                  		tmp = ((y + (a / i)) + (z / i)) * i;
                                  	} else {
                                  		tmp = a + fma(log(c), (b - 0.5), z);
                                  	}
                                  	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 <= -1.5e+33) || !(i <= 1.55e+29))
                                  		tmp = Float64(Float64(Float64(y + Float64(a / i)) + Float64(z / i)) * i);
                                  	else
                                  		tmp = Float64(a + fma(log(c), Float64(b - 0.5), z));
                                  	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[Or[LessEqual[i, -1.5e+33], N[Not[LessEqual[i, 1.55e+29]], $MachinePrecision]], N[(N[(N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision] + N[(z / i), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], N[(a + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $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}
                                  \mathbf{if}\;i \leq -1.5 \cdot 10^{+33} \lor \neg \left(i \leq 1.55 \cdot 10^{+29}\right):\\
                                  \;\;\;\;\left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;a + \mathsf{fma}\left(\log c, b - 0.5, z\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if i < -1.49999999999999992e33 or 1.5499999999999999e29 < i

                                    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. Add Preprocessing
                                    3. Taylor expanded in i around inf

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

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

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

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

                                      \[\leadsto \left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i \]
                                    7. Step-by-step derivation
                                      1. lift-/.f6468.4

                                        \[\leadsto \left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i \]
                                    8. Applied rewrites68.4%

                                      \[\leadsto \left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i \]

                                    if -1.49999999999999992e33 < i < 1.5499999999999999e29

                                    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. Add Preprocessing
                                    3. 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)} \]
                                    4. Step-by-step derivation
                                      1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(\color{blue}{b} - \frac{1}{2}\right)\right) \]
                                      12. lift--.f6494.8

                                        \[\leadsto \left(a + t\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + \log c \cdot \left(b - \color{blue}{0.5}\right)\right) \]
                                    5. Applied rewrites94.8%

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

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

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

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

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

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

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

                                      \[\leadsto a + \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right) \]
                                    10. Step-by-step derivation
                                      1. Applied rewrites56.3%

                                        \[\leadsto a + \mathsf{fma}\left(\color{blue}{\log c}, b - 0.5, z\right) \]
                                    11. Recombined 2 regimes into one program.
                                    12. Final simplification62.0%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.5 \cdot 10^{+33} \lor \neg \left(i \leq 1.55 \cdot 10^{+29}\right):\\ \;\;\;\;\left(\left(y + \frac{a}{i}\right) + \frac{z}{i}\right) \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + \mathsf{fma}\left(\log c, b - 0.5, z\right)\\ \end{array} \]
                                    13. Add Preprocessing

                                    Alternative 15: 23.0% accurate, 234.0× 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.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. Add Preprocessing
                                    3. Taylor expanded in a around inf

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

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

                                      Reproduce

                                      ?
                                      herbie shell --seed 2025085 
                                      (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)))