Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.5%
Time: 12.7s
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.5% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \left(\mathsf{fma}\left(-0.5 + a, \log t, \mathsf{fma}\left({\left(\frac{x}{y}\right)}^{3}, 0.3333333333333333, \frac{\mathsf{fma}\left(x \cdot \frac{x}{y}, -0.5, x\right)}{y}\right)\right) + \left(\log z + \log y\right)\right) - t \end{array} \]
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (-
  (+
   (fma
    (+ -0.5 a)
    (log t)
    (fma
     (pow (/ x y) 3.0)
     0.3333333333333333
     (/ (fma (* x (/ x y)) -0.5 x) y)))
   (+ (log z) (log y)))
  t))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	return (fma((-0.5 + a), log(t), fma(pow((x / y), 3.0), 0.3333333333333333, (fma((x * (x / y)), -0.5, x) / y))) + (log(z) + log(y))) - t;
}
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	return Float64(Float64(fma(Float64(-0.5 + a), log(t), fma((Float64(x / y) ^ 3.0), 0.3333333333333333, Float64(fma(Float64(x * Float64(x / y)), -0.5, x) / y))) + Float64(log(z) + log(y))) - t)
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[(-0.5 + a), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Power[N[(x / y), $MachinePrecision], 3.0], $MachinePrecision] * 0.3333333333333333 + N[(N[(N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision] * -0.5 + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\left(\mathsf{fma}\left(-0.5 + a, \log t, \mathsf{fma}\left({\left(\frac{x}{y}\right)}^{3}, 0.3333333333333333, \frac{\mathsf{fma}\left(x \cdot \frac{x}{y}, -0.5, x\right)}{y}\right)\right) + \left(\log z + \log y\right)\right) - 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. Add Preprocessing
  3. Taylor expanded in y around inf

    \[\leadsto \color{blue}{\left(\log z + \left(-1 \cdot \log \left(\frac{1}{y}\right) + \left(\frac{-1}{2} \cdot \frac{{x}^{2}}{{y}^{2}} + \left(\frac{1}{3} \cdot \frac{{x}^{3}}{{y}^{3}} + \left(\log t \cdot \left(a - \frac{1}{2}\right) + \frac{x}{y}\right)\right)\right)\right)\right) - t} \]
  4. Applied rewrites48.9%

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

Alternative 2: 70.2% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\ \mathbf{if}\;t\_1 \leq -500:\\ \;\;\;\;-t\\ \mathbf{elif}\;t\_1 \leq 700:\\ \;\;\;\;\log \left(\frac{\left(y + x\right) \cdot z}{\sqrt{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot a\\ \end{array} \end{array} \]
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t)))))
   (if (<= t_1 -500.0)
     (- t)
     (if (<= t_1 700.0) (log (/ (* (+ y x) z) (sqrt t))) (* (log t) a)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
	double tmp;
	if (t_1 <= -500.0) {
		tmp = -t;
	} else if (t_1 <= 700.0) {
		tmp = log((((y + x) * z) / sqrt(t)));
	} else {
		tmp = log(t) * a;
	}
	return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
    if (t_1 <= (-500.0d0)) then
        tmp = -t
    else if (t_1 <= 700.0d0) then
        tmp = log((((y + x) * z) / sqrt(t)))
    else
        tmp = log(t) * a
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
	double tmp;
	if (t_1 <= -500.0) {
		tmp = -t;
	} else if (t_1 <= 700.0) {
		tmp = Math.log((((y + x) * z) / Math.sqrt(t)));
	} else {
		tmp = Math.log(t) * a;
	}
	return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	t_1 = ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
	tmp = 0
	if t_1 <= -500.0:
		tmp = -t
	elif t_1 <= 700.0:
		tmp = math.log((((y + x) * z) / math.sqrt(t)))
	else:
		tmp = math.log(t) * a
	return tmp
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t)))
	tmp = 0.0
	if (t_1 <= -500.0)
		tmp = Float64(-t);
	elseif (t_1 <= 700.0)
		tmp = log(Float64(Float64(Float64(y + x) * z) / sqrt(t)));
	else
		tmp = Float64(log(t) * a);
	end
	return tmp
