Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.6%
Time: 17.3s
Alternatives: 14
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 99.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\log z - t\right) + \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. Add Preprocessing

Alternative 2: 82.7% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -560 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 710

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.8% accurate, 0.7× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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.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. Step-by-step derivation
      1. associate-+r-99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 63.2% accurate, 0.7× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. associate-+r-99.6%

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

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

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

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

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

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

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

    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.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. Step-by-step derivation
      1. associate-+r-99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Step-by-step derivation
    1. remove-double-neg99.6%

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

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

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

Alternative 7: 69.0% 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. +-commutative99.6%

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

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

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

      \[\leadsto \color{blue}{\left(\log z - t\right) + \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 72.0%

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

Alternative 8: 64.3% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;t \leq 1.95 \cdot 10^{-25}:\\
\;\;\;\;\log \left(y \cdot \frac{z}{{t}^{\left(0.5 - a\right)}}\right) - t\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2000000000000002e-238 < t < 1.95e-25

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\log \left(\frac{y \cdot z}{e^{\log t \cdot \left(0.5 - a\right)}}\right) - t} \]
    10. Step-by-step derivation
      1. exp-to-pow27.5%

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

        \[\leadsto \log \color{blue}{\left(y \cdot \frac{z}{{t}^{\left(0.5 - a\right)}}\right)} - t \]
    11. Simplified27.6%

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

    if 1.95e-25 < 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.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. Step-by-step derivation
      1. associate-+r-99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 72.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 2.4 \cdot 10^{-118}:\\ \;\;\;\;a \cdot \log t\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-26}:\\ \;\;\;\;\log \left(\frac{z \cdot \left(x + y\right)}{\sqrt{t}}\right) - t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-1 + \frac{\log t \cdot \left(a - 0.5\right)}{t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t 2.4e-118)
   (* a (log t))
   (if (<= t 4.2e-26)
     (- (log (/ (* z (+ x y)) (sqrt t))) 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 <= 2.4e-118) {
		tmp = a * log(t);
	} else if (t <= 4.2e-26) {
		tmp = log(((z * (x + y)) / sqrt(t))) - 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 <= 2.4d-118) then
        tmp = a * log(t)
    else if (t <= 4.2d-26) then
        tmp = log(((z * (x + y)) / sqrt(t))) - 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 <= 2.4e-118) {
		tmp = a * Math.log(t);
	} else if (t <= 4.2e-26) {
		tmp = Math.log(((z * (x + y)) / Math.sqrt(t))) - 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 <= 2.4e-118:
		tmp = a * math.log(t)
	elif t <= 4.2e-26:
		tmp = math.log(((z * (x + y)) / math.sqrt(t))) - 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 <= 2.4e-118)
		tmp = Float64(a * log(t));
	elseif (t <= 4.2e-26)
		tmp = Float64(log(Float64(Float64(z * Float64(x + y)) / sqrt(t))) - t);
	else
		tmp = Float64(t * Float64(-1.0 + Float64(Float64(log(t) * Float64(a - 0.5)) / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= 2.4e-118)
		tmp = a * log(t);
	elseif (t <= 4.2e-26)
		tmp = log(((z * (x + y)) / sqrt(t))) - 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, 2.4e-118], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-26], N[(N[Log[N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], N[(t * N[(-1.0 + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4000000000000001e-118 < t < 4.20000000000000016e-26

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.20000000000000016e-26 < 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.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. Step-by-step derivation
      1. associate-+r-99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 74.1% accurate, 2.7× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.29999999999999992e-99 < 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. Step-by-step derivation
      1. associate-+r-99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 62.6% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 390000000000:\\
\;\;\;\;a \cdot \log t\\

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9e11 < 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 77.9%

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

        \[\leadsto \color{blue}{-t} \]
    7. Simplified77.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 38.4% accurate, 34.8× speedup?

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

\\
-1 + t \cdot \left(-1 + \frac{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 35.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 38.4% 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 35.9%

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

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

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

Alternative 14: 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 35.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 2024145 
(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))))