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

Percentage Accurate: 99.8% → 99.5%
Time: 21.6s
Alternatives: 17
Speedup: 0.4×

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 17 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.5% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \sqrt[3]{b + -0.5} \cdot \sqrt[3]{\log c}\\ \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left({t\_1}^{2}, t\_1, y \cdot i\right) \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (cbrt (+ b -0.5)) (cbrt (log c)))))
   (+ (+ (+ (* x (log y)) z) (+ t a)) (fma (pow t_1 2.0) t_1 (* y i)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = cbrt((b + -0.5)) * cbrt(log(c));
	return (((x * log(y)) + z) + (t + a)) + fma(pow(t_1, 2.0), t_1, (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)
	t_1 = Float64(cbrt(Float64(b + -0.5)) * cbrt(log(c)))
	return Float64(Float64(Float64(Float64(x * log(y)) + z) + Float64(t + a)) + fma((t_1 ^ 2.0), t_1, Float64(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_] := Block[{t$95$1 = N[(N[Power[N[(b + -0.5), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[Log[c], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(N[Power[t$95$1, 2.0], $MachinePrecision] * t$95$1 + 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}
t_1 := \sqrt[3]{b + -0.5} \cdot \sqrt[3]{\log c}\\
\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left({t\_1}^{2}, t\_1, y \cdot i\right)
\end{array}
\end{array}
Derivation
  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. Step-by-step derivation
    1. associate-+l+99.5%

      \[\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. +-commutative99.5%

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

      \[\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) \]
    4. associate-+l+99.5%

      \[\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) \]
    5. fma-define99.5%

      \[\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) \]
    6. sub-neg99.5%

      \[\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) \]
    7. metadata-eval99.5%

      \[\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.5%

    \[\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. Step-by-step derivation
    1. fma-define99.5%

      \[\leadsto \left(\color{blue}{\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) \]
  6. Applied egg-rr99.5%

    \[\leadsto \left(\color{blue}{\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) \]
  7. Step-by-step derivation
    1. add-cube-cbrt99.2%

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

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

      \[\leadsto \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left(\color{blue}{{\left(\sqrt[3]{\left(b + -0.5\right) \cdot \log c}\right)}^{2}}, \sqrt[3]{\left(b + -0.5\right) \cdot \log c}, y \cdot i\right) \]
    4. *-commutative99.2%

      \[\leadsto \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left({\left(\sqrt[3]{\color{blue}{\log c \cdot \left(b + -0.5\right)}}\right)}^{2}, \sqrt[3]{\left(b + -0.5\right) \cdot \log c}, y \cdot i\right) \]
    5. *-commutative99.2%

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

    \[\leadsto \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{\log c \cdot \left(b + -0.5\right)}\right)}^{2}, \sqrt[3]{\log c \cdot \left(b + -0.5\right)}, y \cdot i\right)} \]
  9. Step-by-step derivation
    1. metadata-eval99.2%

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

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

      \[\leadsto \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left({\left(\sqrt[3]{\log c \cdot \left(b + -0.5\right)}\right)}^{2}, \sqrt[3]{\color{blue}{\left(b - 0.5\right) \cdot \log c}}, y \cdot i\right) \]
    4. cbrt-prod99.2%

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

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

      \[\leadsto \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left({\left(\sqrt[3]{\log c \cdot \left(b + -0.5\right)}\right)}^{2}, \sqrt[3]{b + \color{blue}{-0.5}} \cdot \sqrt[3]{\log c}, y \cdot i\right) \]
  10. Applied egg-rr99.2%

    \[\leadsto \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left({\left(\sqrt[3]{\log c \cdot \left(b + -0.5\right)}\right)}^{2}, \color{blue}{\sqrt[3]{b + -0.5} \cdot \sqrt[3]{\log c}}, y \cdot i\right) \]
  11. Step-by-step derivation
    1. metadata-eval99.2%

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

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

      \[\leadsto \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left({\left(\sqrt[3]{\log c \cdot \left(b + -0.5\right)}\right)}^{2}, \sqrt[3]{\color{blue}{\left(b - 0.5\right) \cdot \log c}}, y \cdot i\right) \]
    4. cbrt-prod99.2%

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

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

      \[\leadsto \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left({\left(\sqrt[3]{\log c \cdot \left(b + -0.5\right)}\right)}^{2}, \sqrt[3]{b + \color{blue}{-0.5}} \cdot \sqrt[3]{\log c}, y \cdot i\right) \]
  12. Applied egg-rr99.6%

    \[\leadsto \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \mathsf{fma}\left({\color{blue}{\left(\sqrt[3]{b + -0.5} \cdot \sqrt[3]{\log c}\right)}}^{2}, \sqrt[3]{b + -0.5} \cdot \sqrt[3]{\log c}, y \cdot i\right) \]
  13. Final simplification99.6%

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

Alternative 2: 99.8% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \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.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. Step-by-step derivation
    1. associate-+l+99.5%

      \[\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.5%

      \[\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.5%

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

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

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

      \[\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.5%

      \[\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.5%

      \[\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.5%

      \[\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.5%

      \[\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.5%

      \[\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.5%

      \[\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) \]
    13. sub-neg99.5%

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

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

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

    \[\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.5%

    \[\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 3: 94.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{+147} \lor \neg \left(x \leq 1.35 \cdot 10^{+172}\right):\\ \;\;\;\;\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;z + \left(a + \mathsf{fma}\left(\log c, b + -0.5, y \cdot i\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.8e+147) (not (<= x 1.35e+172)))
   (+ (+ (+ (* x (log y)) z) (+ t a)) (* y i))
   (+ z (+ a (fma (log c) (+ b -0.5) (* y i))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -2.8e+147) || !(x <= 1.35e+172)) {
		tmp = (((x * log(y)) + z) + (t + a)) + (y * i);
	} else {
		tmp = z + (a + fma(log(c), (b + -0.5), (y * i)));
	}
	return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -2.8e+147) || !(x <= 1.35e+172))
		tmp = Float64(Float64(Float64(Float64(x * log(y)) + z) + Float64(t + a)) + Float64(y * i));
	else
		tmp = Float64(z + Float64(a + fma(log(c), Float64(b + -0.5), Float64(y * i))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -2.8e+147], N[Not[LessEqual[x, 1.35e+172]], $MachinePrecision]], N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(z + N[(a + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + N[(y * i), $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.8 \cdot 10^{+147} \lor \neg \left(x \leq 1.35 \cdot 10^{+172}\right):\\
\;\;\;\;\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.8000000000000001e147 or 1.35e172 < 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. +-commutative99.7%

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. +-commutative99.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) \]
      4. 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) \]
      5. 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) \]
      6. 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) \]
      7. 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. Step-by-step derivation
      1. fma-define99.7%

        \[\leadsto \left(\color{blue}{\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) \]
    6. Applied egg-rr99.7%

      \[\leadsto \left(\color{blue}{\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) \]
    7. Step-by-step derivation
      1. add-cube-cbrt99.7%

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

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

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

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

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

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

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

    if -2.8000000000000001e147 < x < 1.35e172

    1. Initial program 99.4%

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

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

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

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

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

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

        \[\leadsto \left(a + z\right) + \left(y \cdot i + \log c \cdot \left(b + \color{blue}{-0.5}\right)\right) \]
      5. distribute-rgt-in81.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \left(\color{blue}{\mathsf{fma}\left(\log c, b + -0.5, y \cdot i\right)} + a\right) \]
      16. *-commutative82.2%

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

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

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

Alternative 4: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \left(y \cdot i + \left(b + -0.5\right) \cdot \log c\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
 (+ (+ (+ (* x (log y)) z) (+ t a)) (+ (* y i) (* (+ 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) {
	return (((x * log(y)) + z) + (t + a)) + ((y * i) + ((b + -0.5) * log(c)));
}
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 = (((x * log(y)) + z) + (t + a)) + ((y * i) + ((b + (-0.5d0)) * log(c)))
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((x * Math.log(y)) + z) + (t + a)) + ((y * i) + ((b + -0.5) * Math.log(c)));
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	return (((x * math.log(y)) + z) + (t + a)) + ((y * i) + ((b + -0.5) * math.log(c)))
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(x * log(y)) + z) + Float64(t + a)) + Float64(Float64(y * i) + Float64(Float64(b + -0.5) * log(c))))
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((x * log(y)) + z) + (t + a)) + ((y * i) + ((b + -0.5) * log(c)));
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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(N[(y * i), $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])\\
\\
\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \left(y \cdot i + \left(b + -0.5\right) \cdot \log c\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. associate-+l+99.5%

      \[\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. +-commutative99.5%

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

      \[\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) \]
    4. associate-+l+99.5%

      \[\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) \]
    5. fma-define99.5%

      \[\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) \]
    6. sub-neg99.5%

      \[\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) \]
    7. metadata-eval99.5%

      \[\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.5%

    \[\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. Step-by-step derivation
    1. fma-define99.5%

      \[\leadsto \left(\color{blue}{\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) \]
  6. Applied egg-rr99.5%

    \[\leadsto \left(\color{blue}{\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) \]
  7. Final simplification99.5%

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

Alternative 5: 97.8% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \left(y \cdot i + b \cdot \log c\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
 (+ (+ (+ (* x (log y)) z) (+ t a)) (+ (* y i) (* b (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) {
	return (((x * log(y)) + z) + (t + a)) + ((y * i) + (b * log(c)));
}
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 = (((x * log(y)) + z) + (t + a)) + ((y * i) + (b * log(c)))
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((x * Math.log(y)) + z) + (t + a)) + ((y * i) + (b * Math.log(c)));
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	return (((x * math.log(y)) + z) + (t + a)) + ((y * i) + (b * math.log(c)))
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(x * log(y)) + z) + Float64(t + a)) + Float64(Float64(y * i) + Float64(b * log(c))))
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((x * log(y)) + z) + (t + a)) + ((y * i) + (b * log(c)));
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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(N[(y * i), $MachinePrecision] + N[(b * 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])\\
\\
\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + \left(y \cdot i + b \cdot \log c\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. associate-+l+99.5%

      \[\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. +-commutative99.5%

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

      \[\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) \]
    4. associate-+l+99.5%

      \[\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) \]
    5. fma-define99.5%

      \[\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) \]
    6. sub-neg99.5%

      \[\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) \]
    7. metadata-eval99.5%

      \[\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.5%

    \[\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. Step-by-step derivation
    1. fma-define99.5%

      \[\leadsto \left(\color{blue}{\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) \]
  6. Applied egg-rr99.5%

    \[\leadsto \left(\color{blue}{\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) \]
  7. Taylor expanded in b around inf 97.8%

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

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

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

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

Alternative 6: 94.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 -4.5 \cdot 10^{+144} \lor \neg \left(x \leq 7.2 \cdot 10^{+171}\right):\\ \;\;\;\;\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + \left(y \cdot i + \log c \cdot \left(b - 0.5\right)\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 -4.5e+144) (not (<= x 7.2e+171)))
   (+ (+ (+ (* x (log y)) z) (+ t a)) (* y i))
   (+ a (+ t (+ z (+ (* y i) (* (log c) (- b 0.5))))))))
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 <= -4.5e+144) || !(x <= 7.2e+171)) {
		tmp = (((x * log(y)) + z) + (t + a)) + (y * i);
	} else {
		tmp = a + (t + (z + ((y * i) + (log(c) * (b - 0.5)))));
	}
	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 <= (-4.5d+144)) .or. (.not. (x <= 7.2d+171))) then
        tmp = (((x * log(y)) + z) + (t + a)) + (y * i)
    else
        tmp = a + (t + (z + ((y * i) + (log(c) * (b - 0.5d0)))))
    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 <= -4.5e+144) || !(x <= 7.2e+171)) {
		tmp = (((x * Math.log(y)) + z) + (t + a)) + (y * i);
	} else {
		tmp = a + (t + (z + ((y * i) + (Math.log(c) * (b - 0.5)))));
	}
	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 <= -4.5e+144) or not (x <= 7.2e+171):
		tmp = (((x * math.log(y)) + z) + (t + a)) + (y * i)
	else:
		tmp = a + (t + (z + ((y * i) + (math.log(c) * (b - 0.5)))))
	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 <= -4.5e+144) || !(x <= 7.2e+171))
		tmp = Float64(Float64(Float64(Float64(x * log(y)) + z) + Float64(t + a)) + Float64(y * i));
	else
		tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5))))));
	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 <= -4.5e+144) || ~((x <= 7.2e+171)))
		tmp = (((x * log(y)) + z) + (t + a)) + (y * i);
	else
		tmp = a + (t + (z + ((y * i) + (log(c) * (b - 0.5)))));
	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, -4.5e+144], N[Not[LessEqual[x, 7.2e+171]], $MachinePrecision]], N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $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 -4.5 \cdot 10^{+144} \lor \neg \left(x \leq 7.2 \cdot 10^{+171}\right):\\
