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

Percentage Accurate: 99.8% → 99.8%
Time: 6.1s
Alternatives: 15
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 93.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}\;a \leq 2.8 \cdot 10^{+76}:\\ \;\;\;\;\left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + 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 (<= a 2.8e+76)
   (+ (+ (fma i y (fma (log c) (- b 0.5) (* (log y) x))) z) t)
   (fma y i (+ (+ (fma (log c) (- b 0.5) z) t) a))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 2.8e+76) {
		tmp = (fma(i, y, fma(log(c), (b - 0.5), (log(y) * x))) + z) + t;
	} else {
		tmp = fma(y, i, ((fma(log(c), (b - 0.5), z) + t) + a));
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (a <= 2.8e+76)
		tmp = Float64(Float64(fma(i, y, fma(log(c), Float64(b - 0.5), Float64(log(y) * x))) + z) + t);
	else
		tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), z) + 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[a, 2.8e+76], N[(N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + t), $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}\;a \leq 2.8 \cdot 10^{+76}:\\
\;\;\;\;\left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.7999999999999999e76

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
    4. Applied rewrites77.9%

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

    if 2.7999999999999999e76 < a

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 91.2% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.50000000000000014e231 or 7.79999999999999945e207 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
    4. Applied rewrites77.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot y + \mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right)\right) + t \]
      10. lift-fma.f6456.4

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

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

    if -2.50000000000000014e231 < x < 7.79999999999999945e207

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 88.2% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7e40 or 1.35000000000000002e206 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
    4. Applied rewrites77.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right) + z\right) + t \]
      9. lift--.f6455.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b - \frac{1}{2}, \log c, \mathsf{fma}\left(x, \log y, z\right)\right) + t \]
      14. lift-log.f6455.6

        \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(x, \log y, z\right)\right) + t \]
    9. Applied rewrites55.6%

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

    if -3.7e40 < x < 1.35000000000000002e206

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 87.7% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+270}:\\ \;\;\;\;-\left(-\log y \cdot x\right)\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+206}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(-0.5, \log c, x \cdot \log y\right) + z\right) + t\\ \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 -2.3e+270)
   (- (- (* (log y) x)))
   (if (<= x 1.35e+206)
     (fma y i (+ (+ (fma (log c) (- b 0.5) z) t) a))
     (+ (+ (fma -0.5 (log c) (* x (log y))) z) t))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (x <= -2.3e+270) {
		tmp = -(-(log(y) * x));
	} else if (x <= 1.35e+206) {
		tmp = fma(y, i, ((fma(log(c), (b - 0.5), z) + t) + a));
	} else {
		tmp = (fma(-0.5, log(c), (x * log(y))) + z) + t;
	}
	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.3e+270)
		tmp = Float64(-Float64(-Float64(log(y) * x)));
	elseif (x <= 1.35e+206)
		tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), z) + t) + a));
	else
		tmp = Float64(Float64(fma(-0.5, log(c), Float64(x * log(y))) + z) + t);
	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, -2.3e+270], (-(-N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision])), If[LessEqual[x, 1.35e+206], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $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.3 \cdot 10^{+270}:\\
\;\;\;\;-\left(-\log y \cdot x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.2999999999999999e270

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto --1 \cdot \left(x \cdot \log y\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(x \cdot \log y\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -\left(-x \cdot \log y\right) \]
      3. *-commutativeN/A

        \[\leadsto -\left(-\log y \cdot x\right) \]
      4. lift-log.f64N/A

        \[\leadsto -\left(-\log y \cdot x\right) \]
      5. lift-*.f6417.2

        \[\leadsto -\left(-\log y \cdot x\right) \]
    7. Applied rewrites17.2%

      \[\leadsto -\left(-\log y \cdot x\right) \]

    if -2.2999999999999999e270 < x < 1.35000000000000002e206

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.35000000000000002e206 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
    4. Applied rewrites77.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right) + z\right) + t \]
      9. lift--.f6455.6

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

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

      \[\leadsto \left(\left(\frac{-1}{2} \cdot \log c + x \cdot \log y\right) + z\right) + t \]
    9. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

        \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2}, \log c, x \cdot \log y\right) + z\right) + t \]
      4. lift-log.f6440.2

        \[\leadsto \left(\mathsf{fma}\left(-0.5, \log c, x \cdot \log y\right) + z\right) + t \]
    10. Applied rewrites40.2%

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

