Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.6%
Time: 15.6s
Alternatives: 14
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 14 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, 0.8× speedup?

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

\\
\left(\log z - t\right) + \mathsf{fma}\left(a + -0.5, \log t, \log \left(x + y\right)\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. +-commutative99.6%

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

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

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

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

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

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

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

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

Alternative 2: 72.3% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;-1 + \left(1 - t\right)\\


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

    1. Initial program 99.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt56.8%

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \color{blue}{\left(\log \left(x + y\right) + \log z\right) - t}\right)}\right)}^{2} \]
      7. sum-log36.5%

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right)}\right)}^{2} \]
    6. Applied egg-rr36.5%

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \log \left(\left(x + y\right) \cdot z\right) - t\right)}\right)}^{2}} \]
    7. Taylor expanded in t around 0 70.2%

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

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

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

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

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

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

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

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

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

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

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

    if 4.6000000000000001e-4 < t < 1.37999999999999998e144

    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. remove-double-neg99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt25.4%

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \color{blue}{\left(\log \left(x + y\right) + \log z\right) - t}\right)}\right)}^{2} \]
      7. sum-log22.5%

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right)}\right)}^{2} \]
    6. Applied egg-rr22.5%

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \log \left(\left(x + y\right) \cdot z\right) - t\right)}\right)}^{2}} \]
    7. Taylor expanded in t around inf 74.1%

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

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

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

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

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

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

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

        \[\leadsto t \cdot \left(\left(\frac{\log \left(z \cdot \left(y + x\right)\right)}{t} - \frac{\log \left(\frac{1}{t}\right) \cdot \left(a + \color{blue}{-0.5}\right)}{t}\right) + \left(-1\right)\right) \]
      8. associate-/l*74.1%

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

        \[\leadsto t \cdot \left(\left(\frac{\log \left(z \cdot \left(y + x\right)\right)}{t} - \color{blue}{\left(-\log t\right)} \cdot \frac{a + -0.5}{t}\right) + \left(-1\right)\right) \]
      10. metadata-eval74.1%

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

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

    if 1.37999999999999998e144 < 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-undefine100.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 89.2%

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

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

      \[\leadsto \color{blue}{-t} \]
    8. Step-by-step derivation
      1. expm1-log1p-u0.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-t\right)\right)} \]
      2. expm1-undefine0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    9. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    10. Step-by-step derivation
      1. sub-neg0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} + \left(-1\right)} \]
      2. log1p-undefine0.0%

        \[\leadsto e^{\color{blue}{\log \left(1 + \left(-t\right)\right)}} + \left(-1\right) \]
      3. rem-exp-log89.2%

        \[\leadsto \color{blue}{\left(1 + \left(-t\right)\right)} + \left(-1\right) \]
      4. unsub-neg89.2%

        \[\leadsto \color{blue}{\left(1 - t\right)} + \left(-1\right) \]
      5. metadata-eval89.2%

        \[\leadsto \left(1 - t\right) + \color{blue}{-1} \]
    11. Simplified89.2%

      \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 0.00046:\\ \;\;\;\;\left(\log z + \log y\right) + \left(a + -0.5\right) \cdot \log t\\ \mathbf{elif}\;t \leq 1.38 \cdot 10^{+144}:\\ \;\;\;\;t \cdot \left(\left(\frac{\log \left(z \cdot \left(x + y\right)\right)}{t} + \log t \cdot \frac{a + -0.5}{t}\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;-1 + \left(1 - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.3% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;-1 + \left(1 - t\right)\\


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

    if 4.80000000000000012e-4 < t < 5.1999999999999998e143

    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. remove-double-neg99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt25.4%

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \color{blue}{\left(\log \left(x + y\right) + \log z\right) - t}\right)}\right)}^{2} \]
      7. sum-log22.5%

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right)}\right)}^{2} \]
    6. Applied egg-rr22.5%

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \log \left(\left(x + y\right) \cdot z\right) - t\right)}\right)}^{2}} \]
    7. Taylor expanded in t around inf 74.1%

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

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

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

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

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

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

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

        \[\leadsto t \cdot \left(\left(\frac{\log \left(z \cdot \left(y + x\right)\right)}{t} - \frac{\log \left(\frac{1}{t}\right) \cdot \left(a + \color{blue}{-0.5}\right)}{t}\right) + \left(-1\right)\right) \]
      8. associate-/l*74.1%

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

        \[\leadsto t \cdot \left(\left(\frac{\log \left(z \cdot \left(y + x\right)\right)}{t} - \color{blue}{\left(-\log t\right)} \cdot \frac{a + -0.5}{t}\right) + \left(-1\right)\right) \]
      10. metadata-eval74.1%

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

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

    if 5.1999999999999998e143 < 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-undefine100.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 89.2%

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

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

      \[\leadsto \color{blue}{-t} \]
    8. Step-by-step derivation
      1. expm1-log1p-u0.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-t\right)\right)} \]
      2. expm1-undefine0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    9. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    10. Step-by-step derivation
      1. sub-neg0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} + \left(-1\right)} \]
      2. log1p-undefine0.0%

        \[\leadsto e^{\color{blue}{\log \left(1 + \left(-t\right)\right)}} + \left(-1\right) \]
      3. rem-exp-log89.2%

        \[\leadsto \color{blue}{\left(1 + \left(-t\right)\right)} + \left(-1\right) \]
      4. unsub-neg89.2%

        \[\leadsto \color{blue}{\left(1 - t\right)} + \left(-1\right) \]
      5. metadata-eval89.2%

        \[\leadsto \left(1 - t\right) + \color{blue}{-1} \]
    11. Simplified89.2%

      \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 0.00048:\\ \;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{+143}:\\ \;\;\;\;t \cdot \left(\left(\frac{\log \left(z \cdot \left(x + y\right)\right)}{t} + \log t \cdot \frac{a + -0.5}{t}\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;-1 + \left(1 - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.6% accurate, 1.0× speedup?

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

\\
\left(\left(\log z - t\right) + \log \left(x + y\right)\right) + \left(a + -0.5\right) \cdot \log 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. remove-double-neg99.6%

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

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

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

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

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

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

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

Alternative 5: 69.7% 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-undefine99.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.1%

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

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

Alternative 6: 70.0% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.9000000000000002e53 or 5.9999999999999998e29 < 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-undefine99.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 81.8%

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

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

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

    if -2.9000000000000002e53 < a < 5.9999999999999998e29

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 59.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -14 \lor \neg \left(a \leq 5.2\right):\\
\;\;\;\;a \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -14 or 5.20000000000000018 < 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-undefine99.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 76.5%

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

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

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

    if -14 < a < 5.20000000000000018

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \log \left(y \cdot \color{blue}{\left(e^{\log z} \cdot e^{\log t \cdot \left(a - 0.5\right)}\right)}\right) - t \]
      4. add-exp-log43.2%

        \[\leadsto \log \left(y \cdot \left(\color{blue}{z} \cdot e^{\log t \cdot \left(a - 0.5\right)}\right)\right) - t \]
      5. sub-neg43.2%

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

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

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

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

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

Alternative 8: 78.6% accurate, 1.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-1 + \left(1 - t\right)\\


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. sum-log71.5%

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

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

    if 9.50000000000000066e143 < 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-undefine100.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 89.2%

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

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

      \[\leadsto \color{blue}{-t} \]
    8. Step-by-step derivation
      1. expm1-log1p-u0.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-t\right)\right)} \]
      2. expm1-undefine0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    9. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    10. Step-by-step derivation
      1. sub-neg0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} + \left(-1\right)} \]
      2. log1p-undefine0.0%

        \[\leadsto e^{\color{blue}{\log \left(1 + \left(-t\right)\right)}} + \left(-1\right) \]
      3. rem-exp-log89.2%

        \[\leadsto \color{blue}{\left(1 + \left(-t\right)\right)} + \left(-1\right) \]
      4. unsub-neg89.2%

        \[\leadsto \color{blue}{\left(1 - t\right)} + \left(-1\right) \]
      5. metadata-eval89.2%

        \[\leadsto \left(1 - t\right) + \color{blue}{-1} \]
    11. Simplified89.2%

      \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.5%

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

