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

Percentage Accurate: 99.8% → 99.9%
Time: 22.1s
Alternatives: 19
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
    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.9% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\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 (+ b -0.5) (log c) (+ z (fma x (log y) (+ 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) {
	return fma(y, i, fma((b + -0.5), log(c), (z + fma(x, log(y), (t + 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 fma(y, i, fma(Float64(b + -0.5), log(c), Float64(z + fma(x, log(y), Float64(t + a)))))
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(z + N[(x * N[Log[y], $MachinePrecision] + N[(t + a), $MachinePrecision]), $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(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\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. associate-+l+99.8%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
    2. associate-+l+99.8%

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

      \[\leadsto \left(\color{blue}{\left(z + x \cdot \log y\right)} + \left(t + a\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    4. associate-+l+99.8%

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

      \[\leadsto \left(z + \left(x \cdot \log y + \color{blue}{\left(a + t\right)}\right)\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    6. associate-+l+99.8%

      \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. +-commutative99.8%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    8. associate-+l+99.8%

      \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
    9. +-commutative99.8%

      \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
    10. fma-define99.8%

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

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

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

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

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

Alternative 2: 94.6% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{+23} \lor \neg \left(x \leq 2.95 \cdot 10^{+122}\right):\\ \;\;\;\;y \cdot i + \left(\left(t + a\right) + \mathsf{fma}\left(x, \log y, z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -2.9e+23) (not (<= x 2.95e+122)))
   (+ (* y i) (+ (+ t a) (fma x (log y) z)))
   (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ 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.9e+23) || !(x <= 2.95e+122)) {
		tmp = (y * i) + ((t + a) + fma(x, log(y), z));
	} else {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (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.9e+23) || !(x <= 2.95e+122))
		tmp = Float64(Float64(y * i) + Float64(Float64(t + a) + fma(x, log(y), z)));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(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[Or[LessEqual[x, -2.9e+23], N[Not[LessEqual[x, 2.95e+122]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(t + a), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+23} \lor \neg \left(x \leq 2.95 \cdot 10^{+122}\right):\\
\;\;\;\;y \cdot i + \left(\left(t + a\right) + \mathsf{fma}\left(x, \log y, z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.90000000000000013e23 or 2.95000000000000016e122 < 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. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.8%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    7. Simplified97.2%

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

    if -2.90000000000000013e23 < x < 2.95000000000000016e122

    1. Initial program 99.9%

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

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

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

Alternative 3: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right)\right) + y \cdot i \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* x (log y)))))) (* y i)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((log(c) * (b - 0.5)) + (a + (t + (z + (x * log(y)))))) + (y * i);
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    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 = ((log(c) * (b - 0.5d0)) + (a + (t + (z + (x * log(y)))))) + (y * i)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (x * Math.log(y)))))) + (y * i);
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	return ((math.log(c) * (b - 0.5)) + (a + (t + (z + (x * math.log(y)))))) + (y * i)
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(x * log(y)))))) + Float64(y * i))
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = ((log(c) * (b - 0.5)) + (a + (t + (z + (x * log(y)))))) + (y * i);
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right)\right) + y \cdot i
\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. Add Preprocessing
  3. Final simplification99.8%

    \[\leadsto \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right)\right) + y \cdot i \]
  4. Add Preprocessing

Alternative 4: 98.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])\\ \\ y \cdot i + \left(b \cdot \log c + \left(a + \left(t + \left(z + x \cdot \log y\right)\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
 (+ (* y i) (+ (* b (log c)) (+ a (+ t (+ z (* x (log y))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (y * i) + ((b * log(c)) + (a + (t + (z + (x * log(y))))));
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    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 = (y * i) + ((b * log(c)) + (a + (t + (z + (x * log(y))))))
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 (y * i) + ((b * Math.log(c)) + (a + (t + (z + (x * Math.log(y))))));
}
[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 (y * i) + ((b * math.log(c)) + (a + (t + (z + (x * math.log(y))))))
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(y * i) + Float64(Float64(b * log(c)) + Float64(a + Float64(t + Float64(z + Float64(x * log(y)))))))
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 = (y * i) + ((b * log(c)) + (a + (t + (z + (x * log(y))))));
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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])\\
\\
y \cdot i + \left(b \cdot \log c + \left(a + \left(t + \left(z + x \cdot \log y\right)\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. Add Preprocessing
  3. Taylor expanded in b around inf 97.6%

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

      \[\leadsto \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
  5. Simplified97.6%

    \[\leadsto \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
  6. Final simplification97.6%

    \[\leadsto y \cdot i + \left(b \cdot \log c + \left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right)\right) \]
  7. Add Preprocessing

Alternative 5: 62.9% accurate, 1.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ t_2 := x \cdot \log y + y \cdot i\\ \mathbf{if}\;x \leq -1.75 \cdot 10^{+137}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 6 \cdot 10^{+41}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.65 \cdot 10^{+81}:\\ \;\;\;\;z \cdot \left(1 + x \cdot \frac{\log y}{z}\right)\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{+240}:\\ \;\;\;\;t\_1\\ \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 (+ (* y i) (* a (+ (/ z a) 1.0))))
        (t_2 (+ (* x (log y)) (* y i))))
   (if (<= x -1.75e+137)
     t_2
     (if (<= x 6e+41)
       t_1
       (if (<= x 2.65e+81)
         (* z (+ 1.0 (* x (/ (log y) z))))
         (if (<= x 6.5e+240) t_1 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 = (y * i) + (a * ((z / a) + 1.0));
	double t_2 = (x * log(y)) + (y * i);
	double tmp;
	if (x <= -1.75e+137) {
		tmp = t_2;
	} else if (x <= 6e+41) {
		tmp = t_1;
	} else if (x <= 2.65e+81) {
		tmp = z * (1.0 + (x * (log(y) / z)));
	} else if (x <= 6.5e+240) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y * i) + (a * ((z / a) + 1.0d0))
    t_2 = (x * log(y)) + (y * i)
    if (x <= (-1.75d+137)) then
        tmp = t_2
    else if (x <= 6d+41) then
        tmp = t_1
    else if (x <= 2.65d+81) then
        tmp = z * (1.0d0 + (x * (log(y) / z)))
    else if (x <= 6.5d+240) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (y * i) + (a * ((z / a) + 1.0));
	double t_2 = (x * Math.log(y)) + (y * i);
	double tmp;
	if (x <= -1.75e+137) {
		tmp = t_2;
	} else if (x <= 6e+41) {
		tmp = t_1;
	} else if (x <= 2.65e+81) {
		tmp = z * (1.0 + (x * (Math.log(y) / z)));
	} else if (x <= 6.5e+240) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = (y * i) + (a * ((z / a) + 1.0))
	t_2 = (x * math.log(y)) + (y * i)
	tmp = 0
	if x <= -1.75e+137:
		tmp = t_2
	elif x <= 6e+41:
		tmp = t_1
	elif x <= 2.65e+81:
		tmp = z * (1.0 + (x * (math.log(y) / z)))
	elif x <= 6.5e+240:
		tmp = t_1
	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(y * i) + Float64(a * Float64(Float64(z / a) + 1.0)))
	t_2 = Float64(Float64(x * log(y)) + Float64(y * i))
	tmp = 0.0
	if (x <= -1.75e+137)
		tmp = t_2;
	elseif (x <= 6e+41)
		tmp = t_1;
	elseif (x <= 2.65e+81)
		tmp = Float64(z * Float64(1.0 + Float64(x * Float64(log(y) / z))));
	elseif (x <= 6.5e+240)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (y * i) + (a * ((z / a) + 1.0));
	t_2 = (x * log(y)) + (y * i);
	tmp = 0.0;
	if (x <= -1.75e+137)
		tmp = t_2;
	elseif (x <= 6e+41)
		tmp = t_1;
	elseif (x <= 2.65e+81)
		tmp = z * (1.0 + (x * (log(y) / z)));
	elseif (x <= 6.5e+240)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(a * N[(N[(z / a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e+137], t$95$2, If[LessEqual[x, 6e+41], t$95$1, If[LessEqual[x, 2.65e+81], N[(z * N[(1.0 + N[(x * N[(N[Log[y], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.5e+240], t$95$1, 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 := y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\
t_2 := x \cdot \log y + y \cdot i\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{+137}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 6 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.65 \cdot 10^{+81}:\\
\;\;\;\;z \cdot \left(1 + x \cdot \frac{\log y}{z}\right)\\

\mathbf{elif}\;x \leq 6.5 \cdot 10^{+240}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.7500000000000001e137 or 6.50000000000000018e240 < x

    1. Initial program 99.6%

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(-1 \cdot \left(x \cdot \log y\right)\right)} + y \cdot i \]
    5. Step-by-step derivation
      1. mul-1-neg84.3%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \log y\right)} + y \cdot i \]
      2. distribute-rgt-neg-in84.3%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \left(-\log y\right)\right)} + y \cdot i \]
    6. Simplified84.3%

      \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \left(-\log y\right)\right)} + y \cdot i \]
    7. Taylor expanded in x around 0 84.3%

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

    if -1.7500000000000001e137 < x < 5.9999999999999997e41 or 2.65000000000000014e81 < x < 6.50000000000000018e240

    1. Initial program 99.9%

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

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

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

    if 5.9999999999999997e41 < x < 2.65000000000000014e81

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.7%

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

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

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

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

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

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \color{blue}{\left(\left(\frac{x \cdot \log y}{z} + \frac{\log c \cdot \left(b - 0.5\right)}{z}\right) + \frac{i \cdot y}{z}\right)}\right)\right)\right) \]
      2. associate-/l*63.1%

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

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

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \frac{\log c \cdot \left(b + \color{blue}{-0.5}\right)}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      5. associate-/l*63.1%

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

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \log c \cdot \frac{\color{blue}{-0.5 + b}}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      7. associate-/l*63.1%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \log c \cdot \frac{-0.5 + b}{z}\right) + \color{blue}{i \cdot \frac{y}{z}}\right)\right)\right)\right) \]
    7. Simplified63.1%

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

      \[\leadsto z \cdot \left(1 + \color{blue}{\frac{x \cdot \log y}{z}}\right) \]
    9. Step-by-step derivation
      1. associate-/l*27.9%

        \[\leadsto z \cdot \left(1 + \color{blue}{x \cdot \frac{\log y}{z}}\right) \]
    10. Simplified27.9%

      \[\leadsto z \cdot \left(1 + \color{blue}{x \cdot \frac{\log y}{z}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+137}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \mathbf{elif}\;x \leq 6 \cdot 10^{+41}:\\ \;\;\;\;y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ \mathbf{elif}\;x \leq 2.65 \cdot 10^{+81}:\\ \;\;\;\;z \cdot \left(1 + x \cdot \frac{\log y}{z}\right)\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{+240}:\\ \;\;\;\;y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 90.8% accurate, 1.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{+232} \lor \neg \left(x \leq 1.95 \cdot 10^{+161}\right):\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -1.95e+232) (not (<= x 1.95e+161)))
   (+ a (+ t (+ z (* x (log y)))))
   (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ 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 <= -1.95e+232) || !(x <= 1.95e+161)) {
		tmp = a + (t + (z + (x * log(y))));
	} else {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    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 <= (-1.95d+232)) .or. (.not. (x <= 1.95d+161))) then
        tmp = a + (t + (z + (x * log(y))))
    else
        tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (a + (z + t)))
    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 <= -1.95e+232) || !(x <= 1.95e+161)) {
		tmp = a + (t + (z + (x * Math.log(y))));
	} else {
		tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + (z + t)));
	}
	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 <= -1.95e+232) or not (x <= 1.95e+161):
		tmp = a + (t + (z + (x * math.log(y))))
	else:
		tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (a + (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 <= -1.95e+232) || !(x <= 1.95e+161))
		tmp = Float64(a + Float64(t + Float64(z + Float64(x * log(y)))));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(z + t))));
	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 <= -1.95e+232) || ~((x <= 1.95e+161)))
		tmp = a + (t + (z + (x * log(y))));
	else
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
	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[Or[LessEqual[x, -1.95e+232], N[Not[LessEqual[x, 1.95e+161]], $MachinePrecision]], N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+232} \lor \neg \left(x \leq 1.95 \cdot 10^{+161}\right):\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.9499999999999999e232 or 1.9500000000000001e161 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.7%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    7. Simplified99.6%

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    8. Taylor expanded in y around 0 96.2%

      \[\leadsto \color{blue}{a + \left(t + \left(z + x \cdot \log y\right)\right)} \]

    if -1.9499999999999999e232 < x < 1.9500000000000001e161

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{+232} \lor \neg \left(x \leq 1.95 \cdot 10^{+161}\right):\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 94.6% accurate, 1.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.1 \cdot 10^{+27} \lor \neg \left(x \leq 1.35 \cdot 10^{+122}\right):\\ \;\;\;\;y \cdot i + x \cdot \left(\log y + \frac{z + \left(t + a\right)}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -1.1e+27) (not (<= x 1.35e+122)))
   (+ (* y i) (* x (+ (log y) (/ (+ z (+ t a)) x))))
   (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ 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 <= -1.1e+27) || !(x <= 1.35e+122)) {
		tmp = (y * i) + (x * (log(y) + ((z + (t + a)) / x)));
	} else {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    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 <= (-1.1d+27)) .or. (.not. (x <= 1.35d+122))) then
        tmp = (y * i) + (x * (log(y) + ((z + (t + a)) / x)))
    else
        tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (a + (z + t)))
    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 <= -1.1e+27) || !(x <= 1.35e+122)) {
		tmp = (y * i) + (x * (Math.log(y) + ((z + (t + a)) / x)));
	} else {
		tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + (z + t)));
	}
	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 <= -1.1e+27) or not (x <= 1.35e+122):
		tmp = (y * i) + (x * (math.log(y) + ((z + (t + a)) / x)))
	else:
		tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (a + (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 <= -1.1e+27) || !(x <= 1.35e+122))
		tmp = Float64(Float64(y * i) + Float64(x * Float64(log(y) + Float64(Float64(z + Float64(t + a)) / x))));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(z + t))));
	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 <= -1.1e+27) || ~((x <= 1.35e+122)))
		tmp = (y * i) + (x * (log(y) + ((z + (t + a)) / x)));
	else
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
	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[Or[LessEqual[x, -1.1e+27], N[Not[LessEqual[x, 1.35e+122]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(x * N[(N[Log[y], $MachinePrecision] + N[(N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+27} \lor \neg \left(x \leq 1.35 \cdot 10^{+122}\right):\\
\;\;\;\;y \cdot i + x \cdot \left(\log y + \frac{z + \left(t + a\right)}{x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.0999999999999999e27 or 1.3499999999999999e122 < 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. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.8%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    7. Simplified97.2%

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    8. Taylor expanded in x around -inf 97.2%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot \log y + -1 \cdot \frac{a + \left(t + z\right)}{x}\right)\right)} + y \cdot i \]
    9. Step-by-step derivation
      1. mul-1-neg97.2%

        \[\leadsto \color{blue}{\left(-x \cdot \left(-1 \cdot \log y + -1 \cdot \frac{a + \left(t + z\right)}{x}\right)\right)} + y \cdot i \]
      2. distribute-rgt-neg-in97.2%

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

        \[\leadsto x \cdot \left(-\left(-1 \cdot \log y + \color{blue}{\left(-\frac{a + \left(t + z\right)}{x}\right)}\right)\right) + y \cdot i \]
      4. unsub-neg97.2%

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

        \[\leadsto x \cdot \left(-\left(\color{blue}{\left(-\log y\right)} - \frac{a + \left(t + z\right)}{x}\right)\right) + y \cdot i \]
      6. +-commutative97.2%

        \[\leadsto x \cdot \left(-\left(\left(-\log y\right) - \frac{\color{blue}{\left(t + z\right) + a}}{x}\right)\right) + y \cdot i \]
      7. +-commutative97.2%

        \[\leadsto x \cdot \left(-\left(\left(-\log y\right) - \frac{\color{blue}{\left(z + t\right)} + a}{x}\right)\right) + y \cdot i \]
      8. associate-+l+97.2%

        \[\leadsto x \cdot \left(-\left(\left(-\log y\right) - \frac{\color{blue}{z + \left(t + a\right)}}{x}\right)\right) + y \cdot i \]
      9. +-commutative97.2%

        \[\leadsto x \cdot \left(-\left(\left(-\log y\right) - \frac{z + \color{blue}{\left(a + t\right)}}{x}\right)\right) + y \cdot i \]
    10. Simplified97.2%

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

    if -1.0999999999999999e27 < x < 1.3499999999999999e122

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.1 \cdot 10^{+27} \lor \neg \left(x \leq 1.35 \cdot 10^{+122}\right):\\ \;\;\;\;y \cdot i + x \cdot \left(\log y + \frac{z + \left(t + a\right)}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 69.3% accurate, 1.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{if}\;y \leq 4.8 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{-16}:\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+100}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (+ t (+ z (* x (log y)))))))
   (if (<= y 4.8e-26)
     t_1
     (if (<= y 1.02e-16)
       (+ (* y i) (* b (log c)))
       (if (<= y 2.4e+100) t_1 (+ (* y i) (* a (+ (/ z a) 1.0))))))))
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 = a + (t + (z + (x * log(y))));
	double tmp;
	if (y <= 4.8e-26) {
		tmp = t_1;
	} else if (y <= 1.02e-16) {
		tmp = (y * i) + (b * log(c));
	} else if (y <= 2.4e+100) {
		tmp = t_1;
	} else {
		tmp = (y * i) + (a * ((z / a) + 1.0));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a + (t + (z + (x * log(y))))
    if (y <= 4.8d-26) then
        tmp = t_1
    else if (y <= 1.02d-16) then
        tmp = (y * i) + (b * log(c))
    else if (y <= 2.4d+100) then
        tmp = t_1
    else
        tmp = (y * i) + (a * ((z / a) + 1.0d0))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (t + (z + (x * Math.log(y))));
	double tmp;
	if (y <= 4.8e-26) {
		tmp = t_1;
	} else if (y <= 1.02e-16) {
		tmp = (y * i) + (b * Math.log(c));
	} else if (y <= 2.4e+100) {
		tmp = t_1;
	} else {
		tmp = (y * i) + (a * ((z / a) + 1.0));
	}
	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 = a + (t + (z + (x * math.log(y))))
	tmp = 0
	if y <= 4.8e-26:
		tmp = t_1
	elif y <= 1.02e-16:
		tmp = (y * i) + (b * math.log(c))
	elif y <= 2.4e+100:
		tmp = t_1
	else:
		tmp = (y * i) + (a * ((z / a) + 1.0))
	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(a + Float64(t + Float64(z + Float64(x * log(y)))))
	tmp = 0.0
	if (y <= 4.8e-26)
		tmp = t_1;
	elseif (y <= 1.02e-16)
		tmp = Float64(Float64(y * i) + Float64(b * log(c)));
	elseif (y <= 2.4e+100)
		tmp = t_1;
	else
		tmp = Float64(Float64(y * i) + Float64(a * Float64(Float64(z / a) + 1.0)));
	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 = a + (t + (z + (x * log(y))));
	tmp = 0.0;
	if (y <= 4.8e-26)
		tmp = t_1;
	elseif (y <= 1.02e-16)
		tmp = (y * i) + (b * log(c));
	elseif (y <= 2.4e+100)
		tmp = t_1;
	else
		tmp = (y * i) + (a * ((z / a) + 1.0));
	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[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.8e-26], t$95$1, If[LessEqual[y, 1.02e-16], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+100], t$95$1, N[(N[(y * i), $MachinePrecision] + N[(a * N[(N[(z / a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a + \left(t + \left(z + x \cdot \log y\right)\right)\\
\mathbf{if}\;y \leq 4.8 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.02 \cdot 10^{-16}:\\
\;\;\;\;y \cdot i + b \cdot \log c\\

\mathbf{elif}\;y \leq 2.4 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 4.8000000000000002e-26 or 1.0200000000000001e-16 < y < 2.40000000000000012e100

    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. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.8%

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    8. Taylor expanded in y around 0 76.2%

      \[\leadsto \color{blue}{a + \left(t + \left(z + x \cdot \log y\right)\right)} \]

    if 4.8000000000000002e-26 < y < 1.0200000000000001e-16

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]
    5. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Simplified99.7%

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]

    if 2.40000000000000012e100 < y

    1. Initial program 99.8%

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

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

      \[\leadsto -1 \cdot \left(a \cdot \left(-1 \cdot \color{blue}{\frac{z}{a}} - 1\right)\right) + y \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{-26}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{-16}:\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+100}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 75.7% accurate, 1.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{+232} \lor \neg \left(x \leq 4.8 \cdot 10^{+30}\right):\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -1.95e+232) (not (<= x 4.8e+30)))
   (+ a (+ t (+ z (* x (log y)))))
   (+ a (+ t (+ z (+ (* y i) (* -0.5 (log c))))))))
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 <= -1.95e+232) || !(x <= 4.8e+30)) {
		tmp = a + (t + (z + (x * log(y))));
	} else {
		tmp = a + (t + (z + ((y * i) + (-0.5 * log(c)))));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    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 <= (-1.95d+232)) .or. (.not. (x <= 4.8d+30))) then
        tmp = a + (t + (z + (x * log(y))))
    else
        tmp = a + (t + (z + ((y * i) + ((-0.5d0) * log(c)))))
    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 <= -1.95e+232) || !(x <= 4.8e+30)) {
		tmp = a + (t + (z + (x * Math.log(y))));
	} else {
		tmp = a + (t + (z + ((y * i) + (-0.5 * Math.log(c)))));
	}
	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 <= -1.95e+232) or not (x <= 4.8e+30):
		tmp = a + (t + (z + (x * math.log(y))))
	else:
		tmp = a + (t + (z + ((y * i) + (-0.5 * math.log(c)))))
	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 <= -1.95e+232) || !(x <= 4.8e+30))
		tmp = Float64(a + Float64(t + Float64(z + Float64(x * log(y)))));
	else
		tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(y * i) + Float64(-0.5 * log(c))))));
	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 <= -1.95e+232) || ~((x <= 4.8e+30)))
		tmp = a + (t + (z + (x * log(y))));
	else
		tmp = a + (t + (z + ((y * i) + (-0.5 * log(c)))));
	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[Or[LessEqual[x, -1.95e+232], N[Not[LessEqual[x, 4.8e+30]], $MachinePrecision]], N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+232} \lor \neg \left(x \leq 4.8 \cdot 10^{+30}\right):\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.9499999999999999e232 or 4.7999999999999999e30 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.7%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    7. Simplified93.9%

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    8. Taylor expanded in y around 0 86.2%

      \[\leadsto \color{blue}{a + \left(t + \left(z + x \cdot \log y\right)\right)} \]

    if -1.9499999999999999e232 < x < 4.7999999999999999e30

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.9%

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

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

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

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

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

      \[\leadsto a + \left(t + \color{blue}{\left(z + \left(-0.5 \cdot \log c + i \cdot y\right)\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{+232} \lor \neg \left(x \leq 4.8 \cdot 10^{+30}\right):\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 90.3% accurate, 1.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{+232} \lor \neg \left(x \leq 1.65 \cdot 10^{+161}\right):\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -2e+232) (not (<= x 1.65e+161)))
   (+ a (+ t (+ z (* x (log y)))))
   (+ (* y i) (+ (+ z a) (* (+ b -0.5) (log c))))))
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 <= -2e+232) || !(x <= 1.65e+161)) {
		tmp = a + (t + (z + (x * log(y))));
	} else {
		tmp = (y * i) + ((z + a) + ((b + -0.5) * log(c)));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    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 <= (-2d+232)) .or. (.not. (x <= 1.65d+161))) then
        tmp = a + (t + (z + (x * log(y))))
    else
        tmp = (y * i) + ((z + a) + ((b + (-0.5d0)) * log(c)))
    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 <= -2e+232) || !(x <= 1.65e+161)) {
		tmp = a + (t + (z + (x * Math.log(y))));
	} else {
		tmp = (y * i) + ((z + a) + ((b + -0.5) * Math.log(c)));
	}
	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 <= -2e+232) or not (x <= 1.65e+161):
		tmp = a + (t + (z + (x * math.log(y))))
	else:
		tmp = (y * i) + ((z + a) + ((b + -0.5) * math.log(c)))
	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 <= -2e+232) || !(x <= 1.65e+161))
		tmp = Float64(a + Float64(t + Float64(z + Float64(x * log(y)))));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(z + a) + Float64(Float64(b + -0.5) * log(c))));
	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 <= -2e+232) || ~((x <= 1.65e+161)))
		tmp = a + (t + (z + (x * log(y))));
	else
		tmp = (y * i) + ((z + a) + ((b + -0.5) * log(c)));
	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[Or[LessEqual[x, -2e+232], N[Not[LessEqual[x, 1.65e+161]], $MachinePrecision]], N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(z + a), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+232} \lor \neg \left(x \leq 1.65 \cdot 10^{+161}\right):\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.00000000000000011e232 or 1.64999999999999999e161 < x

    1. Initial program 99.7%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.7%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    7. Simplified99.6%

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    8. Taylor expanded in y around 0 96.2%

      \[\leadsto \color{blue}{a + \left(t + \left(z + x \cdot \log y\right)\right)} \]

    if -2.00000000000000011e232 < x < 1.64999999999999999e161

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)} + y \cdot i \]
    5. Step-by-step derivation
      1. associate-+r+79.8%

        \[\leadsto \color{blue}{\left(\left(a + z\right) + \log c \cdot \left(b - 0.5\right)\right)} + y \cdot i \]
      2. sub-neg79.8%

        \[\leadsto \left(\left(a + z\right) + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right) + y \cdot i \]
      3. metadata-eval79.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{+232} \lor \neg \left(x \leq 1.65 \cdot 10^{+161}\right):\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 63.7% accurate, 1.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{+137} \lor \neg \left(x \leq 6.5 \cdot 10^{+240}\right):\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -2.6e+137) (not (<= x 6.5e+240)))
   (+ (* x (log y)) (* y i))
   (+ (* y i) (* a (+ (/ z a) 1.0)))))
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.6e+137) || !(x <= 6.5e+240)) {
		tmp = (x * log(y)) + (y * i);
	} else {
		tmp = (y * i) + (a * ((z / a) + 1.0));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    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 <= (-2.6d+137)) .or. (.not. (x <= 6.5d+240))) then
        tmp = (x * log(y)) + (y * i)
    else
        tmp = (y * i) + (a * ((z / a) + 1.0d0))
    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 <= -2.6e+137) || !(x <= 6.5e+240)) {
		tmp = (x * Math.log(y)) + (y * i);
	} else {
		tmp = (y * i) + (a * ((z / a) + 1.0));
	}
	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 <= -2.6e+137) or not (x <= 6.5e+240):
		tmp = (x * math.log(y)) + (y * i)
	else:
		tmp = (y * i) + (a * ((z / a) + 1.0))
	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.6e+137) || !(x <= 6.5e+240))
		tmp = Float64(Float64(x * log(y)) + Float64(y * i));
	else
		tmp = Float64(Float64(y * i) + Float64(a * Float64(Float64(z / a) + 1.0)));
	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 <= -2.6e+137) || ~((x <= 6.5e+240)))
		tmp = (x * log(y)) + (y * i);
	else
		tmp = (y * i) + (a * ((z / a) + 1.0));
	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[Or[LessEqual[x, -2.6e+137], N[Not[LessEqual[x, 6.5e+240]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a * N[(N[(z / a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+137} \lor \neg \left(x \leq 6.5 \cdot 10^{+240}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.5999999999999999e137 or 6.50000000000000018e240 < x

    1. Initial program 99.6%

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(-1 \cdot \left(x \cdot \log y\right)\right)} + y \cdot i \]
    5. Step-by-step derivation
      1. mul-1-neg84.3%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \log y\right)} + y \cdot i \]
      2. distribute-rgt-neg-in84.3%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \left(-\log y\right)\right)} + y \cdot i \]
    6. Simplified84.3%

      \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \left(-\log y\right)\right)} + y \cdot i \]
    7. Taylor expanded in x around 0 84.3%

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

    if -2.5999999999999999e137 < x < 6.50000000000000018e240

    1. Initial program 99.9%

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

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

      \[\leadsto -1 \cdot \left(a \cdot \left(-1 \cdot \color{blue}{\frac{z}{a}} - 1\right)\right) + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{+137} \lor \neg \left(x \leq 6.5 \cdot 10^{+240}\right):\\ \;\;\;\;x \cdot \log y + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 61.8% accurate, 1.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{+232} \lor \neg \left(x \leq 1.55 \cdot 10^{+241}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -9.5e+232) (not (<= x 1.55e+241)))
   (* x (log y))
   (+ (* y i) (* a (+ (/ z a) 1.0)))))
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 <= -9.5e+232) || !(x <= 1.55e+241)) {
		tmp = x * log(y);
	} else {
		tmp = (y * i) + (a * ((z / a) + 1.0));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    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 <= (-9.5d+232)) .or. (.not. (x <= 1.55d+241))) then
        tmp = x * log(y)
    else
        tmp = (y * i) + (a * ((z / a) + 1.0d0))
    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 <= -9.5e+232) || !(x <= 1.55e+241)) {
		tmp = x * Math.log(y);
	} else {
		tmp = (y * i) + (a * ((z / a) + 1.0));
	}
	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 <= -9.5e+232) or not (x <= 1.55e+241):
		tmp = x * math.log(y)
	else:
		tmp = (y * i) + (a * ((z / a) + 1.0))
	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 <= -9.5e+232) || !(x <= 1.55e+241))
		tmp = Float64(x * log(y));
	else
		tmp = Float64(Float64(y * i) + Float64(a * Float64(Float64(z / a) + 1.0)));
	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 <= -9.5e+232) || ~((x <= 1.55e+241)))
		tmp = x * log(y);
	else
		tmp = (y * i) + (a * ((z / a) + 1.0));
	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[Or[LessEqual[x, -9.5e+232], N[Not[LessEqual[x, 1.55e+241]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a * N[(N[(z / a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+232} \lor \neg \left(x \leq 1.55 \cdot 10^{+241}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.4999999999999996e232 or 1.55e241 < x

    1. Initial program 99.5%

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(-1 \cdot \left(x \cdot \log y\right)\right)} + y \cdot i \]
    5. Step-by-step derivation
      1. mul-1-neg95.7%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \log y\right)} + y \cdot i \]
      2. distribute-rgt-neg-in95.7%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \left(-\log y\right)\right)} + y \cdot i \]
    6. Simplified95.7%

      \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \left(-\log y\right)\right)} + y \cdot i \]
    7. Taylor expanded in x around inf 93.0%

      \[\leadsto \color{blue}{x \cdot \log y} \]
    8. Step-by-step derivation
      1. *-commutative93.0%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    9. Simplified93.0%

      \[\leadsto \color{blue}{\log y \cdot x} \]

    if -9.4999999999999996e232 < x < 1.55e241

    1. Initial program 99.9%

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

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

      \[\leadsto -1 \cdot \left(a \cdot \left(-1 \cdot \color{blue}{\frac{z}{a}} - 1\right)\right) + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{+232} \lor \neg \left(x \leq 1.55 \cdot 10^{+241}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 67.2% accurate, 13.7× speedup?

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

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


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

    1. Initial program 99.8%

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

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

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

    if 5.8e50 < a

    1. Initial program 99.9%

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

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

      \[\leadsto -1 \cdot \left(a \cdot \left(-1 \cdot \color{blue}{\frac{z}{a}} - 1\right)\right) + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.8 \cdot 10^{+50}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + a \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 38.9% accurate, 16.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+170}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-265}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -1.9e+170) z (if (<= z -8.2e-265) (* y i) a)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -1.9e+170) {
		tmp = z;
	} else if (z <= -8.2e-265) {
		tmp = y * i;
	} 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.