Alternative 6: 87.2% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.2999999999999999e270 or 1.6000000000000001e208 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto --1 \cdot \left(x \cdot \log y\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(x \cdot \log y\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -\left(-x \cdot \log y\right) \]
      3. *-commutativeN/A

        \[\leadsto -\left(-\log y \cdot x\right) \]
      4. lift-log.f64N/A

        \[\leadsto -\left(-\log y \cdot x\right) \]
      5. lift-*.f6417.2

        \[\leadsto -\left(-\log y \cdot x\right) \]
    7. Applied rewrites17.2%

      \[\leadsto -\left(-\log y \cdot x\right) \]

    if -2.2999999999999999e270 < x < 1.6000000000000001e208

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.2999999999999999e270 or 1.6000000000000001e208 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto --1 \cdot \left(x \cdot \log y\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(x \cdot \log y\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -\left(-x \cdot \log y\right) \]
      3. *-commutativeN/A

        \[\leadsto -\left(-\log y \cdot x\right) \]
      4. lift-log.f64N/A

        \[\leadsto -\left(-\log y \cdot x\right) \]
      5. lift-*.f6417.2

        \[\leadsto -\left(-\log y \cdot x\right) \]
    7. Applied rewrites17.2%

      \[\leadsto -\left(-\log y \cdot x\right) \]

    if -2.2999999999999999e270 < x < 1.6000000000000001e208

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, z\right) + a\right) \]
    9. Applied rewrites83.2%

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

Alternative 8: 77.2% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1.99999999999999993e118 or 9.9999999999999994e165 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, z\right) + a\right) \]
    9. Applied rewrites83.2%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, a + \left(b - \frac{1}{2}\right) \cdot \log c\right) \]
      5. lift-log.f6461.5

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

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

    if -1.99999999999999993e118 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 9.9999999999999994e165

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, z\right) + a\right) \]
    9. Applied rewrites83.2%

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

      \[\leadsto \mathsf{fma}\left(y, i, \left(z + \frac{-1}{2} \cdot \log c\right) + a\right) \]
    11. Step-by-step derivation
      1. fp-cancel-sign-sub-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \left(z - \frac{1}{2} \cdot \log c\right) + a\right) \]
      5. lift-log.f6467.6

        \[\leadsto \mathsf{fma}\left(y, i, \left(z - 0.5 \cdot \log c\right) + a\right) \]
    12. Applied rewrites67.6%

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

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

