Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.6%
Time: 21.9s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
	return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
    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
    code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a):
	return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a)
	return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t)))
end
function tmp = code(x, y, z, t, a)
	tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\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 15 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.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
	return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
    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
    code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a):
	return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a)
	return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t)))
end
function tmp = code(x, y, z, t, a)
	tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \log t \cdot \left(a - 0.5\right) \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (+ (- (+ (log (+ x y)) (log z)) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
	return ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5));
}
real(8) function code(x, y, z, t, a)
    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
    code = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((Math.log((x + y)) + Math.log(z)) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a):
	return ((math.log((x + y)) + math.log(z)) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a)
	return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(log(t) * Float64(a - 0.5)))
end
function tmp = code(x, y, z, t, a)
	tmp = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5));
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Add Preprocessing
  3. Final simplification99.6%

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

Alternative 2: 66.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log t \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t \leq 3.9 \cdot 10^{-7}:\\ \;\;\;\;\left(\log z + \log y\right) + t_1\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{+175}:\\ \;\;\;\;\left(\log \left(y \cdot z\right) + t_1\right) - t\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (log t) (- a 0.5))))
   (if (<= t 3.9e-7)
     (+ (+ (log z) (log y)) t_1)
     (if (<= t 9.2e+175) (- (+ (log (* y z)) t_1) t) (- t)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = log(t) * (a - 0.5);
	double tmp;
	if (t <= 3.9e-7) {
		tmp = (log(z) + log(y)) + t_1;
	} else if (t <= 9.2e+175) {
		tmp = (log((y * z)) + t_1) - t;
	} else {
		tmp = -t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_1
    real(8) :: tmp
    t_1 = log(t) * (a - 0.5d0)
    if (t <= 3.9d-7) then
        tmp = (log(z) + log(y)) + t_1
    else if (t <= 9.2d+175) then
        tmp = (log((y * z)) + t_1) - t
    else
        tmp = -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = Math.log(t) * (a - 0.5);
	double tmp;
	if (t <= 3.9e-7) {
		tmp = (Math.log(z) + Math.log(y)) + t_1;
	} else if (t <= 9.2e+175) {
		tmp = (Math.log((y * z)) + t_1) - t;
	} else {
		tmp = -t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = math.log(t) * (a - 0.5)
	tmp = 0
	if t <= 3.9e-7:
		tmp = (math.log(z) + math.log(y)) + t_1
	elif t <= 9.2e+175:
		tmp = (math.log((y * z)) + t_1) - t
	else:
		tmp = -t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(log(t) * Float64(a - 0.5))
	tmp = 0.0
	if (t <= 3.9e-7)
		tmp = Float64(Float64(log(z) + log(y)) + t_1);
	elseif (t <= 9.2e+175)
		tmp = Float64(Float64(log(Float64(y * z)) + t_1) - t);
	else
		tmp = Float64(-t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = log(t) * (a - 0.5);
	tmp = 0.0;
	if (t <= 3.9e-7)
		tmp = (log(z) + log(y)) + t_1;
	elseif (t <= 9.2e+175)
		tmp = (log((y * z)) + t_1) - t;
	else
		tmp = -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 3.9e-7], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 9.2e+175], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], (-t)]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 9.2 \cdot 10^{+175}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + t_1\right) - t\\

\mathbf{else}:\\
\;\;\;\;-t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 3.90000000000000025e-7

    1. Initial program 99.4%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.3%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.3%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.3%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.3%

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

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

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

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

    if 3.90000000000000025e-7 < t < 9.1999999999999998e175

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.8%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.8%

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

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

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

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

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-+r-99.8%

        \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right) - \mathsf{fma}\left(\log t, 0.5 - a, t\right)} \]
      2. fma-udef99.8%

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

        \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - \log t \cdot \left(0.5 - a\right)\right) - t} \]
      4. sum-log78.2%

        \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - \log t \cdot \left(0.5 - a\right)\right) - t \]
    6. Applied egg-rr78.2%

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

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

    if 9.1999999999999998e175 < t

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg100.0%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in100.0%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. neg-mul-192.1%

        \[\leadsto \color{blue}{-t} \]
    7. Simplified92.1%

      \[\leadsto \color{blue}{-t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 3.9 \cdot 10^{-7}:\\ \;\;\;\;\left(\log z + \log y\right) + \log t \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{+175}:\\ \;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 68.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\log z + \log y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right) \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (+ (+ (log z) (log y)) (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
	return (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t);
}
real(8) function code(x, y, z, t, a)
    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
    code = (log(z) + log(y)) + ((log(t) * (a - 0.5d0)) - t)
end function
public static double code(double x, double y, double z, double t, double a) {
	return (Math.log(z) + Math.log(y)) + ((Math.log(t) * (a - 0.5)) - t);
}
def code(x, y, z, t, a):
	return (math.log(z) + math.log(y)) + ((math.log(t) * (a - 0.5)) - t)
function code(x, y, z, t, a)
	return Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t))
end
function tmp = code(x, y, z, t, a)
	tmp = (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t);
end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
    3. sub-neg99.6%

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

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

      \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
    6. distribute-rgt-neg-in99.6%

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

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

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

      \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
    10. distribute-neg-in99.6%

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

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

      \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
    13. unsub-neg99.6%

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

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

    \[\leadsto \color{blue}{\left(\log y + \log z\right) - \left(t + \log t \cdot \left(0.5 - a\right)\right)} \]
  6. Final simplification70.6%

    \[\leadsto \left(\log z + \log y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right) \]
  7. Add Preprocessing