real(8) function code(x, y, z, t, a, b, c, i)
    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 (z <= (-1.9d+170)) then
        tmp = z
    else if (z <= (-8.2d-265)) then
        tmp = y * i
    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 (z <= -1.9e+170) {
		tmp = z;
	} else if (z <= -8.2e-265) {
		tmp = y * i;
	} 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 z <= -1.9e+170:
		tmp = z
	elif z <= -8.2e-265:
		tmp = y * i
	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 (z <= -1.9e+170)
		tmp = z;
	elseif (z <= -8.2e-265)
		tmp = Float64(y * i);
	else
		tmp = a;
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -1.9e+170)
		tmp = z;
	elseif (z <= -8.2e-265)
		tmp = y * i;
	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[z, -1.9e+170], z, If[LessEqual[z, -8.2e-265], N[(y * i), $MachinePrecision], 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}\;z \leq -1.9 \cdot 10^{+170}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq -8.2 \cdot 10^{-265}:\\
\;\;\;\;y \cdot i\\

\mathbf{else}:\\
\;\;\;\;a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.8999999999999999e170

    1. Initial program 100.0%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define100.0%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    7. Simplified91.6%

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    8. Taylor expanded in z around inf 57.5%

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

    if -1.8999999999999999e170 < z < -8.2e-265

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{i \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative32.2%

        \[\leadsto \color{blue}{y \cdot i} \]
    6. Simplified32.2%

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

    if -8.2e-265 < z

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.8%

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

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

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

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

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

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \color{blue}{\left(\left(\frac{x \cdot \log y}{z} + \frac{\log c \cdot \left(b - 0.5\right)}{z}\right) + \frac{i \cdot y}{z}\right)}\right)\right)\right) \]
      2. associate-/l*63.0%

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

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \frac{\log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      4. metadata-eval63.0%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \frac{\log c \cdot \left(b + \color{blue}{-0.5}\right)}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      5. associate-/l*63.0%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \color{blue}{\log c \cdot \frac{b + -0.5}{z}}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      6. +-commutative63.0%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \log c \cdot \frac{\color{blue}{-0.5 + b}}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      7. associate-/l*60.1%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \log c \cdot \frac{-0.5 + b}{z}\right) + \color{blue}{i \cdot \frac{y}{z}}\right)\right)\right)\right) \]
    7. Simplified60.1%

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

      \[\leadsto \color{blue}{a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification28.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+170}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-265}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

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

