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

Percentage Accurate: 99.8% → 99.8%
Time: 16.0s
Alternatives: 21
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 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.8% accurate, 0.4× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right) \end{array} \]
NOTE: z, t, and a 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) (+ (fma x (log y) z) (+ t a)))))
assert(z < t && t < a);
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), (fma(x, log(y), z) + (t + a))));
}
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(fma(x, log(y), z) + Float64(t + a))))
end
NOTE: z, t, and a 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[(N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 73.2% accurate, 0.4× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right)\\ t_2 := a + \left(z + t\right)\\ t_3 := y \cdot i + t_2\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{+93}:\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \mathbf{elif}\;t_1 \leq 157:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq 220:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{elif}\;t_1 \leq 10^{+71}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1 + t_2\\ \end{array} \end{array} \]
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (log c) (- b 0.5))) (t_2 (+ a (+ z t))) (t_3 (+ (* y i) t_2)))
   (if (<= t_1 -2e+93)
     (+ (* y i) (+ a (* b (log c))))
     (if (<= t_1 157.0)
       t_3
       (if (<= t_1 220.0)
         (+ (* y i) (* x (log y)))
         (if (<= t_1 1e+71) t_3 (+ t_1 t_2)))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = log(c) * (b - 0.5);
	double t_2 = a + (z + t);
	double t_3 = (y * i) + t_2;
	double tmp;
	if (t_1 <= -2e+93) {
		tmp = (y * i) + (a + (b * log(c)));
	} else if (t_1 <= 157.0) {
		tmp = t_3;
	} else if (t_1 <= 220.0) {
		tmp = (y * i) + (x * log(y));
	} else if (t_1 <= 1e+71) {
		tmp = t_3;
	} else {
		tmp = t_1 + t_2;
	}
	return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = log(c) * (b - 0.5d0)
    t_2 = a + (z + t)
    t_3 = (y * i) + t_2
    if (t_1 <= (-2d+93)) then
        tmp = (y * i) + (a + (b * log(c)))
    else if (t_1 <= 157.0d0) then
        tmp = t_3
    else if (t_1 <= 220.0d0) then
        tmp = (y * i) + (x * log(y))
    else if (t_1 <= 1d+71) then
        tmp = t_3
    else
        tmp = t_1 + t_2
    end if
    code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = Math.log(c) * (b - 0.5);
	double t_2 = a + (z + t);
	double t_3 = (y * i) + t_2;
	double tmp;
	if (t_1 <= -2e+93) {
		tmp = (y * i) + (a + (b * Math.log(c)));
	} else if (t_1 <= 157.0) {
		tmp = t_3;
	} else if (t_1 <= 220.0) {
		tmp = (y * i) + (x * Math.log(y));
	} else if (t_1 <= 1e+71) {
		tmp = t_3;
	} else {
		tmp = t_1 + t_2;
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	t_1 = math.log(c) * (b - 0.5)
	t_2 = a + (z + t)
	t_3 = (y * i) + t_2
	tmp = 0
	if t_1 <= -2e+93:
		tmp = (y * i) + (a + (b * math.log(c)))
	elif t_1 <= 157.0:
		tmp = t_3
	elif t_1 <= 220.0:
		tmp = (y * i) + (x * math.log(y))
	elif t_1 <= 1e+71:
		tmp = t_3
	else:
		tmp = t_1 + t_2
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(c) * Float64(b - 0.5))
	t_2 = Float64(a + Float64(z + t))
	t_3 = Float64(Float64(y * i) + t_2)
	tmp = 0.0
	if (t_1 <= -2e+93)
		tmp = Float64(Float64(y * i) + Float64(a + Float64(b * log(c))));
	elseif (t_1 <= 157.0)
		tmp = t_3;
	elseif (t_1 <= 220.0)
		tmp = Float64(Float64(y * i) + Float64(x * log(y)));
	elseif (t_1 <= 1e+71)
		tmp = t_3;
	else
		tmp = Float64(t_1 + t_2);
	end
	return tmp
end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = log(c) * (b - 0.5);
	t_2 = a + (z + t);
	t_3 = (y * i) + t_2;
	tmp = 0.0;
	if (t_1 <= -2e+93)
		tmp = (y * i) + (a + (b * log(c)));
	elseif (t_1 <= 157.0)
		tmp = t_3;
	elseif (t_1 <= 220.0)
		tmp = (y * i) + (x * log(y));
	elseif (t_1 <= 1e+71)
		tmp = t_3;
	else
		tmp = t_1 + t_2;
	end
	tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * i), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+93], N[(N[(y * i), $MachinePrecision] + N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 157.0], t$95$3, If[LessEqual[t$95$1, 220.0], N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+71], t$95$3, N[(t$95$1 + t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := a + \left(z + t\right)\\
t_3 := y \cdot i + t_2\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+93}:\\
\;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\

\mathbf{elif}\;t_1 \leq 157:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_1 \leq 220:\\
\;\;\;\;y \cdot i + x \cdot \log y\\

\mathbf{elif}\;t_1 \leq 10^{+71}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_1 + t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (-.f64 b 1/2) (log.f64 c)) < -2.00000000000000009e93

    1. Initial program 99.8%

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

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

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

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

      \[\leadsto \color{blue}{\left(a + \log c \cdot b\right)} + y \cdot i \]
    6. Step-by-step derivation
      1. +-commutative76.3%

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

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

    if -2.00000000000000009e93 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 157 or 220 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 1e71

    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. Taylor expanded in x around 0 83.3%

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

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

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

    if 157 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 220

    1. Initial program 99.6%

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

      \[\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 \]
    3. Taylor expanded in x around inf 92.1%

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

    if 1e71 < (*.f64 (-.f64 b 1/2) (log.f64 c))

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\log c \cdot \left(b - 0.5\right) \leq -2 \cdot 10^{+93}:\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \mathbf{elif}\;\log c \cdot \left(b - 0.5\right) \leq 157:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{elif}\;\log c \cdot \left(b - 0.5\right) \leq 220:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{elif}\;\log c \cdot \left(b - 0.5\right) \leq 10^{+71}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\\ \end{array} \]

