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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.4% accurate, 0.5× 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 := x \cdot \log y\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+173} \lor \neg \left(t_1 \leq 2 \cdot 10^{+43}\right):\\ \;\;\;\;y \cdot i + \left(t_1 + \left(a + t_2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t_2 + \left(t + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\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
 (let* ((t_1 (* (log c) (- b 0.5))) (t_2 (* x (log y))))
   (if (or (<= t_1 -5e+173) (not (<= t_1 2e+43)))
     (+ (* y i) (+ t_1 (+ a t_2)))
     (+ a (+ t_2 (+ t (+ z (+ (* y i) (* -0.5 (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 t_1 = log(c) * (b - 0.5);
	double t_2 = x * log(y);
	double tmp;
	if ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) {
		tmp = (y * i) + (t_1 + (a + t_2));
	} else {
		tmp = a + (t_2 + (t + (z + ((y * i) + (-0.5 * 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = log(c) * (b - 0.5d0)
    t_2 = x * log(y)
    if ((t_1 <= (-5d+173)) .or. (.not. (t_1 <= 2d+43))) then
        tmp = (y * i) + (t_1 + (a + t_2))
    else
        tmp = a + (t_2 + (t + (z + ((y * i) + ((-0.5d0) * 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 t_1 = Math.log(c) * (b - 0.5);
	double t_2 = x * Math.log(y);
	double tmp;
	if ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) {
		tmp = (y * i) + (t_1 + (a + t_2));
	} else {
		tmp = a + (t_2 + (t + (z + ((y * i) + (-0.5 * Math.log(c))))));
	}
	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 = x * math.log(y)
	tmp = 0
	if (t_1 <= -5e+173) or not (t_1 <= 2e+43):
		tmp = (y * i) + (t_1 + (a + t_2))
	else:
		tmp = a + (t_2 + (t + (z + ((y * i) + (-0.5 * math.log(c))))))
	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(x * log(y))
	tmp = 0.0
	if ((t_1 <= -5e+173) || !(t_1 <= 2e+43))
		tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + t_2)));
	else
		tmp = Float64(a + Float64(t_2 + Float64(t + Float64(z + Float64(Float64(y * i) + Float64(-0.5 * 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)
	t_1 = log(c) * (b - 0.5);
	t_2 = x * log(y);
	tmp = 0.0;
	if ((t_1 <= -5e+173) || ~((t_1 <= 2e+43)))
		tmp = (y * i) + (t_1 + (a + t_2));
	else
		tmp = a + (t_2 + (t + (z + ((y * i) + (-0.5 * 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_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+173], N[Not[LessEqual[t$95$1, 2e+43]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t$95$2 + N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := x \cdot \log y\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+173} \lor \neg \left(t_1 \leq 2 \cdot 10^{+43}\right):\\
\;\;\;\;y \cdot i + \left(t_1 + \left(a + t_2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 b 1/2) (log.f64 c)) < -5.00000000000000034e173 or 2.00000000000000003e43 < (*.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 t around 0 98.4%

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

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

    if -5.00000000000000034e173 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 2.00000000000000003e43

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

Alternative 3: 77.2% accurate, 0.7× 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)\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+173} \lor \neg \left(t_1 \leq 2 \cdot 10^{+43}\right):\\ \;\;\;\;y \cdot i + \left(a + t_1\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(z + \left(y \cdot i + -0.5 \cdot \log c\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
 (let* ((t_1 (* (log c) (- b 0.5))))
   (if (or (<= t_1 -5e+173) (not (<= t_1 2e+43)))
     (+ (* y i) (+ a t_1))
     (+ a (+ z (+ (* y i) (* -0.5 (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 t_1 = log(c) * (b - 0.5);
	double tmp;
	if ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) {
		tmp = (y * i) + (a + t_1);
	} else {
		tmp = a + (z + ((y * i) + (-0.5 * 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) :: t_1
    real(8) :: tmp
    t_1 = log(c) * (b - 0.5d0)
    if ((t_1 <= (-5d+173)) .or. (.not. (t_1 <= 2d+43))) then
        tmp = (y * i) + (a + t_1)
    else
        tmp = a + (z + ((y * i) + ((-0.5d0) * 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 t_1 = Math.log(c) * (b - 0.5);
	double tmp;
	if ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) {
		tmp = (y * i) + (a + t_1);
	} else {
		tmp = a + (z + ((y * i) + (-0.5 * Math.log(c))));
	}
	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)
	tmp = 0
	if (t_1 <= -5e+173) or not (t_1 <= 2e+43):
		tmp = (y * i) + (a + t_1)
	else:
		tmp = a + (z + ((y * i) + (-0.5 * math.log(c))))
	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))
	tmp = 0.0
	if ((t_1 <= -5e+173) || !(t_1 <= 2e+43))
		tmp = Float64(Float64(y * i) + Float64(a + t_1));
	else
		tmp = Float64(a + Float64(z + Float64(Float64(y * i) + Float64(-0.5 * 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)
	t_1 = log(c) * (b - 0.5);
	tmp = 0.0;
	if ((t_1 <= -5e+173) || ~((t_1 <= 2e+43)))
		tmp = (y * i) + (a + t_1);
	else
		tmp = a + (z + ((y * i) + (-0.5 * 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_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+173], N[Not[LessEqual[t$95$1, 2e+43]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision], N[(a + N[(z + N[(N[(y * i), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+173} \lor \neg \left(t_1 \leq 2 \cdot 10^{+43}\right):\\
\;\;\;\;y \cdot i + \left(a + t_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 b 1/2) (log.f64 c)) < -5.00000000000000034e173 or 2.00000000000000003e43 < (*.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 t around 0 98.4%

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

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

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

    if -5.00000000000000034e173 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 2.00000000000000003e43

    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 t around 0 80.5%

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

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

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

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

Alternative 4: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

Alternative 5: 94.1% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{+176} \lor \neg \left(x \leq 1.55 \cdot 10^{+187}\right):\\ \;\;\;\;y \cdot i + \left(\left(a + \left(z + x \cdot \log y\right)\right) + -0.5 \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\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.45e+176) (not (<= x 1.55e+187)))
   (+ (* y i) (+ (+ a (+ z (* x (log y)))) (* -0.5 (log c))))
   (+ (* y i) (+ (* (log c) (- b 0.5)) (+ 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) {
	double tmp;
	if ((x <= -2.45e+176) || !(x <= 1.55e+187)) {
		tmp = (y * i) + ((a + (z + (x * log(y)))) + (-0.5 * log(c)));
	} else {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + 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 ((x <= (-2.45d+176)) .or. (.not. (x <= 1.55d+187))) then
        tmp = (y * i) + ((a + (z + (x * log(y)))) + ((-0.5d0) * log(c)))
    else
        tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (z + (t + 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 ((x <= -2.45e+176) || !(x <= 1.55e+187)) {
		tmp = (y * i) + ((a + (z + (x * Math.log(y)))) + (-0.5 * Math.log(c)));
	} else {
		tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (z + (t + a)));
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -2.45e+176) or not (x <= 1.55e+187):
		tmp = (y * i) + ((a + (z + (x * math.log(y)))) + (-0.5 * math.log(c)))
	else:
		tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (z + (t + a)))
	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.45e+176) || !(x <= 1.55e+187))
		tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(z + Float64(x * log(y)))) + Float64(-0.5 * log(c))));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + 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 ((x <= -2.45e+176) || ~((x <= 1.55e+187)))
		tmp = (y * i) + ((a + (z + (x * log(y)))) + (-0.5 * log(c)));
	else
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + 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[Or[LessEqual[x, -2.45e+176], N[Not[LessEqual[x, 1.55e+187]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+176} \lor \neg \left(x \leq 1.55 \cdot 10^{+187}\right):\\
\;\;\;\;y \cdot i + \left(\left(a + \left(z + x \cdot \log y\right)\right) + -0.5 \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.45e176 or 1.55000000000000006e187 < 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 t around 0 92.2%

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

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

    if -2.45e176 < x < 1.55000000000000006e187

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

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

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

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

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

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

Alternative 6: 93.9% accurate, 1.0× 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)\\ \mathbf{if}\;x \leq -1.9 \cdot 10^{+170} \lor \neg \left(x \leq 1.8 \cdot 10^{+143}\right):\\ \;\;\;\;y \cdot i + \left(t_1 + \left(a + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(t_1 + \left(z + \left(t + a\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
 (let* ((t_1 (* (log c) (- b 0.5))))
   (if (or (<= x -1.9e+170) (not (<= x 1.8e+143)))
     (+ (* y i) (+ t_1 (+ a (* x (log y)))))
     (+ (* y i) (+ t_1 (+ 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) {
	double t_1 = log(c) * (b - 0.5);
	double tmp;
	if ((x <= -1.9e+170) || !(x <= 1.8e+143)) {
		tmp = (y * i) + (t_1 + (a + (x * log(y))));
	} else {
		tmp = (y * i) + (t_1 + (z + (t + 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) :: t_1
    real(8) :: tmp
    t_1 = log(c) * (b - 0.5d0)
    if ((x <= (-1.9d+170)) .or. (.not. (x <= 1.8d+143))) then
        tmp = (y * i) + (t_1 + (a + (x * log(y))))
    else
        tmp = (y * i) + (t_1 + (z + (t + 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 t_1 = Math.log(c) * (b - 0.5);
	double tmp;
	if ((x <= -1.9e+170) || !(x <= 1.8e+143)) {
		tmp = (y * i) + (t_1 + (a + (x * Math.log(y))));
	} else {
		tmp = (y * i) + (t_1 + (z + (t + a)));
	}
	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)
	tmp = 0
	if (x <= -1.9e+170) or not (x <= 1.8e+143):
		tmp = (y * i) + (t_1 + (a + (x * math.log(y))))
	else:
		tmp = (y * i) + (t_1 + (z + (t + a)))
	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))
	tmp = 0.0
	if ((x <= -1.9e+170) || !(x <= 1.8e+143))
		tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + Float64(x * log(y)))));
	else
		tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(z + Float64(t + 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)
	t_1 = log(c) * (b - 0.5);
	tmp = 0.0;
	if ((x <= -1.9e+170) || ~((x <= 1.8e+143)))
		tmp = (y * i) + (t_1 + (a + (x * log(y))));
	else
		tmp = (y * i) + (t_1 + (z + (t + 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_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -1.9e+170], N[Not[LessEqual[x, 1.8e+143]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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)\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+170} \lor \neg \left(x \leq 1.8 \cdot 10^{+143}\right):\\
\;\;\;\;y \cdot i + \left(t_1 + \left(a + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.8999999999999999e170 or 1.8e143 < 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 t around 0 92.5%

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

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

    if -1.8999999999999999e170 < x < 1.8e143

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

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

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

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

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

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

Alternative 7: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\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 (+ t (+ z (* x (log y))))) (* (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) {
	return (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5)));
}
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 + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0)))
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 + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5)));
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5)))
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(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))))
end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5)));
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[(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]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

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

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

Alternative 8: 99.2% 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.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 t around 0 86.8%

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

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

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -1.5 \cdot 10^{+196}:\\ \;\;\;\;t + \left(y \cdot i + t_1\right)\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+209}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(a + \left(z + -0.5 \cdot \log c\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
 (let* ((t_1 (* x (log y))))
   (if (<= x -1.5e+196)
     (+ t (+ (* y i) t_1))
     (if (<= x 1.35e+209)
       (+ (* y i) (+ (* (log c) (- b 0.5)) (+ z (+ t a))))
       (+ t_1 (+ a (+ z (* -0.5 (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 t_1 = x * log(y);
	double tmp;
	if (x <= -1.5e+196) {
		tmp = t + ((y * i) + t_1);
	} else if (x <= 1.35e+209) {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a)));
	} else {
		tmp = t_1 + (a + (z + (-0.5 * 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) :: t_1
    real(8) :: tmp
    t_1 = x * log(y)
    if (x <= (-1.5d+196)) then
        tmp = t + ((y * i) + t_1)
    else if (x <= 1.35d+209) then
        tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (z + (t + a)))
    else
        tmp = t_1 + (a + (z + ((-0.5d0) * 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 t_1 = x * Math.log(y);
	double tmp;
	if (x <= -1.5e+196) {
		tmp = t + ((y * i) + t_1);
	} else if (x <= 1.35e+209) {
		tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (z + (t + a)));
	} else {
		tmp = t_1 + (a + (z + (-0.5 * Math.log(c))));
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	t_1 = x * math.log(y)
	tmp = 0
	if x <= -1.5e+196:
		tmp = t + ((y * i) + t_1)
	elif x <= 1.35e+209:
		tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (z + (t + a)))
	else:
		tmp = t_1 + (a + (z + (-0.5 * math.log(c))))
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -1.5e+196)
		tmp = Float64(t + Float64(Float64(y * i) + t_1));
	elseif (x <= 1.35e+209)
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + a))));
	else
		tmp = Float64(t_1 + Float64(a + Float64(z + Float64(-0.5 * 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)
	t_1 = x * log(y);
	tmp = 0.0;
	if (x <= -1.5e+196)
		tmp = t + ((y * i) + t_1);
	elseif (x <= 1.35e+209)
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a)));
	else
		tmp = t_1 + (a + (z + (-0.5 * 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_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5e+196], N[(t + N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+209], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(a + N[(z + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{+196}:\\
\;\;\;\;t + \left(y \cdot i + t_1\right)\\

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4999999999999999e196 < x < 1.35e209

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

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

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

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

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

    if 1.35e209 < x

    1. Initial program 99.6%

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

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

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

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

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

Alternative 10: 57.7% accurate, 1.8× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} t_1 := y \cdot i + b \cdot \log c\\ t_2 := y \cdot i + \left(t + a\right)\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+164}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -5 \cdot 10^{+92}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{+72}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -10:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-174}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-241}:\\ \;\;\;\;t_1\\ \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
 (let* ((t_1 (+ (* y i) (* b (log c)))) (t_2 (+ (* y i) (+ t a))))
   (if (<= z -3.2e+164)
     (+ z (* y i))
     (if (<= z -5e+92)
       t_1
       (if (<= z -4.4e+72)
         t_2
         (if (<= z -10.0)
           t_1
           (if (<= z -1.8e-174)
             t_2
             (if (<= z 8.2e-241) t_1 (+ 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 t_1 = (y * i) + (b * log(c));
	double t_2 = (y * i) + (t + a);
	double tmp;
	if (z <= -3.2e+164) {
		tmp = z + (y * i);
	} else if (z <= -5e+92) {
		tmp = t_1;
	} else if (z <= -4.4e+72) {
		tmp = t_2;
	} else if (z <= -10.0) {
		tmp = t_1;
	} else if (z <= -1.8e-174) {
		tmp = t_2;
	} else if (z <= 8.2e-241) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y * i) + (b * log(c))
    t_2 = (y * i) + (t + a)
    if (z <= (-3.2d+164)) then
        tmp = z + (y * i)
    else if (z <= (-5d+92)) then
        tmp = t_1
    else if (z <= (-4.4d+72)) then
        tmp = t_2
    else if (z <= (-10.0d0)) then
        tmp = t_1
    else if (z <= (-1.8d-174)) then
        tmp = t_2
    else if (z <= 8.2d-241) then
        tmp = t_1
    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 t_1 = (y * i) + (b * Math.log(c));
	double t_2 = (y * i) + (t + a);
	double tmp;
	if (z <= -3.2e+164) {
		tmp = z + (y * i);
	} else if (z <= -5e+92) {
		tmp = t_1;
	} else if (z <= -4.4e+72) {
		tmp = t_2;
	} else if (z <= -10.0) {
		tmp = t_1;
	} else if (z <= -1.8e-174) {
		tmp = t_2;
	} else if (z <= 8.2e-241) {
		tmp = t_1;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	t_1 = (y * i) + (b * math.log(c))
	t_2 = (y * i) + (t + a)
	tmp = 0
	if z <= -3.2e+164:
		tmp = z + (y * i)
	elif z <= -5e+92:
		tmp = t_1
	elif z <= -4.4e+72:
		tmp = t_2
	elif z <= -10.0:
		tmp = t_1
	elif z <= -1.8e-174:
		tmp = t_2
	elif z <= 8.2e-241:
		tmp = t_1
	else:
		tmp = a + (y * i)
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(y * i) + Float64(b * log(c)))
	t_2 = Float64(Float64(y * i) + Float64(t + a))
	tmp = 0.0
	if (z <= -3.2e+164)
		tmp = Float64(z + Float64(y * i));
	elseif (z <= -5e+92)
		tmp = t_1;
	elseif (z <= -4.4e+72)
		tmp = t_2;
	elseif (z <= -10.0)
		tmp = t_1;
	elseif (z <= -1.8e-174)
		tmp = t_2;
	elseif (z <= 8.2e-241)
		tmp = t_1;
	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)
	t_1 = (y * i) + (b * log(c));
	t_2 = (y * i) + (t + a);
	tmp = 0.0;
	if (z <= -3.2e+164)
		tmp = z + (y * i);
	elseif (z <= -5e+92)
		tmp = t_1;
	elseif (z <= -4.4e+72)
		tmp = t_2;
	elseif (z <= -10.0)
		tmp = t_1;
	elseif (z <= -1.8e-174)
		tmp = t_2;
	elseif (z <= 8.2e-241)
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+164], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5e+92], t$95$1, If[LessEqual[z, -4.4e+72], t$95$2, If[LessEqual[z, -10.0], t$95$1, If[LessEqual[z, -1.8e-174], t$95$2, If[LessEqual[z, 8.2e-241], t$95$1, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot i + b \cdot \log c\\
t_2 := y \cdot i + \left(t + a\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+164}:\\
\;\;\;\;z + y \cdot i\\

\mathbf{elif}\;z \leq -5 \cdot 10^{+92}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -4.4 \cdot 10^{+72}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -10:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.8 \cdot 10^{-174}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 8.2 \cdot 10^{-241}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.1999999999999998e164

    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 t around 0 92.6%

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

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

    if -3.1999999999999998e164 < z < -5.00000000000000022e92 or -4.4e72 < z < -10 or -1.79999999999999999e-174 < z < 8.1999999999999997e-241

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

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

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

    if -5.00000000000000022e92 < z < -4.4e72 or -10 < z < -1.79999999999999999e-174

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in t around 0 75.4%

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

    if 8.1999999999999997e-241 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in t around 0 35.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+164}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -5 \cdot 10^{+92}:\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{+72}:\\ \;\;\;\;y \cdot i + \left(t + a\right)\\ \mathbf{elif}\;z \leq -10:\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-174}:\\ \;\;\;\;y \cdot i + \left(t + a\right)\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-241}:\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 11: 90.2% accurate, 1.8× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+196} \lor \neg \left(x \leq 2.2 \cdot 10^{+212}\right):\\ \;\;\;\;t + \left(y \cdot i + x \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\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 -1.4e+196) (not (<= x 2.2e+212)))
   (+ t (+ (* y i) (* x (log y))))
   (+ (* y i) (+ (* (log c) (- b 0.5)) (+ 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) {
	double tmp;
	if ((x <= -1.4e+196) || !(x <= 2.2e+212)) {
		tmp = t + ((y * i) + (x * log(y)));
	} else {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + 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 ((x <= (-1.4d+196)) .or. (.not. (x <= 2.2d+212))) then
        tmp = t + ((y * i) + (x * log(y)))
    else
        tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (z + (t + 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 ((x <= -1.4e+196) || !(x <= 2.2e+212)) {
		tmp = t + ((y * i) + (x * Math.log(y)));
	} else {
		tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (z + (t + a)));
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -1.4e+196) or not (x <= 2.2e+212):
		tmp = t + ((y * i) + (x * math.log(y)))
	else:
		tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (z + (t + a)))
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -1.4e+196) || !(x <= 2.2e+212))
		tmp = Float64(t + Float64(Float64(y * i) + Float64(x * log(y))));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + 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 ((x <= -1.4e+196) || ~((x <= 2.2e+212)))
		tmp = t + ((y * i) + (x * log(y)));
	else
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + 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[Or[LessEqual[x, -1.4e+196], N[Not[LessEqual[x, 2.2e+212]], $MachinePrecision]], N[(t + N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+196} \lor \neg \left(x \leq 2.2 \cdot 10^{+212}\right):\\
\;\;\;\;t + \left(y \cdot i + x \cdot \log y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4000000000000001e196 or 2.19999999999999995e212 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4000000000000001e196 < x < 2.19999999999999995e212

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

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

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

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

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

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

Alternative 12: 89.7% accurate, 1.9× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{+196} \lor \neg \left(x \leq 6.5 \cdot 10^{+212}\right):\\ \;\;\;\;t + \left(y \cdot i + x \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + z\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 -1.5e+196) (not (<= x 6.5e+212)))
   (+ t (+ (* y i) (* x (log y))))
   (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a z)))))
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 <= -1.5e+196) || !(x <= 6.5e+212)) {
		tmp = t + ((y * i) + (x * log(y)));
	} else {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + z));
	}
	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 <= (-1.5d+196)) .or. (.not. (x <= 6.5d+212))) then
        tmp = t + ((y * i) + (x * log(y)))
    else
        tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (a + z))
    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 <= -1.5e+196) || !(x <= 6.5e+212)) {
		tmp = t + ((y * i) + (x * Math.log(y)));
	} else {
		tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + z));
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -1.5e+196) or not (x <= 6.5e+212):
		tmp = t + ((y * i) + (x * math.log(y)))
	else:
		tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (a + z))
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -1.5e+196) || !(x <= 6.5e+212))
		tmp = Float64(t + Float64(Float64(y * i) + Float64(x * log(y))));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + z)));
	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 <= -1.5e+196) || ~((x <= 6.5e+212)))
		tmp = t + ((y * i) + (x * log(y)));
	else
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + z));
	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, -1.5e+196], N[Not[LessEqual[x, 6.5e+212]], $MachinePrecision]], N[(t + N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+196} \lor \neg \left(x \leq 6.5 \cdot 10^{+212}\right):\\
\;\;\;\;t + \left(y \cdot i + x \cdot \log y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4999999999999999e196 or 6.49999999999999997e212 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4999999999999999e196 < x < 6.49999999999999997e212

    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 t around 0 85.5%

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

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

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

Alternative 13: 75.1% accurate, 1.9× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{+184} \lor \neg \left(b \leq 9.5 \cdot 10^{+123}\right):\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + \left(z + \left(y \cdot i + -0.5 \cdot \log c\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 -7e+184) (not (<= b 9.5e+123)))
   (+ (* y i) (* b (log c)))
   (+ a (+ z (+ (* y i) (* -0.5 (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 ((b <= -7e+184) || !(b <= 9.5e+123)) {
		tmp = (y * i) + (b * log(c));
	} else {
		tmp = a + (z + ((y * i) + (-0.5 * 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 ((b <= (-7d+184)) .or. (.not. (b <= 9.5d+123))) then
        tmp = (y * i) + (b * log(c))
    else
        tmp = a + (z + ((y * i) + ((-0.5d0) * 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 ((b <= -7e+184) || !(b <= 9.5e+123)) {
		tmp = (y * i) + (b * Math.log(c));
	} else {
		tmp = a + (z + ((y * i) + (-0.5 * 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 (b <= -7e+184) or not (b <= 9.5e+123):
		tmp = (y * i) + (b * math.log(c))
	else:
		tmp = a + (z + ((y * i) + (-0.5 * 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 ((b <= -7e+184) || !(b <= 9.5e+123))
		tmp = Float64(Float64(y * i) + Float64(b * log(c)));
	else
		tmp = Float64(a + Float64(z + Float64(Float64(y * i) + Float64(-0.5 * 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 ((b <= -7e+184) || ~((b <= 9.5e+123)))
		tmp = (y * i) + (b * log(c));
	else
		tmp = a + (z + ((y * i) + (-0.5 * 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[Or[LessEqual[b, -7e+184], N[Not[LessEqual[b, 9.5e+123]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(z + N[(N[(y * i), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{+184} \lor \neg \left(b \leq 9.5 \cdot 10^{+123}\right):\\
\;\;\;\;y \cdot i + b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -6.99999999999999956e184 or 9.4999999999999996e123 < 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 t around 0 98.9%

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

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

    if -6.99999999999999956e184 < b < 9.4999999999999996e123

    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 t around 0 82.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{+184} \lor \neg \left(b \leq 9.5 \cdot 10^{+123}\right):\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\\ \end{array} \]

Alternative 14: 61.2% accurate, 2.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+131}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a\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 -1.6e+131) (+ z (* y i)) (+ t (fma 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 (z <= -1.6e+131) {
		tmp = z + (y * i);
	} else {
		tmp = t + fma(y, i, a);
	}
	return tmp;
}
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -1.6e+131)
		tmp = Float64(z + Float64(y * i));
	else
		tmp = Float64(t + fma(y, i, a));
	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[LessEqual[z, -1.6e+131], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(t + N[(y * i + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+131}:\\
\;\;\;\;z + y \cdot i\\

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


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

    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 t around 0 87.1%

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

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

    if -1.6000000000000001e131 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+131}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a\right)\\ \end{array} \]

Alternative 15: 39.0% accurate, 16.5× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} t_1 := t + y \cdot i\\ \mathbf{if}\;z \leq -1.6 \cdot 10^{+102}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\ \;\;\;\;t + a\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-243}:\\ \;\;\;\;t_1\\ \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
 (let* ((t_1 (+ t (* y i))))
   (if (<= z -1.6e+102)
     z
     (if (<= z -3.1e-53)
       t_1
       (if (<= z -5.5e-173) (+ t a) (if (<= z -7.5e-243) t_1 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 t_1 = t + (y * i);
	double tmp;
	if (z <= -1.6e+102) {
		tmp = z;
	} else if (z <= -3.1e-53) {
		tmp = t_1;
	} else if (z <= -5.5e-173) {
		tmp = t + a;
	} else if (z <= -7.5e-243) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = t + (y * i)
    if (z <= (-1.6d+102)) then
        tmp = z
    else if (z <= (-3.1d-53)) then
        tmp = t_1
    else if (z <= (-5.5d-173)) then
        tmp = t + a
    else if (z <= (-7.5d-243)) then
        tmp = t_1
    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 t_1 = t + (y * i);
	double tmp;
	if (z <= -1.6e+102) {
		tmp = z;
	} else if (z <= -3.1e-53) {
		tmp = t_1;
	} else if (z <= -5.5e-173) {
		tmp = t + a;
	} else if (z <= -7.5e-243) {
		tmp = t_1;
	} else {
		tmp = a;
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	t_1 = t + (y * i)
	tmp = 0
	if z <= -1.6e+102:
		tmp = z
	elif z <= -3.1e-53:
		tmp = t_1
	elif z <= -5.5e-173:
		tmp = t + a
	elif z <= -7.5e-243:
		tmp = t_1
	else:
		tmp = a
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(t + Float64(y * i))
	tmp = 0.0
	if (z <= -1.6e+102)
		tmp = z;
	elseif (z <= -3.1e-53)
		tmp = t_1;
	elseif (z <= -5.5e-173)
		tmp = Float64(t + a);
	elseif (z <= -7.5e-243)
		tmp = t_1;
	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)
	t_1 = t + (y * i);
	tmp = 0.0;
	if (z <= -1.6e+102)
		tmp = z;
	elseif (z <= -3.1e-53)
		tmp = t_1;
	elseif (z <= -5.5e-173)
		tmp = t + a;
	elseif (z <= -7.5e-243)
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(t + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+102], z, If[LessEqual[z, -3.1e-53], t$95$1, If[LessEqual[z, -5.5e-173], N[(t + a), $MachinePrecision], If[LessEqual[z, -7.5e-243], t$95$1, a]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := t + y \cdot i\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+102}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq -3.1 \cdot 10^{-53}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\
\;\;\;\;t + a\\

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-243}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.6e102

    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 t around 0 88.0%

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

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

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

    if -1.6e102 < z < -3.10000000000000015e-53 or -5.50000000000000022e-173 < z < -7.5e-243

    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 t around inf 43.0%

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

    if -3.10000000000000015e-53 < z < -5.50000000000000022e-173

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in y around 0 43.5%

      \[\leadsto \color{blue}{a + t} \]

    if -7.5e-243 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in a around inf 14.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+102}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-53}:\\ \;\;\;\;t + y \cdot i\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\ \;\;\;\;t + a\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-243}:\\ \;\;\;\;t + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 16: 38.9% accurate, 19.5× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+101}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-54}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\ \;\;\;\;a\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{-243}:\\ \;\;\;\;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 (<= z -6e+101)
   z
   (if (<= z -5e-54)
     (* y i)
     (if (<= z -5.5e-173) a (if (<= z -1.04e-243) (* 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 (z <= -6e+101) {
		tmp = z;
	} else if (z <= -5e-54) {
		tmp = y * i;
	} else if (z <= -5.5e-173) {
		tmp = a;
	} else if (z <= -1.04e-243) {
		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 (z <= (-6d+101)) then
        tmp = z
    else if (z <= (-5d-54)) then
        tmp = y * i
    else if (z <= (-5.5d-173)) then
        tmp = a
    else if (z <= (-1.04d-243)) 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 (z <= -6e+101) {
		tmp = z;
	} else if (z <= -5e-54) {
		tmp = y * i;
	} else if (z <= -5.5e-173) {
		tmp = a;
	} else if (z <= -1.04e-243) {
		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 z <= -6e+101:
		tmp = z
	elif z <= -5e-54:
		tmp = y * i
	elif z <= -5.5e-173:
		tmp = a
	elif z <= -1.04e-243:
		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 (z <= -6e+101)
		tmp = z;
	elseif (z <= -5e-54)
		tmp = Float64(y * i);
	elseif (z <= -5.5e-173)
		tmp = a;
	elseif (z <= -1.04e-243)
		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 (z <= -6e+101)
		tmp = z;
	elseif (z <= -5e-54)
		tmp = y * i;
	elseif (z <= -5.5e-173)
		tmp = a;
	elseif (z <= -1.04e-243)
		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[z, -6e+101], z, If[LessEqual[z, -5e-54], N[(y * i), $MachinePrecision], If[LessEqual[z, -5.5e-173], a, If[LessEqual[z, -1.04e-243], N[(y * i), $MachinePrecision], a]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+101}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq -5 \cdot 10^{-54}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\
\;\;\;\;a\\

\mathbf{elif}\;z \leq -1.04 \cdot 10^{-243}:\\
\;\;\;\;y \cdot i\\

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


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

    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 t around 0 88.0%

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

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

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

    if -5.99999999999999986e101 < z < -5.00000000000000015e-54 or -5.50000000000000022e-173 < z < -1.0400000000000001e-243

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot i} \]
    6. Simplified30.5%

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

    if -5.00000000000000015e-54 < z < -5.50000000000000022e-173 or -1.0400000000000001e-243 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in a around inf 17.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+101}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-54}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\ \;\;\;\;a\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{-243}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 17: 38.9% accurate, 19.5× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+100}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-53}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\ \;\;\;\;t + a\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-243}:\\ \;\;\;\;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 (<= z -5.6e+100)
   z
   (if (<= z -3.6e-53)
     (* y i)
     (if (<= z -5.5e-173) (+ t a) (if (<= z -5e-243) (* 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 (z <= -5.6e+100) {
		tmp = z;
	} else if (z <= -3.6e-53) {
		tmp = y * i;
	} else if (z <= -5.5e-173) {
		tmp = t + a;
	} else if (z <= -5e-243) {
		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 (z <= (-5.6d+100)) then
        tmp = z
    else if (z <= (-3.6d-53)) then
        tmp = y * i
    else if (z <= (-5.5d-173)) then
        tmp = t + a
    else if (z <= (-5d-243)) 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 (z <= -5.6e+100) {
		tmp = z;
	} else if (z <= -3.6e-53) {
		tmp = y * i;
	} else if (z <= -5.5e-173) {
		tmp = t + a;
	} else if (z <= -5e-243) {
		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 z <= -5.6e+100:
		tmp = z
	elif z <= -3.6e-53:
		tmp = y * i
	elif z <= -5.5e-173:
		tmp = t + a
	elif z <= -5e-243:
		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 (z <= -5.6e+100)
		tmp = z;
	elseif (z <= -3.6e-53)
		tmp = Float64(y * i);
	elseif (z <= -5.5e-173)
		tmp = Float64(t + a);
	elseif (z <= -5e-243)
		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 (z <= -5.6e+100)
		tmp = z;
	elseif (z <= -3.6e-53)
		tmp = y * i;
	elseif (z <= -5.5e-173)
		tmp = t + a;
	elseif (z <= -5e-243)
		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[z, -5.6e+100], z, If[LessEqual[z, -3.6e-53], N[(y * i), $MachinePrecision], If[LessEqual[z, -5.5e-173], N[(t + a), $MachinePrecision], If[LessEqual[z, -5e-243], N[(y * i), $MachinePrecision], a]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+100}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-53}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\
\;\;\;\;t + a\\

\mathbf{elif}\;z \leq -5 \cdot 10^{-243}:\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.5999999999999996e100

    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 t around 0 88.3%

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

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

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

    if -5.5999999999999996e100 < z < -3.5999999999999999e-53 or -5.50000000000000022e-173 < z < -5e-243

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -3.5999999999999999e-53 < z < -5.50000000000000022e-173

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in y around 0 43.5%

      \[\leadsto \color{blue}{a + t} \]

    if -5e-243 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in a around inf 14.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+100}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-53}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\ \;\;\;\;t + a\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-243}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 18: 61.2% accurate, 24.2× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+131}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(t + a\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 -3.2e+131) (+ z (* y i)) (+ (* y i) (+ 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) {
	double tmp;
	if (z <= -3.2e+131) {
		tmp = z + (y * i);
	} else {
		tmp = (y * i) + (t + 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 (z <= (-3.2d+131)) then
        tmp = z + (y * i)
    else
        tmp = (y * i) + (t + 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 (z <= -3.2e+131) {
		tmp = z + (y * i);
	} else {
		tmp = (y * i) + (t + a);
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -3.2e+131:
		tmp = z + (y * i)
	else:
		tmp = (y * i) + (t + a)
	return tmp
z, t, a = sort([z, t, a])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -3.2e+131)
		tmp = Float64(z + Float64(y * i));
	else
		tmp = Float64(Float64(y * i) + Float64(t + 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 (z <= -3.2e+131)
		tmp = z + (y * i);
	else
		tmp = (y * i) + (t + 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[z, -3.2e+131], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+131}:\\
\;\;\;\;z + y \cdot i\\

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


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

    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 t around 0 87.1%

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

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

    if -3.2000000000000002e131 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in t around 0 53.6%

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

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

Alternative 19: 54.6% accurate, 31.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq 2.9 \cdot 10^{+180}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;t + 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 2.9e+180) (+ z (* y i)) (+ 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) {
	double tmp;
	if (a <= 2.9e+180) {
		tmp = z + (y * i);
	} else {
		tmp = t + 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 <= 2.9d+180) then
        tmp = z + (y * i)
    else
        tmp = t + 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 <= 2.9e+180) {
		tmp = z + (y * i);
	} else {
		tmp = t + a;
	}
	return tmp;
}
[z, t, a] = sort([z, t, a])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if a <= 2.9e+180:
		tmp = z + (y * i)
	else:
		tmp = t + 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 <= 2.9e+180)
		tmp = Float64(z + Float64(y * i));
	else
		tmp = Float64(t + 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 <= 2.9e+180)
		tmp = z + (y * i);
	else
		tmp = t + 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, 2.9e+180], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(t + a), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.9 \cdot 10^{+180}:\\
\;\;\;\;z + y \cdot i\\

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


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

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

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

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

    if 2.90000000000000007e180 < 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. Step-by-step derivation
      1. associate-+l+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in y around 0 65.9%

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

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

Alternative 20: 60.9% accurate, 31.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+130}:\\ \;\;\;\;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 (<= z -4.5e+130) (+ 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 (z <= -4.5e+130) {
		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 (z <= (-4.5d+130)) 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 (z <= -4.5e+130) {
		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 z <= -4.5e+130:
		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 (z <= -4.5e+130)
		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 (z <= -4.5e+130)
		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[z, -4.5e+130], 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}\;z \leq -4.5 \cdot 10^{+130}:\\
\;\;\;\;z + y \cdot i\\

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


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

    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 t around 0 87.1%

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

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

    if -4.50000000000000039e130 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in t around 0 40.6%

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

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

Alternative 21: 39.0% accurate, 71.5× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+132}:\\ \;\;\;\;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 (<= z -7.5e+132) 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 (z <= -7.5e+132) {
		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 (z <= (-7.5d+132)) 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 (z <= -7.5e+132) {
		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 z <= -7.5e+132:
		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 (z <= -7.5e+132)
		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 (z <= -7.5e+132)
		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[z, -7.5e+132], z, a]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+132}:\\
\;\;\;\;z\\

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


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

    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 t around 0 87.1%

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

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

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

    if -7.50000000000000017e132 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
    5. Taylor expanded in a around inf 18.8%

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

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

Alternative 22: 23.5% 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.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto t + \mathsf{fma}\left(y, i, \color{blue}{a}\right) \]
  5. Taylor expanded in a around inf 17.0%

    \[\leadsto \color{blue}{a} \]
  6. Final simplification17.0%

    \[\leadsto a \]

Reproduce

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