\mathbf{else}:\\
\;\;\;\;a + \left(t + y \cdot i\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.0200000000000001e83

    1. Initial program 99.9%

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

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

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

    if -1.0200000000000001e83 < z

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.8%

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

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

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

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

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

      \[\leadsto a + \left(t + \color{blue}{i \cdot y}\right) \]
    7. Step-by-step derivation
      1. *-commutative55.6%

        \[\leadsto a + \left(t + \color{blue}{y \cdot i}\right) \]
    8. Simplified55.6%

      \[\leadsto a + \left(t + \color{blue}{y \cdot i}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+83}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + y \cdot i\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 55.0% accurate, 21.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.49999999999999969e171

    1. Initial program 100.0%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define100.0%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    7. Simplified91.6%

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    8. Taylor expanded in z around inf 57.5%

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

    if -4.49999999999999969e171 < z

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{a} + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+171}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 61.4% accurate, 21.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.5000000000000003e82

    1. Initial program 99.9%

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

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

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

    if -6.5000000000000003e82 < z

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{a} + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+82}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 38.6% accurate, 36.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} \mathbf{if}\;z \leq -7.8 \cdot 10^{+82}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -7.8e+82) 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 (z <= -7.8e+82) {
		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.
real(8) function code(x, y, z, t, a, b, c, i)
    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 (z <= (-7.8d+82)) 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 (z <= -7.8e+82) {
		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 z <= -7.8e+82:
		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 (z <= -7.8e+82)
		tmp = z;
	else
		tmp = a;
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -7.8e+82)
		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[z, -7.8e+82], 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}\;z \leq -7.8 \cdot 10^{+82}:\\