Alternative 3: 73.3% accurate, 0.4× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right)\\ t_2 := a + \left(z + t\right)\\ t_3 := y \cdot i + t_2\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{+93}:\\ \;\;\;\;y \cdot i + \left(a + \left(t + b \cdot \log c\right)\right)\\ \mathbf{elif}\;t_1 \leq 157:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq 220:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{elif}\;t_1 \leq 10^{+71}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1 + t_2\\ \end{array} \end{array} \]
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (log c) (- b 0.5))) (t_2 (+ a (+ z t))) (t_3 (+ (* y i) t_2)))
   (if (<= t_1 -2e+93)
     (+ (* y i) (+ a (+ t (* b (log c)))))
     (if (<= t_1 157.0)
       t_3
       (if (<= t_1 220.0)
         (+ (* y i) (* x (log y)))
         (if (<= t_1 1e+71) t_3 (+ t_1 t_2)))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = log(c) * (b - 0.5);
	double t_2 = a + (z + t);
	double t_3 = (y * i) + t_2;
	double tmp;
	if (t_1 <= -2e+93) {
		tmp = (y * i) + (a + (t + (b * log(c))));
	} else if (t_1 <= 157.0) {
		tmp = t_3;
	} else if (t_1 <= 220.0) {
		tmp = (y * i) + (x * log(y));
	} else if (t_1 <= 1e+71) {
		tmp = t_3;
	} else {
		tmp = t_1 + t_2;
	}
	return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = log(c) * (b - 0.5d0)
    t_2 = a + (z + t)
    t_3 = (y * i) + t_2
    if (t_1 <= (-2d+93)) then
        tmp = (y * i) + (a + (t + (b * log(c))))
    else if (t_1 <= 157.0d0) then
        tmp = t_3
    else if (t_1 <= 220.0d0) then
        tmp = (y * i) + (x * log(y))
    else if (t_1 <= 1d+71) then
        tmp = t_3
    else
        tmp = t_1 + t_2
    end if
    code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = Math.log(c) * (b - 0.5);
	double t_2 = a + (z + t);
	double t_3 = (y * i) + t_2;
	double tmp;
	if (t_1 <= -2e+93) {
		tmp = (y * i) + (a + (t + (b * Math.log(c))));
	} else if (t_1 <= 157.0) {
		tmp = t_3;
	} else if (t_1 <= 220.0) {
		tmp = (y * i) + (x * Math.log(y));
	} else if (t_1 <= 1e+71) {
		tmp = t_3;
	} else {
		tmp = t_1 + t_2;
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	t_1 = math.log(c) * (b - 0.5)
	t_2 = a + (z + t)
	t_3 = (y * i) + t_2
	tmp = 0
	if t_1 <= -2e+93:
		tmp = (y * i) + (a + (t + (b * math.log(c))))
	elif t_1 <= 157.0:
		tmp = t_3
	elif t_1 <= 220.0:
		tmp = (y * i) + (x * math.log(y))
	elif t_1 <= 1e+71:
		tmp = t_3
	else:
		tmp = t_1 + t_2
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(c) * Float64(b - 0.5))
	t_2 = Float64(a + Float64(z + t))
	t_3 = Float64(Float64(y * i) + t_2)
	tmp = 0.0
	if (t_1 <= -2e+93)
		tmp = Float64(Float64(y * i) + Float64(a + Float64(t + Float64(b * log(c)))));
	elseif (t_1 <= 157.0)
		tmp = t_3;
	elseif (t_1 <= 220.0)
		tmp = Float64(Float64(y * i) + Float64(x * log(y)));
	elseif (t_1 <= 1e+71)
		tmp = t_3;
	else
		tmp = Float64(t_1 + t_2);
	end
	return tmp
end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = log(c) * (b - 0.5);
	t_2 = a + (z + t);
	t_3 = (y * i) + t_2;
	tmp = 0.0;
	if (t_1 <= -2e+93)
		tmp = (y * i) + (a + (t + (b * log(c))));
	elseif (t_1 <= 157.0)
		tmp = t_3;
	elseif (t_1 <= 220.0)
		tmp = (y * i) + (x * log(y));
	elseif (t_1 <= 1e+71)
		tmp = t_3;
	else
		tmp = t_1 + t_2;
	end
	tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * i), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+93], N[(N[(y * i), $MachinePrecision] + N[(a + N[(t + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 157.0], t$95$3, If[LessEqual[t$95$1, 220.0], N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+71], t$95$3, N[(t$95$1 + t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := a + \left(z + t\right)\\
t_3 := y \cdot i + t_2\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+93}:\\
\;\;\;\;y \cdot i + \left(a + \left(t + b \cdot \log c\right)\right)\\

\mathbf{elif}\;t_1 \leq 157:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_1 \leq 220:\\
\;\;\;\;y \cdot i + x \cdot \log y\\

\mathbf{elif}\;t_1 \leq 10^{+71}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_1 + t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (-.f64 b 1/2) (log.f64 c)) < -2.00000000000000009e93

    1. Initial program 99.8%

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

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

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

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

    if -2.00000000000000009e93 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 157 or 220 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 1e71

    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. Taylor expanded in x around 0 83.3%

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

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

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

    if 157 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 220

    1. Initial program 99.6%

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

      \[\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 \]
    3. Taylor expanded in x around inf 92.1%

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

    if 1e71 < (*.f64 (-.f64 b 1/2) (log.f64 c))

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\log c \cdot \left(b - 0.5\right) \leq -2 \cdot 10^{+93}:\\ \;\;\;\;y \cdot i + \left(a + \left(t + b \cdot \log c\right)\right)\\ \mathbf{elif}\;\log c \cdot \left(b - 0.5\right) \leq 157:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{elif}\;\log c \cdot \left(b - 0.5\right) \leq 220:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{elif}\;\log c \cdot \left(b - 0.5\right) \leq 10^{+71}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\\ \end{array} \]

Alternative 4: 99.8% accurate, 1.0× speedup?

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Final simplification99.8%

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

Alternative 5: 90.1% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.50000000000000052e179 or 2.2e195 < 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. Taylor expanded in b around 0 93.8%

      \[\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 \]
    3. Taylor expanded in x around inf 84.1%

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

    if -6.50000000000000052e179 < x < 2.2e195

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+179} \lor \neg \left(x \leq 2.2 \cdot 10^{+195}\right):\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a + \left(\log c \cdot \left(b - 0.5\right) + \left(z + t\right)\right)\right)\\ \end{array} \]

Alternative 6: 99.3% accurate, 1.0× speedup?

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

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

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

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

Alternative 7: 97.7% accurate, 1.0× speedup?

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

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

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

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

    \[\leadsto y \cdot i + \left(\left(a + \left(z + x \cdot \log y\right)\right) + b \cdot \log c\right) \]

Alternative 8: 90.1% accurate, 1.8× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.55 \cdot 10^{+179} \lor \neg \left(x \leq 2.9 \cdot 10^{+194}\right):\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: z, t, and a 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.55e+179) (not (<= x 2.9e+194)))
   (+ (* y i) (* x (log y)))
   (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ z t))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -2.55e+179) || !(x <= 2.9e+194)) {
		tmp = (y * i) + (x * log(y));
	} else {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
	}
	return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((x <= (-2.55d+179)) .or. (.not. (x <= 2.9d+194))) then
        tmp = (y * i) + (x * log(y))
    else
        tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (a + (z + t)))
    end if
    code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -2.55e+179) || !(x <= 2.9e+194)) {
		tmp = (y * i) + (x * Math.log(y));
	} else {
		tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + (z + t)));
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -2.55e+179) or not (x <= 2.9e+194):
		tmp = (y * i) + (x * math.log(y))
	else:
		tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (a + (z + t)))
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -2.55e+179) || !(x <= 2.9e+194))
		tmp = Float64(Float64(y * i) + Float64(x * log(y)));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(z + t))));
	end
	return tmp