Alternative 9: 66.5% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+53} \lor \neg \left(a \leq 1.9 \cdot 10^{+35}\right):\\
\;\;\;\;a \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.49999999999999975e53 or 1.9e35 < 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-undefine99.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 -5.49999999999999975e53 < a < 1.9e35

    1. Initial program 99.5%

      \[\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.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-undefine99.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 t around inf 61.6%

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

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

Alternative 10: 59.4% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;t \leq 6 \cdot 10^{+34}:\\
\;\;\;\;\left(\log z - t\right) + \log \left(x + y\right)\\

\mathbf{elif}\;t \leq 10^{+88}:\\
\;\;\;\;a \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < 9.5e6

    1. Initial program 99.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt56.9%

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

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

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

        \[\leadsto {\left(\sqrt{\color{blue}{\log t \cdot \left(a + -0.5\right)} + \left(\log \left(x + y\right) + \left(\log z - t\right)\right)}\right)}^{2} \]
      5. fma-define56.9%

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

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \color{blue}{\left(\log \left(x + y\right) + \log z\right) - t}\right)}\right)}^{2} \]
      7. sum-log37.4%

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right)}\right)}^{2} \]
    6. Applied egg-rr37.4%

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \log \left(\left(x + y\right) \cdot z\right) - t\right)}\right)}^{2}} \]
    7. Taylor expanded in t around 0 69.0%

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

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

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

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

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

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

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

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

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

    if 9.5e6 < t < 6.00000000000000037e34

    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.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-undefine99.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 56.9%

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

    if 6.00000000000000037e34 < t < 9.99999999999999959e87

    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-undefine99.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. Taylor expanded in a around inf 73.5%

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

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

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

    if 9.99999999999999959e87 < 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-undefine99.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 85.1%

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

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

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

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