\;\;\;\;\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.49999999999999967e144 or 7.20000000000000036e171 < 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. +-commutative99.7%

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. +-commutative99.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) \]
      4. 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) \]
      5. 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) \]
      6. 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) \]
      7. 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. Step-by-step derivation
      1. fma-define99.7%

        \[\leadsto \left(\color{blue}{\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) \]
    6. Applied egg-rr99.7%

      \[\leadsto \left(\color{blue}{\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) \]
    7. Step-by-step derivation
      1. add-cube-cbrt99.7%

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

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

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

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

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

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

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

    if -4.49999999999999967e144 < x < 7.20000000000000036e171

    1. Initial program 99.4%

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.6e92 or 1.54999999999999996e109 < y < 4.30000000000000026e176

    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 79.3%

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

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

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

        \[\leadsto \color{blue}{\left(a + z\right) + \log c \cdot \left(b - 0.5\right)} \]
      2. +-commutative54.4%

        \[\leadsto \color{blue}{\left(z + a\right)} + \log c \cdot \left(b - 0.5\right) \]
      3. sub-neg54.4%

        \[\leadsto \left(z + a\right) + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)} \]
      4. metadata-eval54.4%

        \[\leadsto \left(z + a\right) + \log c \cdot \left(b + \color{blue}{-0.5}\right) \]
      5. +-commutative54.4%

        \[\leadsto \left(z + a\right) + \log c \cdot \color{blue}{\left(-0.5 + b\right)} \]
    7. Simplified54.4%

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

    if 3.6e92 < y < 1.54999999999999996e109 or 4.30000000000000026e176 < y

    1. Initial program 98.6%

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    5. Simplified65.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.6 \cdot 10^{+92} \lor \neg \left(y \leq 1.55 \cdot 10^{+109}\right) \land y \leq 4.3 \cdot 10^{+176}:\\ \;\;\;\;\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 88.0% 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 -5 \cdot 10^{+237} \lor \neg \left(x \leq 5 \cdot 10^{+231}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;a + \left(z + \left(y \cdot i + \log c \cdot \left(b - 0.5\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 -5e+237) (not (<= x 5e+231)))
   (* x (log y))
   (+ a (+ z (+ (* y i) (* (log c) (- b 0.5)))))))
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 <= -5e+237) || !(x <= 5e+231)) {
		tmp = x * log(y);
	} else {
		tmp = a + (z + ((y * i) + (log(c) * (b - 0.5))));
	}
	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 <= (-5d+237)) .or. (.not. (x <= 5d+231))) then
        tmp = x * log(y)
    else
        tmp = a + (z + ((y * i) + (log(c) * (b - 0.5d0))))
    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 <= -5e+237) || !(x <= 5e+231)) {
		tmp = x * Math.log(y);
	} else {
		tmp = a + (z + ((y * i) + (Math.log(c) * (b - 0.5))));
	}
	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 <= -5e+237) or not (x <= 5e+231):
		tmp = x * math.log(y)
	else:
		tmp = a + (z + ((y * i) + (math.log(c) * (b - 0.5))))
	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 <= -5e+237) || !(x <= 5e+231))
		tmp = Float64(x * log(y));
	else
		tmp = Float64(a + Float64(z + Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5)))));
	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 <= -5e+237) || ~((x <= 5e+231)))
		tmp = x * log(y);
	else
		tmp = a + (z + ((y * i) + (log(c) * (b - 0.5))));
	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, -5e+237], N[Not[LessEqual[x, 5e+231]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(a + N[(z + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $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 -5 \cdot 10^{+237} \lor \neg \left(x \leq 5 \cdot 10^{+231}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.0000000000000002e237 or 5.00000000000000028e231 < x

    1. Initial program 99.7%

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

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

    if -5.0000000000000002e237 < x < 5.00000000000000028e231

    1. Initial program 99.4%

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

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

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

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

Alternative 9: 94.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 -6.2 \cdot 10^{+147} \lor \neg \left(x \leq 7.2 \cdot 10^{+171}\right):\\ \;\;\;\;\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + \left(z + \left(y \cdot i + \log c \cdot \left(b - 0.5\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 -6.2e+147) (not (<= x 7.2e+171)))
   (+ (+ (+ (* x (log y)) z) (+ t a)) (* y i))
   (+ a (+ z (+ (* y i) (* (log c) (- b 0.5)))))))
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 <= -6.2e+147) || !(x <= 7.2e+171)) {
		tmp = (((x * log(y)) + z) + (t + a)) + (y * i);
	} else {
		tmp = a + (z + ((y * i) + (log(c) * (b - 0.5))));
	}
	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 <= (-6.2d+147)) .or. (.not. (x <= 7.2d+171))) then
        tmp = (((x * log(y)) + z) + (t + a)) + (y * i)
    else
        tmp = a + (z + ((y * i) + (log(c) * (b - 0.5d0))))
    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 <= -6.2e+147) || !(x <= 7.2e+171)) {
		tmp = (((x * Math.log(y)) + z) + (t + a)) + (y * i);
	} else {
		tmp = a + (z + ((y * i) + (Math.log(c) * (b - 0.5))));
	}
	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 <= -6.2e+147) or not (x <= 7.2e+171):
		tmp = (((x * math.log(y)) + z) + (t + a)) + (y * i)
	else:
		tmp = a + (z + ((y * i) + (math.log(c) * (b - 0.5))))
	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 <= -6.2e+147) || !(x <= 7.2e+171))
		tmp = Float64(Float64(Float64(Float64(x * log(y)) + z) + Float64(t + a)) + Float64(y * i));
	else
		tmp = Float64(a + Float64(z + Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5)))));
	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 <= -6.2e+147) || ~((x <= 7.2e+171)))
		tmp = (((x * log(y)) + z) + (t + a)) + (y * i);
	else
		tmp = a + (z + ((y * i) + (log(c) * (b - 0.5))));
	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, -6.2e+147], N[Not[LessEqual[x, 7.2e+171]], $MachinePrecision]], N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(z + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $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 -6.2 \cdot 10^{+147} \lor \neg \left(x \leq 7.2 \cdot 10^{+171}\right):\\
\;\;\;\;\left(\left(x \cdot \log y + z\right) + \left(t + a\right)\right) + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.2000000000000001e147 or 7.20000000000000036e171 < 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. +-commutative99.7%

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. +-commutative99.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) \]
      4. 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) \]
      5. 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) \]
      6. 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) \]
      7. 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. Step-by-step derivation
      1. fma-define99.7%

        \[\leadsto \left(\color{blue}{\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) \]
    6. Applied egg-rr99.7%

      \[\leadsto \left(\color{blue}{\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) \]
    7. Step-by-step derivation
      1. add-cube-cbrt99.7%

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

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

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

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

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

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

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

    if -6.2000000000000001e147 < x < 7.20000000000000036e171

    1. Initial program 99.4%

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

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

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

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

Alternative 10: 77.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}\;b \leq -5.7 \cdot 10^{+206}:\\ \;\;\;\;\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{+129}:\\ \;\;\;\;a + \left(t + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(y \cdot i + \log c \cdot \left(b - 0.5\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 (<= b -5.7e+206)
   (+ (+ z a) (* (+ b -0.5) (log c)))
   (if (<= b 1.6e+129)
     (+ a (+ t (+ z (+ (* y i) (* -0.5 (log c))))))
     (+ a (+ (* y i) (* (log c) (- b 0.5)))))))
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 (b <= -5.7e+206) {
		tmp = (z + a) + ((b + -0.5) * log(c));
	} else if (b <= 1.6e+129) {
		tmp = a + (t + (z + ((y * i) + (-0.5 * log(c)))));
	} else {
		tmp = a + ((y * i) + (log(c) * (b - 0.5)));
	}
	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 (b <= (-5.7d+206)) then
        tmp = (z + a) + ((b + (-0.5d0)) * log(c))
    else if (b <= 1.6d+129) then
        tmp = a + (t + (z + ((y * i) + ((-0.5d0) * log(c)))))
    else
        tmp = a + ((y * i) + (log(c) * (b - 0.5d0)))
    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 (b <= -5.7e+206) {
		tmp = (z + a) + ((b + -0.5) * Math.log(c));
	} else if (b <= 1.6e+129) {
		tmp = a + (t + (z + ((y * i) + (-0.5 * Math.log(c)))));
	} else {
		tmp = a + ((y * i) + (Math.log(c) * (b - 0.5)));
	}
	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 b <= -5.7e+206:
		tmp = (z + a) + ((b + -0.5) * math.log(c))
	elif b <= 1.6e+129:
		tmp = a + (t + (z + ((y * i) + (-0.5 * math.log(c)))))
	else:
		tmp = a + ((y * i) + (math.log(c) * (b - 0.5)))
	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 (b <= -5.7e+206)
		tmp = Float64(Float64(z + a) + Float64(Float64(b + -0.5) * log(c)));
	elseif (b <= 1.6e+129)
		tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(y * i) + Float64(-0.5 * log(c))))));
	else
		tmp = Float64(a + Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5))));
	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 (b <= -5.7e+206)
		tmp = (z + a) + ((b + -0.5) * log(c));
	elseif (b <= 1.6e+129)
		tmp = a + (t + (z + ((y * i) + (-0.5 * log(c)))));
	else
		tmp = a + ((y * i) + (log(c) * (b - 0.5)));
	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[b, -5.7e+206], N[(N[(z + a), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.6e+129], N[(a + N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $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}\;b \leq -5.7 \cdot 10^{+206}:\\
\;\;\;\;\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.6999999999999998e206

    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 95.9%

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

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

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

        \[\leadsto \color{blue}{\left(a + z\right) + \log c \cdot \left(b - 0.5\right)} \]
      2. +-commutative84.7%

        \[\leadsto \color{blue}{\left(z + a\right)} + \log c \cdot \left(b - 0.5\right) \]
      3. sub-neg84.7%

        \[\leadsto \left(z + a\right) + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)} \]
      4. metadata-eval84.7%

        \[\leadsto \left(z + a\right) + \log c \cdot \left(b + \color{blue}{-0.5}\right) \]
      5. +-commutative84.7%

        \[\leadsto \left(z + a\right) + \log c \cdot \color{blue}{\left(-0.5 + b\right)} \]
    7. Simplified84.7%

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

    if -5.6999999999999998e206 < b < 1.6000000000000001e129

    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 b around 0 97.9%

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

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

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

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

    if 1.6000000000000001e129 < b

    1. Initial program 96.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 86.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.7 \cdot 10^{+206}:\\ \;\;\;\;\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{+129}:\\ \;\;\;\;a + \left(t + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(y \cdot i + \log c \cdot \left(b - 0.5\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 74.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}\;z \leq -1.15 \cdot 10^{+222}:\\ \;\;\;\;t + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\\ \mathbf{elif}\;z \leq -5 \cdot 10^{+86}:\\ \;\;\;\;a + \left(\left(z + t\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(y \cdot i + \log c \cdot \left(b - 0.5\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -1.15e+222)
   (+ t (+ z (+ (* y i) (* -0.5 (log c)))))
   (if (<= z -5e+86)
     (+ a (+ (+ z t) (* (+ b -0.5) (log c))))
     (+ a (+ (* y i) (* (log c) (- b 0.5)))))))
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.15e+222) {
		tmp = t + (z + ((y * i) + (-0.5 * log(c))));
	} else if (z <= -5e+86) {
		tmp = a + ((z + t) + ((b + -0.5) * log(c)));
	} else {
		tmp = a + ((y * i) + (log(c) * (b - 0.5)));
	}
	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.15d+222)) then
        tmp = t + (z + ((y * i) + ((-0.5d0) * log(c))))
    else if (z <= (-5d+86)) then
        tmp = a + ((z + t) + ((b + (-0.5d0)) * log(c)))
    else
        tmp = a + ((y * i) + (log(c) * (b - 0.5d0)))
    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.15e+222) {
		tmp = t + (z + ((y * i) + (-0.5 * Math.log(c))));
	} else if (z <= -5e+86) {
		tmp = a + ((z + t) + ((b + -0.5) * Math.log(c)));
	} else {
		tmp = a + ((y * i) + (Math.log(c) * (b - 0.5)));
	}
	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.15e+222:
		tmp = t + (z + ((y * i) + (-0.5 * math.log(c))))
	elif z <= -5e+86:
		tmp = a + ((z + t) + ((b + -0.5) * math.log(c)))
	else:
		tmp = a + ((y * i) + (math.log(c) * (b - 0.5)))
	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.15e+222)
		tmp = Float64(t + Float64(z + Float64(Float64(y * i) + Float64(-0.5 * log(c)))));
	elseif (z <= -5e+86)
		tmp = Float64(a + Float64(Float64(z + t) + Float64(Float64(b + -0.5) * log(c))));
	else
		tmp = Float64(a + Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5))));
	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.15e+222)
		tmp = t + (z + ((y * i) + (-0.5 * log(c))));
	elseif (z <= -5e+86)
		tmp = a + ((z + t) + ((b + -0.5) * log(c)));
	else
		tmp = a + ((y * i) + (log(c) * (b - 0.5)));
	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.15e+222], N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5e+86], N[(a + N[(N[(z + t), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $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}\;z \leq -1.15 \cdot 10^{+222}:\\
\;\;\;\;t + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\\

\mathbf{elif}\;z \leq -5 \cdot 10^{+86}:\\
\;\;\;\;a + \left(\left(z + t\right) + \left(b + -0.5\right) \cdot \log c\right)\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

    if -1.15000000000000005e222 < z < -4.9999999999999998e86

    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 86.4%

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

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

        \[\leadsto a + \color{blue}{\left(\left(t + z\right) + \log c \cdot \left(b - 0.5\right)\right)} \]
      2. sub-neg78.0%

        \[\leadsto a + \left(\left(t + z\right) + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right) \]
      3. metadata-eval78.0%

        \[\leadsto a + \left(\left(t + z\right) + \log c \cdot \left(b + \color{blue}{-0.5}\right)\right) \]
    6. Simplified78.0%

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

    if -4.9999999999999998e86 < z

    1. Initial program 99.3%

      \[\left(\left(\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 80.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+222}:\\ \;\;\;\;t + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\\ \mathbf{elif}\;z \leq -5 \cdot 10^{+86}:\\ \;\;\;\;a + \left(\left(z + t\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(y \cdot i + \log c \cdot \left(b - 0.5\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 47.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}\;i \leq -1.35 \cdot 10^{+110} \lor \neg \left(i \leq 1.7 \cdot 10^{+131}\right):\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \log c \cdot \left(b - 0.5\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 (<= i -1.35e+110) (not (<= i 1.7e+131)))
   (* y i)
   (+ a (+ t (* (log c) (- b 0.5))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((i <= -1.35e+110) || !(i <= 1.7e+131)) {
		tmp = y * i;
	} else {
		tmp = a + (t + (log(c) * (b - 0.5)));
	}
	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 ((i <= (-1.35d+110)) .or. (.not. (i <= 1.7d+131))) then
        tmp = y * i
    else
        tmp = a + (t + (log(c) * (b - 0.5d0)))
    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 ((i <= -1.35e+110) || !(i <= 1.7e+131)) {
		tmp = y * i;
	} else {
		tmp = a + (t + (Math.log(c) * (b - 0.5)));
	}
	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 (i <= -1.35e+110) or not (i <= 1.7e+131):
		tmp = y * i
	else:
		tmp = a + (t + (math.log(c) * (b - 0.5)))
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((i <= -1.35e+110) || !(i <= 1.7e+131))
		tmp = Float64(y * i);
	else
		tmp = Float64(a + Float64(t + Float64(log(c) * Float64(b - 0.5))));
	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 ((i <= -1.35e+110) || ~((i <= 1.7e+131)))
		tmp = y * i;
	else
		tmp = a + (t + (log(c) * (b - 0.5)));
	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[i, -1.35e+110], N[Not[LessEqual[i, 1.7e+131]], $MachinePrecision]], N[(y * i), $MachinePrecision], N[(a + N[(t + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $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}\;i \leq -1.35 \cdot 10^{+110} \lor \neg \left(i \leq 1.7 \cdot 10^{+131}\right):\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.35000000000000005e110 or 1.69999999999999993e131 < i

    1. Initial program 98.9%

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    5. Simplified53.2%

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

    if -1.35000000000000005e110 < i < 1.69999999999999993e131

    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(\left(x \cdot \log y + z\right) + \color{blue}{\left(a + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. +-commutative99.8%

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

        \[\leadsto \color{blue}{\left(z + \left(x \cdot \log y + \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) \]
      13. sub-neg99.8%

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \color{blue}{z + \left(\left(x \cdot \log y + a\right) + t\right)}\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. Taylor expanded in z around 0 79.9%

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

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

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

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

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

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

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

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

Alternative 13: 73.3% 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}\;y \leq 41:\\ \;\;\;\;\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + \left(y \cdot i + \log c \cdot \left(b - 0.5\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 (<= y 41.0)
   (+ (+ z a) (* (+ b -0.5) (log c)))
   (+ a (+ (* y i) (* (log c) (- b 0.5))))))
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 (y <= 41.0) {
		tmp = (z + a) + ((b + -0.5) * log(c));
	} else {
		tmp = a + ((y * i) + (log(c) * (b - 0.5)));
	}
	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 (y <= 41.0d0) then
        tmp = (z + a) + ((b + (-0.5d0)) * log(c))
    else
        tmp = a + ((y * i) + (log(c) * (b - 0.5d0)))
    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 (y <= 41.0) {
		tmp = (z + a) + ((b + -0.5) * Math.log(c));
	} else {
		tmp = a + ((y * i) + (Math.log(c) * (b - 0.5)));
	}
	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 y <= 41.0:
		tmp = (z + a) + ((b + -0.5) * math.log(c))
	else:
		tmp = a + ((y * i) + (math.log(c) * (b - 0.5)))
	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 (y <= 41.0)
		tmp = Float64(Float64(z + a) + Float64(Float64(b + -0.5) * log(c)));
	else
		tmp = Float64(a + Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5))));
	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 (y <= 41.0)
		tmp = (z + a) + ((b + -0.5) * log(c));
	else
		tmp = a + ((y * i) + (log(c) * (b - 0.5)));
	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[y, 41.0], N[(N[(z + a), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $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}\;y \leq 41:\\
\;\;\;\;\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 41

    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 75.7%

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

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

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

        \[\leadsto \color{blue}{\left(a + z\right) + \log c \cdot \left(b - 0.5\right)} \]
      2. +-commutative55.3%

        \[\leadsto \color{blue}{\left(z + a\right)} + \log c \cdot \left(b - 0.5\right) \]
      3. sub-neg55.3%

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

        \[\leadsto \left(z + a\right) + \log c \cdot \left(b + \color{blue}{-0.5}\right) \]
      5. +-commutative55.3%

        \[\leadsto \left(z + a\right) + \log c \cdot \color{blue}{\left(-0.5 + b\right)} \]
    7. Simplified55.3%

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

    if 41 < y

    1. Initial program 99.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 41:\\ \;\;\;\;\left(z + a\right) + \left(b + -0.5\right) \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + \left(y \cdot i + \log c \cdot \left(b - 0.5\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 73.6% accurate, 1.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 6:\\ \;\;\;\;a + \left(\left(z + t\right) + \left(b + -0.5\right) \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(y \cdot i + \log c \cdot \left(b - 0.5\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 (<= y 6.0)
   (+ a (+ (+ z t) (* (+ b -0.5) (log c))))
   (+ a (+ (* y i) (* (log c) (- b 0.5))))))
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 (y <= 6.0) {
		tmp = a + ((z + t) + ((b + -0.5) * log(c)));
	} else {
		tmp = a + ((y * i) + (log(c) * (b - 0.5)));
	}
	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 (y <= 6.0d0) then
        tmp = a + ((z + t) + ((b + (-0.5d0)) * log(c)))
    else
        tmp = a + ((y * i) + (log(c) * (b - 0.5d0)))
    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 (y <= 6.0) {
		tmp = a + ((z + t) + ((b + -0.5) * Math.log(c)));
	} else {
		tmp = a + ((y * i) + (Math.log(c) * (b - 0.5)));
	}
	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 y <= 6.0:
		tmp = a + ((z + t) + ((b + -0.5) * math.log(c)))
	else:
		tmp = a + ((y * i) + (math.log(c) * (b - 0.5)))
	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 (y <= 6.0)
		tmp = Float64(a + Float64(Float64(z + t) + Float64(Float64(b + -0.5) * log(c))));
	else
		tmp = Float64(a + Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5))));
	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 (y <= 6.0)
		tmp = a + ((z + t) + ((b + -0.5) * log(c)));
	else
		tmp = a + ((y * i) + (log(c) * (b - 0.5)));
	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[y, 6.0], N[(a + N[(N[(z + t), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $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}\;y \leq 6:\\
\;\;\;\;a + \left(\left(z + t\right) + \left(b + -0.5\right) \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 6

    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 75.7%

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

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

        \[\leadsto a + \color{blue}{\left(\left(t + z\right) + \log c \cdot \left(b - 0.5\right)\right)} \]
      2. sub-neg71.6%

        \[\leadsto a + \left(\left(t + z\right) + \log c \cdot \color{blue}{\left(b + \left(-0.5\right)\right)}\right) \]
      3. metadata-eval71.6%

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

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

    if 6 < y

    1. Initial program 99.1%

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

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

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

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

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

Alternative 15: 38.6% accurate, 6.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq 9.5 \cdot 10^{-304}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{-225}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-158}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{+140} \lor \neg \left(a \leq 1.72 \cdot 10^{+193}\right) \land a \leq 1.12 \cdot 10^{+204}:\\ \;\;\;\;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 (<= a 9.5e-304)
   z
   (if (<= a 1.35e-225)
     (* y i)
     (if (<= a 3.6e-158)
       z
       (if (or (<= a 1.55e+140) (and (not (<= a 1.72e+193)) (<= a 1.12e+204)))
         (* 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 (a <= 9.5e-304) {
		tmp = z;
	} else if (a <= 1.35e-225) {
		tmp = y * i;
	} else if (a <= 3.6e-158) {
		tmp = z;
	} else if ((a <= 1.55e+140) || (!(a <= 1.72e+193) && (a <= 1.12e+204))) {
		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 (a <= 9.5d-304) then
        tmp = z
    else if (a <= 1.35d-225) then
        tmp = y * i
    else if (a <= 3.6d-158) then
        tmp = z
    else if ((a <= 1.55d+140) .or. (.not. (a <= 1.72d+193)) .and. (a <= 1.12d+204)) 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 (a <= 9.5e-304) {
		tmp = z;
	} else if (a <= 1.35e-225) {
		tmp = y * i;
	} else if (a <= 3.6e-158) {
		tmp = z;
	} else if ((a <= 1.55e+140) || (!(a <= 1.72e+193) && (a <= 1.12e+204))) {
		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 a <= 9.5e-304:
		tmp = z
	elif a <= 1.35e-225:
		tmp = y * i
	elif a <= 3.6e-158:
		tmp = z
	elif (a <= 1.55e+140) or (not (a <= 1.72e+193) and (a <= 1.12e+204)):
		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 (a <= 9.5e-304)
		tmp = z;
	elseif (a <= 1.35e-225)
		tmp = Float64(y * i);
	elseif (a <= 3.6e-158)
		tmp = z;
	elseif ((a <= 1.55e+140) || (!(a <= 1.72e+193) && (a <= 1.12e+204)))
		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 (a <= 9.5e-304)
		tmp = z;
	elseif (a <= 1.35e-225)
		tmp = y * i;
	elseif (a <= 3.6e-158)
		tmp = z;
	elseif ((a <= 1.55e+140) || (~((a <= 1.72e+193)) && (a <= 1.12e+204)))
		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[a, 9.5e-304], z, If[LessEqual[a, 1.35e-225], N[(y * i), $MachinePrecision], If[LessEqual[a, 3.6e-158], z, If[Or[LessEqual[a, 1.55e+140], And[N[Not[LessEqual[a, 1.72e+193]], $MachinePrecision], LessEqual[a, 1.12e+204]]], 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}\;a \leq 9.5 \cdot 10^{-304}:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 1.35 \cdot 10^{-225}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;a \leq 3.6 \cdot 10^{-158}:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 1.55 \cdot 10^{+140} \lor \neg \left(a \leq 1.72 \cdot 10^{+193}\right) \land a \leq 1.12 \cdot 10^{+204}:\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 9.50000000000000023e-304 or 1.34999999999999996e-225 < a < 3.59999999999999991e-158

    1. Initial program 99.1%

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

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

    if 9.50000000000000023e-304 < a < 1.34999999999999996e-225 or 3.59999999999999991e-158 < a < 1.55e140 or 1.7199999999999999e193 < a < 1.11999999999999996e204

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    5. Simplified27.3%

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

    if 1.55e140 < a < 1.7199999999999999e193 or 1.11999999999999996e204 < a

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 9.5 \cdot 10^{-304}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{-225}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-158}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{+140} \lor \neg \left(a \leq 1.72 \cdot 10^{+193}\right) \land a \leq 1.12 \cdot 10^{+204}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 37.8% 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}\;a \leq 2.9 \cdot 10^{+162}:\\ \;\;\;\;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 (<= a 2.9e+162) 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 (a <= 2.9e+162) {
		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 (a <= 2.9d+162) 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 (a <= 2.9e+162) {
		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 a <= 2.9e+162:
		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 (a <= 2.9e+162)
		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 (a <= 2.9e+162)
		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[a, 2.9e+162], 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}\;a \leq 2.9 \cdot 10^{+162}:\\
\;\;\;\;z\\

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


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

    1. Initial program 99.4%

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

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

    if 2.90000000000000006e162 < a

    1. Initial program 100.0%

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

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

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

Alternative 17: 22.6% 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.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 15.7%

    \[\leadsto \color{blue}{a} \]
  4. Final simplification15.7%

    \[\leadsto a \]
  5. Add Preprocessing

Reproduce

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