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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(x, \log y, a\right) + \left(z + t\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (fma y i (fma (+ b -0.5) (log c) (+ (fma x (log y) a) (+ z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fma(y, i, fma((b + -0.5), log(c), (fma(x, log(y), a) + (z + t))));
}
function code(x, y, z, t, a, b, c, i)
	return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(fma(x, log(y), a) + Float64(z + t))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision] + a), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(x, \log y, a\right) + \left(z + t\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \left(\mathsf{fma}\left(x, \log y, z\right) + \left(a + t\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (fma x (log y) z) (+ a t)) (+ (* (+ 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 (fma(x, log(y), z) + (a + t)) + (((b + -0.5) * log(c)) + (y * i));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(fma(x, log(y), z) + Float64(a + t)) + Float64(Float64(Float64(b + -0.5) * log(c)) + Float64(y * i)))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\mathsf{fma}\left(x, \log y, z\right) + \left(a + t\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right)
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 91.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := -0.5 \cdot \log c\\ \mathbf{if}\;x \leq -3.2 \cdot 10^{+176}:\\ \;\;\;\;a + \left(t + \left(z + \left(t_1 + t_2\right)\right)\right)\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+188}:\\ \;\;\;\;y \cdot i + \left(a + \left(\left(b + -0.5\right) \cdot \log c + \left(z + t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t + \left(z + \left(t_2 + \left(y \cdot i + t_1\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* x (log y))) (t_2 (* -0.5 (log c))))
   (if (<= x -3.2e+176)
     (+ a (+ t (+ z (+ t_1 t_2))))
     (if (<= x 2.6e+188)
       (+ (* y i) (+ a (+ (* (+ b -0.5) (log c)) (+ z t))))
       (+ t (+ z (+ t_2 (+ (* y i) t_1))))))))
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 = -0.5 * log(c);
	double tmp;
	if (x <= -3.2e+176) {
		tmp = a + (t + (z + (t_1 + t_2)));
	} else if (x <= 2.6e+188) {
		tmp = (y * i) + (a + (((b + -0.5) * log(c)) + (z + t)));
	} else {
		tmp = t + (z + (t_2 + ((y * i) + t_1)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = (-0.5d0) * log(c)
    if (x <= (-3.2d+176)) then
        tmp = a + (t + (z + (t_1 + t_2)))
    else if (x <= 2.6d+188) then
        tmp = (y * i) + (a + (((b + (-0.5d0)) * log(c)) + (z + t)))
    else
        tmp = t + (z + (t_2 + ((y * i) + t_1)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = x * Math.log(y);
	double t_2 = -0.5 * Math.log(c);
	double tmp;
	if (x <= -3.2e+176) {
		tmp = a + (t + (z + (t_1 + t_2)));
	} else if (x <= 2.6e+188) {
		tmp = (y * i) + (a + (((b + -0.5) * Math.log(c)) + (z + t)));
	} else {
		tmp = t + (z + (t_2 + ((y * i) + t_1)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = x * math.log(y)
	t_2 = -0.5 * math.log(c)
	tmp = 0
	if x <= -3.2e+176:
		tmp = a + (t + (z + (t_1 + t_2)))
	elif x <= 2.6e+188:
		tmp = (y * i) + (a + (((b + -0.5) * math.log(c)) + (z + t)))
	else:
		tmp = t + (z + (t_2 + ((y * i) + t_1)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(x * log(y))
	t_2 = Float64(-0.5 * log(c))
	tmp = 0.0
	if (x <= -3.2e+176)
		tmp = Float64(a + Float64(t + Float64(z + Float64(t_1 + t_2))));
	elseif (x <= 2.6e+188)
		tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(Float64(b + -0.5) * log(c)) + Float64(z + t))));
	else
		tmp = Float64(t + Float64(z + Float64(t_2 + Float64(Float64(y * i) + t_1))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = x * log(y);
	t_2 = -0.5 * log(c);
	tmp = 0.0;
	if (x <= -3.2e+176)
		tmp = a + (t + (z + (t_1 + t_2)));
	elseif (x <= 2.6e+188)
		tmp = (y * i) + (a + (((b + -0.5) * log(c)) + (z + t)));
	else
		tmp = t + (z + (t_2 + ((y * i) + t_1)));
	end
	tmp_2 = tmp;
end
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[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+176], N[(a + N[(t + N[(z + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e+188], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(z + N[(t$95$2 + N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := -0.5 \cdot \log c\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+176}:\\
\;\;\;\;a + \left(t + \left(z + \left(t_1 + t_2\right)\right)\right)\\

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

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


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

    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) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

    if -3.1999999999999998e176 < x < 2.59999999999999987e188

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if 2.59999999999999987e188 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.8% accurate, 1.0× speedup?

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

\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)
\end{array}
Derivation
  1. Initial program 99.8%

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

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

Alternative 5: 90.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.2 \cdot 10^{+178} \lor \neg \left(x \leq 6.2 \cdot 10^{+204}\right):\\ \;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + -0.5 \cdot \log c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(\left(b + -0.5\right) \cdot \log c + \left(z + t\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -3.2e+178) (not (<= x 6.2e+204)))
   (+ a (+ t (+ z (+ (* x (log y)) (* -0.5 (log c))))))
   (+ (* y i) (+ a (+ (* (+ b -0.5) (log c)) (+ z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -3.2e+178) || !(x <= 6.2e+204)) {
		tmp = a + (t + (z + ((x * log(y)) + (-0.5 * log(c)))));
	} else {
		tmp = (y * i) + (a + (((b + -0.5) * log(c)) + (z + t)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((x <= (-3.2d+178)) .or. (.not. (x <= 6.2d+204))) then
        tmp = a + (t + (z + ((x * log(y)) + ((-0.5d0) * log(c)))))
    else
        tmp = (y * i) + (a + (((b + (-0.5d0)) * log(c)) + (z + t)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -3.2e+178) || !(x <= 6.2e+204)) {
		tmp = a + (t + (z + ((x * Math.log(y)) + (-0.5 * Math.log(c)))));
	} else {
		tmp = (y * i) + (a + (((b + -0.5) * Math.log(c)) + (z + t)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -3.2e+178) or not (x <= 6.2e+204):
		tmp = a + (t + (z + ((x * math.log(y)) + (-0.5 * math.log(c)))))
	else:
		tmp = (y * i) + (a + (((b + -0.5) * math.log(c)) + (z + t)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -3.2e+178) || !(x <= 6.2e+204))
		tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(x * log(y)) + Float64(-0.5 * log(c))))));
	else
		tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(Float64(b + -0.5) * log(c)) + Float64(z + t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x <= -3.2e+178) || ~((x <= 6.2e+204)))
		tmp = a + (t + (z + ((x * log(y)) + (-0.5 * log(c)))));
	else
		tmp = (y * i) + (a + (((b + -0.5) * log(c)) + (z + t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -3.2e+178], N[Not[LessEqual[x, 6.2e+204]], $MachinePrecision]], N[(a + N[(t + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+178} \lor \neg \left(x \leq 6.2 \cdot 10^{+204}\right):\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + -0.5 \cdot \log c\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.2e178 or 6.2000000000000003e204 < 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) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

    if -3.2e178 < x < 6.2000000000000003e204

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

Alternative 6: 98.3% accurate, 1.0× speedup?

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

\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + b \cdot \log c\right)
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

Alternative 7: 50.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + y \cdot i\\ t_2 := t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{if}\;a \leq 4.2 \cdot 10^{-146}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-105}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+19}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{+93}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.08 \cdot 10^{+138}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* y i))) (t_2 (+ t (+ z (* (log c) (- b 0.5))))))
   (if (<= a 4.2e-146)
     t_2
     (if (<= a 8.5e-105)
       (+ z (* y i))
       (if (<= a 7e+19)
         t_2
         (if (<= a 8.5e+61)
           t_1
           (if (<= a 9.2e+93)
             t_2
             (if (<= a 1.08e+138)
               t_1
               (if (<= a 1.8e+148) t_2 (fma y i a))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (y * i);
	double t_2 = t + (z + (log(c) * (b - 0.5)));
	double tmp;
	if (a <= 4.2e-146) {
		tmp = t_2;
	} else if (a <= 8.5e-105) {
		tmp = z + (y * i);
	} else if (a <= 7e+19) {
		tmp = t_2;
	} else if (a <= 8.5e+61) {
		tmp = t_1;
	} else if (a <= 9.2e+93) {
		tmp = t_2;
	} else if (a <= 1.08e+138) {
		tmp = t_1;
	} else if (a <= 1.8e+148) {
		tmp = t_2;
	} else {
		tmp = fma(y, i, a);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(y * i))
	t_2 = Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5))))
	tmp = 0.0
	if (a <= 4.2e-146)
		tmp = t_2;
	elseif (a <= 8.5e-105)
		tmp = Float64(z + Float64(y * i));
	elseif (a <= 7e+19)
		tmp = t_2;
	elseif (a <= 8.5e+61)
		tmp = t_1;
	elseif (a <= 9.2e+93)
		tmp = t_2;
	elseif (a <= 1.08e+138)
		tmp = t_1;
	elseif (a <= 1.8e+148)
		tmp = t_2;
	else
		tmp = fma(y, i, a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 4.2e-146], t$95$2, If[LessEqual[a, 8.5e-105], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+19], t$95$2, If[LessEqual[a, 8.5e+61], t$95$1, If[LessEqual[a, 9.2e+93], t$95$2, If[LessEqual[a, 1.08e+138], t$95$1, If[LessEqual[a, 1.8e+148], t$95$2, N[(y * i + a), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a + y \cdot i\\
t_2 := t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{if}\;a \leq 4.2 \cdot 10^{-146}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 8.5 \cdot 10^{-105}:\\
\;\;\;\;z + y \cdot i\\

\mathbf{elif}\;a \leq 7 \cdot 10^{+19}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 8.5 \cdot 10^{+61}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 9.2 \cdot 10^{+93}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 1.08 \cdot 10^{+138}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 1.8 \cdot 10^{+148}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < 4.1999999999999998e-146 or 8.50000000000000038e-105 < a < 7e19 or 8.50000000000000035e61 < a < 9.2000000000000006e93 or 1.08000000000000007e138 < a < 1.80000000000000003e148

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.1999999999999998e-146 < a < 8.50000000000000038e-105

    1. Initial program 99.8%

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

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

    if 7e19 < a < 8.50000000000000035e61 or 9.2000000000000006e93 < a < 1.08000000000000007e138

    1. Initial program 99.8%

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

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

    if 1.80000000000000003e148 < a

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{a} + y \cdot i \]
    3. Taylor expanded in a around 0 65.6%

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

        \[\leadsto \color{blue}{i \cdot y + a} \]
      2. *-commutative65.6%

        \[\leadsto \color{blue}{y \cdot i} + a \]
      3. fma-udef65.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    5. Simplified65.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4.2 \cdot 10^{-146}:\\ \;\;\;\;t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-105}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+19}:\\ \;\;\;\;t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{+61}:\\ \;\;\;\;a + y \cdot i\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{+93}:\\ \;\;\;\;t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{elif}\;a \leq 1.08 \cdot 10^{+138}:\\ \;\;\;\;a + y \cdot i\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \]

Alternative 8: 86.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+181} \lor \neg \left(x \leq 7.5 \cdot 10^{+209}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(\left(b + -0.5\right) \cdot \log c + \left(z + t\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -4.5e+181) (not (<= x 7.5e+209)))
   (* x (log y))
   (+ (* y i) (+ a (+ (* (+ b -0.5) (log c)) (+ z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -4.5e+181) || !(x <= 7.5e+209)) {
		tmp = x * log(y);
	} else {
		tmp = (y * i) + (a + (((b + -0.5) * log(c)) + (z + t)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((x <= (-4.5d+181)) .or. (.not. (x <= 7.5d+209))) then
        tmp = x * log(y)
    else
        tmp = (y * i) + (a + (((b + (-0.5d0)) * log(c)) + (z + t)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -4.5e+181) || !(x <= 7.5e+209)) {
		tmp = x * Math.log(y);
	} else {
		tmp = (y * i) + (a + (((b + -0.5) * Math.log(c)) + (z + t)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -4.5e+181) or not (x <= 7.5e+209):
		tmp = x * math.log(y)
	else:
		tmp = (y * i) + (a + (((b + -0.5) * math.log(c)) + (z + t)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -4.5e+181) || !(x <= 7.5e+209))
		tmp = Float64(x * log(y));
	else
		tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(Float64(b + -0.5) * log(c)) + Float64(z + t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x <= -4.5e+181) || ~((x <= 7.5e+209)))
		tmp = x * log(y);
	else
		tmp = (y * i) + (a + (((b + -0.5) * log(c)) + (z + t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -4.5e+181], N[Not[LessEqual[x, 7.5e+209]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+181} \lor \neg \left(x \leq 7.5 \cdot 10^{+209}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.5e181 or 7.50000000000000055e209 < 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) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

    if -4.5e181 < x < 7.50000000000000055e209

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

Alternative 9: 72.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right)\\ \mathbf{if}\;a \leq 3.4 \cdot 10^{+123}:\\ \;\;\;\;t + \left(z + \left(y \cdot i + t_1\right)\right)\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{+169} \lor \neg \left(a \leq 2.05 \cdot 10^{+254}\right):\\ \;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (log c) (- b 0.5))))
   (if (<= a 3.4e+123)
     (+ t (+ z (+ (* y i) t_1)))
     (if (or (<= a 1.95e+169) (not (<= a 2.05e+254)))
       (+ a (+ t (+ z t_1)))
       (+ a (* y i))))))
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 (a <= 3.4e+123) {
		tmp = t + (z + ((y * i) + t_1));
	} else if ((a <= 1.95e+169) || !(a <= 2.05e+254)) {
		tmp = a + (t + (z + t_1));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
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 (a <= 3.4d+123) then
        tmp = t + (z + ((y * i) + t_1))
    else if ((a <= 1.95d+169) .or. (.not. (a <= 2.05d+254))) then
        tmp = a + (t + (z + t_1))
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
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 (a <= 3.4e+123) {
		tmp = t + (z + ((y * i) + t_1));
	} else if ((a <= 1.95e+169) || !(a <= 2.05e+254)) {
		tmp = a + (t + (z + t_1));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = math.log(c) * (b - 0.5)
	tmp = 0
	if a <= 3.4e+123:
		tmp = t + (z + ((y * i) + t_1))
	elif (a <= 1.95e+169) or not (a <= 2.05e+254):
		tmp = a + (t + (z + t_1))
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(c) * Float64(b - 0.5))
	tmp = 0.0
	if (a <= 3.4e+123)
		tmp = Float64(t + Float64(z + Float64(Float64(y * i) + t_1)));
	elseif ((a <= 1.95e+169) || !(a <= 2.05e+254))
		tmp = Float64(a + Float64(t + Float64(z + t_1)));
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = log(c) * (b - 0.5);
	tmp = 0.0;
	if (a <= 3.4e+123)
		tmp = t + (z + ((y * i) + t_1));
	elseif ((a <= 1.95e+169) || ~((a <= 2.05e+254)))
		tmp = a + (t + (z + t_1));
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
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[a, 3.4e+123], N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 1.95e+169], N[Not[LessEqual[a, 2.05e+254]], $MachinePrecision]], N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;a \leq 3.4 \cdot 10^{+123}:\\
\;\;\;\;t + \left(z + \left(y \cdot i + t_1\right)\right)\\

\mathbf{elif}\;a \leq 1.95 \cdot 10^{+169} \lor \neg \left(a \leq 2.05 \cdot 10^{+254}\right):\\
\;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 3.40000000000000001e123

    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 \color{blue}{\left(a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\right)} + y \cdot i \]
    3. Step-by-step derivation
      1. +-commutative84.9%

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

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

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

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

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

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

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

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

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

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

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

    if 3.40000000000000001e123 < a < 1.94999999999999991e169 or 2.04999999999999993e254 < 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 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.94999999999999991e169 < a < 2.04999999999999993e254

    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 a around inf 67.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 3.4 \cdot 10^{+123}:\\ \;\;\;\;t + \left(z + \left(y \cdot i + \log c \cdot \left(b - 0.5\right)\right)\right)\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{+169} \lor \neg \left(a \leq 2.05 \cdot 10^{+254}\right):\\ \;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 10: 66.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right)\\ \mathbf{if}\;i \leq -1.6 \cdot 10^{+195}:\\ \;\;\;\;y \cdot i + t_1\\ \mathbf{elif}\;i \leq 2.1 \cdot 10^{+207}:\\ \;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (log c) (- b 0.5))))
   (if (<= i -1.6e+195)
     (+ (* y i) t_1)
     (if (<= i 2.1e+207) (+ a (+ t (+ z t_1))) (+ a (* y i))))))
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 (i <= -1.6e+195) {
		tmp = (y * i) + t_1;
	} else if (i <= 2.1e+207) {
		tmp = a + (t + (z + t_1));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
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 (i <= (-1.6d+195)) then
        tmp = (y * i) + t_1
    else if (i <= 2.1d+207) then
        tmp = a + (t + (z + t_1))
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
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 (i <= -1.6e+195) {
		tmp = (y * i) + t_1;
	} else if (i <= 2.1e+207) {
		tmp = a + (t + (z + t_1));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = math.log(c) * (b - 0.5)
	tmp = 0
	if i <= -1.6e+195:
		tmp = (y * i) + t_1
	elif i <= 2.1e+207:
		tmp = a + (t + (z + t_1))
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(c) * Float64(b - 0.5))
	tmp = 0.0
	if (i <= -1.6e+195)
		tmp = Float64(Float64(y * i) + t_1);
	elseif (i <= 2.1e+207)
		tmp = Float64(a + Float64(t + Float64(z + t_1)));
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = log(c) * (b - 0.5);
	tmp = 0.0;
	if (i <= -1.6e+195)
		tmp = (y * i) + t_1;
	elseif (i <= 2.1e+207)
		tmp = a + (t + (z + t_1));
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
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[i, -1.6e+195], N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[i, 2.1e+207], N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;i \leq -1.6 \cdot 10^{+195}:\\
\;\;\;\;y \cdot i + t_1\\

\mathbf{elif}\;i \leq 2.1 \cdot 10^{+207}:\\
\;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -1.59999999999999991e195

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.59999999999999991e195 < i < 2.0999999999999999e207

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0999999999999999e207 < i

    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 a around inf 71.3%

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

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

Alternative 11: 67.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right)\\ \mathbf{if}\;i \leq -9.6 \cdot 10^{+194}:\\ \;\;\;\;t + \left(y \cdot i + t_1\right)\\ \mathbf{elif}\;i \leq 1.7 \cdot 10^{+207}:\\ \;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (log c) (- b 0.5))))
   (if (<= i -9.6e+194)
     (+ t (+ (* y i) t_1))
     (if (<= i 1.7e+207) (+ a (+ t (+ z t_1))) (+ a (* y i))))))
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 (i <= -9.6e+194) {
		tmp = t + ((y * i) + t_1);
	} else if (i <= 1.7e+207) {
		tmp = a + (t + (z + t_1));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
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 (i <= (-9.6d+194)) then
        tmp = t + ((y * i) + t_1)
    else if (i <= 1.7d+207) then
        tmp = a + (t + (z + t_1))
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
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 (i <= -9.6e+194) {
		tmp = t + ((y * i) + t_1);
	} else if (i <= 1.7e+207) {
		tmp = a + (t + (z + t_1));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = math.log(c) * (b - 0.5)
	tmp = 0
	if i <= -9.6e+194:
		tmp = t + ((y * i) + t_1)
	elif i <= 1.7e+207:
		tmp = a + (t + (z + t_1))
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(c) * Float64(b - 0.5))
	tmp = 0.0
	if (i <= -9.6e+194)
		tmp = Float64(t + Float64(Float64(y * i) + t_1));
	elseif (i <= 1.7e+207)
		tmp = Float64(a + Float64(t + Float64(z + t_1)));
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = log(c) * (b - 0.5);
	tmp = 0.0;
	if (i <= -9.6e+194)
		tmp = t + ((y * i) + t_1);
	elseif (i <= 1.7e+207)
		tmp = a + (t + (z + t_1));
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
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[i, -9.6e+194], N[(t + N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.7e+207], N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;i \leq -9.6 \cdot 10^{+194}:\\
\;\;\;\;t + \left(y \cdot i + t_1\right)\\

\mathbf{elif}\;i \leq 1.7 \cdot 10^{+207}:\\
\;\;\;\;a + \left(t + \left(z + t_1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -9.6e194

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.6e194 < i < 1.6999999999999999e207

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6999999999999999e207 < i

    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 a around inf 71.3%

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

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

Alternative 12: 74.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot \left(b - 0.5\right)\\ \mathbf{if}\;a \leq 7.5 \cdot 10^{+79}:\\ \;\;\;\;t + \left(z + \left(y \cdot i + t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(a + t\right) + t_1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (log c) (- b 0.5))))
   (if (<= a 7.5e+79)
     (+ t (+ z (+ (* y i) t_1)))
     (+ (* y i) (+ (+ a t) t_1)))))
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 (a <= 7.5e+79) {
		tmp = t + (z + ((y * i) + t_1));
	} else {
		tmp = (y * i) + ((a + t) + t_1);
	}
	return tmp;
}
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 (a <= 7.5d+79) then
        tmp = t + (z + ((y * i) + t_1))
    else
        tmp = (y * i) + ((a + t) + t_1)
    end if
    code = tmp
end function
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 (a <= 7.5e+79) {
		tmp = t + (z + ((y * i) + t_1));
	} else {
		tmp = (y * i) + ((a + t) + t_1);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = math.log(c) * (b - 0.5)
	tmp = 0
	if a <= 7.5e+79:
		tmp = t + (z + ((y * i) + t_1))
	else:
		tmp = (y * i) + ((a + t) + t_1)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(c) * Float64(b - 0.5))
	tmp = 0.0
	if (a <= 7.5e+79)
		tmp = Float64(t + Float64(z + Float64(Float64(y * i) + t_1)));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(a + t) + t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = log(c) * (b - 0.5);
	tmp = 0.0;
	if (a <= 7.5e+79)
		tmp = t + (z + ((y * i) + t_1));
	else
		tmp = (y * i) + ((a + t) + t_1);
	end
	tmp_2 = tmp;
end
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[a, 7.5e+79], N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(a + t), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;a \leq 7.5 \cdot 10^{+79}:\\
\;\;\;\;t + \left(z + \left(y \cdot i + t_1\right)\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999967e79 < 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 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 41.9% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z + y \cdot i\\ \mathbf{if}\;a \leq 1.65 \cdot 10^{-273}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-219}:\\ \;\;\;\;b \cdot \log c\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{+79}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ z (* y i))))
   (if (<= a 1.65e-273)
     t_1
     (if (<= a 8.5e-219)
       (* b (log c))
       (if (<= a 3.8e-182)
         t_1
         (if (<= a 3.6e-147)
           (* x (log y))
           (if (<= a 2.7e+79) t_1 (fma y i a))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = z + (y * i);
	double tmp;
	if (a <= 1.65e-273) {
		tmp = t_1;
	} else if (a <= 8.5e-219) {
		tmp = b * log(c);
	} else if (a <= 3.8e-182) {
		tmp = t_1;
	} else if (a <= 3.6e-147) {
		tmp = x * log(y);
	} else if (a <= 2.7e+79) {
		tmp = t_1;
	} else {
		tmp = fma(y, i, a);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(z + Float64(y * i))
	tmp = 0.0
	if (a <= 1.65e-273)
		tmp = t_1;
	elseif (a <= 8.5e-219)
		tmp = Float64(b * log(c));
	elseif (a <= 3.8e-182)
		tmp = t_1;
	elseif (a <= 3.6e-147)
		tmp = Float64(x * log(y));
	elseif (a <= 2.7e+79)
		tmp = t_1;
	else
		tmp = fma(y, i, a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 1.65e-273], t$95$1, If[LessEqual[a, 8.5e-219], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.8e-182], t$95$1, If[LessEqual[a, 3.6e-147], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e+79], t$95$1, N[(y * i + a), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z + y \cdot i\\
\mathbf{if}\;a \leq 1.65 \cdot 10^{-273}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 8.5 \cdot 10^{-219}:\\
\;\;\;\;b \cdot \log c\\

\mathbf{elif}\;a \leq 3.8 \cdot 10^{-182}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 3.6 \cdot 10^{-147}:\\
\;\;\;\;x \cdot \log y\\

\mathbf{elif}\;a \leq 2.7 \cdot 10^{+79}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < 1.64999999999999995e-273 or 8.49999999999999964e-219 < a < 3.8000000000000003e-182 or 3.60000000000000012e-147 < a < 2.7e79

    1. Initial program 99.8%

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

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

    if 1.64999999999999995e-273 < a < 8.49999999999999964e-219

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \log c} \]
    6. Step-by-step derivation
      1. *-commutative27.9%

        \[\leadsto \color{blue}{\log c \cdot b} \]
    7. Simplified27.9%

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

    if 3.8000000000000003e-182 < a < 3.60000000000000012e-147

    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) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

    if 2.7e79 < 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 a around inf 58.4%

      \[\leadsto \color{blue}{a} + y \cdot i \]
    3. Taylor expanded in a around 0 58.4%

      \[\leadsto \color{blue}{a + i \cdot y} \]
    4. Step-by-step derivation
      1. +-commutative58.4%

        \[\leadsto \color{blue}{i \cdot y + a} \]
      2. *-commutative58.4%

        \[\leadsto \color{blue}{y \cdot i} + a \]
      3. fma-udef58.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    5. Simplified58.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.65 \cdot 10^{-273}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-219}:\\ \;\;\;\;b \cdot \log c\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-182}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;a \leq 2.7 \cdot 10^{+79}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \]

Alternative 14: 42.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z + y \cdot i\\ \mathbf{if}\;a \leq 1.25 \cdot 10^{-273}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-221}:\\ \;\;\;\;t + \log c \cdot \left(b - 0.5\right)\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-146}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+79}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ z (* y i))))
   (if (<= a 1.25e-273)
     t_1
     (if (<= a 1.7e-221)
       (+ t (* (log c) (- b 0.5)))
       (if (<= a 3.8e-182)
         t_1
         (if (<= a 4.5e-146)
           (* x (log y))
           (if (<= a 4.5e+79) t_1 (fma y i a))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = z + (y * i);
	double tmp;
	if (a <= 1.25e-273) {
		tmp = t_1;
	} else if (a <= 1.7e-221) {
		tmp = t + (log(c) * (b - 0.5));
	} else if (a <= 3.8e-182) {
		tmp = t_1;
	} else if (a <= 4.5e-146) {
		tmp = x * log(y);
	} else if (a <= 4.5e+79) {
		tmp = t_1;
	} else {
		tmp = fma(y, i, a);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(z + Float64(y * i))
	tmp = 0.0
	if (a <= 1.25e-273)
		tmp = t_1;
	elseif (a <= 1.7e-221)
		tmp = Float64(t + Float64(log(c) * Float64(b - 0.5)));
	elseif (a <= 3.8e-182)
		tmp = t_1;
	elseif (a <= 4.5e-146)
		tmp = Float64(x * log(y));
	elseif (a <= 4.5e+79)
		tmp = t_1;
	else
		tmp = fma(y, i, a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 1.25e-273], t$95$1, If[LessEqual[a, 1.7e-221], N[(t + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.8e-182], t$95$1, If[LessEqual[a, 4.5e-146], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.5e+79], t$95$1, N[(y * i + a), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z + y \cdot i\\
\mathbf{if}\;a \leq 1.25 \cdot 10^{-273}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 3.8 \cdot 10^{-182}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{-146}:\\
\;\;\;\;x \cdot \log y\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{+79}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < 1.24999999999999991e-273 or 1.7000000000000001e-221 < a < 3.8000000000000003e-182 or 4.5000000000000001e-146 < a < 4.49999999999999994e79

    1. Initial program 99.8%

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

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

    if 1.24999999999999991e-273 < a < 1.7000000000000001e-221

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8000000000000003e-182 < a < 4.5000000000000001e-146

    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) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

    if 4.49999999999999994e79 < 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 a around inf 58.4%

      \[\leadsto \color{blue}{a} + y \cdot i \]
    3. Taylor expanded in a around 0 58.4%

      \[\leadsto \color{blue}{a + i \cdot y} \]
    4. Step-by-step derivation
      1. +-commutative58.4%

        \[\leadsto \color{blue}{i \cdot y + a} \]
      2. *-commutative58.4%

        \[\leadsto \color{blue}{y \cdot i} + a \]
      3. fma-udef58.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    5. Simplified58.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.25 \cdot 10^{-273}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-221}:\\ \;\;\;\;t + \log c \cdot \left(b - 0.5\right)\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-182}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-146}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+79}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, a\right)\\ \end{array} \]

Alternative 15: 42.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z + y \cdot i\\ \mathbf{if}\;a \leq 8 \cdot 10^{-275}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-222}:\\ \;\;\;\;b \cdot \log c\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{+79}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ z (* y i))))
   (if (<= a 8e-275)
     t_1
     (if (<= a 6e-222)
       (* b (log c))
       (if (<= a 2.6e-182)
         t_1
         (if (<= a 3.6e-147)
           (* x (log y))
           (if (<= a 7.5e+79) t_1 (+ a (* y i)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = z + (y * i);
	double tmp;
	if (a <= 8e-275) {
		tmp = t_1;
	} else if (a <= 6e-222) {
		tmp = b * log(c);
	} else if (a <= 2.6e-182) {
		tmp = t_1;
	} else if (a <= 3.6e-147) {
		tmp = x * log(y);
	} else if (a <= 7.5e+79) {
		tmp = t_1;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
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 = z + (y * i)
    if (a <= 8d-275) then
        tmp = t_1
    else if (a <= 6d-222) then
        tmp = b * log(c)
    else if (a <= 2.6d-182) then
        tmp = t_1
    else if (a <= 3.6d-147) then
        tmp = x * log(y)
    else if (a <= 7.5d+79) then
        tmp = t_1
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = z + (y * i);
	double tmp;
	if (a <= 8e-275) {
		tmp = t_1;
	} else if (a <= 6e-222) {
		tmp = b * Math.log(c);
	} else if (a <= 2.6e-182) {
		tmp = t_1;
	} else if (a <= 3.6e-147) {
		tmp = x * Math.log(y);
	} else if (a <= 7.5e+79) {
		tmp = t_1;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = z + (y * i)
	tmp = 0
	if a <= 8e-275:
		tmp = t_1
	elif a <= 6e-222:
		tmp = b * math.log(c)
	elif a <= 2.6e-182:
		tmp = t_1
	elif a <= 3.6e-147:
		tmp = x * math.log(y)
	elif a <= 7.5e+79:
		tmp = t_1
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(z + Float64(y * i))
	tmp = 0.0
	if (a <= 8e-275)
		tmp = t_1;
	elseif (a <= 6e-222)
		tmp = Float64(b * log(c));
	elseif (a <= 2.6e-182)
		tmp = t_1;
	elseif (a <= 3.6e-147)
		tmp = Float64(x * log(y));
	elseif (a <= 7.5e+79)
		tmp = t_1;
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = z + (y * i);
	tmp = 0.0;
	if (a <= 8e-275)
		tmp = t_1;
	elseif (a <= 6e-222)
		tmp = b * log(c);
	elseif (a <= 2.6e-182)
		tmp = t_1;
	elseif (a <= 3.6e-147)
		tmp = x * log(y);
	elseif (a <= 7.5e+79)
		tmp = t_1;
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 8e-275], t$95$1, If[LessEqual[a, 6e-222], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.6e-182], t$95$1, If[LessEqual[a, 3.6e-147], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e+79], t$95$1, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z + y \cdot i\\
\mathbf{if}\;a \leq 8 \cdot 10^{-275}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 6 \cdot 10^{-222}:\\
\;\;\;\;b \cdot \log c\\

\mathbf{elif}\;a \leq 2.6 \cdot 10^{-182}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 3.6 \cdot 10^{-147}:\\
\;\;\;\;x \cdot \log y\\

\mathbf{elif}\;a \leq 7.5 \cdot 10^{+79}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < 7.99999999999999947e-275 or 6.00000000000000059e-222 < a < 2.60000000000000006e-182 or 3.60000000000000012e-147 < a < 7.49999999999999967e79

    1. Initial program 99.8%

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

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

    if 7.99999999999999947e-275 < a < 6.00000000000000059e-222

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \log c} \]
    6. Step-by-step derivation
      1. *-commutative27.9%

        \[\leadsto \color{blue}{\log c \cdot b} \]
    7. Simplified27.9%

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

    if 2.60000000000000006e-182 < a < 3.60000000000000012e-147

    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) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999967e79 < 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 a around inf 58.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 8 \cdot 10^{-275}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-222}:\\ \;\;\;\;b \cdot \log c\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-182}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{+79}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 16: 42.8% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z + y \cdot i\\ \mathbf{if}\;a \leq 1.9 \cdot 10^{-183}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{-146}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+79}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ z (* y i))))
   (if (<= a 1.9e-183)
     t_1
     (if (<= a 1.3e-146)
       (* x (log y))
       (if (<= a 1.05e+79) t_1 (+ a (* y i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = z + (y * i);
	double tmp;
	if (a <= 1.9e-183) {
		tmp = t_1;
	} else if (a <= 1.3e-146) {
		tmp = x * log(y);
	} else if (a <= 1.05e+79) {
		tmp = t_1;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
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 = z + (y * i)
    if (a <= 1.9d-183) then
        tmp = t_1
    else if (a <= 1.3d-146) then
        tmp = x * log(y)
    else if (a <= 1.05d+79) then
        tmp = t_1
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = z + (y * i);
	double tmp;
	if (a <= 1.9e-183) {
		tmp = t_1;
	} else if (a <= 1.3e-146) {
		tmp = x * Math.log(y);
	} else if (a <= 1.05e+79) {
		tmp = t_1;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = z + (y * i)
	tmp = 0
	if a <= 1.9e-183:
		tmp = t_1
	elif a <= 1.3e-146:
		tmp = x * math.log(y)
	elif a <= 1.05e+79:
		tmp = t_1
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(z + Float64(y * i))
	tmp = 0.0
	if (a <= 1.9e-183)
		tmp = t_1;
	elseif (a <= 1.3e-146)
		tmp = Float64(x * log(y));
	elseif (a <= 1.05e+79)
		tmp = t_1;
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = z + (y * i);
	tmp = 0.0;
	if (a <= 1.9e-183)
		tmp = t_1;
	elseif (a <= 1.3e-146)
		tmp = x * log(y);
	elseif (a <= 1.05e+79)
		tmp = t_1;
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 1.9e-183], t$95$1, If[LessEqual[a, 1.3e-146], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e+79], t$95$1, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z + y \cdot i\\
\mathbf{if}\;a \leq 1.9 \cdot 10^{-183}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 1.3 \cdot 10^{-146}:\\
\;\;\;\;x \cdot \log y\\

\mathbf{elif}\;a \leq 1.05 \cdot 10^{+79}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 1.8999999999999998e-183 or 1.29999999999999993e-146 < a < 1.05000000000000004e79

    1. Initial program 99.8%

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

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

    if 1.8999999999999998e-183 < a < 1.29999999999999993e-146

    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) + a\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)} \]
      2. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

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

    if 1.05000000000000004e79 < 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 a around inf 58.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.9 \cdot 10^{-183}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{-146}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+79}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 17: 22.7% accurate, 19.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.6 \cdot 10^{-207}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-138}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;a \leq 1.36 \cdot 10^{-34}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{+123}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= a 1.6e-207)
   z
   (if (<= a 1.4e-138)
     (* y i)
     (if (<= a 1.36e-34) z (if (<= a 1.6e+123) (* y i) a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 1.6e-207) {
		tmp = z;
	} else if (a <= 1.4e-138) {
		tmp = y * i;
	} else if (a <= 1.36e-34) {
		tmp = z;
	} else if (a <= 1.6e+123) {
		tmp = y * i;
	} else {
		tmp = a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (a <= 1.6d-207) then
        tmp = z
    else if (a <= 1.4d-138) then
        tmp = y * i
    else if (a <= 1.36d-34) then
        tmp = z
    else if (a <= 1.6d+123) then
        tmp = y * i
    else
        tmp = a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 1.6e-207) {
		tmp = z;
	} else if (a <= 1.4e-138) {
		tmp = y * i;
	} else if (a <= 1.36e-34) {
		tmp = z;
	} else if (a <= 1.6e+123) {
		tmp = y * i;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if a <= 1.6e-207:
		tmp = z
	elif a <= 1.4e-138:
		tmp = y * i
	elif a <= 1.36e-34:
		tmp = z
	elif a <= 1.6e+123:
		tmp = y * i
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (a <= 1.6e-207)
		tmp = z;
	elseif (a <= 1.4e-138)
		tmp = Float64(y * i);
	elseif (a <= 1.36e-34)
		tmp = z;
	elseif (a <= 1.6e+123)
		tmp = Float64(y * i);
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (a <= 1.6e-207)
		tmp = z;
	elseif (a <= 1.4e-138)
		tmp = y * i;
	elseif (a <= 1.36e-34)
		tmp = z;
	elseif (a <= 1.6e+123)
		tmp = y * i;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.6e-207], z, If[LessEqual[a, 1.4e-138], N[(y * i), $MachinePrecision], If[LessEqual[a, 1.36e-34], z, If[LessEqual[a, 1.6e+123], N[(y * i), $MachinePrecision], a]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.6 \cdot 10^{-207}:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 1.4 \cdot 10^{-138}:\\
\;\;\;\;y \cdot i\\

\mathbf{elif}\;a \leq 1.36 \cdot 10^{-34}:\\
\;\;\;\;z\\

\mathbf{elif}\;a \leq 1.6 \cdot 10^{+123}:\\
\;\;\;\;y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 1.6000000000000002e-207 or 1.4e-138 < a < 1.3600000000000001e-34

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6000000000000002e-207 < a < 1.4e-138 or 1.3600000000000001e-34 < a < 1.60000000000000002e123

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.60000000000000002e123 < 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 89.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.6 \cdot 10^{-207}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-138}:\\ \;\;\;\;y \cdot i\\ \mathbf{elif}\;a \leq 1.36 \cdot 10^{-34}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{+123}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 18: 42.5% accurate, 31.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+196}:\\ \;\;\;\;z + t\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -9.5e+196) (+ z t) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -9.5e+196) {
		tmp = z + t;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
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 <= (-9.5d+196)) then
        tmp = z + t
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -9.5e+196) {
		tmp = z + t;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -9.5e+196:
		tmp = z + t
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -9.5e+196)
		tmp = Float64(z + t);
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -9.5e+196)
		tmp = z + t;
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -9.5e+196], N[(z + t), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+196}:\\
\;\;\;\;z + t\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.5000000000000004e196 < 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 a around inf 37.5%

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

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