\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{+33}:\\
\;\;\;\;\left(t\_1 + z\right) + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0 or -9.9999999999999995e32 < (+.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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, z\right) + a\right) \]
    9. Applied rewrites83.2%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, a + \left(b - \frac{1}{2}\right) \cdot \log c\right) \]
      5. lift-log.f6461.5

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

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

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
    4. Applied rewrites77.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right) + z\right) + t \]
      9. lift--.f6455.6

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

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

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

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

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

        \[\leadsto \left(\left(b - \frac{1}{2}\right) \cdot \log c + z\right) + t \]
      4. lift-log.f6440.0

        \[\leadsto \left(\left(b - 0.5\right) \cdot \log c + z\right) + t \]
    10. Applied rewrites40.0%

      \[\leadsto \left(\left(b - 0.5\right) \cdot \log c + z\right) + t \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 67.4% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(b - 0.5\right) \cdot \log c\\ t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;-\left(-i\right) \cdot y\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+76}:\\ \;\;\;\;\left(t\_1 + z\right) + t\\ \mathbf{else}:\\ \;\;\;\;-\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot 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
 (let* ((t_1 (* (- b 0.5) (log c)))
        (t_2 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) t_1) (* y i))))
   (if (<= t_2 (- INFINITY))
     (- (* (- i) y))
     (if (<= t_2 2e+76) (+ (+ t_1 z) t) (- (* (- (- (/ (* i y) a)) 1.0) 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 = (b - 0.5) * log(c);
	double t_2 = (((((x * log(y)) + z) + t) + a) + t_1) + (y * i);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = -(-i * y);
	} else if (t_2 <= 2e+76) {
		tmp = (t_1 + z) + t;
	} else {
		tmp = -((-((i * y) / a) - 1.0) * a);
	}
	return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (b - 0.5) * Math.log(c);
	double t_2 = (((((x * Math.log(y)) + z) + t) + a) + t_1) + (y * i);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = -(-i * y);
	} else if (t_2 <= 2e+76) {
		tmp = (t_1 + z) + t;
	} else {
		tmp = -((-((i * y) / a) - 1.0) * 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):
	t_1 = (b - 0.5) * math.log(c)
	t_2 = (((((x * math.log(y)) + z) + t) + a) + t_1) + (y * i)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = -(-i * y)
	elif t_2 <= 2e+76:
		tmp = (t_1 + z) + t
	else:
		tmp = -((-((i * y) / a) - 1.0) * 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(b - 0.5) * log(c))
	t_2 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + t_1) + Float64(y * i))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(-Float64(Float64(-i) * y));
	elseif (t_2 <= 2e+76)
		tmp = Float64(Float64(t_1 + z) + t);
	else
		tmp = Float64(-Float64(Float64(Float64(-Float64(Float64(i * y) / a)) - 1.0) * 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)
	t_1 = (b - 0.5) * log(c);
	t_2 = (((((x * log(y)) + z) + t) + a) + t_1) + (y * i);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = -(-i * y);
	elseif (t_2 <= 2e+76)
		tmp = (t_1 + z) + t;
	else
		tmp = -((-((i * y) / a) - 1.0) * 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_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], (-N[((-i) * y), $MachinePrecision]), If[LessEqual[t$95$2, 2e+76], N[(N[(t$95$1 + z), $MachinePrecision] + t), $MachinePrecision], (-N[(N[((-N[(N[(i * y), $MachinePrecision] / a), $MachinePrecision]) - 1.0), $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}
t_1 := \left(b - 0.5\right) \cdot \log c\\
t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;-\left(-i\right) \cdot y\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+76}:\\
\;\;\;\;\left(t\_1 + z\right) + t\\

\mathbf{else}:\\
\;\;\;\;-\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto --1 \cdot \left(i \cdot y\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto -\left(-1 \cdot i\right) \cdot y \]
      2. lower-*.f64N/A

        \[\leadsto -\left(-1 \cdot i\right) \cdot y \]
      3. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(i\right)\right) \cdot y \]
      4. lower-neg.f6424.0

        \[\leadsto -\left(-i\right) \cdot y \]
    7. Applied rewrites24.0%

      \[\leadsto -\left(-i\right) \cdot y \]

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right) + z\right) + t \]
    4. Applied rewrites77.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\log c, b - \frac{1}{2}, \log y \cdot x\right) + z\right) + t \]
      9. lift--.f6455.6

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

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

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

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

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

        \[\leadsto \left(\left(b - \frac{1}{2}\right) \cdot \log c + z\right) + t \]
      4. lift-log.f6440.0

        \[\leadsto \left(\left(b - 0.5\right) \cdot \log c + z\right) + t \]
    10. Applied rewrites40.0%

      \[\leadsto \left(\left(b - 0.5\right) \cdot \log c + z\right) + t \]

    if 2.0000000000000001e76 < (+.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. Taylor expanded in a around -inf

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

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

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

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

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

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

      \[\leadsto -\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto -\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a \]
      2. lower-*.f6441.8

        \[\leadsto -\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a \]
    7. Applied rewrites41.8%

      \[\leadsto -\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 11: 58.8% 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 -\infty:\\ \;\;\;\;-\left(-i\right) \cdot y\\ \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+33}:\\ \;\;\;\;-\left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;-\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot 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
 (let* ((t_1
         (+
          (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
          (* y i))))
   (if (<= t_1 (- INFINITY))
     (- (* (- i) y))
     (if (<= t_1 -1e+33) (- (- z)) (- (* (- (- (/ (* i y) a)) 1.0) a))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = -(-i * y);
	} else if (t_1 <= -1e+33) {
		tmp = -(-z);
	} else {
		tmp = -((-((i * y) / a) - 1.0) * a);
	}
	return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = -(-i * y);
	} else if (t_1 <= -1e+33) {
		tmp = -(-z);
	} else {
		tmp = -((-((i * y) / a) - 1.0) * 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):
	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = -(-i * y)
	elif t_1 <= -1e+33:
		tmp = -(-z)
	else:
		tmp = -((-((i * y) / a) - 1.0) * a)
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(-Float64(Float64(-i) * y));
	elseif (t_1 <= -1e+33)
		tmp = Float64(-Float64(-z));
	else
		tmp = Float64(-Float64(Float64(Float64(-Float64(Float64(i * y) / a)) - 1.0) * 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)
	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = -(-i * y);
	elseif (t_1 <= -1e+33)
		tmp = -(-z);
	else
		tmp = -((-((i * y) / a) - 1.0) * 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_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], (-N[((-i) * y), $MachinePrecision]), If[LessEqual[t$95$1, -1e+33], (-(-z)), (-N[(N[((-N[(N[(i * y), $MachinePrecision] / a), $MachinePrecision]) - 1.0), $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}
t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;-\left(-i\right) \cdot y\\

\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+33}:\\
\;\;\;\;-\left(-z\right)\\

\mathbf{else}:\\
\;\;\;\;-\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto --1 \cdot \left(i \cdot y\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto -\left(-1 \cdot i\right) \cdot y \]
      2. lower-*.f64N/A

        \[\leadsto -\left(-1 \cdot i\right) \cdot y \]
      3. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(i\right)\right) \cdot y \]
      4. lower-neg.f6424.0

        \[\leadsto -\left(-i\right) \cdot y \]
    7. Applied rewrites24.0%

      \[\leadsto -\left(-i\right) \cdot y \]

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto --1 \cdot z \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(z\right)\right) \]
      2. lower-neg.f6422.5

        \[\leadsto -\left(-z\right) \]
    7. Applied rewrites22.5%

      \[\leadsto -\left(-z\right) \]

    if -9.9999999999999995e32 < (+.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. Taylor expanded in a around -inf

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

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

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

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

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

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

      \[\leadsto -\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto -\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a \]
      2. lower-*.f6441.8

        \[\leadsto -\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a \]
    7. Applied rewrites41.8%

      \[\leadsto -\left(\left(-\frac{i \cdot y}{a}\right) - 1\right) \cdot a \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 12: 55.5% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := -\left(-i\right) \cdot y\\ t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -200:\\ \;\;\;\;-\left(-z\right)\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+307}:\\ \;\;\;\;-\left(\left(-\frac{z}{a}\right) - 1\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (* (- i) y)))
        (t_2
         (+
          (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
          (* y i))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -200.0)
       (- (- z))
       (if (<= t_2 4e+307) (- (* (- (- (/ z a)) 1.0) a)) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = -(-i * y);
	double t_2 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -200.0) {
		tmp = -(-z);
	} else if (t_2 <= 4e+307) {
		tmp = -((-(z / a) - 1.0) * a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = -(-i * y);
	double t_2 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -200.0) {
		tmp = -(-z);
	} else if (t_2 <= 4e+307) {
		tmp = -((-(z / a) - 1.0) * a);
	} else {
		tmp = t_1;
	}
	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 = -(-i * y)
	t_2 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -200.0:
		tmp = -(-z)
	elif t_2 <= 4e+307:
		tmp = -((-(z / a) - 1.0) * a)
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(-Float64(Float64(-i) * y))
	t_2 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -200.0)
		tmp = Float64(-Float64(-z));
	elseif (t_2 <= 4e+307)
		tmp = Float64(-Float64(Float64(Float64(-Float64(z / a)) - 1.0) * a));
	else
		tmp = t_1;
	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 = -(-i * y);
	t_2 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -200.0)
		tmp = -(-z);
	elseif (t_2 <= 4e+307)
		tmp = -((-(z / a) - 1.0) * a);
	else
		tmp = t_1;
	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[((-i) * y), $MachinePrecision])}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -200.0], (-(-z)), If[LessEqual[t$95$2, 4e+307], (-N[(N[((-N[(z / a), $MachinePrecision]) - 1.0), $MachinePrecision] * a), $MachinePrecision]), t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := -\left(-i\right) \cdot y\\
t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -200:\\
\;\;\;\;-\left(-z\right)\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;-\left(\left(-\frac{z}{a}\right) - 1\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0 or 3.99999999999999994e307 < (+.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. Taylor expanded in a around -inf

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

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

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

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

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

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

      \[\leadsto --1 \cdot \left(i \cdot y\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto -\left(-1 \cdot i\right) \cdot y \]
      2. lower-*.f64N/A

        \[\leadsto -\left(-1 \cdot i\right) \cdot y \]
      3. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(i\right)\right) \cdot y \]
      4. lower-neg.f6424.0

        \[\leadsto -\left(-i\right) \cdot y \]
    7. Applied rewrites24.0%

      \[\leadsto -\left(-i\right) \cdot y \]

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto --1 \cdot z \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(z\right)\right) \]
      2. lower-neg.f6422.5

        \[\leadsto -\left(-z\right) \]
    7. Applied rewrites22.5%

      \[\leadsto -\left(-z\right) \]

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto -\left(\left(-\frac{z}{a}\right) - 1\right) \cdot a \]
    6. Step-by-step derivation
      1. lower-/.f6436.4

        \[\leadsto -\left(\left(-\frac{z}{a}\right) - 1\right) \cdot a \]
    7. Applied rewrites36.4%

      \[\leadsto -\left(\left(-\frac{z}{a}\right) - 1\right) \cdot a \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 13: 55.5% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := -\left(-i\right) \cdot y\\ t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -40:\\ \;\;\;\;-\left(-z\right)\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+307}:\\ \;\;\;\;-\left(-a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (* (- i) y)))
        (t_2
         (+
          (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
          (* y i))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -40.0) (- (- z)) (if (<= t_2 4e+307) (- (- a)) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = -(-i * y);
	double t_2 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -40.0) {
		tmp = -(-z);
	} else if (t_2 <= 4e+307) {
		tmp = -(-a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = -(-i * y);
	double t_2 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -40.0) {
		tmp = -(-z);
	} else if (t_2 <= 4e+307) {
		tmp = -(-a);
	} else {
		tmp = t_1;
	}
	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 = -(-i * y)
	t_2 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -40.0:
		tmp = -(-z)
	elif t_2 <= 4e+307:
		tmp = -(-a)
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(-Float64(Float64(-i) * y))
	t_2 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -40.0)
		tmp = Float64(-Float64(-z));
	elseif (t_2 <= 4e+307)
		tmp = Float64(-Float64(-a));
	else
		tmp = t_1;
	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 = -(-i * y);
	t_2 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -40.0)
		tmp = -(-z);
	elseif (t_2 <= 4e+307)
		tmp = -(-a);
	else
		tmp = t_1;
	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[((-i) * y), $MachinePrecision])}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -40.0], (-(-z)), If[LessEqual[t$95$2, 4e+307], (-(-a)), t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := -\left(-i\right) \cdot y\\
t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -40:\\
\;\;\;\;-\left(-z\right)\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;-\left(-a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0 or 3.99999999999999994e307 < (+.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. Taylor expanded in a around -inf

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

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

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

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

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

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

      \[\leadsto --1 \cdot \left(i \cdot y\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto -\left(-1 \cdot i\right) \cdot y \]
      2. lower-*.f64N/A

        \[\leadsto -\left(-1 \cdot i\right) \cdot y \]
      3. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(i\right)\right) \cdot y \]
      4. lower-neg.f6424.0

        \[\leadsto -\left(-i\right) \cdot y \]
    7. Applied rewrites24.0%

      \[\leadsto -\left(-i\right) \cdot y \]

    if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -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. Taylor expanded in a around -inf

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

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

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

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

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

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

      \[\leadsto --1 \cdot z \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(z\right)\right) \]
      2. lower-neg.f6422.5

        \[\leadsto -\left(-z\right) \]
    7. Applied rewrites22.5%

      \[\leadsto -\left(-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)) < 3.99999999999999994e307

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto --1 \cdot a \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(a\right)\right) \]
      2. lower-neg.f6422.5

        \[\leadsto -\left(-a\right) \]
    7. Applied rewrites22.5%

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

