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

Percentage Accurate: 99.8% → 99.8%
Time: 9.8s
Alternatives: 19
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 19 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])\\ \\ \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} \]
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
 (+ (+ (+ (+ (+ (* x (log y)) z) t) 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) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
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 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
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 (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
[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 (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
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 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(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}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\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}
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. Add Preprocessing

Alternative 2: 55.6% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq -40:\\ \;\;\;\;z\\ \mathbf{elif}\;t\_1 \leq 3 \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 -1e+306)
     (* i y)
     (if (<= t_1 -40.0) z (if (<= t_1 3e+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 <= -1e+306) {
		tmp = i * y;
	} else if (t_1 <= -40.0) {
		tmp = z;
	} else if (t_1 <= 3e+306) {
		tmp = a;
	} else {
		tmp = i * y;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
    if (t_1 <= (-1d+306)) then
        tmp = i * y
    else if (t_1 <= (-40.0d0)) then
        tmp = z
    else if (t_1 <= 3d+306) then
        tmp = a
    else
        tmp = i * y
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
	double tmp;
	if (t_1 <= -1e+306) {
		tmp = i * y;
	} else if (t_1 <= -40.0) {
		tmp = z;
	} else if (t_1 <= 3e+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 <= -1e+306:
		tmp = i * y
	elif t_1 <= -40.0:
		tmp = z
	elif t_1 <= 3e+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 <= -1e+306)
		tmp = Float64(i * y);
	elseif (t_1 <= -40.0)
		tmp = z;
	elseif (t_1 <= 3e+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 <= -1e+306)
		tmp = i * y;
	elseif (t_1 <= -40.0)
		tmp = z;
	elseif (t_1 <= 3e+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, -1e+306], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -40.0], z, If[LessEqual[t$95$1, 3e+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 -1 \cdot 10^{+306}:\\
\;\;\;\;i \cdot y\\

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

\mathbf{elif}\;t\_1 \leq 3 \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)) < -1.00000000000000002e306 or 3.00000000000000021e306 < (+.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. Applied rewrites94.1%

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

      if -1.00000000000000002e306 < (+.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)) < -40

      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 z around inf

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

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

        if -40 < (+.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)) < 3.00000000000000021e306

        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 a around inf

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

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

        Alternative 3: 76.0% accurate, 0.4× speedup?

        \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+256}:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+84}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \left(t + z\right) + a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, \log c, a + i \cdot y\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+256)
             (fma y i z)
             (if (<= t_1 1e+84)
               (fma (- b 0.5) (log c) (+ (+ t z) a))
               (fma b (log c) (+ 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 <= -2e+256) {
        		tmp = fma(y, i, z);
        	} else if (t_1 <= 1e+84) {
        		tmp = fma((b - 0.5), log(c), ((t + z) + a));
        	} else {
        		tmp = fma(b, log(c), (a + (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 <= -2e+256)
        		tmp = fma(y, i, z);
        	elseif (t_1 <= 1e+84)
        		tmp = fma(Float64(b - 0.5), log(c), Float64(Float64(t + z) + a));
        	else
        		tmp = fma(b, log(c), Float64(a + Float64(i * y)));
        	end
        	return tmp
        end
        
        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+256], N[(y * i + z), $MachinePrecision], If[LessEqual[t$95$1, 1e+84], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(t + z), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], N[(b * N[Log[c], $MachinePrecision] + N[(a + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
        \\
        \begin{array}{l}
        t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
        \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+256}:\\
        \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
        
        \mathbf{elif}\;t\_1 \leq 10^{+84}:\\
        \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \left(t + z\right) + a\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(b, \log c, a + i \cdot y\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.0000000000000001e256

          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 rewrites55.1%

              \[\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.f6455.1

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

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

            if -2.0000000000000001e256 < (+.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.00000000000000006e84

            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. Applied rewrites89.3%

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

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

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

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

                  if 1.00000000000000006e84 < (+.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.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 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 rewrites58.6%

                      \[\leadsto \left(\color{blue}{a} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                    2. Step-by-step derivation
                      1. lift-+.f64N/A

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, a + y \cdot i\right)} \]
                      7. lower-+.f6458.6

                        \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{a + y \cdot i}\right) \]
                      8. lift-*.f64N/A

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

                        \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, a + \color{blue}{i \cdot y}\right) \]
                      10. lower-*.f6458.6

                        \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, a + \color{blue}{i \cdot y}\right) \]
                    3. Applied rewrites58.6%

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

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

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

                    Alternative 4: 74.9% 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 -4 \cdot 10^{+170}:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+84}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z + a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, \log c, a + i \cdot y\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 -4e+170)
                         (fma y i z)
                         (if (<= t_1 1e+84)
                           (fma (- b 0.5) (log c) (+ z a))
                           (fma b (log c) (+ 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 <= -4e+170) {
                    		tmp = fma(y, i, z);
                    	} else if (t_1 <= 1e+84) {
                    		tmp = fma((b - 0.5), log(c), (z + a));
                    	} else {
                    		tmp = fma(b, log(c), (a + (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 <= -4e+170)
                    		tmp = fma(y, i, z);
                    	elseif (t_1 <= 1e+84)
                    		tmp = fma(Float64(b - 0.5), log(c), Float64(z + a));
                    	else
                    		tmp = fma(b, log(c), Float64(a + Float64(i * y)));
                    	end
                    	return tmp
                    end
                    
                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+170], N[(y * i + z), $MachinePrecision], If[LessEqual[t$95$1, 1e+84], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision], N[(b * N[Log[c], $MachinePrecision] + N[(a + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                    \\
                    \begin{array}{l}
                    t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                    \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+170}:\\
                    \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
                    
                    \mathbf{elif}\;t\_1 \leq 10^{+84}:\\
                    \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z + a\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(b, \log c, a + i \cdot y\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)) < -4.00000000000000014e170

                      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 rewrites44.1%

                          \[\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.f6444.1

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

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

                        if -4.00000000000000014e170 < (+.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.00000000000000006e84

                        1. Initial program 99.7%

                          \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                        2. 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. Applied rewrites94.4%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, \left(t + z\right) + a\right)\right)} \]
                          2. Step-by-step derivation
                            1. Applied rewrites94.4%

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

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

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

                              if 1.00000000000000006e84 < (+.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.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 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 rewrites58.6%

                                  \[\leadsto \left(\color{blue}{a} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                2. Step-by-step derivation
                                  1. lift-+.f64N/A

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

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

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

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

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, a + y \cdot i\right)} \]
                                  7. lower-+.f6458.6

                                    \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{a + y \cdot i}\right) \]
                                  8. lift-*.f64N/A

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

                                    \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, a + \color{blue}{i \cdot y}\right) \]
                                  10. lower-*.f6458.6

                                    \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, a + \color{blue}{i \cdot y}\right) \]
                                3. Applied rewrites58.6%

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

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

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

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

                                  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 rewrites39.9%

                                      \[\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.f6439.9

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

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

                                    if -5e8 < (+.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.9999999999999999e305

                                    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 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 rewrites54.3%

                                        \[\leadsto \left(\color{blue}{a} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                      2. Step-by-step derivation
                                        1. lift-+.f64N/A

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

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

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

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

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

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, a + y \cdot i\right)} \]
                                        7. lower-+.f6454.4

                                          \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{a + y \cdot i}\right) \]
                                        8. lift-*.f64N/A

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

                                          \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, a + \color{blue}{i \cdot y}\right) \]
                                        10. lower-*.f6454.4

                                          \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, a + \color{blue}{i \cdot y}\right) \]
                                      3. Applied rewrites54.4%

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

                                        \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{a}\right) \]
                                      5. Step-by-step derivation
                                        1. Applied rewrites43.7%

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

                                        if 1.9999999999999999e305 < (+.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 x around inf

                                          \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites100.0%

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

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

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

                                              \[\leadsto \color{blue}{y \cdot i} + \log y \cdot x \]
                                            4. lower-fma.f64100.0

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

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

                                        Alternative 6: 69.1% 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 -500000000:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{elif}\;t\_1 \leq 3 \cdot 10^{+306}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, a\right)\\ \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 -500000000.0)
                                             (fma y i z)
                                             (if (<= t_1 3e+306) (fma (- b 0.5) (log c) 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 <= -500000000.0) {
                                        		tmp = fma(y, i, z);
                                        	} else if (t_1 <= 3e+306) {
                                        		tmp = fma((b - 0.5), log(c), 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 <= -500000000.0)
                                        		tmp = fma(y, i, z);
                                        	elseif (t_1 <= 3e+306)
                                        		tmp = fma(Float64(b - 0.5), log(c), a);
                                        	else
                                        		tmp = Float64(i * y);
                                        	end
                                        	return tmp
                                        end
                                        
                                        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                        code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -500000000.0], N[(y * i + z), $MachinePrecision], If[LessEqual[t$95$1, 3e+306], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + a), $MachinePrecision], N[(i * y), $MachinePrecision]]]]
                                        
                                        \begin{array}{l}
                                        [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                                        \\
                                        \begin{array}{l}
                                        t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
                                        \mathbf{if}\;t\_1 \leq -500000000:\\
                                        \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
                                        
                                        \mathbf{elif}\;t\_1 \leq 3 \cdot 10^{+306}:\\
                                        \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, a\right)\\
                                        
                                        \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)) < -5e8

                                          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 rewrites39.9%

                                              \[\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.f6439.9

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

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

                                            if -5e8 < (+.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)) < 3.00000000000000021e306

                                            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 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.9%

                                                \[\leadsto \left(\color{blue}{a} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                              2. Step-by-step derivation
                                                1. lift-+.f64N/A

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

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

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

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

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

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, a + y \cdot i\right)} \]
                                                7. lower-+.f6453.9

                                                  \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{a + y \cdot i}\right) \]
                                                8. lift-*.f64N/A

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

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

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

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

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

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

                                                if 3.00000000000000021e306 < (+.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. Applied rewrites100.0%

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

                                                Alternative 7: 60.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 -1 \cdot 10^{+306}:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq -40:\\ \;\;\;\;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 -1e+306) (* i y) (if (<= t_1 -40.0) 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 <= -1e+306) {
                                                		tmp = i * y;
                                                	} else if (t_1 <= -40.0) {
                                                		tmp = 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 <= -1e+306)
                                                		tmp = Float64(i * y);
                                                	elseif (t_1 <= -40.0)
                                                		tmp = 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, -1e+306], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -40.0], z, 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 -1 \cdot 10^{+306}:\\
                                                \;\;\;\;i \cdot y\\
                                                
                                                \mathbf{elif}\;t\_1 \leq -40:\\
                                                \;\;\;\;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)) < -1.00000000000000002e306

                                                  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 inf

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

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

                                                    if -1.00000000000000002e306 < (+.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)) < -40

                                                    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 z around inf

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

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

                                                      if -40 < (+.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.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 z around -inf

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                        5. Step-by-step derivation
                                                          1. Applied rewrites41.5%

                                                            \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                        6. Recombined 3 regimes into one program.
                                                        7. Final simplification35.1%

                                                          \[\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 -1 \cdot 10^{+306}:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;\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 -40:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \]
                                                        8. Add Preprocessing

                                                        Alternative 8: 81.9% 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 -500000000:\\ \;\;\;\;\left(z + t\_1\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, a + i \cdot y\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 (* (- b 0.5) (log c))))
                                                           (if (<= (+ (+ (+ (+ (+ (* x (log y)) z) t) a) t_1) (* y i)) -500000000.0)
                                                             (+ (+ z t_1) (* y i))
                                                             (fma (- b 0.5) (log c) (+ 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 = (b - 0.5) * log(c);
                                                        	double tmp;
                                                        	if (((((((x * log(y)) + z) + t) + a) + t_1) + (y * i)) <= -500000000.0) {
                                                        		tmp = (z + t_1) + (y * i);
                                                        	} else {
                                                        		tmp = fma((b - 0.5), log(c), (a + (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(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)) <= -500000000.0)
                                                        		tmp = Float64(Float64(z + t_1) + Float64(y * i));
                                                        	else
                                                        		tmp = fma(Float64(b - 0.5), log(c), Float64(a + Float64(i * y)));
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                        code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(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], -500000000.0], N[(N[(z + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(a + N[(i * y), $MachinePrecision]), $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 -500000000:\\
                                                        \;\;\;\;\left(z + t\_1\right) + y \cdot i\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, a + i \cdot y\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)) < -5e8

                                                          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 rewrites52.4%

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

                                                            if -5e8 < (+.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 rewrites59.7%

                                                                \[\leadsto \left(\color{blue}{a} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                              2. Step-by-step derivation
                                                                1. lift-+.f64N/A

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

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

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

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

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

                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, a + y \cdot i\right)} \]
                                                                7. lower-+.f6459.7

                                                                  \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{a + y \cdot i}\right) \]
                                                                8. lift-*.f64N/A

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

                                                                  \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, a + \color{blue}{i \cdot y}\right) \]
                                                                10. lower-*.f6459.7

                                                                  \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, a + \color{blue}{i \cdot y}\right) \]
                                                              3. Applied rewrites59.7%

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

                                                            Alternative 9: 65.5% 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 -40:\\ \;\;\;\;\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))
                                                                  -40.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)) <= -40.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)) <= -40.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], -40.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 -40:\\
                                                            \;\;\;\;\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)) < -40

                                                              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 rewrites39.6%

                                                                  \[\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.f6439.6

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

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

                                                                if -40 < (+.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.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 z around -inf

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                                  5. Step-by-step derivation
                                                                    1. Applied rewrites41.5%

                                                                      \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
                                                                  6. Recombined 2 regimes into one program.
                                                                  7. Final simplification40.6%

                                                                    \[\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 -40:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \]
                                                                  8. Add Preprocessing

                                                                  Alternative 10: 44.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 -40:\\ \;\;\;\;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))
                                                                        -40.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)) <= -40.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)) <= (-40.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)) <= -40.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)) <= -40.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)) <= -40.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)) <= -40.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], -40.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 -40:\\
                                                                  \;\;\;\;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)) < -40

                                                                    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 rewrites15.9%

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

                                                                      if -40 < (+.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.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 a around inf

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

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

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

                                                                        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

                                                                            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + \color{blue}{a}\right)\right) \]
                                                                          5. Step-by-step derivation
                                                                            1. Applied rewrites78.2%

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

                                                                            if -8.40000000000000059e196 < x < 1.4500000000000001e90

                                                                            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 x around 0

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

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

                                                                              if 1.4500000000000001e90 < x

                                                                              1. Initial program 99.6%

                                                                                \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                              2. 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. Applied rewrites92.4%

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

                                                                                  \[\leadsto \mathsf{fma}\left(\log c, b, \mathsf{fma}\left(\log y, x, \left(t + z\right) + a\right)\right) \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites92.4%

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

                                                                                Alternative 12: 93.6% 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}\;z \leq -1.3 \cdot 10^{+97}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a\\ \end{array} \end{array} \]
                                                                                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                (FPCore (x y z t a b c i)
                                                                                 :precision binary64
                                                                                 (if (<= z -1.3e+97)
                                                                                   (fma y i (+ (* (fma (- x) (/ (log y) z) -1.0) (- z)) (+ t a)))
                                                                                   (+ (fma i y (fma (log c) (- b 0.5) (fma (log y) x t))) a)))
                                                                                assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                                                                                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                                	double tmp;
                                                                                	if (z <= -1.3e+97) {
                                                                                		tmp = fma(y, i, ((fma(-x, (log(y) / z), -1.0) * -z) + (t + a)));
                                                                                	} else {
                                                                                		tmp = fma(i, y, fma(log(c), (b - 0.5), fma(log(y), x, t))) + a;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                                                                                function code(x, y, z, t, a, b, c, i)
                                                                                	tmp = 0.0
                                                                                	if (z <= -1.3e+97)
                                                                                		tmp = fma(y, i, Float64(Float64(fma(Float64(-x), Float64(log(y) / z), -1.0) * Float64(-z)) + Float64(t + a)));
                                                                                	else
                                                                                		tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), fma(log(y), x, t))) + a);
                                                                                	end
                                                                                	return tmp
                                                                                end
                                                                                
                                                                                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.3e+97], N[(y * i + N[(N[(N[((-x) * N[(N[Log[y], $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision] * (-z)), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]
                                                                                
                                                                                \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}\;z \leq -1.3 \cdot 10^{+97}:\\
                                                                                \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + a\right)\right)\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, t\right)\right)\right) + a\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 2 regimes
                                                                                2. if z < -1.3e97

                                                                                  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(\left(\color{blue}{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{x \cdot \log y}{z} - 1\right)\right)} + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \]
                                                                                  4. Step-by-step derivation
                                                                                    1. Applied rewrites99.9%

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

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

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

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

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

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

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

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

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

                                                                                      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + \color{blue}{a}\right)\right) \]
                                                                                    5. Step-by-step derivation
                                                                                      1. Applied rewrites92.6%

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

                                                                                      if -1.3e97 < z

                                                                                      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 z around 0

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

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

                                                                                      Alternative 13: 87.7% 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}\;x \leq -8.4 \cdot 10^{+196}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + a\right)\right)\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+90}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \log y \cdot x + 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 -8.4e+196)
                                                                                         (fma y i (+ (* (fma (- x) (/ (log y) z) -1.0) (- z)) (+ t a)))
                                                                                         (if (<= x 1.45e+90)
                                                                                           (+ (+ a t) (fma (log c) (- b 0.5) (fma i y z)))
                                                                                           (fma (- b 0.5) (log c) (+ (* (log y) x) 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 <= -8.4e+196) {
                                                                                      		tmp = fma(y, i, ((fma(-x, (log(y) / z), -1.0) * -z) + (t + a)));
                                                                                      	} else if (x <= 1.45e+90) {
                                                                                      		tmp = (a + t) + fma(log(c), (b - 0.5), fma(i, y, z));
                                                                                      	} else {
                                                                                      		tmp = fma((b - 0.5), log(c), ((log(y) * x) + 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 (x <= -8.4e+196)
                                                                                      		tmp = fma(y, i, Float64(Float64(fma(Float64(-x), Float64(log(y) / z), -1.0) * Float64(-z)) + Float64(t + a)));
                                                                                      	elseif (x <= 1.45e+90)
                                                                                      		tmp = Float64(Float64(a + t) + fma(log(c), Float64(b - 0.5), fma(i, y, z)));
                                                                                      	else
                                                                                      		tmp = fma(Float64(b - 0.5), log(c), Float64(Float64(log(y) * x) + 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[x, -8.4e+196], N[(y * i + N[(N[(N[((-x) * N[(N[Log[y], $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision] * (-z)), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.45e+90], N[(N[(a + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + a), $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 -8.4 \cdot 10^{+196}:\\
                                                                                      \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + a\right)\right)\\
                                                                                      
                                                                                      \mathbf{elif}\;x \leq 1.45 \cdot 10^{+90}:\\
                                                                                      \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \log y \cdot x + a\right)\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 3 regimes
                                                                                      2. if x < -8.40000000000000059e196

                                                                                        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

                                                                                            \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + \color{blue}{a}\right)\right) \]
                                                                                          5. Step-by-step derivation
                                                                                            1. Applied rewrites78.2%

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

                                                                                            if -8.40000000000000059e196 < x < 1.4500000000000001e90

                                                                                            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 x around 0

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

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

                                                                                              if 1.4500000000000001e90 < x

                                                                                              1. Initial program 99.6%

                                                                                                \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                                              2. 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. Applied rewrites92.4%

                                                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, \left(t + z\right) + a\right)\right)} \]
                                                                                                2. Step-by-step derivation
                                                                                                  1. Applied rewrites92.4%

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

                                                                                                    \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, x \cdot \log y + a\right) \]
                                                                                                  3. Step-by-step derivation
                                                                                                    1. Applied rewrites75.4%

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

                                                                                                  Alternative 14: 89.1% accurate, 1.6× speedup?

                                                                                                  \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -8.4 \cdot 10^{+196}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + a\right)\right)\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+208}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\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 -8.4e+196)
                                                                                                     (fma y i (+ (* (fma (- x) (/ (log y) z) -1.0) (- z)) (+ t a)))
                                                                                                     (if (<= x 4.5e+208)
                                                                                                       (+ (+ a t) (fma (log c) (- b 0.5) (fma i y z)))
                                                                                                       (fma y i (* x (log 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 tmp;
                                                                                                  	if (x <= -8.4e+196) {
                                                                                                  		tmp = fma(y, i, ((fma(-x, (log(y) / z), -1.0) * -z) + (t + a)));
                                                                                                  	} else if (x <= 4.5e+208) {
                                                                                                  		tmp = (a + t) + fma(log(c), (b - 0.5), fma(i, y, z));
                                                                                                  	} else {
                                                                                                  		tmp = fma(y, i, (x * log(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)
                                                                                                  	tmp = 0.0
                                                                                                  	if (x <= -8.4e+196)
                                                                                                  		tmp = fma(y, i, Float64(Float64(fma(Float64(-x), Float64(log(y) / z), -1.0) * Float64(-z)) + Float64(t + a)));
                                                                                                  	elseif (x <= 4.5e+208)
                                                                                                  		tmp = Float64(Float64(a + t) + fma(log(c), Float64(b - 0.5), fma(i, y, z)));
                                                                                                  	else
                                                                                                  		tmp = fma(y, i, Float64(x * log(y)));
                                                                                                  	end
                                                                                                  	return tmp
                                                                                                  end
                                                                                                  
                                                                                                  NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -8.4e+196], N[(y * i + N[(N[(N[((-x) * N[(N[Log[y], $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision] * (-z)), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e+208], N[(N[(a + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $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 -8.4 \cdot 10^{+196}:\\
                                                                                                  \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + a\right)\right)\\
                                                                                                  
                                                                                                  \mathbf{elif}\;x \leq 4.5 \cdot 10^{+208}:\\
                                                                                                  \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\
                                                                                                  
                                                                                                  \mathbf{else}:\\
                                                                                                  \;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\
                                                                                                  
                                                                                                  
                                                                                                  \end{array}
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Split input into 3 regimes
                                                                                                  2. if x < -8.40000000000000059e196

                                                                                                    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

                                                                                                        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(-x, \frac{\log y}{z}, -1\right) \cdot \left(-z\right) + \left(t + \color{blue}{a}\right)\right) \]
                                                                                                      5. Step-by-step derivation
                                                                                                        1. Applied rewrites78.2%

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

                                                                                                        if -8.40000000000000059e196 < x < 4.50000000000000015e208

                                                                                                        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 x around 0

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

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

                                                                                                          if 4.50000000000000015e208 < x

                                                                                                          1. Initial program 99.6%

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

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

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

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

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

                                                                                                                \[\leadsto \color{blue}{y \cdot i} + \log y \cdot x \]
                                                                                                              4. lower-fma.f6484.5

                                                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]
                                                                                                            3. Applied rewrites84.5%

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

                                                                                                          Alternative 15: 89.8% 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 -3.4 \cdot 10^{+217} \lor \neg \left(x \leq 4.5 \cdot 10^{+208}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\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 (<= x -3.4e+217) (not (<= x 4.5e+208)))
                                                                                                             (fma y i (* x (log y)))
                                                                                                             (+ (+ a t) (fma (log c) (- b 0.5) (fma i y 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 ((x <= -3.4e+217) || !(x <= 4.5e+208)) {
                                                                                                          		tmp = fma(y, i, (x * log(y)));
                                                                                                          	} else {
                                                                                                          		tmp = (a + t) + fma(log(c), (b - 0.5), fma(i, y, 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 ((x <= -3.4e+217) || !(x <= 4.5e+208))
                                                                                                          		tmp = fma(y, i, Float64(x * log(y)));
                                                                                                          	else
                                                                                                          		tmp = Float64(Float64(a + t) + fma(log(c), Float64(b - 0.5), fma(i, y, 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[x, -3.4e+217], N[Not[LessEqual[x, 4.5e+208]], $MachinePrecision]], N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $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 -3.4 \cdot 10^{+217} \lor \neg \left(x \leq 4.5 \cdot 10^{+208}\right):\\
                                                                                                          \;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\
                                                                                                          
                                                                                                          \mathbf{else}:\\
                                                                                                          \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(i, y, z\right)\right)\\
                                                                                                          
                                                                                                          
                                                                                                          \end{array}
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Split input into 2 regimes
                                                                                                          2. if x < -3.3999999999999999e217 or 4.50000000000000015e208 < x

                                                                                                            1. Initial program 99.6%

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

                                                                                                              \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
                                                                                                            4. Step-by-step derivation
                                                                                                              1. Applied rewrites86.2%

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

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

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

                                                                                                                  \[\leadsto \color{blue}{y \cdot i} + \log y \cdot x \]
                                                                                                                4. lower-fma.f6486.2

                                                                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]
                                                                                                              3. Applied rewrites86.2%

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

                                                                                                              if -3.3999999999999999e217 < x < 4.50000000000000015e208

                                                                                                              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 x around 0

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

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

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

                                                                                                              Alternative 16: 70.6% 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}\;x \leq -2.25 \cdot 10^{+146} \lor \neg \left(x \leq 3.35 \cdot 10^{+162}\right):\\ \;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z + 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 (or (<= x -2.25e+146) (not (<= x 3.35e+162)))
                                                                                                                 (fma y i (* x (log y)))
                                                                                                                 (fma (- b 0.5) (log c) (+ 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 <= -2.25e+146) || !(x <= 3.35e+162)) {
                                                                                                              		tmp = fma(y, i, (x * log(y)));
                                                                                                              	} else {
                                                                                                              		tmp = fma((b - 0.5), log(c), (z + 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 ((x <= -2.25e+146) || !(x <= 3.35e+162))
                                                                                                              		tmp = fma(y, i, Float64(x * log(y)));
                                                                                                              	else
                                                                                                              		tmp = fma(Float64(b - 0.5), log(c), Float64(z + 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[Or[LessEqual[x, -2.25e+146], N[Not[LessEqual[x, 3.35e+162]], $MachinePrecision]], N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(z + a), $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 -2.25 \cdot 10^{+146} \lor \neg \left(x \leq 3.35 \cdot 10^{+162}\right):\\
                                                                                                              \;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\
                                                                                                              
                                                                                                              \mathbf{else}:\\
                                                                                                              \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z + a\right)\\
                                                                                                              
                                                                                                              
                                                                                                              \end{array}
                                                                                                              \end{array}
                                                                                                              
                                                                                                              Derivation
                                                                                                              1. Split input into 2 regimes
                                                                                                              2. if x < -2.25000000000000013e146 or 3.34999999999999995e162 < x

                                                                                                                1. Initial program 99.7%

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

                                                                                                                  \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
                                                                                                                4. Step-by-step derivation
                                                                                                                  1. Applied rewrites77.0%

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

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

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

                                                                                                                      \[\leadsto \color{blue}{y \cdot i} + \log y \cdot x \]
                                                                                                                    4. lower-fma.f6477.1

                                                                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]
                                                                                                                  3. Applied rewrites77.1%

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

                                                                                                                  if -2.25000000000000013e146 < x < 3.34999999999999995e162

                                                                                                                  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. Applied rewrites76.3%

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

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

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

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

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

                                                                                                                      Alternative 17: 73.0% 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}\;z \leq -4 \cdot 10^{+125}:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, a + i \cdot y\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 (<= z -4e+125) (fma y i z) (fma (- b 0.5) (log c) (+ 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 tmp;
                                                                                                                      	if (z <= -4e+125) {
                                                                                                                      		tmp = fma(y, i, z);
                                                                                                                      	} else {
                                                                                                                      		tmp = fma((b - 0.5), log(c), (a + (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)
                                                                                                                      	tmp = 0.0
                                                                                                                      	if (z <= -4e+125)
                                                                                                                      		tmp = fma(y, i, z);
                                                                                                                      	else
                                                                                                                      		tmp = fma(Float64(b - 0.5), log(c), Float64(a + Float64(i * y)));
                                                                                                                      	end
                                                                                                                      	return tmp
                                                                                                                      end
                                                                                                                      
                                                                                                                      NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                                                                                                                      code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -4e+125], N[(y * i + z), $MachinePrecision], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(a + N[(i * y), $MachinePrecision]), $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}\;z \leq -4 \cdot 10^{+125}:\\
                                                                                                                      \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
                                                                                                                      
                                                                                                                      \mathbf{else}:\\
                                                                                                                      \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, a + i \cdot y\right)\\
                                                                                                                      
                                                                                                                      
                                                                                                                      \end{array}
                                                                                                                      \end{array}
                                                                                                                      
                                                                                                                      Derivation
                                                                                                                      1. Split input into 2 regimes
                                                                                                                      2. if z < -3.9999999999999997e125

                                                                                                                        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 \color{blue}{z} + y \cdot i \]
                                                                                                                        4. Step-by-step derivation
                                                                                                                          1. Applied rewrites56.1%

                                                                                                                            \[\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.f6456.1

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

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

                                                                                                                          if -3.9999999999999997e125 < z

                                                                                                                          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 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 rewrites60.5%

                                                                                                                              \[\leadsto \left(\color{blue}{a} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                                                                            2. Step-by-step derivation
                                                                                                                              1. lift-+.f64N/A

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

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

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

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

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

                                                                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, a + y \cdot i\right)} \]
                                                                                                                              7. lower-+.f6460.5

                                                                                                                                \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{a + y \cdot i}\right) \]
                                                                                                                              8. lift-*.f64N/A

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

                                                                                                                                \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, a + \color{blue}{i \cdot y}\right) \]
                                                                                                                              10. lower-*.f6460.5

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

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

                                                                                                                          Alternative 18: 73.0% 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}\;z \leq -4 \cdot 10^{+125}:\\ \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, a\right)\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 (<= z -4e+125) (fma y i z) (fma y i (fma (- b 0.5) (log c) 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 (z <= -4e+125) {
                                                                                                                          		tmp = fma(y, i, z);
                                                                                                                          	} else {
                                                                                                                          		tmp = fma(y, i, fma((b - 0.5), log(c), 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 (z <= -4e+125)
                                                                                                                          		tmp = fma(y, i, z);
                                                                                                                          	else
                                                                                                                          		tmp = fma(y, i, fma(Float64(b - 0.5), log(c), 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[z, -4e+125], N[(y * i + z), $MachinePrecision], N[(y * i + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + a), $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}\;z \leq -4 \cdot 10^{+125}:\\
                                                                                                                          \;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
                                                                                                                          
                                                                                                                          \mathbf{else}:\\
                                                                                                                          \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, a\right)\right)\\
                                                                                                                          
                                                                                                                          
                                                                                                                          \end{array}
                                                                                                                          \end{array}
                                                                                                                          
                                                                                                                          Derivation
                                                                                                                          1. Split input into 2 regimes
                                                                                                                          2. if z < -3.9999999999999997e125

                                                                                                                            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 \color{blue}{z} + y \cdot i \]
                                                                                                                            4. Step-by-step derivation
                                                                                                                              1. Applied rewrites56.1%

                                                                                                                                \[\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.f6456.1

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

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

                                                                                                                              if -3.9999999999999997e125 < z

                                                                                                                              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 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 rewrites60.5%

                                                                                                                                  \[\leadsto \left(\color{blue}{a} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                                                                                                2. Step-by-step derivation
                                                                                                                                  1. lift-+.f64N/A

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

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

                                                                                                                                    \[\leadsto \color{blue}{y \cdot i} + \left(a + \left(b - \frac{1}{2}\right) \cdot \log c\right) \]
                                                                                                                                  4. lower-fma.f6460.5

                                                                                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a + \left(b - 0.5\right) \cdot \log c\right)} \]
                                                                                                                                  5. lift-+.f64N/A

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

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

                                                                                                                                    \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + a\right) \]
                                                                                                                                  8. lower-fma.f6460.5

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

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

                                                                                                                              Alternative 19: 22.8% 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 rewrites18.0%

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

                                                                                                                                Reproduce

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