Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 99.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \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-undefine99.6%

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

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

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

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

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

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

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

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

Alternative 2: 86.3% accurate, 1.0× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. expm1-log1p-u0.0%

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

        \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\log t\right)} - 1\right)} \]
    4. Applied egg-rr0.0%

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\log t\right)} - 1\right)} \]
    5. Step-by-step derivation
      1. expm1-define0.0%

        \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    6. Simplified0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.48000000000000002e-6 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

    if 1.48000000000000002e-6 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

    if 0.00169999999999999991 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 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 6: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\log \left(x + y\right) + \left(\log z - t\right)\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(log(Float64(x + y)) + Float64(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[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\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. Step-by-step derivation
    1. associate--l+99.6%

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

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

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

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

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

Alternative 7: 67.8% accurate, 1.0× speedup?

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

\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\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. Step-by-step derivation
    1. associate--l+99.6%

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

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

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

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

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

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

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

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

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

Alternative 8: 67.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 71.6% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified50.2%

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

    if 2.79999999999999986e-167 < t < 1.14999999999999993e-102

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.14999999999999993e-102 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 87.0% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(a - 0.5\right)} \cdot \log t \]
      4. 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)} \]
      5. sum-log77.9%

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

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

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

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

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

    if 6.7e16 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 71.5% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(a - 0.5\right)} \cdot \log t \]
      4. 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)} \]
      5. sum-log77.9%

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

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

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

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

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

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

    if 6.7e16 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 71.8% accurate, 2.7× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5e-149 < t

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 61.3% accurate, 2.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.1500000000000001e28 or 4.3e16 < a

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    7. Simplified78.2%

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

    if -3.1500000000000001e28 < a < 4.3e16

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 37.2% accurate, 34.8× speedup?

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

\\
-1 - t \cdot \left(\frac{-1}{t} - -1\right)
\end{array}
Derivation
  1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{t \cdot \left(\frac{1}{t} - 1\right)} + -1 \]
  13. Final simplification40.3%

    \[\leadsto -1 - t \cdot \left(\frac{-1}{t} - -1\right) \]
  14. Add Preprocessing

Alternative 15: 37.2% accurate, 62.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(1 - t\right) + -1} \]
  12. Final simplification40.3%

    \[\leadsto -1 + \left(1 - t\right) \]
  13. Add Preprocessing

Alternative 16: 37.2% accurate, 156.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 2.4% accurate, 313.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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

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

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