Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.6%
Time: 15.9s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

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

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Step-by-step derivation
    1. 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. +-commutative99.6%

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

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

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

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

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

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

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

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

Alternative 2: 68.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log z + \log \left(x + y\right)\\ \mathbf{if}\;t\_1 \leq -750 \lor \neg \left(t\_1 \leq 700\right):\\ \;\;\;\;\left(\log z - t\right) + a \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(\log \left(z \cdot y\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (log z) (log (+ x y)))))
   (if (or (<= t_1 -750.0) (not (<= t_1 700.0)))
     (+ (- (log z) t) (* a (log t)))
     (- (+ (log (* z y)) (* (log t) (- a 0.5))) t))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = log(z) + log((x + y));
	double tmp;
	if ((t_1 <= -750.0) || !(t_1 <= 700.0)) {
		tmp = (log(z) - t) + (a * log(t));
	} else {
		tmp = (log((z * y)) + (log(t) * (a - 0.5))) - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = log(z) + log((x + y))
    if ((t_1 <= (-750.0d0)) .or. (.not. (t_1 <= 700.0d0))) then
        tmp = (log(z) - t) + (a * log(t))
    else
        tmp = (log((z * y)) + (log(t) * (a - 0.5d0))) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = Math.log(z) + Math.log((x + y));
	double tmp;
	if ((t_1 <= -750.0) || !(t_1 <= 700.0)) {
		tmp = (Math.log(z) - t) + (a * Math.log(t));
	} else {
		tmp = (Math.log((z * y)) + (Math.log(t) * (a - 0.5))) - t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = math.log(z) + math.log((x + y))
	tmp = 0
	if (t_1 <= -750.0) or not (t_1 <= 700.0):
		tmp = (math.log(z) - t) + (a * math.log(t))
	else:
		tmp = (math.log((z * y)) + (math.log(t) * (a - 0.5))) - t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(log(z) + log(Float64(x + y)))
	tmp = 0.0
	if ((t_1 <= -750.0) || !(t_1 <= 700.0))
		tmp = Float64(Float64(log(z) - t) + Float64(a * log(t)));
	else
		tmp = Float64(Float64(log(Float64(z * y)) + Float64(log(t) * Float64(a - 0.5))) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = log(z) + log((x + y));
	tmp = 0.0;
	if ((t_1 <= -750.0) || ~((t_1 <= 700.0)))
		tmp = (log(z) - t) + (a * log(t));
	else
		tmp = (log((z * y)) + (log(t) * (a - 0.5))) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -750.0], N[Not[LessEqual[t$95$1, 700.0]], $MachinePrecision]], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log z + \log \left(x + y\right)\\
\mathbf{if}\;t\_1 \leq -750 \lor \neg \left(t\_1 \leq 700\right):\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -750 or 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z))

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.6% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a \cdot \log t}{t} + -1\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 0 98.4%

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

    if 185 < 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) + \left(\log z - t\right)\right)} + \left(a - 0.5\right) \cdot \log t \]
      2. +-commutative99.9%

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t \cdot \left(\color{blue}{\frac{a \cdot \log t}{t}} + -1\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.3%

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

Alternative 4: 81.0% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a \cdot \log t}{t} + -1\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 0 98.4%

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

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

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

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

    if 185 < 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) + \left(\log z - t\right)\right)} + \left(a - 0.5\right) \cdot \log t \]
      2. +-commutative99.9%

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t \cdot \left(\color{blue}{\frac{a \cdot \log t}{t}} + -1\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.7%

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

Alternative 5: 81.0% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a \cdot \log t}{t} + -1\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 185 < 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) + \left(\log z - t\right)\right)} + \left(a - 0.5\right) \cdot \log t \]
      2. +-commutative99.9%

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t \cdot \left(\color{blue}{\frac{a \cdot \log t}{t}} + -1\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.7%

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

Alternative 6: 99.6% accurate, 1.0× speedup?

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

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

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

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

Alternative 7: 68.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right) \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
	return (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = (log(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
end function
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)));
}
def code(x, y, z, t, a):
	return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
function code(x, y, z, t, a)
	return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5))))
end
function tmp = code(x, y, z, t, a)
	tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
end
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}

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

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Step-by-step derivation
    1. 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. +-commutative99.6%

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

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

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

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

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

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

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

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

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