Alternative 11: 61.0% accurate, 1.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-1 + \left(1 - t\right)\\


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

    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. remove-double-neg99.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt46.2%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right)}\right)}^{2} \]
    6. Applied egg-rr31.8%

      \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{fma}\left(\log t, a + -0.5, \log \left(\left(x + y\right) \cdot z\right) - t\right)}\right)}^{2}} \]
    7. Taylor expanded in x around 0 49.9%

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

    if 2.74999999999999985e143 < 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-undefine100.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 89.2%

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

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

      \[\leadsto \color{blue}{-t} \]
    8. Step-by-step derivation
      1. expm1-log1p-u0.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-t\right)\right)} \]
      2. expm1-undefine0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    9. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    10. Step-by-step derivation
      1. sub-neg0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} + \left(-1\right)} \]
      2. log1p-undefine0.0%

        \[\leadsto e^{\color{blue}{\log \left(1 + \left(-t\right)\right)}} + \left(-1\right) \]
      3. rem-exp-log89.2%

        \[\leadsto \color{blue}{\left(1 + \left(-t\right)\right)} + \left(-1\right) \]
      4. unsub-neg89.2%

        \[\leadsto \color{blue}{\left(1 - t\right)} + \left(-1\right) \]
      5. metadata-eval89.2%

        \[\leadsto \left(1 - t\right) + \color{blue}{-1} \]
    11. Simplified89.2%

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

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

Alternative 12: 61.6% accurate, 2.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.65999999999999994e87 < 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-undefine99.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 85.1%

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

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

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

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

Alternative 13: 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-undefine99.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 37.5%

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

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

    \[\leadsto \color{blue}{-t} \]
  8. Add Preprocessing

Alternative 14: 2.4% accurate, 313.0× speedup?

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

\\
0
\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-undefine99.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 37.5%

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

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

    \[\leadsto \color{blue}{-t} \]
  8. Step-by-step derivation
    1. expm1-log1p-u1.4%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-t\right)\right)} \]
    2. expm1-undefine1.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
  9. Applied egg-rr1.3%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
  10. Step-by-step derivation
    1. sub-neg1.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} + \left(-1\right)} \]
    2. log1p-undefine1.3%

      \[\leadsto e^{\color{blue}{\log \left(1 + \left(-t\right)\right)}} + \left(-1\right) \]
    3. rem-exp-log37.4%

      \[\leadsto \color{blue}{\left(1 + \left(-t\right)\right)} + \left(-1\right) \]
    4. unsub-neg37.4%

      \[\leadsto \color{blue}{\left(1 - t\right)} + \left(-1\right) \]
    5. metadata-eval37.4%

      \[\leadsto \left(1 - t\right) + \color{blue}{-1} \]
  11. Simplified37.4%

    \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
  12. Taylor expanded in t around 0 2.3%

    \[\leadsto \color{blue}{1} + -1 \]
  13. Step-by-step derivation
    1. metadata-eval2.3%

      \[\leadsto \color{blue}{0} \]
  14. Applied egg-rr2.3%

    \[\leadsto \color{blue}{0} \]
  15. Add Preprocessing

Developer Target 1: 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 2024185 
(FPCore (x y z t a)
  :name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (log (+ x y)) (+ (- (log z) t) (* (- a 1/2) (log t)))))

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