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

Percentage Accurate: 99.8% → 99.8%
Time: 16.4s
Alternatives: 20
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 20 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.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.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: 90.6% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := a + t_1\\ t_3 := \log c \cdot \left(b - 0.5\right)\\ t_4 := y \cdot i + \left(t_3 + \left(z + \left(t + a\right)\right)\right)\\ \mathbf{if}\;x \leq -4.1 \cdot 10^{+204}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, z + t_1\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+79}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{+154}:\\ \;\;\;\;t + \left(t_3 + t_2\right)\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+202}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, t_2\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)))
        (t_2 (+ a t_1))
        (t_3 (* (log c) (- b 0.5)))
        (t_4 (+ (* y i) (+ t_3 (+ z (+ t a))))))
   (if (<= x -4.1e+204)
     (+ t (fma y i (+ z t_1)))
     (if (<= x 1.6e+79)
       t_4
       (if (<= x 2.5e+154)
         (+ t (+ t_3 t_2))
         (if (<= x 9e+202) t_4 (+ t (fma y i t_2))))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * log(y);
	double t_2 = a + t_1;
	double t_3 = log(c) * (b - 0.5);
	double t_4 = (y * i) + (t_3 + (z + (t + a)));
	double tmp;
	if (x <= -4.1e+204) {
		tmp = t + fma(y, i, (z + t_1));
	} else if (x <= 1.6e+79) {
		tmp = t_4;
	} else if (x <= 2.5e+154) {
		tmp = t + (t_3 + t_2);
	} else if (x <= 9e+202) {
		tmp = t_4;
	} else {
		tmp = t + fma(y, i, t_2);
	}
	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))
	t_2 = Float64(a + t_1)
	t_3 = Float64(log(c) * Float64(b - 0.5))
	t_4 = Float64(Float64(y * i) + Float64(t_3 + Float64(z + Float64(t + a))))
	tmp = 0.0
	if (x <= -4.1e+204)
		tmp = Float64(t + fma(y, i, Float64(z + t_1)));
	elseif (x <= 1.6e+79)
		tmp = t_4;
	elseif (x <= 2.5e+154)
		tmp = Float64(t + Float64(t_3 + t_2));
	elseif (x <= 9e+202)
		tmp = t_4;
	else
		tmp = Float64(t + fma(y, i, t_2));
	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_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y * i), $MachinePrecision] + N[(t$95$3 + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.1e+204], N[(t + N[(y * i + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+79], t$95$4, If[LessEqual[x, 2.5e+154], N[(t + N[(t$95$3 + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e+202], t$95$4, N[(t + N[(y * i + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := a + t_1\\
t_3 := \log c \cdot \left(b - 0.5\right)\\
t_4 := y \cdot i + \left(t_3 + \left(z + \left(t + a\right)\right)\right)\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{+204}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, z + t_1\right)\\

\mathbf{elif}\;x \leq 1.6 \cdot 10^{+79}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x \leq 2.5 \cdot 10^{+154}:\\
\;\;\;\;t + \left(t_3 + t_2\right)\\

\mathbf{elif}\;x \leq 9 \cdot 10^{+202}:\\
\;\;\;\;t_4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -4.09999999999999975e204

    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. Step-by-step derivation
      1. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around inf 95.4%

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

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

    if -4.09999999999999975e204 < x < 1.60000000000000001e79 or 2.50000000000000002e154 < x < 8.99999999999999955e202

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

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

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

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

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

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

      \[\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.60000000000000001e79 < x < 2.50000000000000002e154

    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 y around 0 90.5%

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

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

    if 8.99999999999999955e202 < x

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around inf 97.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{+204}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, z + x \cdot \log y\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+79}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{+154}:\\ \;\;\;\;t + \left(\log c \cdot \left(b - 0.5\right) + \left(a + x \cdot \log y\right)\right)\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+202}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a + x \cdot \log y\right)\\ \end{array} \]

Alternative 3: 90.6% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := \log c \cdot \left(b - 0.5\right)\\ t_3 := a + t_1\\ \mathbf{if}\;x \leq -5 \cdot 10^{+205}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, z + t_1\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+79}:\\ \;\;\;\;y \cdot i + \left(a + \mathsf{fma}\left(\log c, b + -0.5, t + z\right)\right)\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+155}:\\ \;\;\;\;t + \left(t_2 + t_3\right)\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{+201}:\\ \;\;\;\;y \cdot i + \left(t_2 + \left(z + \left(t + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, t_3\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))) (t_2 (* (log c) (- b 0.5))) (t_3 (+ a t_1)))
   (if (<= x -5e+205)
     (+ t (fma y i (+ z t_1)))
     (if (<= x 1.6e+79)
       (+ (* y i) (+ a (fma (log c) (+ b -0.5) (+ t z))))
       (if (<= x 1.35e+155)
         (+ t (+ t_2 t_3))
         (if (<= x 3.3e+201)
           (+ (* y i) (+ t_2 (+ z (+ t a))))
           (+ t (fma y i t_3))))))))
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 t_2 = log(c) * (b - 0.5);
	double t_3 = a + t_1;
	double tmp;
	if (x <= -5e+205) {
		tmp = t + fma(y, i, (z + t_1));
	} else if (x <= 1.6e+79) {
		tmp = (y * i) + (a + fma(log(c), (b + -0.5), (t + z)));
	} else if (x <= 1.35e+155) {
		tmp = t + (t_2 + t_3);
	} else if (x <= 3.3e+201) {
		tmp = (y * i) + (t_2 + (z + (t + a)));
	} else {
		tmp = t + fma(y, i, t_3);
	}
	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))
	t_2 = Float64(log(c) * Float64(b - 0.5))
	t_3 = Float64(a + t_1)
	tmp = 0.0
	if (x <= -5e+205)
		tmp = Float64(t + fma(y, i, Float64(z + t_1)));
	elseif (x <= 1.6e+79)
		tmp = Float64(Float64(y * i) + Float64(a + fma(log(c), Float64(b + -0.5), Float64(t + z))));
	elseif (x <= 1.35e+155)
		tmp = Float64(t + Float64(t_2 + t_3));
	elseif (x <= 3.3e+201)
		tmp = Float64(Float64(y * i) + Float64(t_2 + Float64(z + Float64(t + a))));
	else
		tmp = Float64(t + fma(y, i, t_3));
	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_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a + t$95$1), $MachinePrecision]}, If[LessEqual[x, -5e+205], N[(t + N[(y * i + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+79], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+155], N[(t + N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+201], N[(N[(y * i), $MachinePrecision] + N[(t$95$2 + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(y * i + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
t_3 := a + t_1\\
\mathbf{if}\;x \leq -5 \cdot 10^{+205}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, z + t_1\right)\\

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

\mathbf{elif}\;x \leq 1.35 \cdot 10^{+155}:\\
\;\;\;\;t + \left(t_2 + t_3\right)\\

\mathbf{elif}\;x \leq 3.3 \cdot 10^{+201}:\\
\;\;\;\;y \cdot i + \left(t_2 + \left(z + \left(t + a\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -5.0000000000000002e205

    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. Step-by-step derivation
      1. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around inf 95.4%

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

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

    if -5.0000000000000002e205 < x < 1.60000000000000001e79

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.60000000000000001e79 < x < 1.34999999999999997e155

    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 y around 0 90.5%

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

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

    if 1.34999999999999997e155 < x < 3.3e201

    1. Initial program 100.0%

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

      \[\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. +-commutative98.1%

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

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

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

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

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

    if 3.3e201 < x

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around inf 97.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+205}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, z + x \cdot \log y\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+79}:\\ \;\;\;\;y \cdot i + \left(a + \mathsf{fma}\left(\log c, b + -0.5, t + z\right)\right)\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+155}:\\ \;\;\;\;t + \left(\log c \cdot \left(b - 0.5\right) + \left(a + x \cdot \log y\right)\right)\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{+201}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a + x \cdot \log y\right)\\ \end{array} \]

Alternative 4: 99.8% accurate, 1.0× speedup?

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

Alternative 5: 91.2% 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}\;y \leq 2 \cdot 10^{-29}:\\ \;\;\;\;t + \left(t_1 + \left(a + \left(z + x \cdot \log y\right)\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 (<= y 2e-29)
     (+ t (+ t_1 (+ a (+ z (* 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 (y <= 2e-29) {
		tmp = t + (t_1 + (a + (z + (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 (y <= 2d-29) then
        tmp = t + (t_1 + (a + (z + (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 (y <= 2e-29) {
		tmp = t + (t_1 + (a + (z + (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 y <= 2e-29:
		tmp = t + (t_1 + (a + (z + (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 (y <= 2e-29)
		tmp = Float64(t + Float64(t_1 + Float64(a + Float64(z + 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 (y <= 2e-29)
		tmp = t + (t_1 + (a + (z + (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[LessEqual[y, 2e-29], N[(t + N[(t$95$1 + N[(a + N[(z + N[(x * N[Log[y], $MachinePrecision]), $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}\;y \leq 2 \cdot 10^{-29}:\\
\;\;\;\;t + \left(t_1 + \left(a + \left(z + x \cdot \log y\right)\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 y < 1.99999999999999989e-29

    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 y around 0 99.0%

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

    if 1.99999999999999989e-29 < y

    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 91.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. +-commutative91.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2 \cdot 10^{-29}:\\ \;\;\;\;t + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + x \cdot \log y\right)\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 6: 91.2% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{+201} \lor \neg \left(x \leq 4.3 \cdot 10^{+85}\right):\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a + 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 -9e+201) (not (<= x 4.3e+85)))
   (+ t (fma y i (+ a (* 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 <= -9e+201) || !(x <= 4.3e+85)) {
		tmp = t + fma(y, i, (a + (x * log(y))));
	} else {
		tmp = (y * i) + ((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 <= -9e+201) || !(x <= 4.3e+85))
		tmp = Float64(t + fma(y, i, Float64(a + 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
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, -9e+201], N[Not[LessEqual[x, 4.3e+85]], $MachinePrecision]], N[(t + N[(y * i + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(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 -9 \cdot 10^{+201} \lor \neg \left(x \leq 4.3 \cdot 10^{+85}\right):\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a + 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 < -9.0000000000000002e201 or 4.2999999999999999e85 < 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. Step-by-step derivation
      1. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around inf 89.4%

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

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

    if -9.0000000000000002e201 < x < 4.2999999999999999e85

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

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

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

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

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

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

      \[\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 -9 \cdot 10^{+201} \lor \neg \left(x \leq 4.3 \cdot 10^{+85}\right):\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a + 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 7: 91.0% 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 -8 \cdot 10^{+201}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, z + t_1\right)\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{+85}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a + t_1\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 -8e+201)
     (+ t (fma y i (+ z t_1)))
     (if (<= x 4.3e+85)
       (+ (* y i) (+ (* (log c) (- b 0.5)) (+ z (+ t a))))
       (+ t (fma y i (+ a t_1)))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * log(y);
	double tmp;
	if (x <= -8e+201) {
		tmp = t + fma(y, i, (z + t_1));
	} else if (x <= 4.3e+85) {
		tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a)));
	} else {
		tmp = t + fma(y, i, (a + t_1));
	}
	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 <= -8e+201)
		tmp = Float64(t + fma(y, i, Float64(z + t_1)));
	elseif (x <= 4.3e+85)
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + a))));
	else
		tmp = Float64(t + fma(y, i, Float64(a + t_1)));
	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_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+201], N[(t + N[(y * i + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.3e+85], 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 + N[(y * i + N[(a + t$95$1), $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 -8 \cdot 10^{+201}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, z + t_1\right)\\

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

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


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

    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. Step-by-step derivation
      1. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around inf 95.4%

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

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

    if -8.0000000000000003e201 < x < 4.2999999999999999e85

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

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

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

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

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

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

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

    if 4.2999999999999999e85 < 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. Step-by-step derivation
      1. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around inf 86.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{+201}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, z + x \cdot \log y\right)\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{+85}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a + x \cdot \log y\right)\\ \end{array} \]

Alternative 8: 90.7% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+207} \lor \neg \left(x \leq 1.22 \cdot 10^{+201}\right):\\ \;\;\;\;t + \mathsf{fma}\left(y, 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 -2.4e+207) (not (<= x 1.22e+201)))
   (+ t (fma 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 <= -2.4e+207) || !(x <= 1.22e+201)) {
		tmp = t + fma(y, i, (x * log(y)));
	} else {
		tmp = (y * i) + ((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.4e+207) || !(x <= 1.22e+201))
		tmp = Float64(t + fma(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
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.4e+207], N[Not[LessEqual[x, 1.22e+201]], $MachinePrecision]], N[(t + N[(y * i + 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 -2.4 \cdot 10^{+207} \lor \neg \left(x \leq 1.22 \cdot 10^{+201}\right):\\
\;\;\;\;t + \mathsf{fma}\left(y, 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 < -2.4000000000000001e207 or 1.22000000000000004e201 < 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. Step-by-step derivation
      1. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4000000000000001e207 < x < 1.22000000000000004e201

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

      \[\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. +-commutative95.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+207} \lor \neg \left(x \leq 1.22 \cdot 10^{+201}\right):\\ \;\;\;\;t + \mathsf{fma}\left(y, 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 9: 76.0% accurate, 1.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;t + \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 i < -3.4e-15 or 4e21 < i

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Step-by-step derivation
      1. 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.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 z around inf 89.0%

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

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

    if -3.4e-15 < i < 4e21

    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.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.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 y around 0 97.2%

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

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

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

Alternative 10: 84.4% accurate, 1.9× 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(z + \left(t + a\right)\right)\right) \end{array} \]
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (* 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) {
	return (y * i) + ((log(c) * (b - 0.5)) + (z + (t + 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 = (y * i) + ((log(c) * (b - 0.5d0)) + (z + (t + 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 (y * i) + ((Math.log(c) * (b - 0.5)) + (z + (t + a)));
}
[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)) + (z + (t + a)))
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(z + Float64(t + a))))
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)) + (z + (t + a)));
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(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])\\
\\
y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\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 x around 0 84.2%

    \[\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. +-commutative84.2%

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

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

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

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

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

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

Alternative 11: 83.9% accurate, 1.9× 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 + z\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))))
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));
}
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))
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));
}
[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))
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 + z)))
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));
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 + z), $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 + z\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 x around 0 84.2%

    \[\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. +-commutative84.2%

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

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

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

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

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

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

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

Alternative 12: 71.9% accurate, 2.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -7.19999999999999973e229 or 1.49999999999999998e183 < b

    1. Initial program 99.8%

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

      \[\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. +-commutative91.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Taylor expanded in b around inf 68.3%

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

    if -7.19999999999999973e229 < b < 1.49999999999999998e183

    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 z around inf 91.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.2 \cdot 10^{+229} \lor \neg \left(b \leq 1.5 \cdot 10^{+183}\right):\\ \;\;\;\;b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a + z\right)\\ \end{array} \]

Alternative 13: 73.2% accurate, 2.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.7e172 or 3.4000000000000001e121 < b

    1. Initial program 99.8%

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

      \[\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. +-commutative92.1%

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

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

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

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

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

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

    if -2.7e172 < b < 3.4000000000000001e121

    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 z around inf 94.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{+172} \lor \neg \left(b \leq 3.4 \cdot 10^{+121}\right):\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, a + z\right)\\ \end{array} \]

Alternative 14: 61.1% accurate, 2.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq 2.9 \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 (<= a 2.9e+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 (a <= 2.9e+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 (a <= 2.9e+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[a, 2.9e+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}\;a \leq 2.9 \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 a < 2.9000000000000001e131

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in x around 0 83.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. +-commutative83.5%

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

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

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

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

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

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

    if 2.9000000000000001e131 < a

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. 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 66.3%

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

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

Alternative 15: 61.3% accurate, 2.0× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq 7 \cdot 10^{+131}:\\ \;\;\;\;t + \mathsf{fma}\left(y, i, z\right)\\ \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 (<= a 7e+131) (+ t (fma y i z)) (+ 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 (a <= 7e+131) {
		tmp = t + fma(y, i, z);
	} 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 (a <= 7e+131)
		tmp = Float64(t + fma(y, i, z));
	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[a, 7e+131], N[(t + N[(y * i + z), $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}\;a \leq 7 \cdot 10^{+131}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, z\right)\\

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


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

    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.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.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.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 z around inf 78.9%

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

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

    if 6.9999999999999998e131 < a

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. 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 66.3%

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

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

Alternative 16: 38.8% accurate, 19.5× speedup?

\[\begin{array}{l} [z, t, a] = \mathsf{sort}([z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+161}:\\ \;\;\;\;t + z\\ \mathbf{elif}\;z \leq -1.38 \cdot 10^{+57}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-111}:\\ \;\;\;\;a\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-140}:\\ \;\;\;\;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 -7e+161)
   (+ t z)
   (if (<= z -1.38e+57)
     (* y i)
     (if (<= z -2.9e-111) a (if (<= z -1.55e-140) (* 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 <= -7e+161) {
		tmp = t + z;
	} else if (z <= -1.38e+57) {
		tmp = y * i;
	} else if (z <= -2.9e-111) {
		tmp = a;
	} else if (z <= -1.55e-140) {
		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 <= (-7d+161)) then
        tmp = t + z
    else if (z <= (-1.38d+57)) then
        tmp = y * i
    else if (z <= (-2.9d-111)) then
        tmp = a
    else if (z <= (-1.55d-140)) 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 <= -7e+161) {
		tmp = t + z;
	} else if (z <= -1.38e+57) {
		tmp = y * i;
	} else if (z <= -2.9e-111) {
		tmp = a;
	} else if (z <= -1.55e-140) {
		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 <= -7e+161:
		tmp = t + z
	elif z <= -1.38e+57:
		tmp = y * i
	elif z <= -2.9e-111:
		tmp = a
	elif z <= -1.55e-140:
		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 <= -7e+161)
		tmp = Float64(t + z);
	elseif (z <= -1.38e+57)
		tmp = Float64(y * i);
	elseif (z <= -2.9e-111)
		tmp = a;
	elseif (z <= -1.55e-140)
		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 <= -7e+161)
		tmp = t + z;
	elseif (z <= -1.38e+57)
		tmp = y * i;
	elseif (z <= -2.9e-111)
		tmp = a;
	elseif (z <= -1.55e-140)
		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, -7e+161], N[(t + z), $MachinePrecision], If[LessEqual[z, -1.38e+57], N[(y * i), $MachinePrecision], If[LessEqual[z, -2.9e-111], a, If[LessEqual[z, -1.55e-140], N[(y * i), $MachinePrecision], a]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+161}:\\
\;\;\;\;t + z\\

\mathbf{elif}\;z \leq -1.38 \cdot 10^{+57}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-111}:\\
\;\;\;\;a\\

\mathbf{elif}\;z \leq -1.55 \cdot 10^{-140}:\\
\;\;\;\;y \cdot i\\

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


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

    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 y around 0 85.7%

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

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

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

    if -6.99999999999999976e161 < z < -1.38e57 or -2.90000000000000002e-111 < z < -1.55e-140

    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 y around inf 40.4%

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

        \[\leadsto t + \color{blue}{y \cdot i} \]
    6. Simplified40.4%

      \[\leadsto t + \color{blue}{y \cdot i} \]
    7. Taylor expanded in t around 0 35.5%

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

        \[\leadsto \color{blue}{y \cdot i} \]
    9. Simplified35.5%

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

    if -1.38e57 < z < -2.90000000000000002e-111 or -1.55e-140 < z

    1. Initial program 99.8%

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

      \[\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. +-commutative84.9%

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

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

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

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

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

      \[\leadsto \color{blue}{a} + y \cdot i \]
    6. Taylor expanded in a around inf 18.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+161}:\\ \;\;\;\;t + z\\ \mathbf{elif}\;z \leq -1.38 \cdot 10^{+57}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-111}:\\ \;\;\;\;a\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-140}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 17: 55.1% accurate, 31.0× speedup?

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

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


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

    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 y around 0 85.7%

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

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

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

    if -7.8000000000000004e161 < z

    1. Initial program 99.8%

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

      \[\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. +-commutative84.8%

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

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

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

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

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

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

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

Alternative 18: 60.8% accurate, 31.0× speedup?

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

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


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

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in x around 0 83.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. +-commutative83.5%

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

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

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

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

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

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

    if 6.0000000000000003e131 < a

    1. Initial program 99.9%

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

      \[\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. +-commutative88.8%

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

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

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

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

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

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

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

Alternative 19: 36.1% accurate, 43.3× speedup?

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

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


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

    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.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.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.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 y around inf 34.9%

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

        \[\leadsto t + \color{blue}{y \cdot i} \]
    6. Simplified34.9%

      \[\leadsto t + \color{blue}{y \cdot i} \]
    7. Taylor expanded in t around 0 24.4%

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

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

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

    if 2.20000000000000007e102 < a

    1. Initial program 99.9%

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

      \[\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. +-commutative88.2%

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

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

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

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

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

      \[\leadsto \color{blue}{a} + y \cdot i \]
    6. Taylor expanded in a around inf 48.5%

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

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

Alternative 20: 23.1% 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. Taylor expanded in x around 0 84.2%

    \[\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. +-commutative84.2%

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

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

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

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

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

    \[\leadsto \color{blue}{a} + y \cdot i \]
  6. Taylor expanded in a around inf 17.8%

    \[\leadsto \color{blue}{a} \]
  7. Final simplification17.8%

    \[\leadsto a \]

Reproduce

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