Alternative 14: 43.7% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -40:\\ \;\;\;\;-\left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;-\left(-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)
   (- (- 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 = Float64(-Float64(-z));
	else
		tmp = Float64(-Float64(-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:\\
\;\;\;\;-\left(-z\right)\\

\mathbf{else}:\\
\;\;\;\;-\left(-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.8%

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

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

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

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

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

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

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

      \[\leadsto --1 \cdot z \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(z\right)\right) \]
      2. lower-neg.f6422.5

        \[\leadsto -\left(-z\right) \]
    7. Applied rewrites22.5%

      \[\leadsto -\left(-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. Taylor expanded in a around -inf

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

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

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

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

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

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

      \[\leadsto --1 \cdot a \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto -\left(\mathsf{neg}\left(a\right)\right) \]
      2. lower-neg.f6422.5

        \[\leadsto -\left(-a\right) \]
    7. Applied rewrites22.5%

      \[\leadsto -\left(-a\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 22.5% accurate, 12.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ -\left(-a\right) \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i) :precision binary64 (- (- 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 Float64(-Float64(-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])\\
\\
-\left(-a\right)
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

    \[\leadsto --1 \cdot a \]
  6. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto -\left(\mathsf{neg}\left(a\right)\right) \]
    2. lower-neg.f6422.5

      \[\leadsto -\left(-a\right) \]
  7. Applied rewrites22.5%

    \[\leadsto -\left(-a\right) \]
  8. Add Preprocessing

Reproduce

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