Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.3%
Time: 16.0s
Alternatives: 16
Speedup: N/A×

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 16 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.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\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
 (- (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) t))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	return (log(y) + (log(z) + (log(t) * (a - 0.5)))) - 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(y) + (log(z) + (log(t) * (a - 0.5d0)))) - 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(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)))) - t;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	return (math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))) - t
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	return Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) - t)
end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
	tmp = (log(y) + (log(z) + (log(t) * (a - 0.5)))) - 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[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\right) - t
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 140:\\ \;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot a - 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 (<= t 140.0)
   (+ (log y) (+ (log z) (* (log t) (- a 0.5))))
   (- (* (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 (t <= 140.0) {
		tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
	} else {
		tmp = (log(t) * a) - 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 (t <= 140.0d0) then
        tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
    else
        tmp = (log(t) * a) - 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 (t <= 140.0) {
		tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
	} else {
		tmp = (Math.log(t) * a) - t;
	}
	return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	tmp = 0
	if t <= 140.0:
		tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))
	else:
		tmp = (math.log(t) * a) - 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 (t <= 140.0)
		tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5))));
	else
		tmp = Float64(Float64(log(t) * a) - 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 (t <= 140.0)
		tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
	else
		tmp = (log(t) * a) - 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[LessEqual[t, 140.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 140:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 140 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} - t \]
    10. Simplified98.4%

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

Alternative 3: 99.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\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
 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	return (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
}
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(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
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(z) - t) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5))))
end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
	tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
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[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.0% 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 \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 175\right):\\ \;\;\;\;\log t \cdot a - t\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot \left(a - 0.5\right) + \left(\log \left(z \cdot \left(y + x\right)\right) - 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 -4.8e-108) (not (<= a 175.0)))
   (- (* (log t) a) t)
   (+ (* (log t) (- a 0.5)) (- (log (* z (+ y x))) 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 <= -4.8e-108) || !(a <= 175.0)) {
		tmp = (log(t) * a) - t;
	} else {
		tmp = (log(t) * (a - 0.5)) + (log((z * (y + x))) - 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 <= (-4.8d-108)) .or. (.not. (a <= 175.0d0))) then
        tmp = (log(t) * a) - t
    else
        tmp = (log(t) * (a - 0.5d0)) + (log((z * (y + x))) - 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 <= -4.8e-108) || !(a <= 175.0)) {
		tmp = (Math.log(t) * a) - t;
	} else {
		tmp = (Math.log(t) * (a - 0.5)) + (Math.log((z * (y + x))) - 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 <= -4.8e-108) or not (a <= 175.0):
		tmp = (math.log(t) * a) - t
	else:
		tmp = (math.log(t) * (a - 0.5)) + (math.log((z * (y + x))) - 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 <= -4.8e-108) || !(a <= 175.0))
		tmp = Float64(Float64(log(t) * a) - t);
	else
		tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(Float64(z * Float64(y + x))) - 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 <= -4.8e-108) || ~((a <= 175.0)))
		tmp = (log(t) * a) - t;
	else
		tmp = (log(t) * (a - 0.5)) + (log((z * (y + x))) - 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, -4.8e-108], N[Not[LessEqual[a, 175.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 175\right):\\
\;\;\;\;\log t \cdot a - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.80000000000000034e-108 or 175 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} - t \]
    10. Simplified93.6%

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

    if -4.80000000000000034e-108 < a < 175

    1. Initial program 99.4%

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

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

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

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