end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
	tmp = 0.0;
	if (t_1 <= -500.0)
		tmp = -t;
	elseif (t_1 <= 700.0)
		tmp = log((((y + x) * z) / sqrt(t)));
	else
		tmp = log(t) * a;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -500.0], (-t), If[LessEqual[t$95$1, 700.0], N[Log[N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;-t\\

\mathbf{elif}\;t\_1 \leq 700:\\
\;\;\;\;\log \left(\frac{\left(y + x\right) \cdot z}{\sqrt{t}}\right)\\

\mathbf{else}:\\
\;\;\;\;\log t \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < -500

    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. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \color{blue}{-1 \cdot t} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
      2. lower-neg.f6462.5

        \[\leadsto \color{blue}{-t} \]
    5. Applied rewrites62.5%

      \[\leadsto \color{blue}{-t} \]

    if -500 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < 700

    1. Initial program 98.8%

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

      \[\leadsto \color{blue}{\left(\log z + \left(\log \left(x + y\right) + \frac{-1}{2} \cdot \log t\right)\right) - t} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) + \frac{-1}{2} \cdot \log t\right)} - t \]
      2. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) - \left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t\right)} - t \]
      3. associate--l-N/A

        \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
      4. lower--.f64N/A

        \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
      6. lower-+.f64N/A

        \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
      7. lower-log.f64N/A

        \[\leadsto \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
      8. +-commutativeN/A

        \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
      10. lower-log.f64N/A

        \[\leadsto \left(\log \left(y + x\right) + \color{blue}{\log z}\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
      11. metadata-evalN/A

        \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \left(\color{blue}{\frac{1}{2}} \cdot \log t + t\right) \]
      12. lower-fma.f64N/A

        \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \color{blue}{\mathsf{fma}\left(\frac{1}{2}, \log t, t\right)} \]
      13. lower-log.f6498.3

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

      \[\leadsto \color{blue}{\left(\log \left(y + x\right) + \log z\right) - \mathsf{fma}\left(0.5, \log t, t\right)} \]
    6. Taylor expanded in t around 0

      \[\leadsto \left(\log z + \log \left(x + y\right)\right) - \color{blue}{\frac{1}{2} \cdot \log t} \]
    7. Step-by-step derivation
      1. Applied rewrites97.1%

        \[\leadsto \mathsf{fma}\left(-0.5, \log t, \log \left(y + x\right)\right) + \color{blue}{\log z} \]
      2. Step-by-step derivation
        1. Applied rewrites98.3%

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

        if 700 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t)))

        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. Add Preprocessing
        3. Taylor expanded in a around inf

          \[\leadsto \color{blue}{a \cdot \log t} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\log t \cdot a} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\log t \cdot a} \]
          3. lower-log.f6468.2

            \[\leadsto \color{blue}{\log t} \cdot a \]
        5. Applied rewrites68.2%

          \[\leadsto \color{blue}{\log t \cdot a} \]
      3. Recombined 3 regimes into one program.
      4. Add Preprocessing

      Alternative 3: 88.1% accurate, 0.6× speedup?

      \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;\log \left(x + y\right) + \log z \leq 680:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log z + \log y\right)\\ \end{array} \end{array} \]
      NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
      (FPCore (x y z t a)
       :precision binary64
       (if (<= (+ (log (+ x y)) (log z)) 680.0)
         (fma (- a 0.5) (log t) (- (log (* z (+ y x))) t))
         (fma (- a 0.5) (log t) (+ (log z) (log y)))))
      assert(x < y && y < z && z < t && t < a);
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((log((x + y)) + log(z)) <= 680.0) {
      		tmp = fma((a - 0.5), log(t), (log((z * (y + x))) - t));
      	} else {
      		tmp = fma((a - 0.5), log(t), (log(z) + log(y)));
      	}
      	return tmp;
      }
      
      x, y, z, t, a = sort([x, y, z, t, a])
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (Float64(log(Float64(x + y)) + log(z)) <= 680.0)
      		tmp = fma(Float64(a - 0.5), log(t), Float64(log(Float64(z * Float64(y + x))) - t));
      	else
      		tmp = fma(Float64(a - 0.5), log(t), Float64(log(z) + log(y)));
      	end
      	return tmp
      end
      
      NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision], 680.0], N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;\log \left(x + y\right) + \log z \leq 680:\\
      \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log z + \log y\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 680

        1. Initial program 99.6%

          \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

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

            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t + \left(\left(\log \left(x + y\right) + \log z\right) - t\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} + \left(\left(\log \left(x + y\right) + \log z\right) - t\right) \]
          4. lower-fma.f6499.6

            \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, \log t, \left(\log \left(x + y\right) + \log z\right) - t\right)} \]
          5. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) \]
          6. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) \]
          7. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) \]
          8. sum-logN/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) \]
          9. lower-log.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) \]
          10. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) \]
          11. lower-*.f6496.7

            \[\leadsto \mathsf{fma}\left(a - 0.5, \log t, \log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) \]
          12. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) \]
          13. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) \]
          14. lower-+.f6496.7

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

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

        if 680 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z))

        1. Initial program 99.6%

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

          \[\leadsto \left(\left(\color{blue}{\log y} + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t \]
        4. Step-by-step derivation
          1. lower-log.f6464.1

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

          \[\leadsto \left(\left(\color{blue}{\log y} + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
        6. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(\left(\log y + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t + \left(\left(\log y + \log z\right) - t\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} + \left(\left(\log y + \log z\right) - t\right) \]
          4. lower-fma.f6464.1

            \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, \log t, \left(\log y + \log z\right) - t\right)} \]
          5. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log y + \log z\right) - t}\right) \]
          6. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log y + \log z\right)} - t\right) \]
          7. associate--l+N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log y + \left(\log z - t\right)}\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log y + \color{blue}{\left(\log z - t\right)}\right) \]
          9. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log z - t\right) + \log y}\right) \]
          10. lower-+.f6464.1

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, \log t, \left(\log z - t\right) + \log y\right)} \]
        8. Taylor expanded in t around 0

          \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log z} + \log y\right) \]
        9. Step-by-step derivation
          1. lower-log.f6450.1

            \[\leadsto \mathsf{fma}\left(a - 0.5, \log t, \color{blue}{\log z} + \log y\right) \]
        10. Applied rewrites50.1%

          \[\leadsto \mathsf{fma}\left(a - 0.5, \log t, \color{blue}{\log z} + \log y\right) \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 4: 83.4% accurate, 0.7× speedup?

      \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;\log \left(x + y\right) + \log z \leq 700:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot a\\ \end{array} \end{array} \]
      NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
      (FPCore (x y z t a)
       :precision binary64
       (if (<= (+ (log (+ x y)) (log z)) 700.0)
         (fma (- a 0.5) (log t) (- (log (* z (+ y x))) t))
         (* (log t) a)))
      assert(x < y && y < z && z < t && t < a);
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if ((log((x + y)) + log(z)) <= 700.0) {
      		tmp = fma((a - 0.5), log(t), (log((z * (y + x))) - t));
      	} else {
      		tmp = log(t) * a;
      	}
      	return tmp;
      }
      
      x, y, z, t, a = sort([x, y, z, t, a])
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (Float64(log(Float64(x + y)) + log(z)) <= 700.0)
      		tmp = fma(Float64(a - 0.5), log(t), Float64(log(Float64(z * Float64(y + x))) - t));
      	else
      		tmp = Float64(log(t) * a);
      	end
      	return tmp
      end
      
      NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision], 700.0], N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]]
      
      \begin{array}{l}
      [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;\log \left(x + y\right) + \log z \leq 700:\\
      \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\log t \cdot a\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700

        1. Initial program 99.6%

          \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

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

            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t + \left(\left(\log \left(x + y\right) + \log z\right) - t\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} + \left(\left(\log \left(x + y\right) + \log z\right) - t\right) \]
          4. lower-fma.f6499.6

            \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, \log t, \left(\log \left(x + y\right) + \log z\right) - t\right)} \]
          5. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) \]
          6. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) \]
          7. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) \]
          8. sum-logN/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) \]
          9. lower-log.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) \]
          10. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) \]
          11. lower-*.f6496.7

            \[\leadsto \mathsf{fma}\left(a - 0.5, \log t, \log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) \]
          12. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) \]
          13. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) \]
          14. lower-+.f6496.7

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

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

        if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z))

        1. Initial program 99.6%

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

          \[\leadsto \color{blue}{a \cdot \log t} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\log t \cdot a} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\log t \cdot a} \]
          3. lower-log.f6445.6

            \[\leadsto \color{blue}{\log t} \cdot a \]
        5. Applied rewrites45.6%

          \[\leadsto \color{blue}{\log t \cdot a} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 5: 87.6% accurate, 1.0× speedup?

      \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := \log t \cdot a\\ \mathbf{if}\;a \leq -1 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-6}:\\ \;\;\;\;\left(\log y + \log z\right) - \mathsf{fma}\left(0.5, \log t, t\right)\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+91}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
      (FPCore (x y z t a)
       :precision binary64
       (let* ((t_1 (* (log t) a)))
         (if (<= a -1e+20)
           t_1
           (if (<= a 5e-6)
             (- (+ (log y) (log z)) (fma 0.5 (log t) t))
             (if (<= a 2.9e+91)
               (fma (- a 0.5) (log t) (- (log (* z (+ y x))) t))
               t_1)))))
      assert(x < y && y < z && z < t && t < a);
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = log(t) * a;
      	double tmp;
      	if (a <= -1e+20) {
      		tmp = t_1;
      	} else if (a <= 5e-6) {
      		tmp = (log(y) + log(z)) - fma(0.5, log(t), t);
      	} else if (a <= 2.9e+91) {
      		tmp = fma((a - 0.5), log(t), (log((z * (y + x))) - t));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      x, y, z, t, a = sort([x, y, z, t, a])
      function code(x, y, z, t, a)
      	t_1 = Float64(log(t) * a)
      	tmp = 0.0
      	if (a <= -1e+20)
      		tmp = t_1;
      	elseif (a <= 5e-6)
      		tmp = Float64(Float64(log(y) + log(z)) - fma(0.5, log(t), t));
      	elseif (a <= 2.9e+91)
      		tmp = fma(Float64(a - 0.5), log(t), Float64(log(Float64(z * Float64(y + x))) - t));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1e+20], t$95$1, If[LessEqual[a, 5e-6], N[(N[(N[Log[y], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(0.5 * N[Log[t], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.9e+91], N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
      \\
      \begin{array}{l}
      t_1 := \log t \cdot a\\
      \mathbf{if}\;a \leq -1 \cdot 10^{+20}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;a \leq 5 \cdot 10^{-6}:\\
      \;\;\;\;\left(\log y + \log z\right) - \mathsf{fma}\left(0.5, \log t, t\right)\\
      
      \mathbf{elif}\;a \leq 2.9 \cdot 10^{+91}:\\
      \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if a < -1e20 or 2.90000000000000014e91 < 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. Add Preprocessing
        3. Taylor expanded in a around inf

          \[\leadsto \color{blue}{a \cdot \log t} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\log t \cdot a} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\log t \cdot a} \]
          3. lower-log.f6490.5

            \[\leadsto \color{blue}{\log t} \cdot a \]
        5. Applied rewrites90.5%

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

        if -1e20 < a < 5.00000000000000041e-6

        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. Add Preprocessing
        3. Taylor expanded in a around 0

          \[\leadsto \color{blue}{\left(\log z + \left(\log \left(x + y\right) + \frac{-1}{2} \cdot \log t\right)\right) - t} \]
        4. Step-by-step derivation
          1. associate-+r+N/A

            \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) + \frac{-1}{2} \cdot \log t\right)} - t \]
          2. fp-cancel-sign-sub-invN/A

            \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) - \left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t\right)} - t \]
          3. associate--l-N/A

            \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
          4. lower--.f64N/A

            \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
          5. +-commutativeN/A

            \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
          6. lower-+.f64N/A

            \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
          7. lower-log.f64N/A

            \[\leadsto \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
          8. +-commutativeN/A

            \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
          9. lower-+.f64N/A

            \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
          10. lower-log.f64N/A

            \[\leadsto \left(\log \left(y + x\right) + \color{blue}{\log z}\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
          11. metadata-evalN/A

            \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \left(\color{blue}{\frac{1}{2}} \cdot \log t + t\right) \]
          12. lower-fma.f64N/A

            \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \color{blue}{\mathsf{fma}\left(\frac{1}{2}, \log t, t\right)} \]
          13. lower-log.f6498.3

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

          \[\leadsto \color{blue}{\left(\log \left(y + x\right) + \log z\right) - \mathsf{fma}\left(0.5, \log t, t\right)} \]
        6. Taylor expanded in x around 0

          \[\leadsto \left(\log y + \log z\right) - \mathsf{fma}\left(\frac{1}{2}, \log t, t\right) \]
        7. Step-by-step derivation
          1. Applied rewrites60.0%

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

          if 5.00000000000000041e-6 < a < 2.90000000000000014e91

          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. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t + \left(\left(\log \left(x + y\right) + \log z\right) - t\right)} \]
            3. lift-*.f64N/A

              \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} + \left(\left(\log \left(x + y\right) + \log z\right) - t\right) \]
            4. lower-fma.f6499.8

              \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, \log t, \left(\log \left(x + y\right) + \log z\right) - t\right)} \]
            5. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) \]
            6. lift-log.f64N/A

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) \]
            7. lift-log.f64N/A

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) \]
            8. sum-logN/A

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) \]
            9. lower-log.f64N/A

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) \]
            10. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) \]
            11. lower-*.f6486.2

              \[\leadsto \mathsf{fma}\left(a - 0.5, \log t, \log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) \]
            12. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) \]
            13. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) \]
            14. lower-+.f6486.2

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)} \]
        8. Recombined 3 regimes into one program.
        9. Final simplification74.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{+20}:\\ \;\;\;\;\log t \cdot a\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-6}:\\ \;\;\;\;\left(\log y + \log z\right) - \mathsf{fma}\left(0.5, \log t, t\right)\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+91}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot a\\ \end{array} \]
        10. Add Preprocessing

        Alternative 6: 99.6% accurate, 1.0× speedup?

        \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \end{array} \]
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        (FPCore (x y z t a)
         :precision binary64
         (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
        assert(x < y && y < z && z < t && t < a);
        double code(double x, double y, double z, double t, double a) {
        	return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
        }
        
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        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
        
        assert x < y && y < z && z < t && t < a;
        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));
        }
        
        [x, y, z, t, a] = sort([x, y, z, t, a])
        def code(x, y, z, t, a):
        	return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
        
        x, y, z, t, a = sort([x, y, z, t, a])
        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
        
        x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
        function tmp = code(x, y, z, t, a)
        	tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
        end
        
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        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}
        [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
        \\
        \left(\left(\log \left(x + y\right) + \log z\right) - t\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. Add Preprocessing
        3. Add Preprocessing

        Alternative 7: 99.3% accurate, 1.0× speedup?

        \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \mathsf{fma}\left(a - 0.5, \log t, \left(\log z - t\right) + \log y\right) \end{array} \]
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        (FPCore (x y z t a)
         :precision binary64
         (fma (- a 0.5) (log t) (+ (- (log z) t) (log y))))
        assert(x < y && y < z && z < t && t < a);
        double code(double x, double y, double z, double t, double a) {
        	return fma((a - 0.5), log(t), ((log(z) - t) + log(y)));
        }
        
        x, y, z, t, a = sort([x, y, z, t, a])
        function code(x, y, z, t, a)
        	return fma(Float64(a - 0.5), log(t), Float64(Float64(log(z) - t) + log(y)))
        end
        
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_, a_] := N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
        \\
        \mathsf{fma}\left(a - 0.5, \log t, \left(\log z - t\right) + \log y\right)
        \end{array}
        
        Derivation
        1. Initial program 99.6%

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

          \[\leadsto \left(\left(\color{blue}{\log y} + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t \]
        4. Step-by-step derivation
          1. lower-log.f6465.3

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

          \[\leadsto \left(\left(\color{blue}{\log y} + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
        6. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(\left(\log y + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t + \left(\left(\log y + \log z\right) - t\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} + \left(\left(\log y + \log z\right) - t\right) \]
          4. lower-fma.f6465.3

            \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, \log t, \left(\log y + \log z\right) - t\right)} \]
          5. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log y + \log z\right) - t}\right) \]
          6. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log y + \log z\right)} - t\right) \]
          7. associate--l+N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log y + \left(\log z - t\right)}\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log y + \color{blue}{\left(\log z - t\right)}\right) \]
          9. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log z - t\right) + \log y}\right) \]
          10. lower-+.f6465.3

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

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

        Alternative 8: 99.3% accurate, 1.0× speedup?

        \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \mathsf{fma}\left(-0.5 + a, \log t, \log z\right) + \left(\log y - t\right) \end{array} \]
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        (FPCore (x y z t a)
         :precision binary64
         (+ (fma (+ -0.5 a) (log t) (log z)) (- (log y) t)))
        assert(x < y && y < z && z < t && t < a);
        double code(double x, double y, double z, double t, double a) {
        	return fma((-0.5 + a), log(t), log(z)) + (log(y) - t);
        }
        
        x, y, z, t, a = sort([x, y, z, t, a])
        function code(x, y, z, t, a)
        	return Float64(fma(Float64(-0.5 + a), log(t), log(z)) + Float64(log(y) - t))
        end
        
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_, a_] := N[(N[(N[(-0.5 + a), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
        \\
        \mathsf{fma}\left(-0.5 + a, \log t, \log z\right) + \left(\log y - 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. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\left(\log y + \left(\log z + \log t \cdot \left(a - \frac{1}{2}\right)\right)\right) - t} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{\left(\left(\log z + \log t \cdot \left(a - \frac{1}{2}\right)\right) + \log y\right)} - t \]
          2. associate--l+N/A

            \[\leadsto \color{blue}{\left(\log z + \log t \cdot \left(a - \frac{1}{2}\right)\right) + \left(\log y - t\right)} \]
          3. lower-+.f64N/A

            \[\leadsto \color{blue}{\left(\log z + \log t \cdot \left(a - \frac{1}{2}\right)\right) + \left(\log y - t\right)} \]
          4. +-commutativeN/A

            \[\leadsto \color{blue}{\left(\log t \cdot \left(a - \frac{1}{2}\right) + \log z\right)} + \left(\log y - t\right) \]
          5. distribute-rgt-out--N/A

            \[\leadsto \left(\color{blue}{\left(a \cdot \log t - \frac{1}{2} \cdot \log t\right)} + \log z\right) + \left(\log y - t\right) \]
          6. metadata-evalN/A

            \[\leadsto \left(\left(a \cdot \log t - \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \log t\right) + \log z\right) + \left(\log y - t\right) \]
          7. fp-cancel-sign-sub-invN/A

            \[\leadsto \left(\color{blue}{\left(a \cdot \log t + \frac{-1}{2} \cdot \log t\right)} + \log z\right) + \left(\log y - t\right) \]
          8. distribute-rgt-outN/A

            \[\leadsto \left(\color{blue}{\log t \cdot \left(a + \frac{-1}{2}\right)} + \log z\right) + \left(\log y - t\right) \]
          9. +-commutativeN/A

            \[\leadsto \left(\log t \cdot \color{blue}{\left(\frac{-1}{2} + a\right)} + \log z\right) + \left(\log y - t\right) \]
          10. *-commutativeN/A

            \[\leadsto \left(\color{blue}{\left(\frac{-1}{2} + a\right) \cdot \log t} + \log z\right) + \left(\log y - t\right) \]
          11. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2} + a, \log t, \log z\right)} + \left(\log y - t\right) \]
          12. lower-+.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} + a}, \log t, \log z\right) + \left(\log y - t\right) \]
          13. lower-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} + a, \color{blue}{\log t}, \log z\right) + \left(\log y - t\right) \]
          14. lower-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} + a, \log t, \color{blue}{\log z}\right) + \left(\log y - t\right) \]
          15. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} + a, \log t, \log z\right) + \color{blue}{\left(\log y - t\right)} \]
          16. lower-log.f6465.3

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

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

        Alternative 9: 83.0% accurate, 1.3× speedup?

        \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := \log t \cdot a\\ \mathbf{if}\;a \leq -1 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-6}:\\ \;\;\;\;\left(\log \left(\frac{z}{\sqrt{t}}\right) - t\right) + \log \left(y + x\right)\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+91}:\\ \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        (FPCore (x y z t a)
         :precision binary64
         (let* ((t_1 (* (log t) a)))
           (if (<= a -1e+20)
             t_1
             (if (<= a 2.8e-6)
               (+ (- (log (/ z (sqrt t))) t) (log (+ y x)))
               (if (<= a 2.9e+91)
                 (fma (- a 0.5) (log t) (- (log (* z (+ y x))) t))
                 t_1)))))
        assert(x < y && y < z && z < t && t < a);
        double code(double x, double y, double z, double t, double a) {
        	double t_1 = log(t) * a;
        	double tmp;
        	if (a <= -1e+20) {
        		tmp = t_1;
        	} else if (a <= 2.8e-6) {
        		tmp = (log((z / sqrt(t))) - t) + log((y + x));
        	} else if (a <= 2.9e+91) {
        		tmp = fma((a - 0.5), log(t), (log((z * (y + x))) - t));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        x, y, z, t, a = sort([x, y, z, t, a])
        function code(x, y, z, t, a)
        	t_1 = Float64(log(t) * a)
        	tmp = 0.0
        	if (a <= -1e+20)
        		tmp = t_1;
        	elseif (a <= 2.8e-6)
        		tmp = Float64(Float64(log(Float64(z / sqrt(t))) - t) + log(Float64(y + x)));
        	elseif (a <= 2.9e+91)
        		tmp = fma(Float64(a - 0.5), log(t), Float64(log(Float64(z * Float64(y + x))) - t));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1e+20], t$95$1, If[LessEqual[a, 2.8e-6], N[(N[(N[Log[N[(z / N[Sqrt[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(y + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.9e+91], N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
        
        \begin{array}{l}
        [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
        \\
        \begin{array}{l}
        t_1 := \log t \cdot a\\
        \mathbf{if}\;a \leq -1 \cdot 10^{+20}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;a \leq 2.8 \cdot 10^{-6}:\\
        \;\;\;\;\left(\log \left(\frac{z}{\sqrt{t}}\right) - t\right) + \log \left(y + x\right)\\
        
        \mathbf{elif}\;a \leq 2.9 \cdot 10^{+91}:\\
        \;\;\;\;\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if a < -1e20 or 2.90000000000000014e91 < 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. Add Preprocessing
          3. Taylor expanded in a around inf

            \[\leadsto \color{blue}{a \cdot \log t} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{\log t \cdot a} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\log t \cdot a} \]
            3. lower-log.f6490.5

              \[\leadsto \color{blue}{\log t} \cdot a \]
          5. Applied rewrites90.5%

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

          if -1e20 < a < 2.79999999999999987e-6

          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. Add Preprocessing
          3. Taylor expanded in a around 0

            \[\leadsto \color{blue}{\left(\log z + \left(\log \left(x + y\right) + \frac{-1}{2} \cdot \log t\right)\right) - t} \]
          4. Step-by-step derivation
            1. associate-+r+N/A

              \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) + \frac{-1}{2} \cdot \log t\right)} - t \]
            2. fp-cancel-sign-sub-invN/A

              \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) - \left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t\right)} - t \]
            3. associate--l-N/A

              \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
            4. lower--.f64N/A

              \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
            5. +-commutativeN/A

              \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
            6. lower-+.f64N/A

              \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
            7. lower-log.f64N/A

              \[\leadsto \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
            8. +-commutativeN/A

              \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
            9. lower-+.f64N/A

              \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
            10. lower-log.f64N/A

              \[\leadsto \left(\log \left(y + x\right) + \color{blue}{\log z}\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
            11. metadata-evalN/A

              \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \left(\color{blue}{\frac{1}{2}} \cdot \log t + t\right) \]
            12. lower-fma.f64N/A

              \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \color{blue}{\mathsf{fma}\left(\frac{1}{2}, \log t, t\right)} \]
            13. lower-log.f6498.3

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

            \[\leadsto \color{blue}{\left(\log \left(y + x\right) + \log z\right) - \mathsf{fma}\left(0.5, \log t, t\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites89.3%

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

            if 2.79999999999999987e-6 < a < 2.90000000000000014e91

            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. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t + \left(\left(\log \left(x + y\right) + \log z\right) - t\right)} \]
              3. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} + \left(\left(\log \left(x + y\right) + \log z\right) - t\right) \]
              4. lower-fma.f6499.8

                \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, \log t, \left(\log \left(x + y\right) + \log z\right) - t\right)} \]
              5. lift-+.f64N/A

                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) \]
              6. lift-log.f64N/A

                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) \]
              7. lift-log.f64N/A

                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) \]
              8. sum-logN/A

                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) \]
              9. lower-log.f64N/A

                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) \]
              10. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) \]
              11. lower-*.f6486.2

                \[\leadsto \mathsf{fma}\left(a - 0.5, \log t, \log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) \]
              12. lift-+.f64N/A

                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) \]
              13. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a - \frac{1}{2}, \log t, \log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) \]
              14. lower-+.f6486.2

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(a - 0.5, \log t, \log \left(z \cdot \left(y + x\right)\right) - t\right)} \]
          7. Recombined 3 regimes into one program.
          8. Add Preprocessing

          Alternative 10: 74.9% accurate, 1.4× speedup?

          \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+14} \lor \neg \left(a - 0.5 \leq -0.4\right):\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;\log \left(\left(y + x\right) \cdot z\right) - \mathsf{fma}\left(\log t, 0.5, t\right)\\ \end{array} \end{array} \]
          NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
          (FPCore (x y z t a)
           :precision binary64
           (if (or (<= (- a 0.5) -4e+14) (not (<= (- a 0.5) -0.4)))
             (* (log t) a)
             (- (log (* (+ y x) z)) (fma (log t) 0.5 t))))
          assert(x < y && y < z && z < t && t < a);
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (((a - 0.5) <= -4e+14) || !((a - 0.5) <= -0.4)) {
          		tmp = log(t) * a;
          	} else {
          		tmp = log(((y + x) * z)) - fma(log(t), 0.5, t);
          	}
          	return tmp;
          }
          
          x, y, z, t, a = sort([x, y, z, t, a])
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if ((Float64(a - 0.5) <= -4e+14) || !(Float64(a - 0.5) <= -0.4))
          		tmp = Float64(log(t) * a);
          	else
          		tmp = Float64(log(Float64(Float64(y + x) * z)) - fma(log(t), 0.5, t));
          	end
          	return tmp
          end
          
          NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
          code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -4e+14], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * 0.5 + t), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+14} \lor \neg \left(a - 0.5 \leq -0.4\right):\\
          \;\;\;\;\log t \cdot a\\
          
          \mathbf{else}:\\
          \;\;\;\;\log \left(\left(y + x\right) \cdot z\right) - \mathsf{fma}\left(\log t, 0.5, t\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (-.f64 a #s(literal 1/2 binary64)) < -4e14 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64))

            1. Initial program 99.6%

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

              \[\leadsto \color{blue}{a \cdot \log t} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{\log t \cdot a} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{\log t \cdot a} \]
              3. lower-log.f6484.8

                \[\leadsto \color{blue}{\log t} \cdot a \]
            5. Applied rewrites84.8%

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

            if -4e14 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002

            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. Add Preprocessing
            3. Taylor expanded in a around 0

              \[\leadsto \color{blue}{\left(\log z + \left(\log \left(x + y\right) + \frac{-1}{2} \cdot \log t\right)\right) - t} \]
            4. Step-by-step derivation
              1. associate-+r+N/A

                \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) + \frac{-1}{2} \cdot \log t\right)} - t \]
              2. fp-cancel-sign-sub-invN/A

                \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) - \left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t\right)} - t \]
              3. associate--l-N/A

                \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
              4. lower--.f64N/A

                \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
              5. +-commutativeN/A

                \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
              6. lower-+.f64N/A

                \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
              7. lower-log.f64N/A

                \[\leadsto \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
              8. +-commutativeN/A

                \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
              9. lower-+.f64N/A

                \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
              10. lower-log.f64N/A

                \[\leadsto \left(\log \left(y + x\right) + \color{blue}{\log z}\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
              11. metadata-evalN/A

                \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \left(\color{blue}{\frac{1}{2}} \cdot \log t + t\right) \]
              12. lower-fma.f64N/A

                \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \color{blue}{\mathsf{fma}\left(\frac{1}{2}, \log t, t\right)} \]
              13. lower-log.f6498.3

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

              \[\leadsto \color{blue}{\left(\log \left(y + x\right) + \log z\right) - \mathsf{fma}\left(0.5, \log t, t\right)} \]
            6. Step-by-step derivation
              1. Applied rewrites74.3%

                \[\leadsto \log \left(\left(y + x\right) \cdot z\right) - \color{blue}{\mathsf{fma}\left(\log t, 0.5, t\right)} \]
            7. Recombined 2 regimes into one program.
            8. Final simplification79.2%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+14} \lor \neg \left(a - 0.5 \leq -0.4\right):\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;\log \left(\left(y + x\right) \cdot z\right) - \mathsf{fma}\left(\log t, 0.5, t\right)\\ \end{array} \]
            9. Add Preprocessing

            Alternative 11: 74.6% accurate, 1.4× speedup?

            \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+14} \lor \neg \left(a - 0.5 \leq -0.4\right):\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;\log \left(y \cdot z\right) - \mathsf{fma}\left(\log t, 0.5, t\right)\\ \end{array} \end{array} \]
            NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
            (FPCore (x y z t a)
             :precision binary64
             (if (or (<= (- a 0.5) -4e+14) (not (<= (- a 0.5) -0.4)))
               (* (log t) a)
               (- (log (* y z)) (fma (log t) 0.5 t))))
            assert(x < y && y < z && z < t && t < a);
            double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if (((a - 0.5) <= -4e+14) || !((a - 0.5) <= -0.4)) {
            		tmp = log(t) * a;
            	} else {
            		tmp = log((y * z)) - fma(log(t), 0.5, t);
            	}
            	return tmp;
            }
            
            x, y, z, t, a = sort([x, y, z, t, a])
            function code(x, y, z, t, a)
            	tmp = 0.0
            	if ((Float64(a - 0.5) <= -4e+14) || !(Float64(a - 0.5) <= -0.4))
            		tmp = Float64(log(t) * a);
            	else
            		tmp = Float64(log(Float64(y * z)) - fma(log(t), 0.5, t));
            	end
            	return tmp
            end
            
            NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
            code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -4e+14], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * 0.5 + t), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+14} \lor \neg \left(a - 0.5 \leq -0.4\right):\\
            \;\;\;\;\log t \cdot a\\
            
            \mathbf{else}:\\
            \;\;\;\;\log \left(y \cdot z\right) - \mathsf{fma}\left(\log t, 0.5, t\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (-.f64 a #s(literal 1/2 binary64)) < -4e14 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64))

              1. Initial program 99.6%

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

                \[\leadsto \color{blue}{a \cdot \log t} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{\log t \cdot a} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\log t \cdot a} \]
                3. lower-log.f6484.8

                  \[\leadsto \color{blue}{\log t} \cdot a \]
              5. Applied rewrites84.8%

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

              if -4e14 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002

              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. Add Preprocessing
              3. Taylor expanded in a around 0

                \[\leadsto \color{blue}{\left(\log z + \left(\log \left(x + y\right) + \frac{-1}{2} \cdot \log t\right)\right) - t} \]
              4. Step-by-step derivation
                1. associate-+r+N/A

                  \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) + \frac{-1}{2} \cdot \log t\right)} - t \]
                2. fp-cancel-sign-sub-invN/A

                  \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) - \left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t\right)} - t \]
                3. associate--l-N/A

                  \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
                4. lower--.f64N/A

                  \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
                5. +-commutativeN/A

                  \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                6. lower-+.f64N/A

                  \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                7. lower-log.f64N/A

                  \[\leadsto \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                8. +-commutativeN/A

                  \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                9. lower-+.f64N/A

                  \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                10. lower-log.f64N/A

                  \[\leadsto \left(\log \left(y + x\right) + \color{blue}{\log z}\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                11. metadata-evalN/A

                  \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \left(\color{blue}{\frac{1}{2}} \cdot \log t + t\right) \]
                12. lower-fma.f64N/A

                  \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \color{blue}{\mathsf{fma}\left(\frac{1}{2}, \log t, t\right)} \]
                13. lower-log.f6498.3

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

                \[\leadsto \color{blue}{\left(\log \left(y + x\right) + \log z\right) - \mathsf{fma}\left(0.5, \log t, t\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites74.3%

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

                  \[\leadsto \log \left(y \cdot z\right) - \mathsf{fma}\left(\log \color{blue}{t}, \frac{1}{2}, t\right) \]
                3. Step-by-step derivation
                  1. Applied rewrites46.3%

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

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

                Alternative 12: 71.7% accurate, 2.1× speedup?

                \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+14} \lor \neg \left(a - 0.5 \leq -0.4\right):\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;\log \left(\frac{\left(y + x\right) \cdot z}{\sqrt{t}}\right) - t\\ \end{array} \end{array} \]
                NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
                (FPCore (x y z t a)
                 :precision binary64
                 (if (or (<= (- a 0.5) -4e+14) (not (<= (- a 0.5) -0.4)))
                   (* (log t) a)
                   (- (log (/ (* (+ y x) z) (sqrt t))) t)))
                assert(x < y && y < z && z < t && t < a);
                double code(double x, double y, double z, double t, double a) {
                	double tmp;
                	if (((a - 0.5) <= -4e+14) || !((a - 0.5) <= -0.4)) {
                		tmp = log(t) * a;
                	} else {
                		tmp = log((((y + x) * z) / sqrt(t))) - t;
                	}
                	return tmp;
                }
                
                NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
                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 - 0.5d0) <= (-4d+14)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
                        tmp = log(t) * a
                    else
                        tmp = log((((y + x) * z) / sqrt(t))) - t
                    end if
                    code = tmp
                end function
                
                assert x < y && y < z && z < t && t < a;
                public static double code(double x, double y, double z, double t, double a) {
                	double tmp;
                	if (((a - 0.5) <= -4e+14) || !((a - 0.5) <= -0.4)) {
                		tmp = Math.log(t) * a;
                	} else {
                		tmp = Math.log((((y + x) * z) / Math.sqrt(t))) - t;
                	}
                	return tmp;
                }
                
                [x, y, z, t, a] = sort([x, y, z, t, a])
                def code(x, y, z, t, a):
                	tmp = 0
                	if ((a - 0.5) <= -4e+14) or not ((a - 0.5) <= -0.4):
                		tmp = math.log(t) * a
                	else:
                		tmp = math.log((((y + x) * z) / math.sqrt(t))) - t
                	return tmp
                
                x, y, z, t, a = sort([x, y, z, t, a])
                function code(x, y, z, t, a)
                	tmp = 0.0
                	if ((Float64(a - 0.5) <= -4e+14) || !(Float64(a - 0.5) <= -0.4))
                		tmp = Float64(log(t) * a);
                	else
                		tmp = Float64(log(Float64(Float64(Float64(y + x) * z) / sqrt(t))) - t);
                	end
                	return tmp
                end
                
                x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
                function tmp_2 = code(x, y, z, t, a)
                	tmp = 0.0;
                	if (((a - 0.5) <= -4e+14) || ~(((a - 0.5) <= -0.4)))
                		tmp = log(t) * a;
                	else
                		tmp = log((((y + x) * z) / sqrt(t))) - t;
                	end
                	tmp_2 = tmp;
                end
                
                NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
                code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -4e+14], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
                
                \begin{array}{l}
                [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
                \\
                \begin{array}{l}
                \mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+14} \lor \neg \left(a - 0.5 \leq -0.4\right):\\
                \;\;\;\;\log t \cdot a\\
                
                \mathbf{else}:\\
                \;\;\;\;\log \left(\frac{\left(y + x\right) \cdot z}{\sqrt{t}}\right) - t\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (-.f64 a #s(literal 1/2 binary64)) < -4e14 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64))

                  1. Initial program 99.6%

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

                    \[\leadsto \color{blue}{a \cdot \log t} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{\log t \cdot a} \]
                    2. lower-*.f64N/A

                      \[\leadsto \color{blue}{\log t \cdot a} \]
                    3. lower-log.f6484.8

                      \[\leadsto \color{blue}{\log t} \cdot a \]
                  5. Applied rewrites84.8%

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

                  if -4e14 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002

                  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. Add Preprocessing
                  3. Taylor expanded in a around 0

                    \[\leadsto \color{blue}{\left(\log z + \left(\log \left(x + y\right) + \frac{-1}{2} \cdot \log t\right)\right) - t} \]
                  4. Step-by-step derivation
                    1. associate-+r+N/A

                      \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) + \frac{-1}{2} \cdot \log t\right)} - t \]
                    2. fp-cancel-sign-sub-invN/A

                      \[\leadsto \color{blue}{\left(\left(\log z + \log \left(x + y\right)\right) - \left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t\right)} - t \]
                    3. associate--l-N/A

                      \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
                    4. lower--.f64N/A

                      \[\leadsto \color{blue}{\left(\log z + \log \left(x + y\right)\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right)} \]
                    5. +-commutativeN/A

                      \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                    6. lower-+.f64N/A

                      \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right)} - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                    7. lower-log.f64N/A

                      \[\leadsto \left(\color{blue}{\log \left(x + y\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                    8. +-commutativeN/A

                      \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                    9. lower-+.f64N/A

                      \[\leadsto \left(\log \color{blue}{\left(y + x\right)} + \log z\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                    10. lower-log.f64N/A

                      \[\leadsto \left(\log \left(y + x\right) + \color{blue}{\log z}\right) - \left(\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot \log t + t\right) \]
                    11. metadata-evalN/A

                      \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \left(\color{blue}{\frac{1}{2}} \cdot \log t + t\right) \]
                    12. lower-fma.f64N/A

                      \[\leadsto \left(\log \left(y + x\right) + \log z\right) - \color{blue}{\mathsf{fma}\left(\frac{1}{2}, \log t, t\right)} \]
                    13. lower-log.f6498.3

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

                    \[\leadsto \color{blue}{\left(\log \left(y + x\right) + \log z\right) - \mathsf{fma}\left(0.5, \log t, t\right)} \]
                  6. Step-by-step derivation
                    1. Applied rewrites70.3%

                      \[\leadsto \color{blue}{\log \left(\frac{\left(y + x\right) \cdot z}{\sqrt{t}}\right) - t} \]
                  7. Recombined 2 regimes into one program.
                  8. Final simplification77.1%

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

                  Alternative 13: 61.9% accurate, 2.7× speedup?

                  \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq -5 \cdot 10^{+14} \lor \neg \left(a \leq 710000000000\right):\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
                  NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
                  (FPCore (x y z t a)
                   :precision binary64
                   (if (or (<= a -5e+14) (not (<= a 710000000000.0))) (* (log t) a) (- t)))
                  assert(x < y && y < z && z < t && t < a);
                  double code(double x, double y, double z, double t, double a) {
                  	double tmp;
                  	if ((a <= -5e+14) || !(a <= 710000000000.0)) {
                  		tmp = log(t) * a;
                  	} else {
                  		tmp = -t;
                  	}
                  	return tmp;
                  }
                  
                  NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
                  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 <= (-5d+14)) .or. (.not. (a <= 710000000000.0d0))) then
                          tmp = log(t) * a
                      else
                          tmp = -t
                      end if
                      code = tmp
                  end function
                  
                  assert x < y && y < z && z < t && t < a;
                  public static double code(double x, double y, double z, double t, double a) {
                  	double tmp;
                  	if ((a <= -5e+14) || !(a <= 710000000000.0)) {
                  		tmp = Math.log(t) * a;
                  	} else {
                  		tmp = -t;
                  	}
                  	return tmp;
                  }
                  
                  [x, y, z, t, a] = sort([x, y, z, t, a])
                  def code(x, y, z, t, a):
                  	tmp = 0
                  	if (a <= -5e+14) or not (a <= 710000000000.0):
                  		tmp = math.log(t) * a
                  	else:
                  		tmp = -t
                  	return tmp
                  
                  x, y, z, t, a = sort([x, y, z, t, a])
                  function code(x, y, z, t, a)
                  	tmp = 0.0
                  	if ((a <= -5e+14) || !(a <= 710000000000.0))
                  		tmp = Float64(log(t) * a);
                  	else
                  		tmp = Float64(-t);
                  	end
                  	return tmp
                  end
                  
                  x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
                  function tmp_2 = code(x, y, z, t, a)
                  	tmp = 0.0;
                  	if ((a <= -5e+14) || ~((a <= 710000000000.0)))
                  		tmp = log(t) * a;
                  	else
                  		tmp = -t;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
                  code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5e+14], N[Not[LessEqual[a, 710000000000.0]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
                  
                  \begin{array}{l}
                  [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;a \leq -5 \cdot 10^{+14} \lor \neg \left(a \leq 710000000000\right):\\
                  \;\;\;\;\log t \cdot a\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;-t\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if a < -5e14 or 7.1e11 < 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. Add Preprocessing
                    3. Taylor expanded in a around inf

                      \[\leadsto \color{blue}{a \cdot \log t} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{\log t \cdot a} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\log t \cdot a} \]
                      3. lower-log.f6485.5

                        \[\leadsto \color{blue}{\log t} \cdot a \]
                    5. Applied rewrites85.5%

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

                    if -5e14 < a < 7.1e11

                    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. Add Preprocessing
                    3. Taylor expanded in t around inf

                      \[\leadsto \color{blue}{-1 \cdot t} \]
                    4. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
                      2. lower-neg.f6453.9

                        \[\leadsto \color{blue}{-t} \]
                    5. Applied rewrites53.9%

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

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

                  Alternative 14: 37.4% accurate, 107.0× speedup?

                  \[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ -t \end{array} \]
                  NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
                  (FPCore (x y z t a) :precision binary64 (- t))
                  assert(x < y && y < z && z < t && t < a);
                  double code(double x, double y, double z, double t, double a) {
                  	return -t;
                  }
                  
                  NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
                  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
                  
                  assert x < y && y < z && z < t && t < a;
                  public static double code(double x, double y, double z, double t, double a) {
                  	return -t;
                  }
                  
                  [x, y, z, t, a] = sort([x, y, z, t, a])
                  def code(x, y, z, t, a):
                  	return -t
                  
                  x, y, z, t, a = sort([x, y, z, t, a])
                  function code(x, y, z, t, a)
                  	return Float64(-t)
                  end
                  
                  x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
                  function tmp = code(x, y, z, t, a)
                  	tmp = -t;
                  end
                  
                  NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
                  code[x_, y_, z_, t_, a_] := (-t)
                  
                  \begin{array}{l}
                  [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
                  \\
                  -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. Add Preprocessing
                  3. Taylor expanded in t around inf

                    \[\leadsto \color{blue}{-1 \cdot t} \]
                  4. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
                    2. lower-neg.f6435.8

                      \[\leadsto \color{blue}{-t} \]
                  5. Applied rewrites35.8%

                    \[\leadsto \color{blue}{-t} \]
                  6. 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 2024338 
                  (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))))