end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x <= -2.55e+179) || ~((x <= 2.9e+194)))
		tmp = (y * i) + (x * log(y));
	else
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
	end
	tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -2.55e+179], N[Not[LessEqual[x, 2.9e+194]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{+179} \lor \neg \left(x \leq 2.9 \cdot 10^{+194}\right):\\
\;\;\;\;y \cdot i + x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.5500000000000001e179 or 2.9000000000000001e194 < 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. Taylor expanded in b around 0 93.8%

      \[\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 \]
    3. Taylor expanded in x around inf 84.1%

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

    if -2.5500000000000001e179 < x < 2.9000000000000001e194

    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. Taylor expanded in x around 0 95.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.55 \cdot 10^{+179} \lor \neg \left(x \leq 2.9 \cdot 10^{+194}\right):\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \]

Alternative 9: 89.0% accurate, 1.9× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+179} \lor \neg \left(x \leq 7.5 \cdot 10^{+154}\right):\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -8.5e+179) (not (<= x 7.5e+154)))
   (+ (* y i) (* x (log y)))
   (+ (* y i) (+ a (+ z (* (log c) (- b 0.5)))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -8.5e+179) || !(x <= 7.5e+154)) {
		tmp = (y * i) + (x * log(y));
	} else {
		tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
	}
	return tmp;
}
NOTE: z, t, and a 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 <= (-8.5d+179)) .or. (.not. (x <= 7.5d+154))) then
        tmp = (y * i) + (x * log(y))
    else
        tmp = (y * i) + (a + (z + (log(c) * (b - 0.5d0))))
    end if
    code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -8.5e+179) || !(x <= 7.5e+154)) {
		tmp = (y * i) + (x * Math.log(y));
	} else {
		tmp = (y * i) + (a + (z + (Math.log(c) * (b - 0.5))));
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -8.5e+179) or not (x <= 7.5e+154):
		tmp = (y * i) + (x * math.log(y))
	else:
		tmp = (y * i) + (a + (z + (math.log(c) * (b - 0.5))))
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -8.5e+179) || !(x <= 7.5e+154))
		tmp = Float64(Float64(y * i) + Float64(x * log(y)));
	else
		tmp = Float64(Float64(y * i) + Float64(a + Float64(z + Float64(log(c) * Float64(b - 0.5)))));
	end
	return tmp