Alternative 5: 77.1% accurate, 1.4× 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 - t\\ \mathbf{if}\;a \leq -2.1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-52}:\\ \;\;\;\;\left(\log y + \log z\right) - t\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{-15}:\\ \;\;\;\;\log \left(y \cdot z\right) + \log t \cdot -0.5\\ \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) t)))
   (if (<= a -2.1)
     t_1
     (if (<= a 9e-52)
       (- (+ (log y) (log z)) t)
       (if (<= a 2.3e-15) (+ (log (* y z)) (* (log t) -0.5)) 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) - t;
	double tmp;
	if (a <= -2.1) {
		tmp = t_1;
	} else if (a <= 9e-52) {
		tmp = (log(y) + log(z)) - t;
	} else if (a <= 2.3e-15) {
		tmp = log((y * z)) + (log(t) * -0.5);
	} else {
		tmp = t_1;
	}
	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(t) * a) - t
    if (a <= (-2.1d0)) then
        tmp = t_1
    else if (a <= 9d-52) then
        tmp = (log(y) + log(z)) - t
    else if (a <= 2.3d-15) then
        tmp = log((y * z)) + (log(t) * (-0.5d0))
    else
        tmp = t_1
    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(t) * a) - t;
	double tmp;
	if (a <= -2.1) {
		tmp = t_1;
	} else if (a <= 9e-52) {
		tmp = (Math.log(y) + Math.log(z)) - t;
	} else if (a <= 2.3e-15) {
		tmp = Math.log((y * z)) + (Math.log(t) * -0.5);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	t_1 = (math.log(t) * a) - t
	tmp = 0
	if a <= -2.1:
		tmp = t_1
	elif a <= 9e-52:
		tmp = (math.log(y) + math.log(z)) - t
	elif a <= 2.3e-15:
		tmp = math.log((y * z)) + (math.log(t) * -0.5)
	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(Float64(log(t) * a) - t)
	tmp = 0.0
	if (a <= -2.1)
		tmp = t_1;
	elseif (a <= 9e-52)
		tmp = Float64(Float64(log(y) + log(z)) - t);
	elseif (a <= 2.3e-15)
		tmp = Float64(log(Float64(y * z)) + Float64(log(t) * -0.5));
	else
		tmp = t_1;
	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(t) * a) - t;
	tmp = 0.0;
	if (a <= -2.1)
		tmp = t_1;
	elseif (a <= 9e-52)
		tmp = (log(y) + log(z)) - t;
	elseif (a <= 2.3e-15)
		tmp = log((y * z)) + (log(t) * -0.5);
	else
		tmp = t_1;
	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[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -2.1], t$95$1, If[LessEqual[a, 9e-52], N[(N[(N[Log[y], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 2.3e-15], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $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 - t\\
\mathbf{if}\;a \leq -2.1:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.10000000000000009 or 2.2999999999999999e-15 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} - t \]
    10. Simplified97.8%

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

    if -2.10000000000000009 < a < 9.0000000000000001e-52

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000001e-52 < a < 2.2999999999999999e-15

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 84.8% 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 \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 55000\right):\\ \;\;\;\;\log t \cdot a - t\\ \mathbf{else}:\\ \;\;\;\;\left(\log t \cdot \left(a + -0.5\right) - t\right) + \log \left(y \cdot z\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 -4.8e-108) (not (<= a 55000.0)))
   (- (* (log t) a) t)
   (+ (- (* (log t) (+ a -0.5)) t) (log (* y z)))))
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 <= -4.8e-108) || !(a <= 55000.0)) {
		tmp = (log(t) * a) - t;
	} else {
		tmp = ((log(t) * (a + -0.5)) - t) + log((y * z));
	}
	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 <= (-4.8d-108)) .or. (.not. (a <= 55000.0d0))) then
        tmp = (log(t) * a) - t
    else
        tmp = ((log(t) * (a + (-0.5d0))) - t) + log((y * z))
    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 <= -4.8e-108) || !(a <= 55000.0)) {
		tmp = (Math.log(t) * a) - t;
	} else {
		tmp = ((Math.log(t) * (a + -0.5)) - t) + Math.log((y * z));
	}
	return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	tmp = 0
	if (a <= -4.8e-108) or not (a <= 55000.0):
		tmp = (math.log(t) * a) - t
	else:
		tmp = ((math.log(t) * (a + -0.5)) - t) + math.log((y * z))
	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 <= -4.8e-108) || !(a <= 55000.0))
		tmp = Float64(Float64(log(t) * a) - t);
	else
		tmp = Float64(Float64(Float64(log(t) * Float64(a + -0.5)) - t) + log(Float64(y * z)));
	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 <= -4.8e-108) || ~((a <= 55000.0)))
		tmp = (log(t) * a) - t;
	else
		tmp = ((log(t) * (a + -0.5)) - t) + log((y * z));
	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, -4.8e-108], N[Not[LessEqual[a, 55000.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 55000\right):\\
\;\;\;\;\log t \cdot a - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.80000000000000034e-108 or 55000 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} - t \]
    10. Simplified93.6%

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

    if -4.80000000000000034e-108 < a < 55000

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 84.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 \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 0.142\right):\\ \;\;\;\;\log t \cdot a - t\\ \mathbf{else}:\\ \;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot -0.5\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 -4.8e-108) (not (<= a 0.142)))
   (- (* (log t) a) t)
   (- (+ (log (* y z)) (* (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 <= -4.8e-108) || !(a <= 0.142)) {
		tmp = (log(t) * a) - t;
	} else {
		tmp = (log((y * z)) + (log(t) * -0.5)) - 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 <= (-4.8d-108)) .or. (.not. (a <= 0.142d0))) then
        tmp = (log(t) * a) - t
    else
        tmp = (log((y * z)) + (log(t) * (-0.5d0))) - 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 <= -4.8e-108) || !(a <= 0.142)) {
		tmp = (Math.log(t) * a) - t;
	} else {
		tmp = (Math.log((y * z)) + (Math.log(t) * -0.5)) - 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 <= -4.8e-108) or not (a <= 0.142):
		tmp = (math.log(t) * a) - t
	else:
		tmp = (math.log((y * z)) + (math.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 ((a <= -4.8e-108) || !(a <= 0.142))
		tmp = Float64(Float64(log(t) * a) - t);
	else
		tmp = Float64(Float64(log(Float64(y * z)) + Float64(log(t) * -0.5)) - 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 <= -4.8e-108) || ~((a <= 0.142)))
		tmp = (log(t) * a) - t;
	else
		tmp = (log((y * z)) + (log(t) * -0.5)) - 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, -4.8e-108], N[Not[LessEqual[a, 0.142]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $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 \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 0.142\right):\\
\;\;\;\;\log t \cdot a - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.80000000000000034e-108 or 0.141999999999999987 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} - t \]
    10. Simplified93.6%

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

    if -4.80000000000000034e-108 < a < 0.141999999999999987

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 84.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 \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 0.00068\right):\\ \;\;\;\;\log t \cdot a - t\\ \mathbf{else}:\\ \;\;\;\;\log \left(y \cdot z\right) + \left(\log t \cdot -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 -4.8e-108) (not (<= a 0.00068)))
   (- (* (log t) a) t)
   (+ (log (* y z)) (- (* (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 <= -4.8e-108) || !(a <= 0.00068)) {
		tmp = (log(t) * a) - t;
	} else {
		tmp = log((y * z)) + ((log(t) * -0.5) - 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 <= (-4.8d-108)) .or. (.not. (a <= 0.00068d0))) then
        tmp = (log(t) * a) - t
    else
        tmp = log((y * z)) + ((log(t) * (-0.5d0)) - 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 <= -4.8e-108) || !(a <= 0.00068)) {
		tmp = (Math.log(t) * a) - t;
	} else {
		tmp = Math.log((y * z)) + ((Math.log(t) * -0.5) - 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 <= -4.8e-108) or not (a <= 0.00068):
		tmp = (math.log(t) * a) - t
	else:
		tmp = math.log((y * z)) + ((math.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 ((a <= -4.8e-108) || !(a <= 0.00068))
		tmp = Float64(Float64(log(t) * a) - t);
	else
		tmp = Float64(log(Float64(y * z)) + Float64(Float64(log(t) * -0.5) - 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 <= -4.8e-108) || ~((a <= 0.00068)))
		tmp = (log(t) * a) - t;
	else
		tmp = log((y * z)) + ((log(t) * -0.5) - 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, -4.8e-108], N[Not[LessEqual[a, 0.00068]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 0.00068\right):\\
\;\;\;\;\log t \cdot a - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.80000000000000034e-108 or 6.8e-4 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} - t \]
    10. Simplified93.6%

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

    if -4.80000000000000034e-108 < a < 6.8e-4

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 77.9% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq -0.98 \lor \neg \left(a \leq 2.6\right):\\ \;\;\;\;\log t \cdot a - t\\ \mathbf{else}:\\ \;\;\;\;\left(\log y + \log z\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.98) (not (<= a 2.6)))
   (- (* (log t) a) t)
   (- (+ (log y) (log z)) 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.98) || !(a <= 2.6)) {
		tmp = (log(t) * a) - t;
	} else {
		tmp = (log(y) + log(z)) - 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.98d0)) .or. (.not. (a <= 2.6d0))) then
        tmp = (log(t) * a) - t
    else
        tmp = (log(y) + log(z)) - 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.98) || !(a <= 2.6)) {
		tmp = (Math.log(t) * a) - t;
	} else {
		tmp = (Math.log(y) + Math.log(z)) - 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.98) or not (a <= 2.6):
		tmp = (math.log(t) * a) - t
	else:
		tmp = (math.log(y) + math.log(z)) - 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 <= -0.98) || !(a <= 2.6))
		tmp = Float64(Float64(log(t) * a) - t);
	else
		tmp = Float64(Float64(log(y) + log(z)) - 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.98) || ~((a <= 2.6)))
		tmp = (log(t) * a) - t;
	else
		tmp = (log(y) + log(z)) - 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, -0.98], N[Not[LessEqual[a, 2.6]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[Log[z], $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 \leq -0.98 \lor \neg \left(a \leq 2.6\right):\\
\;\;\;\;\log t \cdot a - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -0.97999999999999998 or 2.60000000000000009 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} - t \]
    10. Simplified97.8%

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

    if -0.97999999999999998 < a < 2.60000000000000009

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 86.3% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 0.0136:\\ \;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot a - 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 (<= t 0.0136)
   (+ (* (log t) (- a 0.5)) (log (* y z)))
   (- (* (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 (t <= 0.0136) {
		tmp = (log(t) * (a - 0.5)) + log((y * z));
	} else {
		tmp = (log(t) * a) - 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 (t <= 0.0136d0) then
        tmp = (log(t) * (a - 0.5d0)) + log((y * z))
    else
        tmp = (log(t) * a) - 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 (t <= 0.0136) {
		tmp = (Math.log(t) * (a - 0.5)) + Math.log((y * z));
	} else {
		tmp = (Math.log(t) * a) - t;
	}
	return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	tmp = 0
	if t <= 0.0136:
		tmp = (math.log(t) * (a - 0.5)) + math.log((y * z))
	else:
		tmp = (math.log(t) * a) - 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 (t <= 0.0136)
		tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z)));
	else
		tmp = Float64(Float64(log(t) * a) - 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 (t <= 0.0136)
		tmp = (log(t) * (a - 0.5)) + log((y * z));
	else
		tmp = (log(t) * a) - 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[LessEqual[t, 0.0136], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0136:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\\

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0135999999999999992 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} - t \]
    10. Simplified96.8%

      \[\leadsto \color{blue}{\log t \cdot a} - t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.6%

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

Alternative 11: 77.0% accurate, 1.5× 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}\;t \leq 120:\\ \;\;\;\;t\_1 + \log \left(y + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 - 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
 (let* ((t_1 (* (log t) a)))
   (if (<= t 120.0) (+ t_1 (log (+ y x))) (- t_1 t))))
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 (t <= 120.0) {
		tmp = t_1 + log((y + x));
	} else {
		tmp = t_1 - 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) :: t_1
    real(8) :: tmp
    t_1 = log(t) * a
    if (t <= 120.0d0) then
        tmp = t_1 + log((y + x))
    else
        tmp = t_1 - 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 t_1 = Math.log(t) * a;
	double tmp;
	if (t <= 120.0) {
		tmp = t_1 + Math.log((y + x));
	} else {
		tmp = t_1 - t;
	}
	return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	t_1 = math.log(t) * a
	tmp = 0
	if t <= 120.0:
		tmp = t_1 + math.log((y + x))
	else:
		tmp = t_1 - t
	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 (t <= 120.0)
		tmp = Float64(t_1 + log(Float64(y + x)));
	else
		tmp = Float64(t_1 - 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)
	t_1 = log(t) * a;
	tmp = 0.0;
	if (t <= 120.0)
		tmp = t_1 + log((y + x));
	else
		tmp = t_1 - 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_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, 120.0], N[(t$95$1 + N[Log[N[(y + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]
\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}\;t \leq 120:\\
\;\;\;\;t\_1 + \log \left(y + x\right)\\

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 120 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} - t \]
    10. Simplified98.4%

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

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

Alternative 12: 61.8% accurate, 2.9× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 12500000000000:\\ \;\;\;\;\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 (<= t 12500000000000.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 (t <= 12500000000000.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 (t <= 12500000000000.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 (t <= 12500000000000.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 t <= 12500000000000.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 (t <= 12500000000000.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 (t <= 12500000000000.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[LessEqual[t, 12500000000000.0], 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}\;t \leq 12500000000000:\\
\;\;\;\;\log t \cdot a\\

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25e13 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 73.9% accurate, 3.0× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \log t \cdot 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 (- (* (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) {
	return (log(t) * a) - 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(t) * a) - 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(t) * a) - t;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	return (math.log(t) * a) - t
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	return Float64(Float64(log(t) * a) - t)
end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
	tmp = (log(t) * a) - 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[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\log t \cdot a - t
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\log t \cdot a} - t \]
  10. Simplified73.6%

    \[\leadsto \color{blue}{\log t \cdot a} - t \]
  11. Add Preprocessing

Alternative 14: 37.5% accurate, 62.6× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \left(1 - t\right) + -1 \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 (+ (- 1.0 t) -1.0))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	return (1.0 - t) + -1.0;
}
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 = (1.0d0 - t) + (-1.0d0)
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 (1.0 - t) + -1.0;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	return (1.0 - t) + -1.0
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	return Float64(Float64(1.0 - t) + -1.0)
end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
	tmp = (1.0 - t) + -1.0;
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[(1.0 - t), $MachinePrecision] + -1.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\left(1 - t\right) + -1
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
  12. Add Preprocessing

Alternative 15: 37.5% accurate, 156.5× 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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 2.4% accurate, 313.0× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ 0 \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 0.0)
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
	return 0.0;
}
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 = 0.0d0
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 0.0;
}
[x, y, z, t, a] = sort([x, y, z, t, a])
def code(x, y, z, t, a):
	return 0.0
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	return 0.0
end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
	tmp = 0.0;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
0
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer Target 1: 99.6% accurate, 1.0× speedup?

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

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

Reproduce

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