Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.6%
Time: 28.2s
Alternatives: 18
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 18 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} \\ \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right) \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (+ (log (+ x y)) (- (log z) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
	return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a)
	return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t)))
end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\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) + \log z\right) - \left(t - \left(a - 0.5\right) \cdot \log t\right)} \]
    2. associate--l+99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 67.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -680000000000 \lor \neg \left(a \leq 1.4\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.8e11 or 1.3999999999999999 < a

    1. Initial program 99.6%

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

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

      \[\leadsto \left(\log y + \color{blue}{a \cdot \log t}\right) - t \]
    5. Step-by-step derivation
      1. *-commutative74.2%

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

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

    if -6.8e11 < a < 1.3999999999999999

    1. Initial program 99.5%

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

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

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

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

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

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

Alternative 3: 67.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.60000000000000013e-4 < t

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

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

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

Alternative 5: 68.3% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 6: 56.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log t \cdot a\\ \mathbf{if}\;a \leq -2900000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-71}:\\ \;\;\;\;\log y - t\\ \mathbf{elif}\;a \leq -3.7 \cdot 10^{-119}:\\ \;\;\;\;\log \left(\frac{\left(x + y\right) \cdot z}{\sqrt{t}}\right)\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{+31}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 4.9 \cdot 10^{+48} \lor \neg \left(a \leq 1.65 \cdot 10^{+74}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (log t) a)))
   (if (<= a -2900000000000.0)
     t_1
     (if (<= a -1.2e-71)
       (- (log y) t)
       (if (<= a -3.7e-119)
         (log (/ (* (+ x y) z) (sqrt t)))
         (if (<= a 1.65e+31)
           (- (+ (log z) (log y)) t)
           (if (or (<= a 4.9e+48) (not (<= a 1.65e+74))) t_1 (- t))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = log(t) * a;
	double tmp;
	if (a <= -2900000000000.0) {
		tmp = t_1;
	} else if (a <= -1.2e-71) {
		tmp = log(y) - t;
	} else if (a <= -3.7e-119) {
		tmp = log((((x + y) * z) / sqrt(t)));
	} else if (a <= 1.65e+31) {
		tmp = (log(z) + log(y)) - t;
	} else if ((a <= 4.9e+48) || !(a <= 1.65e+74)) {
		tmp = t_1;
	} else {
		tmp = -t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = log(t) * a
    if (a <= (-2900000000000.0d0)) then
        tmp = t_1
    else if (a <= (-1.2d-71)) then
        tmp = log(y) - t
    else if (a <= (-3.7d-119)) then
        tmp = log((((x + y) * z) / sqrt(t)))
    else if (a <= 1.65d+31) then
        tmp = (log(z) + log(y)) - t
    else if ((a <= 4.9d+48) .or. (.not. (a <= 1.65d+74))) then
        tmp = t_1
    else
        tmp = -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = Math.log(t) * a;
	double tmp;
	if (a <= -2900000000000.0) {
		tmp = t_1;
	} else if (a <= -1.2e-71) {
		tmp = Math.log(y) - t;
	} else if (a <= -3.7e-119) {
		tmp = Math.log((((x + y) * z) / Math.sqrt(t)));
	} else if (a <= 1.65e+31) {
		tmp = (Math.log(z) + Math.log(y)) - t;
	} else if ((a <= 4.9e+48) || !(a <= 1.65e+74)) {
		tmp = t_1;
	} else {
		tmp = -t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = math.log(t) * a
	tmp = 0
	if a <= -2900000000000.0:
		tmp = t_1
	elif a <= -1.2e-71:
		tmp = math.log(y) - t
	elif a <= -3.7e-119:
		tmp = math.log((((x + y) * z) / math.sqrt(t)))
	elif a <= 1.65e+31:
		tmp = (math.log(z) + math.log(y)) - t
	elif (a <= 4.9e+48) or not (a <= 1.65e+74):
		tmp = t_1
	else:
		tmp = -t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(log(t) * a)
	tmp = 0.0
	if (a <= -2900000000000.0)
		tmp = t_1;
	elseif (a <= -1.2e-71)
		tmp = Float64(log(y) - t);
	elseif (a <= -3.7e-119)
		tmp = log(Float64(Float64(Float64(x + y) * z) / sqrt(t)));
	elseif (a <= 1.65e+31)
		tmp = Float64(Float64(log(z) + log(y)) - t);
	elseif ((a <= 4.9e+48) || !(a <= 1.65e+74))
		tmp = t_1;
	else
		tmp = Float64(-t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = log(t) * a;
	tmp = 0.0;
	if (a <= -2900000000000.0)
		tmp = t_1;
	elseif (a <= -1.2e-71)
		tmp = log(y) - t;
	elseif (a <= -3.7e-119)
		tmp = log((((x + y) * z) / sqrt(t)));
	elseif (a <= 1.65e+31)
		tmp = (log(z) + log(y)) - t;
	elseif ((a <= 4.9e+48) || ~((a <= 1.65e+74)))
		tmp = t_1;
	else
		tmp = -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -2900000000000.0], t$95$1, If[LessEqual[a, -1.2e-71], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, -3.7e-119], N[Log[N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[a, 1.65e+31], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[a, 4.9e+48], N[Not[LessEqual[a, 1.65e+74]], $MachinePrecision]], t$95$1, (-t)]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.2 \cdot 10^{-71}:\\
\;\;\;\;\log y - t\\

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

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

\mathbf{elif}\;a \leq 4.9 \cdot 10^{+48} \lor \neg \left(a \leq 1.65 \cdot 10^{+74}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -2.9e12 or 1.64999999999999996e31 < a < 4.9000000000000003e48 or 1.6500000000000001e74 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9e12 < a < -1.2e-71

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e-71 < a < -3.7000000000000001e-119

    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-udef99.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 89.3%

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

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

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

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

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

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

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

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

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

    if -3.7000000000000001e-119 < a < 1.64999999999999996e31

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9000000000000003e48 < a < 1.6500000000000001e74

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2900000000000:\\ \;\;\;\;\log t \cdot a\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-71}:\\ \;\;\;\;\log y - t\\ \mathbf{elif}\;a \leq -3.7 \cdot 10^{-119}:\\ \;\;\;\;\log \left(\frac{\left(x + y\right) \cdot z}{\sqrt{t}}\right)\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{+31}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 4.9 \cdot 10^{+48} \lor \neg \left(a \leq 1.65 \cdot 10^{+74}\right):\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 60.6% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;t \leq 8.5 \cdot 10^{-125}:\\
\;\;\;\;\log \left(x + y\right) + t_2\\

\mathbf{elif}\;t \leq 3.1 \cdot 10^{-5}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.35999999999999994e-151 or 8.5000000000000002e-125 < t < 3.10000000000000014e-5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.35999999999999994e-151 < t < 8.5000000000000002e-125

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.10000000000000014e-5 < t

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 8: 73.8% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.9999999999999997e38 or 920 < a

    1. Initial program 99.6%

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

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

      \[\leadsto \left(\log y + \color{blue}{a \cdot \log t}\right) - t \]
    5. Step-by-step derivation
      1. *-commutative73.8%

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

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

    if -4.9999999999999997e38 < a < 920

    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-udef99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 64.1% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;t \leq 4.3 \cdot 10^{+49}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 4.5000000000000003e-80 or 8.50000000000000046e-69 < t < 4.2999999999999999e49

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5000000000000003e-80 < t < 8.50000000000000046e-69

    1. Initial program 99.0%

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

        \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \log z\right) - \left(t - \left(a - 0.5\right) \cdot \log t\right)} \]
      2. associate--l+98.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-neg98.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. +-commutative98.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. *-commutative98.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-in98.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-udef98.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-neg98.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. +-commutative98.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-in98.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-eval98.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-eval98.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-neg98.9%

        \[\leadsto \log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, \color{blue}{0.5 - a}, t\right)\right) \]
    3. Simplified98.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 0 99.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log z - \log \left(\frac{{t}^{\left(0.5 - a\right)}}{y + x}\right)} \]
    11. Applied egg-rr98.7%

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

      \[\leadsto \color{blue}{\log z - \log \left(\sqrt{t} \cdot \frac{1}{x + y}\right)} \]
    13. Step-by-step derivation
      1. associate-*r/87.6%

        \[\leadsto \log z - \log \color{blue}{\left(\frac{\sqrt{t} \cdot 1}{x + y}\right)} \]
      2. *-rgt-identity87.6%

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

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

        \[\leadsto \color{blue}{\log \left(\frac{z}{\frac{\sqrt{t}}{y + x}}\right)} \]
      5. associate-/r/74.9%

        \[\leadsto \log \color{blue}{\left(\frac{z}{\sqrt{t}} \cdot \left(y + x\right)\right)} \]
      6. *-commutative74.9%

        \[\leadsto \log \color{blue}{\left(\left(y + x\right) \cdot \frac{z}{\sqrt{t}}\right)} \]
      7. +-commutative74.9%

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

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

    if 4.2999999999999999e49 < 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. Add Preprocessing
    3. Taylor expanded in x around 0 71.6%

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

      \[\leadsto \color{blue}{-1 \cdot t} \]
    5. Step-by-step derivation
      1. mul-1-neg79.4%

        \[\leadsto \color{blue}{-t} \]
    6. Simplified79.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 4.5 \cdot 10^{-80}:\\ \;\;\;\;\log \left(x + y\right) + \log t \cdot a\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-69}:\\ \;\;\;\;\log \left(\left(x + y\right) \cdot \frac{z}{\sqrt{t}}\right)\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{+49}:\\ \;\;\;\;\log \left(x + y\right) + \log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 72.5% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{-40} \lor \neg \left(a \leq 0.8\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.4999999999999999e-40 or 0.80000000000000004 < 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. Add Preprocessing
    3. Taylor expanded in x around 0 73.1%

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

      \[\leadsto \left(\log y + \color{blue}{a \cdot \log t}\right) - t \]
    5. Step-by-step derivation
      1. *-commutative71.9%

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

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

    if -6.4999999999999999e-40 < a < 0.80000000000000004

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

Alternative 11: 60.2% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{-40} \lor \neg \left(a \leq 0.85\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.4999999999999999e-40 or 0.849999999999999978 < 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. Add Preprocessing
    3. Taylor expanded in x around 0 73.1%

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

      \[\leadsto \left(\log y + \color{blue}{a \cdot \log t}\right) - t \]
    5. Step-by-step derivation
      1. *-commutative71.9%

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

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

    if -6.4999999999999999e-40 < a < 0.849999999999999978

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

Alternative 12: 57.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a \leq -1.45 \cdot 10^{+16}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 2.2 \cdot 10^{+48} \lor \neg \left(a \leq 3.2 \cdot 10^{+77}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.45e16 or 1.64999999999999996e31 < a < 2.1999999999999999e48 or 3.2000000000000002e77 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e16 < a < 1.64999999999999996e31

    1. Initial program 99.5%

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

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

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

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

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

        \[\leadsto \left(\log y + \mathsf{fma}\left(\color{blue}{{\left(\sqrt[3]{\log t \cdot \left(a - 0.5\right)}\right)}^{2}}, \sqrt[3]{\log t \cdot \left(a - 0.5\right)}, \log z\right)\right) - t \]
      5. sub-neg65.1%

        \[\leadsto \left(\log y + \mathsf{fma}\left({\left(\sqrt[3]{\log t \cdot \color{blue}{\left(a + \left(-0.5\right)\right)}}\right)}^{2}, \sqrt[3]{\log t \cdot \left(a - 0.5\right)}, \log z\right)\right) - t \]
      6. metadata-eval65.1%

        \[\leadsto \left(\log y + \mathsf{fma}\left({\left(\sqrt[3]{\log t \cdot \left(a + \color{blue}{-0.5}\right)}\right)}^{2}, \sqrt[3]{\log t \cdot \left(a - 0.5\right)}, \log z\right)\right) - t \]
      7. sub-neg65.1%

        \[\leadsto \left(\log y + \mathsf{fma}\left({\left(\sqrt[3]{\log t \cdot \left(a + -0.5\right)}\right)}^{2}, \sqrt[3]{\log t \cdot \color{blue}{\left(a + \left(-0.5\right)\right)}}, \log z\right)\right) - t \]
      8. metadata-eval65.1%

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

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

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

    if 2.1999999999999999e48 < a < 3.2000000000000002e77

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 13: 56.6% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

Alternative 14: 56.5% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;a \leq 1.8 \cdot 10^{+31}:\\
\;\;\;\;\log y - t\\

\mathbf{elif}\;a \leq 6.4 \cdot 10^{+47} \lor \neg \left(a \leq 2 \cdot 10^{+75}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.2e12 or 1.79999999999999998e31 < a < 6.4e47 or 1.99999999999999985e75 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2e12 < a < 1.79999999999999998e31

    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-udef99.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.4e47 < a < 1.99999999999999985e75

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5200000000000:\\ \;\;\;\;\log t \cdot a\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{+31}:\\ \;\;\;\;\log y - t\\ \mathbf{elif}\;a \leq 6.4 \cdot 10^{+47} \lor \neg \left(a \leq 2 \cdot 10^{+75}\right):\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 64.4% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;a \leq 1.72 \cdot 10^{+31}:\\
\;\;\;\;\log \left(x + y\right) - t\\

\mathbf{elif}\;a \leq 10^{+48} \lor \neg \left(a \leq 1.3 \cdot 10^{+73}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -9.5e11 or 1.72e31 < a < 1.00000000000000004e48 or 1.3e73 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.5e11 < a < 1.72e31

    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-udef99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000004e48 < a < 1.3e73

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -950000000000:\\ \;\;\;\;\log t \cdot a\\ \mathbf{elif}\;a \leq 1.72 \cdot 10^{+31}:\\ \;\;\;\;\log \left(x + y\right) - t\\ \mathbf{elif}\;a \leq 10^{+48} \lor \neg \left(a \leq 1.3 \cdot 10^{+73}\right):\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 40.7% accurate, 2.9× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\log \left(x + y\right)} \]
    9. Step-by-step derivation
      1. +-commutative9.1%

        \[\leadsto \log \color{blue}{\left(y + x\right)} \]
    10. Simplified9.1%

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

    if 135 < t

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot t} \]
    5. Step-by-step derivation
      1. mul-1-neg72.1%

        \[\leadsto \color{blue}{-t} \]
    6. Simplified72.1%

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

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

Alternative 17: 61.1% accurate, 2.9× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    14. Simplified53.6%

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

    if 1.3000000000000001e50 < 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. Add Preprocessing
    3. Taylor expanded in x around 0 71.6%

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

      \[\leadsto \color{blue}{-1 \cdot t} \]
    5. Step-by-step derivation
      1. mul-1-neg79.4%

        \[\leadsto \color{blue}{-t} \]
    6. Simplified79.4%

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

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

Alternative 18: 37.3% accurate, 156.5× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot t} \]
  5. Step-by-step derivation
    1. mul-1-neg34.4%

      \[\leadsto \color{blue}{-t} \]
  6. Simplified34.4%

    \[\leadsto \color{blue}{-t} \]
  7. Final simplification34.4%

    \[\leadsto -t \]
  8. 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 2024020 
(FPCore (x y z t a)
  :name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
  :precision binary64

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

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