\;\;\;\;z\\

\mathbf{else}:\\
\;\;\;\;a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.79999999999999951e82

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.9%

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    7. Simplified91.5%

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    8. Taylor expanded in z around inf 42.0%

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

    if -7.79999999999999951e82 < z

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. fma-define99.8%

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\frac{i \cdot y}{z} + \left(\frac{x \cdot \log y}{z} + \frac{\log c \cdot \left(b - 0.5\right)}{z}\right)\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. +-commutative61.7%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \color{blue}{\left(\left(\frac{x \cdot \log y}{z} + \frac{\log c \cdot \left(b - 0.5\right)}{z}\right) + \frac{i \cdot y}{z}\right)}\right)\right)\right) \]
      2. associate-/l*61.7%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(\color{blue}{x \cdot \frac{\log y}{z}} + \frac{\log c \cdot \left(b - 0.5\right)}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      3. sub-neg61.7%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \frac{\log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      4. metadata-eval61.7%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \frac{\log c \cdot \left(b + \color{blue}{-0.5}\right)}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      5. associate-/l*61.7%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \color{blue}{\log c \cdot \frac{b + -0.5}{z}}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      6. +-commutative61.7%

        \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \log c \cdot \frac{\color{blue}{-0.5 + b}}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
      7. associate-/l*59.2%

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

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

      \[\leadsto \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification23.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+82}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 22.9% accurate, 219.0× speedup?

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Step-by-step derivation
    1. associate-+l+99.8%

      \[\leadsto \color{blue}{\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
    2. associate-+l+99.8%

      \[\leadsto \color{blue}{\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    3. fma-define99.8%

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

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

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

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

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

      \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \color{blue}{\left(\left(\frac{x \cdot \log y}{z} + \frac{\log c \cdot \left(b - 0.5\right)}{z}\right) + \frac{i \cdot y}{z}\right)}\right)\right)\right) \]
    2. associate-/l*69.0%

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

      \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \frac{\log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
    4. metadata-eval69.0%

      \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \frac{\log c \cdot \left(b + \color{blue}{-0.5}\right)}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
    5. associate-/l*69.0%

      \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \color{blue}{\log c \cdot \frac{b + -0.5}{z}}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
    6. +-commutative69.0%

      \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \log c \cdot \frac{\color{blue}{-0.5 + b}}{z}\right) + \frac{i \cdot y}{z}\right)\right)\right)\right) \]
    7. associate-/l*67.0%

      \[\leadsto z \cdot \left(1 + \left(\frac{a}{z} + \left(\frac{t}{z} + \left(\left(x \cdot \frac{\log y}{z} + \log c \cdot \frac{-0.5 + b}{z}\right) + \color{blue}{i \cdot \frac{y}{z}}\right)\right)\right)\right) \]
  7. Simplified67.0%

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

    \[\leadsto \color{blue}{a} \]
  9. Final simplification16.6%

    \[\leadsto a \]
  10. Add Preprocessing

Reproduce

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