end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x <= -8.5e+179) || ~((x <= 7.5e+154)))
		tmp = (y * i) + (x * log(y));
	else
		tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
	end
	tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -8.5e+179], N[Not[LessEqual[x, 7.5e+154]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+179} \lor \neg \left(x \leq 7.5 \cdot 10^{+154}\right):\\
\;\;\;\;y \cdot i + x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.49999999999999962e179 or 7.5000000000000004e154 < 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. Taylor expanded in b around 0 94.4%

      \[\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 \]
    3. Taylor expanded in x around inf 82.3%

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

    if -8.49999999999999962e179 < x < 7.5000000000000004e154

    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. Taylor expanded in x around 0 96.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+179} \lor \neg \left(x \leq 7.5 \cdot 10^{+154}\right):\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\ \end{array} \]

Alternative 10: 71.0% accurate, 1.9× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} t_1 := b \cdot \log c\\ t_2 := y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{if}\;b \leq -1.42 \cdot 10^{+168}:\\ \;\;\;\;a + \left(t + t_1\right)\\ \mathbf{elif}\;b \leq -2.7 \cdot 10^{-68}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -4.5 \cdot 10^{-159}:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{+197}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + t_1\\ \end{array} \end{array} \]
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* b (log c))) (t_2 (+ (* y i) (+ a (+ z t)))))
   (if (<= b -1.42e+168)
     (+ a (+ t t_1))
     (if (<= b -2.7e-68)
       t_2
       (if (<= b -4.5e-159)
         (+ (* y i) (* x (log y)))
         (if (<= b 1.85e+197) t_2 (+ (* y i) t_1)))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = b * log(c);
	double t_2 = (y * i) + (a + (z + t));
	double tmp;
	if (b <= -1.42e+168) {
		tmp = a + (t + t_1);
	} else if (b <= -2.7e-68) {
		tmp = t_2;
	} else if (b <= -4.5e-159) {
		tmp = (y * i) + (x * log(y));
	} else if (b <= 1.85e+197) {
		tmp = t_2;
	} else {
		tmp = (y * i) + t_1;
	}
	return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = b * log(c)
    t_2 = (y * i) + (a + (z + t))
    if (b <= (-1.42d+168)) then
        tmp = a + (t + t_1)
    else if (b <= (-2.7d-68)) then
        tmp = t_2
    else if (b <= (-4.5d-159)) then
        tmp = (y * i) + (x * log(y))
    else if (b <= 1.85d+197) then
        tmp = t_2
    else
        tmp = (y * i) + t_1
    end if
    code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = b * Math.log(c);
	double t_2 = (y * i) + (a + (z + t));
	double tmp;
	if (b <= -1.42e+168) {
		tmp = a + (t + t_1);
	} else if (b <= -2.7e-68) {
		tmp = t_2;
	} else if (b <= -4.5e-159) {
		tmp = (y * i) + (x * Math.log(y));
	} else if (b <= 1.85e+197) {
		tmp = t_2;
	} else {
		tmp = (y * i) + t_1;
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	t_1 = b * math.log(c)
	t_2 = (y * i) + (a + (z + t))
	tmp = 0
	if b <= -1.42e+168:
		tmp = a + (t + t_1)
	elif b <= -2.7e-68:
		tmp = t_2
	elif b <= -4.5e-159:
		tmp = (y * i) + (x * math.log(y))
	elif b <= 1.85e+197:
		tmp = t_2
	else:
		tmp = (y * i) + t_1
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(b * log(c))
	t_2 = Float64(Float64(y * i) + Float64(a + Float64(z + t)))
	tmp = 0.0
	if (b <= -1.42e+168)
		tmp = Float64(a + Float64(t + t_1));
	elseif (b <= -2.7e-68)
		tmp = t_2;
	elseif (b <= -4.5e-159)
		tmp = Float64(Float64(y * i) + Float64(x * log(y)));
	elseif (b <= 1.85e+197)
		tmp = t_2;
	else
		tmp = Float64(Float64(y * i) + t_1);
	end
	return tmp
end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = b * log(c);
	t_2 = (y * i) + (a + (z + t));
	tmp = 0.0;
	if (b <= -1.42e+168)
		tmp = a + (t + t_1);
	elseif (b <= -2.7e-68)
		tmp = t_2;
	elseif (b <= -4.5e-159)
		tmp = (y * i) + (x * log(y));
	elseif (b <= 1.85e+197)
		tmp = t_2;
	else
		tmp = (y * i) + t_1;
	end
	tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.42e+168], N[(a + N[(t + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.7e-68], t$95$2, If[LessEqual[b, -4.5e-159], N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e+197], t$95$2, N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := b \cdot \log c\\
t_2 := y \cdot i + \left(a + \left(z + t\right)\right)\\
\mathbf{if}\;b \leq -1.42 \cdot 10^{+168}:\\
\;\;\;\;a + \left(t + t_1\right)\\

\mathbf{elif}\;b \leq -2.7 \cdot 10^{-68}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq -4.5 \cdot 10^{-159}:\\
\;\;\;\;y \cdot i + x \cdot \log y\\

\mathbf{elif}\;b \leq 1.85 \cdot 10^{+197}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.42e168

    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. Taylor expanded in x around 0 89.8%

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

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

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

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

    if -1.42e168 < b < -2.7000000000000002e-68 or -4.49999999999999989e-159 < b < 1.8500000000000002e197

    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. Taylor expanded in x around 0 84.3%

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

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

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

    if -2.7000000000000002e-68 < b < -4.49999999999999989e-159

    1. Initial program 99.8%

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

      \[\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 \]
    3. Taylor expanded in x around inf 77.9%

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

    if 1.8500000000000002e197 < b

    1. Initial program 99.6%

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

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

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

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
  3. Recombined 4 regimes into one program.
  4. Final simplification79.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.42 \cdot 10^{+168}:\\ \;\;\;\;a + \left(t + b \cdot \log c\right)\\ \mathbf{elif}\;b \leq -2.7 \cdot 10^{-68}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{elif}\;b \leq -4.5 \cdot 10^{-159}:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{+197}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \end{array} \]

Alternative 11: 72.0% accurate, 2.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.55000000000000006e168 or 8.49999999999999956e149 < b

    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. Taylor expanded in x around 0 90.7%

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

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

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

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

    if -3.55000000000000006e168 < b < 8.49999999999999956e149

    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. Taylor expanded in x around 0 81.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.55 \cdot 10^{+168} \lor \neg \left(b \leq 8.5 \cdot 10^{+149}\right):\\ \;\;\;\;a + \left(t + b \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \end{array} \]

Alternative 12: 73.4% accurate, 2.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} t_1 := b \cdot \log c\\ \mathbf{if}\;b \leq -1.75 \cdot 10^{+168}:\\ \;\;\;\;a + \left(t + t_1\right)\\ \mathbf{elif}\;b \leq 8.6 \cdot 10^{+194}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + t_1\\ \end{array} \end{array} \]
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* b (log c))))
   (if (<= b -1.75e+168)
     (+ a (+ t t_1))
     (if (<= b 8.6e+194) (+ (* y i) (+ a (+ z t))) (+ (* y i) t_1)))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = b * log(c);
	double tmp;
	if (b <= -1.75e+168) {
		tmp = a + (t + t_1);
	} else if (b <= 8.6e+194) {
		tmp = (y * i) + (a + (z + t));
	} else {
		tmp = (y * i) + t_1;
	}
	return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = b * log(c)
    if (b <= (-1.75d+168)) then
        tmp = a + (t + t_1)
    else if (b <= 8.6d+194) then
        tmp = (y * i) + (a + (z + t))
    else
        tmp = (y * i) + t_1
    end if
    code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = b * Math.log(c);
	double tmp;
	if (b <= -1.75e+168) {
		tmp = a + (t + t_1);
	} else if (b <= 8.6e+194) {
		tmp = (y * i) + (a + (z + t));
	} else {
		tmp = (y * i) + t_1;
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	t_1 = b * math.log(c)
	tmp = 0
	if b <= -1.75e+168:
		tmp = a + (t + t_1)
	elif b <= 8.6e+194:
		tmp = (y * i) + (a + (z + t))
	else:
		tmp = (y * i) + t_1
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(b * log(c))
	tmp = 0.0
	if (b <= -1.75e+168)
		tmp = Float64(a + Float64(t + t_1));
	elseif (b <= 8.6e+194)
		tmp = Float64(Float64(y * i) + Float64(a + Float64(z + t)));
	else
		tmp = Float64(Float64(y * i) + t_1);
	end
	return tmp
end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = b * log(c);
	tmp = 0.0;
	if (b <= -1.75e+168)
		tmp = a + (t + t_1);
	elseif (b <= 8.6e+194)
		tmp = (y * i) + (a + (z + t));
	else
		tmp = (y * i) + t_1;
	end
	tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.75e+168], N[(a + N[(t + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.6e+194], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;b \leq -1.75 \cdot 10^{+168}:\\
\;\;\;\;a + \left(t + t_1\right)\\

\mathbf{elif}\;b \leq 8.6 \cdot 10^{+194}:\\
\;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\

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


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

    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. Taylor expanded in x around 0 89.8%

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

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

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

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

    if -1.7500000000000001e168 < b < 8.59999999999999988e194

    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. Taylor expanded in x around 0 80.9%

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

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

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

    if 8.59999999999999988e194 < b

    1. Initial program 99.6%

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

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

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

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.75 \cdot 10^{+168}:\\ \;\;\;\;a + \left(t + b \cdot \log c\right)\\ \mathbf{elif}\;b \leq 8.6 \cdot 10^{+194}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \end{array} \]

Alternative 13: 75.5% accurate, 2.0× speedup?

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

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


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

    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. Taylor expanded in x around 0 81.3%

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

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

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

    if -2.45000000000000014e70 < z

    1. Initial program 99.8%

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

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

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

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

      \[\leadsto \color{blue}{\left(a + \log c \cdot b\right)} + y \cdot i \]
    6. Step-by-step derivation
      1. +-commutative60.9%

        \[\leadsto \color{blue}{\left(\log c \cdot b + a\right)} + y \cdot i \]
    7. Simplified60.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{+70}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\ \end{array} \]

Alternative 14: 70.9% accurate, 2.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.1999999999999998e177 or 1.25000000000000012e198 < b

    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. Taylor expanded in x around 0 92.7%

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

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

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

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

    if -2.1999999999999998e177 < b < 1.25000000000000012e198

    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. Taylor expanded in x around 0 81.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{+177} \lor \neg \left(b \leq 1.25 \cdot 10^{+198}\right):\\ \;\;\;\;b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + t\right)\right)\\ \end{array} \]