Alternative 4: 60.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log \left(y \cdot z\right)\\ t_2 := a \cdot \log t\\ t_3 := \left(t_2 + t_1\right) - t\\ \mathbf{if}\;a \leq -6.6 \cdot 10^{+68}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -76000000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq -3.2 \cdot 10^{-76}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-22}:\\ \;\;\;\;t_1 - \left(t + 0.5 \cdot \log t\right)\\ \mathbf{elif}\;a \leq 1.14 \cdot 10^{+179}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (log (* y z))) (t_2 (* a (log t))) (t_3 (- (+ t_2 t_1) t)))
   (if (<= a -6.6e+68)
     t_2
     (if (<= a -76000000000.0)
       t_3
       (if (<= a -3.2e-76)
         (- (+ (log z) (log y)) t)
         (if (<= a 1.55e-22)
           (- t_1 (+ t (* 0.5 (log t))))
           (if (<= a 1.14e+179) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = log((y * z));
	double t_2 = a * log(t);
	double t_3 = (t_2 + t_1) - t;
	double tmp;
	if (a <= -6.6e+68) {
		tmp = t_2;
	} else if (a <= -76000000000.0) {
		tmp = t_3;
	} else if (a <= -3.2e-76) {
		tmp = (log(z) + log(y)) - t;
	} else if (a <= 1.55e-22) {
		tmp = t_1 - (t + (0.5 * log(t)));
	} else if (a <= 1.14e+179) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = log((y * z))
    t_2 = a * log(t)
    t_3 = (t_2 + t_1) - t
    if (a <= (-6.6d+68)) then
        tmp = t_2
    else if (a <= (-76000000000.0d0)) then
        tmp = t_3
    else if (a <= (-3.2d-76)) then
        tmp = (log(z) + log(y)) - t
    else if (a <= 1.55d-22) then
        tmp = t_1 - (t + (0.5d0 * log(t)))
    else if (a <= 1.14d+179) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = Math.log((y * z));
	double t_2 = a * Math.log(t);
	double t_3 = (t_2 + t_1) - t;
	double tmp;
	if (a <= -6.6e+68) {
		tmp = t_2;
	} else if (a <= -76000000000.0) {
		tmp = t_3;
	} else if (a <= -3.2e-76) {
		tmp = (Math.log(z) + Math.log(y)) - t;
	} else if (a <= 1.55e-22) {
		tmp = t_1 - (t + (0.5 * Math.log(t)));
	} else if (a <= 1.14e+179) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = math.log((y * z))
	t_2 = a * math.log(t)
	t_3 = (t_2 + t_1) - t
	tmp = 0
	if a <= -6.6e+68:
		tmp = t_2
	elif a <= -76000000000.0:
		tmp = t_3
	elif a <= -3.2e-76:
		tmp = (math.log(z) + math.log(y)) - t
	elif a <= 1.55e-22:
		tmp = t_1 - (t + (0.5 * math.log(t)))
	elif a <= 1.14e+179:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = log(Float64(y * z))
	t_2 = Float64(a * log(t))
	t_3 = Float64(Float64(t_2 + t_1) - t)
	tmp = 0.0
	if (a <= -6.6e+68)
		tmp = t_2;
	elseif (a <= -76000000000.0)
		tmp = t_3;
	elseif (a <= -3.2e-76)
		tmp = Float64(Float64(log(z) + log(y)) - t);
	elseif (a <= 1.55e-22)
		tmp = Float64(t_1 - Float64(t + Float64(0.5 * log(t))));
	elseif (a <= 1.14e+179)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = log((y * z));
	t_2 = a * log(t);
	t_3 = (t_2 + t_1) - t;
	tmp = 0.0;
	if (a <= -6.6e+68)
		tmp = t_2;
	elseif (a <= -76000000000.0)
		tmp = t_3;
	elseif (a <= -3.2e-76)
		tmp = (log(z) + log(y)) - t;
	elseif (a <= 1.55e-22)
		tmp = t_1 - (t + (0.5 * log(t)));
	elseif (a <= 1.14e+179)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 + t$95$1), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -6.6e+68], t$95$2, If[LessEqual[a, -76000000000.0], t$95$3, If[LessEqual[a, -3.2e-76], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 1.55e-22], N[(t$95$1 - N[(t + N[(0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.14e+179], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log \left(y \cdot z\right)\\
t_2 := a \cdot \log t\\
t_3 := \left(t_2 + t_1\right) - t\\
\mathbf{if}\;a \leq -6.6 \cdot 10^{+68}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq -76000000000:\\
\;\;\;\;t_3\\

\mathbf{elif}\;a \leq -3.2 \cdot 10^{-76}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\

\mathbf{elif}\;a \leq 1.55 \cdot 10^{-22}:\\
\;\;\;\;t_1 - \left(t + 0.5 \cdot \log t\right)\\

\mathbf{elif}\;a \leq 1.14 \cdot 10^{+179}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6.6000000000000001e68 or 1.14000000000000007e179 < a

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.7%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.7%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.7%

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative92.4%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified92.4%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if -6.6000000000000001e68 < a < -7.6e10 or 1.55000000000000006e-22 < a < 1.14000000000000007e179

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

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

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

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

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

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

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

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

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

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

    if -7.6e10 < a < -3.1999999999999998e-76

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.5%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.5%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.5%

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

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

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

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

    if -3.1999999999999998e-76 < a < 1.55000000000000006e-22

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

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

      \[\leadsto \color{blue}{\left(\log y + \log z\right) - \left(t + 0.5 \cdot \log t\right)} \]
    7. Step-by-step derivation
      1. log-prod52.0%

        \[\leadsto \color{blue}{\log \left(y \cdot z\right)} - \left(t + 0.5 \cdot \log t\right) \]
      2. *-commutative52.0%

        \[\leadsto \log \color{blue}{\left(z \cdot y\right)} - \left(t + 0.5 \cdot \log t\right) \]
      3. *-commutative52.0%

        \[\leadsto \log \left(z \cdot y\right) - \left(t + \color{blue}{\log t \cdot 0.5}\right) \]
    8. Simplified52.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.6 \cdot 10^{+68}:\\ \;\;\;\;a \cdot \log t\\ \mathbf{elif}\;a \leq -76000000000:\\ \;\;\;\;\left(a \cdot \log t + \log \left(y \cdot z\right)\right) - t\\ \mathbf{elif}\;a \leq -3.2 \cdot 10^{-76}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-22}:\\ \;\;\;\;\log \left(y \cdot z\right) - \left(t + 0.5 \cdot \log t\right)\\ \mathbf{elif}\;a \leq 1.14 \cdot 10^{+179}:\\ \;\;\;\;\left(a \cdot \log t + \log \left(y \cdot z\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;a \cdot \log t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \log t\\ t_2 := \left(t_1 + \log \left(y \cdot z\right)\right) - t\\ \mathbf{if}\;a \leq -4.5 \cdot 10^{+65}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -145000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-74}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-22}:\\ \;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot -0.5\right) - t\\ \mathbf{elif}\;a \leq 7.9 \cdot 10^{+177}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* a (log t))) (t_2 (- (+ t_1 (log (* y z))) t)))
   (if (<= a -4.5e+65)
     t_1
     (if (<= a -145000000000.0)
       t_2
       (if (<= a -1.2e-74)
         (- (+ (log z) (log y)) t)
         (if (<= a 1.55e-22)
           (- (+ (log (* z (+ x y))) (* (log t) -0.5)) t)
           (if (<= a 7.9e+177) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = a * log(t);
	double t_2 = (t_1 + log((y * z))) - t;
	double tmp;
	if (a <= -4.5e+65) {
		tmp = t_1;
	} else if (a <= -145000000000.0) {
		tmp = t_2;
	} else if (a <= -1.2e-74) {
		tmp = (log(z) + log(y)) - t;
	} else if (a <= 1.55e-22) {
		tmp = (log((z * (x + y))) + (log(t) * -0.5)) - t;
	} else if (a <= 7.9e+177) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = a * log(t)
    t_2 = (t_1 + log((y * z))) - t
    if (a <= (-4.5d+65)) then
        tmp = t_1
    else if (a <= (-145000000000.0d0)) then
        tmp = t_2
    else if (a <= (-1.2d-74)) then
        tmp = (log(z) + log(y)) - t
    else if (a <= 1.55d-22) then
        tmp = (log((z * (x + y))) + (log(t) * (-0.5d0))) - t
    else if (a <= 7.9d+177) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = a * Math.log(t);
	double t_2 = (t_1 + Math.log((y * z))) - t;
	double tmp;
	if (a <= -4.5e+65) {
		tmp = t_1;
	} else if (a <= -145000000000.0) {
		tmp = t_2;
	} else if (a <= -1.2e-74) {
		tmp = (Math.log(z) + Math.log(y)) - t;
	} else if (a <= 1.55e-22) {
		tmp = (Math.log((z * (x + y))) + (Math.log(t) * -0.5)) - t;
	} else if (a <= 7.9e+177) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = a * math.log(t)
	t_2 = (t_1 + math.log((y * z))) - t
	tmp = 0
	if a <= -4.5e+65:
		tmp = t_1
	elif a <= -145000000000.0:
		tmp = t_2
	elif a <= -1.2e-74:
		tmp = (math.log(z) + math.log(y)) - t
	elif a <= 1.55e-22:
		tmp = (math.log((z * (x + y))) + (math.log(t) * -0.5)) - t
	elif a <= 7.9e+177:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(a * log(t))
	t_2 = Float64(Float64(t_1 + log(Float64(y * z))) - t)
	tmp = 0.0
	if (a <= -4.5e+65)
		tmp = t_1;
	elseif (a <= -145000000000.0)
		tmp = t_2;
	elseif (a <= -1.2e-74)
		tmp = Float64(Float64(log(z) + log(y)) - t);
	elseif (a <= 1.55e-22)
		tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * -0.5)) - t);
	elseif (a <= 7.9e+177)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = a * log(t);
	t_2 = (t_1 + log((y * z))) - t;
	tmp = 0.0;
	if (a <= -4.5e+65)
		tmp = t_1;
	elseif (a <= -145000000000.0)
		tmp = t_2;
	elseif (a <= -1.2e-74)
		tmp = (log(z) + log(y)) - t;
	elseif (a <= 1.55e-22)
		tmp = (log((z * (x + y))) + (log(t) * -0.5)) - t;
	elseif (a <= 7.9e+177)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -4.5e+65], t$95$1, If[LessEqual[a, -145000000000.0], t$95$2, If[LessEqual[a, -1.2e-74], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 1.55e-22], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 7.9e+177], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -145000000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq -1.2 \cdot 10^{-74}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\

\mathbf{elif}\;a \leq 1.55 \cdot 10^{-22}:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot -0.5\right) - t\\

\mathbf{elif}\;a \leq 7.9 \cdot 10^{+177}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4.5e65 or 7.8999999999999999e177 < a

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.7%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.7%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.7%

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative92.4%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified92.4%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if -4.5e65 < a < -1.45e11 or 1.55000000000000006e-22 < a < 7.8999999999999999e177

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e11 < a < -1.1999999999999999e-74

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.5%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.5%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.5%

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

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

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

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

    if -1.1999999999999999e-74 < a < 1.55000000000000006e-22

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{\left(\log z + \left(\log \left(x + y\right) + -0.5 \cdot \log t\right)\right) - t} \]
    4. Step-by-step derivation
      1. associate-+r+99.6%

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

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

        \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} + -0.5 \cdot \log t\right) - t \]
      4. *-commutative85.5%

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

        \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) + -0.5 \cdot \log t\right) - t \]
      6. *-commutative85.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{+65}:\\ \;\;\;\;a \cdot \log t\\ \mathbf{elif}\;a \leq -145000000000:\\ \;\;\;\;\left(a \cdot \log t + \log \left(y \cdot z\right)\right) - t\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-74}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-22}:\\ \;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot -0.5\right) - t\\ \mathbf{elif}\;a \leq 7.9 \cdot 10^{+177}:\\ \;\;\;\;\left(a \cdot \log t + \log \left(y \cdot z\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;a \cdot \log t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 78.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{+65} \lor \neg \left(a \leq 6 \cdot 10^{+176}\right):\\ \;\;\;\;a \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= a -6.8e+65) (not (<= a 6e+176)))
   (* a (log t))
   (- (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -6.8e+65) || !(a <= 6e+176)) {
		tmp = a * log(t);
	} else {
		tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: tmp
    if ((a <= (-6.8d+65)) .or. (.not. (a <= 6d+176))) then
        tmp = a * log(t)
    else
        tmp = (log((z * (x + y))) + (log(t) * (a - 0.5d0))) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -6.8e+65) || !(a <= 6e+176)) {
		tmp = a * Math.log(t);
	} else {
		tmp = (Math.log((z * (x + y))) + (Math.log(t) * (a - 0.5))) - t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -6.8e+65) or not (a <= 6e+176):
		tmp = a * math.log(t)
	else:
		tmp = (math.log((z * (x + y))) + (math.log(t) * (a - 0.5))) - t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((a <= -6.8e+65) || !(a <= 6e+176))
		tmp = Float64(a * log(t));
	else
		tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a <= -6.8e+65) || ~((a <= 6e+176)))
		tmp = a * log(t);
	else
		tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.8e+65], N[Not[LessEqual[a, 6e+176]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+65} \lor \neg \left(a \leq 6 \cdot 10^{+176}\right):\\
\;\;\;\;a \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.7999999999999999e65 or 6e176 < a

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.7%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.7%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.7%

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative92.4%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified92.4%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if -6.7999999999999999e65 < a < 6e176

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-+r-99.6%

        \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right) - \mathsf{fma}\left(\log t, 0.5 - a, t\right)} \]
      2. fma-udef99.6%

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

        \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - \log t \cdot \left(0.5 - a\right)\right) - t} \]
      4. sum-log82.2%

        \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - \log t \cdot \left(0.5 - a\right)\right) - t \]
    6. Applied egg-rr82.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{+65} \lor \neg \left(a \leq 6 \cdot 10^{+176}\right):\\ \;\;\;\;a \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 56.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \log t\\ t_2 := \left(\log z + \log y\right) - t\\ \mathbf{if}\;a \leq -70000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3.25 \cdot 10^{-242}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-193}:\\ \;\;\;\;\log \left(\sqrt{\frac{1}{t}} \cdot \left(z \cdot \left(x + y\right)\right)\right)\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{+62}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* a (log t))) (t_2 (- (+ (log z) (log y)) t)))
   (if (<= a -70000000000.0)
     t_1
     (if (<= a 3.25e-242)
       t_2
       (if (<= a 5.8e-193)
         (log (* (sqrt (/ 1.0 t)) (* z (+ x y))))
         (if (<= a 5.2e+62) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = a * log(t);
	double t_2 = (log(z) + log(y)) - t;
	double tmp;
	if (a <= -70000000000.0) {
		tmp = t_1;
	} else if (a <= 3.25e-242) {
		tmp = t_2;
	} else if (a <= 5.8e-193) {
		tmp = log((sqrt((1.0 / t)) * (z * (x + y))));
	} else if (a <= 5.2e+62) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = a * log(t)
    t_2 = (log(z) + log(y)) - t
    if (a <= (-70000000000.0d0)) then
        tmp = t_1
    else if (a <= 3.25d-242) then
        tmp = t_2
    else if (a <= 5.8d-193) then
        tmp = log((sqrt((1.0d0 / t)) * (z * (x + y))))
    else if (a <= 5.2d+62) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = a * Math.log(t);
	double t_2 = (Math.log(z) + Math.log(y)) - t;
	double tmp;
	if (a <= -70000000000.0) {
		tmp = t_1;
	} else if (a <= 3.25e-242) {
		tmp = t_2;
	} else if (a <= 5.8e-193) {
		tmp = Math.log((Math.sqrt((1.0 / t)) * (z * (x + y))));
	} else if (a <= 5.2e+62) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = a * math.log(t)
	t_2 = (math.log(z) + math.log(y)) - t
	tmp = 0
	if a <= -70000000000.0:
		tmp = t_1
	elif a <= 3.25e-242:
		tmp = t_2
	elif a <= 5.8e-193:
		tmp = math.log((math.sqrt((1.0 / t)) * (z * (x + y))))
	elif a <= 5.2e+62:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(a * log(t))
	t_2 = Float64(Float64(log(z) + log(y)) - t)
	tmp = 0.0
	if (a <= -70000000000.0)
		tmp = t_1;
	elseif (a <= 3.25e-242)
		tmp = t_2;
	elseif (a <= 5.8e-193)
		tmp = log(Float64(sqrt(Float64(1.0 / t)) * Float64(z * Float64(x + y))));
	elseif (a <= 5.2e+62)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = a * log(t);
	t_2 = (log(z) + log(y)) - t;
	tmp = 0.0;
	if (a <= -70000000000.0)
		tmp = t_1;
	elseif (a <= 3.25e-242)
		tmp = t_2;
	elseif (a <= 5.8e-193)
		tmp = log((sqrt((1.0 / t)) * (z * (x + y))));
	elseif (a <= 5.2e+62)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -70000000000.0], t$95$1, If[LessEqual[a, 3.25e-242], t$95$2, If[LessEqual[a, 5.8e-193], N[Log[N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[a, 5.2e+62], t$95$2, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \left(\log z + \log y\right) - t\\
\mathbf{if}\;a \leq -70000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 3.25 \cdot 10^{-242}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{-193}:\\
\;\;\;\;\log \left(\sqrt{\frac{1}{t}} \cdot \left(z \cdot \left(x + y\right)\right)\right)\\

\mathbf{elif}\;a \leq 5.2 \cdot 10^{+62}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7e10 or 5.19999999999999968e62 < a

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative83.7%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified83.7%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if -7e10 < a < 3.2499999999999999e-242 or 5.80000000000000013e-193 < a < 5.19999999999999968e62

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.7%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.7%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.7%

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

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

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

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

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

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

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

    if 3.2499999999999999e-242 < a < 5.80000000000000013e-193

    1. Initial program 98.8%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-log-exp98.8%

        \[\leadsto \color{blue}{\log \left(e^{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t}\right)} \]
      2. +-commutative98.8%

        \[\leadsto \log \left(e^{\color{blue}{\left(a - 0.5\right) \cdot \log t + \left(\left(\log \left(x + y\right) + \log z\right) - t\right)}}\right) \]
      3. exp-sum99.4%

        \[\leadsto \log \color{blue}{\left(e^{\left(a - 0.5\right) \cdot \log t} \cdot e^{\left(\log \left(x + y\right) + \log z\right) - t}\right)} \]
      4. sub-neg99.4%

        \[\leadsto \log \left(e^{\color{blue}{\left(a + \left(-0.5\right)\right)} \cdot \log t} \cdot e^{\left(\log \left(x + y\right) + \log z\right) - t}\right) \]
      5. metadata-eval99.4%

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

        \[\leadsto \log \left(e^{\color{blue}{\log t \cdot \left(a + -0.5\right)}} \cdot e^{\left(\log \left(x + y\right) + \log z\right) - t}\right) \]
      7. exp-to-pow98.3%

        \[\leadsto \log \left(\color{blue}{{t}^{\left(a + -0.5\right)}} \cdot e^{\left(\log \left(x + y\right) + \log z\right) - t}\right) \]
      8. associate-+r-98.3%

        \[\leadsto \log \left({t}^{\left(a + -0.5\right)} \cdot e^{\color{blue}{\log \left(x + y\right) + \left(\log z - t\right)}}\right) \]
      9. exp-sum98.3%

        \[\leadsto \log \left({t}^{\left(a + -0.5\right)} \cdot \color{blue}{\left(e^{\log \left(x + y\right)} \cdot e^{\log z - t}\right)}\right) \]
      10. add-exp-log99.1%

        \[\leadsto \log \left({t}^{\left(a + -0.5\right)} \cdot \left(\color{blue}{\left(x + y\right)} \cdot e^{\log z - t}\right)\right) \]
      11. exp-diff99.1%

        \[\leadsto \log \left({t}^{\left(a + -0.5\right)} \cdot \left(\left(x + y\right) \cdot \color{blue}{\frac{e^{\log z}}{e^{t}}}\right)\right) \]
      12. add-exp-log100.0%

        \[\leadsto \log \left({t}^{\left(a + -0.5\right)} \cdot \left(\left(x + y\right) \cdot \frac{\color{blue}{z}}{e^{t}}\right)\right) \]
    4. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\log \left({t}^{\left(a + -0.5\right)} \cdot \left(\left(x + y\right) \cdot \frac{z}{e^{t}}\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \log \left({t}^{\left(a + -0.5\right)} \cdot \left(\color{blue}{\left(y + x\right)} \cdot \frac{z}{e^{t}}\right)\right) \]
    6. Simplified100.0%

      \[\leadsto \color{blue}{\log \left({t}^{\left(a + -0.5\right)} \cdot \left(\left(y + x\right) \cdot \frac{z}{e^{t}}\right)\right)} \]
    7. Taylor expanded in t around 0 100.0%

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

      \[\leadsto \log \left(\color{blue}{\sqrt{\frac{1}{t}}} \cdot \left(\left(y + x\right) \cdot z\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -70000000000:\\ \;\;\;\;a \cdot \log t\\ \mathbf{elif}\;a \leq 3.25 \cdot 10^{-242}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-193}:\\ \;\;\;\;\log \left(\sqrt{\frac{1}{t}} \cdot \left(z \cdot \left(x + y\right)\right)\right)\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{+62}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;a \cdot \log t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 61.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+67} \lor \neg \left(a \leq 2 \cdot 10^{+178}\right):\\
\;\;\;\;a \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.0000000000000001e67 or 2.0000000000000001e178 < a

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.7%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.7%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.7%

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative92.4%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified92.4%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if -3.0000000000000001e67 < a < 2.0000000000000001e178

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-+r-99.6%

        \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right) - \mathsf{fma}\left(\log t, 0.5 - a, t\right)} \]
      2. fma-udef99.6%

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

        \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - \log t \cdot \left(0.5 - a\right)\right) - t} \]
      4. sum-log82.2%

        \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - \log t \cdot \left(0.5 - a\right)\right) - t \]
    6. Applied egg-rr82.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3 \cdot 10^{+67} \lor \neg \left(a \leq 2 \cdot 10^{+178}\right):\\ \;\;\;\;a \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 55.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \log t\\ t_2 := \left(\log z + \log y\right) - t\\ \mathbf{if}\;a \leq -14000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-242}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-193}:\\ \;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right)\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+50}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* a (log t))) (t_2 (- (+ (log z) (log y)) t)))
   (if (<= a -14000000000.0)
     t_1
     (if (<= a 4.5e-242)
       t_2
       (if (<= a 5.5e-193)
         (log (* y (* z (pow t (+ a -0.5)))))
         (if (<= a 9e+50) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = a * log(t);
	double t_2 = (log(z) + log(y)) - t;
	double tmp;
	if (a <= -14000000000.0) {
		tmp = t_1;
	} else if (a <= 4.5e-242) {
		tmp = t_2;
	} else if (a <= 5.5e-193) {
		tmp = log((y * (z * pow(t, (a + -0.5)))));
	} else if (a <= 9e+50) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = a * log(t)
    t_2 = (log(z) + log(y)) - t
    if (a <= (-14000000000.0d0)) then
        tmp = t_1
    else if (a <= 4.5d-242) then
        tmp = t_2
    else if (a <= 5.5d-193) then
        tmp = log((y * (z * (t ** (a + (-0.5d0))))))
    else if (a <= 9d+50) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = a * Math.log(t);
	double t_2 = (Math.log(z) + Math.log(y)) - t;
	double tmp;
	if (a <= -14000000000.0) {
		tmp = t_1;
	} else if (a <= 4.5e-242) {
		tmp = t_2;
	} else if (a <= 5.5e-193) {
		tmp = Math.log((y * (z * Math.pow(t, (a + -0.5)))));
	} else if (a <= 9e+50) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = a * math.log(t)
	t_2 = (math.log(z) + math.log(y)) - t
	tmp = 0
	if a <= -14000000000.0:
		tmp = t_1
	elif a <= 4.5e-242:
		tmp = t_2
	elif a <= 5.5e-193:
		tmp = math.log((y * (z * math.pow(t, (a + -0.5)))))
	elif a <= 9e+50:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(a * log(t))
	t_2 = Float64(Float64(log(z) + log(y)) - t)
	tmp = 0.0
	if (a <= -14000000000.0)
		tmp = t_1;
	elseif (a <= 4.5e-242)
		tmp = t_2;
	elseif (a <= 5.5e-193)
		tmp = log(Float64(y * Float64(z * (t ^ Float64(a + -0.5)))));
	elseif (a <= 9e+50)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = a * log(t);
	t_2 = (log(z) + log(y)) - t;
	tmp = 0.0;
	if (a <= -14000000000.0)
		tmp = t_1;
	elseif (a <= 4.5e-242)
		tmp = t_2;
	elseif (a <= 5.5e-193)
		tmp = log((y * (z * (t ^ (a + -0.5)))));
	elseif (a <= 9e+50)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -14000000000.0], t$95$1, If[LessEqual[a, 4.5e-242], t$95$2, If[LessEqual[a, 5.5e-193], N[Log[N[(y * N[(z * N[Power[t, N[(a + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[a, 9e+50], t$95$2, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \left(\log z + \log y\right) - t\\
\mathbf{if}\;a \leq -14000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{-242}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 5.5 \cdot 10^{-193}:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right)\\

\mathbf{elif}\;a \leq 9 \cdot 10^{+50}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.4e10 or 9.00000000000000027e50 < a

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative83.7%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified83.7%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if -1.4e10 < a < 4.4999999999999999e-242 or 5.50000000000000014e-193 < a < 9.00000000000000027e50

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.7%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.7%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.7%

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

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

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

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

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

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

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

    if 4.4999999999999999e-242 < a < 5.50000000000000014e-193

    1. Initial program 98.8%

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

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

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in97.8%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in97.8%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\log \left(y \cdot z\right)} + a \cdot \log t\right) - \left(t + 0.5 \cdot \log t\right) \]
      3. *-commutative40.9%

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

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

        \[\leadsto \left(\log \left(z \cdot y\right) + \log t \cdot a\right) - \left(t + \color{blue}{\log t \cdot 0.5}\right) \]
    8. Simplified40.9%

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

      \[\leadsto \color{blue}{\left(\log \left(y \cdot z\right) + a \cdot \log t\right) - 0.5 \cdot \log t} \]
    10. Step-by-step derivation
      1. associate--l+40.9%

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

        \[\leadsto \color{blue}{\left(\log y + \log z\right)} + \left(a \cdot \log t - 0.5 \cdot \log t\right) \]
      3. distribute-rgt-out--43.7%

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

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

        \[\leadsto \left(\log y + \log z\right) + \color{blue}{\log \left({t}^{\left(a - 0.5\right)}\right)} \]
      6. sub-neg43.7%

        \[\leadsto \left(\log y + \log z\right) + \log \left({t}^{\color{blue}{\left(a + \left(-0.5\right)\right)}}\right) \]
      7. metadata-eval43.7%

        \[\leadsto \left(\log y + \log z\right) + \log \left({t}^{\left(a + \color{blue}{-0.5}\right)}\right) \]
      8. associate-+r+43.7%

        \[\leadsto \color{blue}{\log y + \left(\log z + \log \left({t}^{\left(a + -0.5\right)}\right)\right)} \]
      9. log-prod43.4%

        \[\leadsto \log y + \color{blue}{\log \left(z \cdot {t}^{\left(a + -0.5\right)}\right)} \]
      10. log-prod43.7%

        \[\leadsto \color{blue}{\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right)} \]
    11. Simplified43.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -14000000000:\\ \;\;\;\;a \cdot \log t\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-242}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-193}:\\ \;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right)\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+50}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;a \cdot \log t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 56.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \log t\\ t_2 := \left(\log z + \log y\right) - t\\ \mathbf{if}\;a \leq -56000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-242}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-193}:\\ \;\;\;\;\log \left(y \cdot z\right) - 0.5 \cdot \log t\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{+50}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* a (log t))) (t_2 (- (+ (log z) (log y)) t)))
   (if (<= a -56000000000.0)
     t_1
     (if (<= a 4.5e-242)
       t_2
       (if (<= a 7.2e-193)
         (- (log (* y z)) (* 0.5 (log t)))
         (if (<= a 1.7e+50) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = a * log(t);
	double t_2 = (log(z) + log(y)) - t;
	double tmp;
	if (a <= -56000000000.0) {
		tmp = t_1;
	} else if (a <= 4.5e-242) {
		tmp = t_2;
	} else if (a <= 7.2e-193) {
		tmp = log((y * z)) - (0.5 * log(t));
	} else if (a <= 1.7e+50) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = a * log(t)
    t_2 = (log(z) + log(y)) - t
    if (a <= (-56000000000.0d0)) then
        tmp = t_1
    else if (a <= 4.5d-242) then
        tmp = t_2
    else if (a <= 7.2d-193) then
        tmp = log((y * z)) - (0.5d0 * log(t))
    else if (a <= 1.7d+50) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = a * Math.log(t);
	double t_2 = (Math.log(z) + Math.log(y)) - t;
	double tmp;
	if (a <= -56000000000.0) {
		tmp = t_1;
	} else if (a <= 4.5e-242) {
		tmp = t_2;
	} else if (a <= 7.2e-193) {
		tmp = Math.log((y * z)) - (0.5 * Math.log(t));
	} else if (a <= 1.7e+50) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = a * math.log(t)
	t_2 = (math.log(z) + math.log(y)) - t
	tmp = 0
	if a <= -56000000000.0:
		tmp = t_1
	elif a <= 4.5e-242:
		tmp = t_2
	elif a <= 7.2e-193:
		tmp = math.log((y * z)) - (0.5 * math.log(t))
	elif a <= 1.7e+50:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(a * log(t))
	t_2 = Float64(Float64(log(z) + log(y)) - t)
	tmp = 0.0
	if (a <= -56000000000.0)
		tmp = t_1;
	elseif (a <= 4.5e-242)
		tmp = t_2;
	elseif (a <= 7.2e-193)
		tmp = Float64(log(Float64(y * z)) - Float64(0.5 * log(t)));
	elseif (a <= 1.7e+50)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = a * log(t);
	t_2 = (log(z) + log(y)) - t;
	tmp = 0.0;
	if (a <= -56000000000.0)
		tmp = t_1;
	elseif (a <= 4.5e-242)
		tmp = t_2;
	elseif (a <= 7.2e-193)
		tmp = log((y * z)) - (0.5 * log(t));
	elseif (a <= 1.7e+50)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -56000000000.0], t$95$1, If[LessEqual[a, 4.5e-242], t$95$2, If[LessEqual[a, 7.2e-193], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - N[(0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.7e+50], t$95$2, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \left(\log z + \log y\right) - t\\
\mathbf{if}\;a \leq -56000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{-242}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 7.2 \cdot 10^{-193}:\\
\;\;\;\;\log \left(y \cdot z\right) - 0.5 \cdot \log t\\

\mathbf{elif}\;a \leq 1.7 \cdot 10^{+50}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.6e10 or 1.6999999999999999e50 < a

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative83.7%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified83.7%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if -5.6e10 < a < 4.4999999999999999e-242 or 7.1999999999999998e-193 < a < 1.6999999999999999e50

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.7%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.7%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.7%

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

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

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

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

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

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

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

    if 4.4999999999999999e-242 < a < 7.1999999999999998e-193

    1. Initial program 98.8%

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

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

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in97.8%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in97.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\log y + \log z\right) - \left(t + 0.5 \cdot \log t\right)} \]
    7. Step-by-step derivation
      1. log-prod40.9%

        \[\leadsto \color{blue}{\log \left(y \cdot z\right)} - \left(t + 0.5 \cdot \log t\right) \]
      2. *-commutative40.9%

        \[\leadsto \log \color{blue}{\left(z \cdot y\right)} - \left(t + 0.5 \cdot \log t\right) \]
      3. *-commutative40.9%

        \[\leadsto \log \left(z \cdot y\right) - \left(t + \color{blue}{\log t \cdot 0.5}\right) \]
    8. Simplified40.9%

      \[\leadsto \color{blue}{\log \left(z \cdot y\right) - \left(t + \log t \cdot 0.5\right)} \]
    9. Taylor expanded in t around 0 40.9%

      \[\leadsto \log \left(z \cdot y\right) - \color{blue}{0.5 \cdot \log t} \]
    10. Step-by-step derivation
      1. *-commutative40.9%

        \[\leadsto \log \left(z \cdot y\right) - \color{blue}{\log t \cdot 0.5} \]
    11. Simplified40.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -56000000000:\\ \;\;\;\;a \cdot \log t\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-242}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-193}:\\ \;\;\;\;\log \left(y \cdot z\right) - 0.5 \cdot \log t\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{+50}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;a \cdot \log t\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 60.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \log t\\ \mathbf{if}\;a \leq -68000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{-23}:\\ \;\;\;\;\log \left(y \cdot z\right) - \left(t + 0.5 \cdot \log t\right)\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+56}:\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* a (log t))))
   (if (<= a -68000000.0)
     t_1
     (if (<= a 2.5e-23)
       (- (log (* y z)) (+ t (* 0.5 (log t))))
       (if (<= a 1.15e+56) (- t) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = a * log(t);
	double tmp;
	if (a <= -68000000.0) {
		tmp = t_1;
	} else if (a <= 2.5e-23) {
		tmp = log((y * z)) - (t + (0.5 * log(t)));
	} else if (a <= 1.15e+56) {
		tmp = -t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: t_1
    real(8) :: tmp
    t_1 = a * log(t)
    if (a <= (-68000000.0d0)) then
        tmp = t_1
    else if (a <= 2.5d-23) then
        tmp = log((y * z)) - (t + (0.5d0 * log(t)))
    else if (a <= 1.15d+56) then
        tmp = -t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = a * Math.log(t);
	double tmp;
	if (a <= -68000000.0) {
		tmp = t_1;
	} else if (a <= 2.5e-23) {
		tmp = Math.log((y * z)) - (t + (0.5 * Math.log(t)));
	} else if (a <= 1.15e+56) {
		tmp = -t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = a * math.log(t)
	tmp = 0
	if a <= -68000000.0:
		tmp = t_1
	elif a <= 2.5e-23:
		tmp = math.log((y * z)) - (t + (0.5 * math.log(t)))
	elif a <= 1.15e+56:
		tmp = -t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(a * log(t))
	tmp = 0.0
	if (a <= -68000000.0)
		tmp = t_1;
	elseif (a <= 2.5e-23)
		tmp = Float64(log(Float64(y * z)) - Float64(t + Float64(0.5 * log(t))));
	elseif (a <= 1.15e+56)
		tmp = Float64(-t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = a * log(t);
	tmp = 0.0;
	if (a <= -68000000.0)
		tmp = t_1;
	elseif (a <= 2.5e-23)
		tmp = log((y * z)) - (t + (0.5 * log(t)));
	elseif (a <= 1.15e+56)
		tmp = -t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -68000000.0], t$95$1, If[LessEqual[a, 2.5e-23], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - N[(t + N[(0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e+56], (-t), t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -68000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 2.5 \cdot 10^{-23}:\\
\;\;\;\;\log \left(y \cdot z\right) - \left(t + 0.5 \cdot \log t\right)\\

\mathbf{elif}\;a \leq 1.15 \cdot 10^{+56}:\\
\;\;\;\;-t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.8e7 or 1.15000000000000007e56 < a

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative83.1%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified83.1%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if -6.8e7 < a < 2.5000000000000001e-23

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

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

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

        \[\leadsto \color{blue}{\log \left(y \cdot z\right)} - \left(t + 0.5 \cdot \log t\right) \]
      2. *-commutative51.3%

        \[\leadsto \log \color{blue}{\left(z \cdot y\right)} - \left(t + 0.5 \cdot \log t\right) \]
      3. *-commutative51.3%

        \[\leadsto \log \left(z \cdot y\right) - \left(t + \color{blue}{\log t \cdot 0.5}\right) \]
    8. Simplified51.3%

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

    if 2.5000000000000001e-23 < a < 1.15000000000000007e56

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.7%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.7%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.7%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. neg-mul-169.5%

        \[\leadsto \color{blue}{-t} \]
    7. Simplified69.5%

      \[\leadsto \color{blue}{-t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.5%

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

Alternative 12: 61.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 4700000000:\\ \;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t 4700000000.0)
   (+ (log (* y z)) (* (log t) (- a 0.5)))
   (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 4700000000.0) {
		tmp = log((y * z)) + (log(t) * (a - 0.5));
	} else {
		tmp = log((x + y)) + (log(z) - t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: tmp
    if (t <= 4700000000.0d0) then
        tmp = log((y * z)) + (log(t) * (a - 0.5d0))
    else
        tmp = log((x + y)) + (log(z) - t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 4700000000.0) {
		tmp = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
	} else {
		tmp = Math.log((x + y)) + (Math.log(z) - t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= 4700000000.0:
		tmp = math.log((y * z)) + (math.log(t) * (a - 0.5))
	else:
		tmp = math.log((x + y)) + (math.log(z) - t)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= 4700000000.0)
		tmp = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5)));
	else
		tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= 4700000000.0)
		tmp = log((y * z)) + (log(t) * (a - 0.5));
	else
		tmp = log((x + y)) + (log(z) - t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4700000000.0], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 4700000000:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\

\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 4.7e9

    1. Initial program 99.4%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.3%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.3%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.3%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.3%

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

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

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

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

        \[\leadsto \color{blue}{\log \left(y \cdot z\right)} - \log t \cdot \left(0.5 - a\right) \]
      2. *-commutative45.7%

        \[\leadsto \log \color{blue}{\left(z \cdot y\right)} - \log t \cdot \left(0.5 - a\right) \]
    8. Simplified45.7%

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

    if 4.7e9 < t

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.9%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.9%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.9%

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

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

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

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

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

      \[\leadsto \log \left(x + y\right) + \left(\log z - \color{blue}{t}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.4%

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

Alternative 13: 57.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -31000000000 \lor \neg \left(a \leq 1.45 \cdot 10^{+48}\right):\\ \;\;\;\;a \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= a -31000000000.0) (not (<= a 1.45e+48)))
   (* a (log t))
   (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -31000000000.0) || !(a <= 1.45e+48)) {
		tmp = a * log(t);
	} else {
		tmp = (log(z) + log(y)) - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: tmp
    if ((a <= (-31000000000.0d0)) .or. (.not. (a <= 1.45d+48))) then
        tmp = a * log(t)
    else
        tmp = (log(z) + log(y)) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((a <= -31000000000.0) || !(a <= 1.45e+48)) {
		tmp = a * Math.log(t);
	} else {
		tmp = (Math.log(z) + Math.log(y)) - t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -31000000000.0) or not (a <= 1.45e+48):
		tmp = a * math.log(t)
	else:
		tmp = (math.log(z) + math.log(y)) - t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((a <= -31000000000.0) || !(a <= 1.45e+48))
		tmp = Float64(a * log(t));
	else
		tmp = Float64(Float64(log(z) + log(y)) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((a <= -31000000000.0) || ~((a <= 1.45e+48)))
		tmp = a * log(t);
	else
		tmp = (log(z) + log(y)) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -31000000000.0], N[Not[LessEqual[a, 1.45e+48]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -31000000000 \lor \neg \left(a \leq 1.45 \cdot 10^{+48}\right):\\
\;\;\;\;a \cdot \log t\\

\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.1e10 or 1.4499999999999999e48 < a

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative83.7%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified83.7%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if -3.1e10 < a < 1.4499999999999999e48

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.6%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.6%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.6%

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

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

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

      \[\leadsto \left(\log y + \log z\right) - \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -31000000000 \lor \neg \left(a \leq 1.45 \cdot 10^{+48}\right):\\ \;\;\;\;a \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 62.5% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 6 \cdot 10^{+25}:\\ \;\;\;\;a \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
(FPCore (x y z t a) :precision binary64 (if (<= t 6e+25) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 6e+25) {
		tmp = a * log(t);
	} else {
		tmp = -t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    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) :: tmp
    if (t <= 6d+25) then
        tmp = a * log(t)
    else
        tmp = -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 6e+25) {
		tmp = a * Math.log(t);
	} else {
		tmp = -t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= 6e+25:
		tmp = a * math.log(t)
	else:
		tmp = -t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= 6e+25)
		tmp = Float64(a * log(t));
	else
		tmp = Float64(-t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= 6e+25)
		tmp = a * log(t);
	else
		tmp = -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 6e+25], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 6 \cdot 10^{+25}:\\
\;\;\;\;a \cdot \log t\\

\mathbf{else}:\\
\;\;\;\;-t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 6.00000000000000011e25

    1. Initial program 99.4%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.3%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.3%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.3%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
      13. unsub-neg99.3%

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

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

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutative56.7%

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified56.7%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if 6.00000000000000011e25 < t

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
      3. sub-neg99.9%

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
      6. distribute-rgt-neg-in99.9%

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

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

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

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
      10. distribute-neg-in99.9%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. neg-mul-180.8%

        \[\leadsto \color{blue}{-t} \]
    7. Simplified80.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6 \cdot 10^{+25}:\\ \;\;\;\;a \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 38.3% accurate, 156.5× speedup?

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

\\
-t
\end{array}
Derivation
  1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t - \left(a - 0.5\right) \cdot \log t\right)\right)} \]
    3. sub-neg99.6%

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

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

      \[\leadsto \log \left(x + y\right) + \left(\log z - \left(\left(-\color{blue}{\log t \cdot \left(a - 0.5\right)}\right) + t\right)\right) \]
    6. distribute-rgt-neg-in99.6%

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

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

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

      \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, -\color{blue}{\left(\left(-0.5\right) + a\right)}, t\right)\right) \]
    10. distribute-neg-in99.6%

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

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

      \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5} + \left(-a\right), t\right)\right) \]
    13. unsub-neg99.6%

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

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

    \[\leadsto \color{blue}{-1 \cdot t} \]
  6. Step-by-step derivation
    1. neg-mul-139.2%

      \[\leadsto \color{blue}{-t} \]
  7. Simplified39.2%

    \[\leadsto \color{blue}{-t} \]
  8. Final simplification39.2%

    \[\leadsto -t \]
  9. Add Preprocessing

Developer target: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right) \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t)))))
double code(double x, double y, double z, double t, double a) {
	return log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
}
real(8) function code(x, y, z, t, a)
    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
    code = log((x + y)) + ((log(z) - t) + ((a - 0.5d0) * log(t)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return Math.log((x + y)) + ((Math.log(z) - t) + ((a - 0.5) * Math.log(t)));
}
def code(x, y, z, t, a):
	return math.log((x + y)) + ((math.log(z) - t) + ((a - 0.5) * math.log(t)))
function code(x, y, z, t, a)
	return Float64(log(Float64(x + y)) + Float64(Float64(log(z) - t) + Float64(Float64(a - 0.5) * log(t))))
end
function tmp = code(x, y, z, t, a)
	tmp = log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Reproduce

?
herbie shell --seed 2024011 
(FPCore (x y z t a)
  :name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))

  (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))