Alternative 19: 43.7% accurate, 31.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 7.5 \cdot 10^{+79}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= a 7.5e+79) (+ z (* y i)) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 7.5e+79) {
		tmp = z + (y * i);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
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 <= 7.5d+79) then
        tmp = z + (y * i)
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 7.5e+79) {
		tmp = z + (y * i);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if a <= 7.5e+79:
		tmp = z + (y * i)
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (a <= 7.5e+79)
		tmp = Float64(z + Float64(y * i));
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (a <= 7.5e+79)
		tmp = z + (y * i);
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 7.5e+79], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.5 \cdot 10^{+79}:\\
\;\;\;\;z + y \cdot i\\

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


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

    1. Initial program 99.8%

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

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

    if 7.49999999999999967e79 < 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 a around inf 58.4%

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

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

Alternative 20: 21.2% accurate, 71.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 4.5 \cdot 10^{+79}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 4.5e+79) z a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 4.5e+79) {
		tmp = z;
	} else {
		tmp = a;
	}
	return tmp;
}
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 <= 4.5d+79) then
        tmp = z
    else
        tmp = a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 4.5e+79) {
		tmp = z;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if a <= 4.5e+79:
		tmp = z
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (a <= 4.5e+79)
		tmp = z;
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (a <= 4.5e+79)
		tmp = z;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 4.5e+79], z, a]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.5 \cdot 10^{+79}:\\
\;\;\;\;z\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.49999999999999994e79 < 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 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 16.5% accurate, 219.0× speedup?

\[\begin{array}{l} \\ a \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
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
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
def code(x, y, z, t, a, b, c, i):
	return a
function code(x, y, z, t, a, b, c, i)
	return a
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = a;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}

\\
a
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto a \]

Reproduce

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