Alternative 15: 36.8% accurate, 19.5× speedup?

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

\mathbf{elif}\;a \leq -4.3 \cdot 10^{-307}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;a \leq 9.2 \cdot 10^{-98}:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 4 \cdot 10^{+208}:\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.3000000000000001e-237 or -4.3000000000000001e-307 < a < 9.20000000000000002e-98

    1. Initial program 99.8%

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

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

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

    if -1.3000000000000001e-237 < a < -4.3000000000000001e-307 or 9.20000000000000002e-98 < a < 3.9999999999999999e208

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    4. Simplified40.3%

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

    if 3.9999999999999999e208 < 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. Taylor expanded in x around 0 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.3 \cdot 10^{-237}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq -4.3 \cdot 10^{-307}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{-98}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+208}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 16: 47.6% accurate, 19.6× speedup?

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

\mathbf{elif}\;a \leq 3 \cdot 10^{-309}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;a \leq 9 \cdot 10^{-99}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.8000000000000004e-233 or 3.000000000000001e-309 < a < 9.0000000000000006e-99

    1. Initial program 99.8%

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

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

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

    if -6.8000000000000004e-233 < a < 3.000000000000001e-309

    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. Taylor expanded in y around inf 31.4%

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

        \[\leadsto \color{blue}{y \cdot i} \]
    4. Simplified31.4%

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

    if 9.0000000000000006e-99 < a

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{-233}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 3 \cdot 10^{-309}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-99}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 17: 60.0% accurate, 24.2× speedup?

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

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


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

    1. Initial program 99.8%

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

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

    if 2.00000000000000009e48 < a

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(t + a\right)} + y \cdot i \]
    7. Simplified74.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2 \cdot 10^{+48}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(t + a\right) + y \cdot i\\ \end{array} \]

Alternative 18: 67.2% accurate, 24.3× speedup?

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

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

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

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

    \[\leadsto \color{blue}{\left(a + \left(t + z\right)\right)} + y \cdot i \]
  5. Final simplification65.6%

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

Alternative 19: 59.7% accurate, 31.0× speedup?

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

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


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

    1. Initial program 99.8%

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

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

    if 3.59999999999999983e48 < a

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 3.6 \cdot 10^{+48}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 20: 37.4% accurate, 71.5× speedup?

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

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


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

    1. Initial program 99.8%

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

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

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

    if 4.00000000000000018e48 < a

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4 \cdot 10^{+48}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 21: 22.3% accurate, 219.0× speedup?

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

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

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

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

    \[\leadsto a \]

Reproduce

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