Alternative 8: 86.2% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 3.5999999999999998e-23

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 0 99.2%

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

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

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

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

    if 3.5999999999999998e-23 < 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) + \left(\log z - t\right)\right)} + \left(a - 0.5\right) \cdot \log t \]
      2. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 78.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \log t\\ \mathbf{if}\;t \leq 185:\\ \;\;\;\;\log \left(x + y\right) + t\_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\frac{t\_1}{t} + -1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* a (log t))))
   (if (<= t 185.0) (+ (log (+ x y)) t_1) (* t (+ (/ t_1 t) -1.0)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = a * log(t);
	double tmp;
	if (t <= 185.0) {
		tmp = log((x + y)) + t_1;
	} else {
		tmp = t * ((t_1 / t) + -1.0);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * log(t)
    if (t <= 185.0d0) then
        tmp = log((x + y)) + t_1
    else
        tmp = t * ((t_1 / t) + (-1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = a * Math.log(t);
	double tmp;
	if (t <= 185.0) {
		tmp = Math.log((x + y)) + t_1;
	} else {
		tmp = t * ((t_1 / t) + -1.0);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = a * math.log(t)
	tmp = 0
	if t <= 185.0:
		tmp = math.log((x + y)) + t_1
	else:
		tmp = t * ((t_1 / t) + -1.0)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(a * log(t))
	tmp = 0.0
	if (t <= 185.0)
		tmp = Float64(log(Float64(x + y)) + t_1);
	else
		tmp = Float64(t * Float64(Float64(t_1 / t) + -1.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = a * log(t);
	tmp = 0.0;
	if (t <= 185.0)
		tmp = log((x + y)) + t_1;
	else
		tmp = t * ((t_1 / t) + -1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 185.0], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], N[(t * N[(N[(t$95$1 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;t \leq 185:\\
\;\;\;\;\log \left(x + y\right) + t\_1\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 185 < 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) + \left(\log z - t\right)\right)} + \left(a - 0.5\right) \cdot \log t \]
      2. +-commutative99.9%

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t \cdot \left(\color{blue}{\frac{a \cdot \log t}{t}} + -1\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.6%

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

Alternative 10: 77.9% accurate, 1.5× speedup?

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

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

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Step-by-step derivation
    1. 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. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 62.0% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 105000 \lor \neg \left(t \leq 10^{+36}\right) \land t \leq 10^{+61}:\\
\;\;\;\;a \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 105000 or 1.00000000000000004e36 < t < 9.99999999999999949e60

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    8. Simplified53.1%

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

    if 105000 < t < 1.00000000000000004e36 or 9.99999999999999949e60 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \log \left(x + y\right) + \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. neg-mul-179.3%

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
    7. Simplified79.3%

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
    8. Taylor expanded in t around inf 79.3%

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

        \[\leadsto \color{blue}{-t} \]
    10. Simplified79.3%

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

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

Alternative 12: 66.7% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+39} \lor \neg \left(a \leq 1.1 \cdot 10^{+16}\right):\\
\;\;\;\;a \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.95e39 or 1.1e16 < a

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    8. Simplified74.1%

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

    if -1.95e39 < a < 1.1e16

    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 58.7%

      \[\leadsto \log \left(x + y\right) + \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. neg-mul-158.7%

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
    7. Simplified58.7%

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

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

Alternative 13: 75.4% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 2.6 \cdot 10^{-33}:\\ \;\;\;\;a \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-1 + a \cdot \frac{\log t}{t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t 2.6e-33) (* a (log t)) (* t (+ -1.0 (* a (/ (log t) t))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 2.6e-33) {
		tmp = a * log(t);
	} else {
		tmp = t * (-1.0 + (a * (log(t) / t)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (t <= 2.6d-33) then
        tmp = a * log(t)
    else
        tmp = t * ((-1.0d0) + (a * (log(t) / t)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 2.6e-33) {
		tmp = a * Math.log(t);
	} else {
		tmp = t * (-1.0 + (a * (Math.log(t) / t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= 2.6e-33:
		tmp = a * math.log(t)
	else:
		tmp = t * (-1.0 + (a * (math.log(t) / t)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= 2.6e-33)
		tmp = Float64(a * log(t));
	else
		tmp = Float64(t * Float64(-1.0 + Float64(a * Float64(log(t) / t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= 2.6e-33)
		tmp = a * log(t);
	else
		tmp = t * (-1.0 + (a * (log(t) / t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.6e-33], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(t * N[(-1.0 + N[(a * N[(N[Log[t], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.6 \cdot 10^{-33}:\\
\;\;\;\;a \cdot \log t\\

\mathbf{else}:\\
\;\;\;\;t \cdot \left(-1 + a \cdot \frac{\log t}{t}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.59999999999999994e-33

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.59999999999999994e-33 < 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) + \left(\log z - t\right)\right)} + \left(a - 0.5\right) \cdot \log t \]
      2. +-commutative99.9%

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t \cdot \left(\color{blue}{\frac{a \cdot \log t}{t}} + -1\right) \]
    11. Step-by-step derivation
      1. associate-/l*95.1%

        \[\leadsto t \cdot \left(\color{blue}{a \cdot \frac{\log t}{t}} + -1\right) \]
    12. Simplified95.1%

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

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

Alternative 14: 75.4% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \log t\\ \mathbf{if}\;t \leq 2.5 \cdot 10^{-32}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\frac{t\_1}{t} + -1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* a (log t)))) (if (<= t 2.5e-32) t_1 (* t (+ (/ t_1 t) -1.0)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = a * log(t);
	double tmp;
	if (t <= 2.5e-32) {
		tmp = t_1;
	} else {
		tmp = t * ((t_1 / t) + -1.0);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * log(t)
    if (t <= 2.5d-32) then
        tmp = t_1
    else
        tmp = t * ((t_1 / t) + (-1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = a * Math.log(t);
	double tmp;
	if (t <= 2.5e-32) {
		tmp = t_1;
	} else {
		tmp = t * ((t_1 / t) + -1.0);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = a * math.log(t)
	tmp = 0
	if t <= 2.5e-32:
		tmp = t_1
	else:
		tmp = t * ((t_1 / t) + -1.0)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(a * log(t))
	tmp = 0.0
	if (t <= 2.5e-32)
		tmp = t_1;
	else
		tmp = Float64(t * Float64(Float64(t_1 / t) + -1.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = a * log(t);
	tmp = 0.0;
	if (t <= 2.5e-32)
		tmp = t_1;
	else
		tmp = t * ((t_1 / t) + -1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 2.5e-32], t$95$1, N[(t * N[(N[(t$95$1 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;t \leq 2.5 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.5e-32

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5e-32 < 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) + \left(\log z - t\right)\right)} + \left(a - 0.5\right) \cdot \log t \]
      2. +-commutative99.9%

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 58.6% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+38} \lor \neg \left(a \leq 2.75 \cdot 10^{+17}\right):\\
\;\;\;\;a \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.3000000000000001e38 or 2.75e17 < a

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    8. Simplified74.1%

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

    if -2.3000000000000001e38 < a < 2.75e17

    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 58.7%

      \[\leadsto \log \left(x + y\right) + \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. neg-mul-158.7%

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
    7. Simplified58.7%

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
    8. Taylor expanded in x around 0 44.1%

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

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

Alternative 16: 41.1% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 185:\\
\;\;\;\;\log \left(x + y\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \log \left(x + y\right) + \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. neg-mul-19.5%

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
    7. Simplified9.5%

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
    8. Taylor expanded in t around 0 9.5%

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

    if 185 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \log \left(x + y\right) + \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. neg-mul-172.9%

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
    7. Simplified72.9%

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
    8. Taylor expanded in t around inf 73.0%

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

        \[\leadsto \color{blue}{-t} \]
    10. Simplified73.0%

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

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

Alternative 17: 38.0% accurate, 156.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \log \left(x + y\right) + \color{blue}{-1 \cdot t} \]
  6. Step-by-step derivation
    1. neg-mul-143.9%

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
  7. Simplified43.9%

    \[\leadsto \log \left(x + y\right) + \color{blue}{\left(-t\right)} \]
  8. Taylor expanded in t around inf 40.9%

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

      \[\leadsto \color{blue}{-t} \]
  10. Simplified40.9%

    \[\leadsto \color{blue}{-t} \]
  11. Final simplification40.9%

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

Developer target: 99.6% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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