Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.6%
Time: 24.1s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 99.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 76.6% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 517.20000000000005 < (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. remove-double-neg99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, \log y + -0.5 \cdot \log t, \log z\right)} - t \]
      4. add-log-exp34.6%

        \[\leadsto \mathsf{fma}\left(1, \log y + \color{blue}{\log \left(e^{-0.5 \cdot \log t}\right)}, \log z\right) - t \]
      5. sum-log30.6%

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{\log \left(y \cdot e^{-0.5 \cdot \log t}\right)}, \log z\right) - t \]
      6. *-commutative30.6%

        \[\leadsto \mathsf{fma}\left(1, \log \left(y \cdot e^{\color{blue}{\log t \cdot -0.5}}\right), \log z\right) - t \]
      7. exp-to-pow30.6%

        \[\leadsto \mathsf{fma}\left(1, \log \left(y \cdot \color{blue}{{t}^{-0.5}}\right), \log z\right) - t \]
    8. Applied egg-rr30.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, \log \left(y \cdot {t}^{-0.5}\right), \log z\right)} - t \]
    9. Step-by-step derivation
      1. fma-undefine30.6%

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

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

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

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

Alternative 3: 68.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log t \cdot a\\ \mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a - 0.5 \leq 10:\\ \;\;\;\;\left(\log y + \left(\log z + \log t \cdot -0.5\right)\right) - t\\ \mathbf{elif}\;a - 0.5 \leq 5 \cdot 10^{+128}:\\ \;\;\;\;\log \left(y \cdot z\right) + \mathsf{fma}\left(\log t, a + -0.5, -t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (log t) a)))
   (if (<= (- a 0.5) -2e+21)
     t_1
     (if (<= (- a 0.5) 10.0)
       (- (+ (log y) (+ (log z) (* (log t) -0.5))) t)
       (if (<= (- a 0.5) 5e+128)
         (+ (log (* y z)) (fma (log t) (+ a -0.5) (- t)))
         t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = log(t) * a;
	double tmp;
	if ((a - 0.5) <= -2e+21) {
		tmp = t_1;
	} else if ((a - 0.5) <= 10.0) {
		tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t;
	} else if ((a - 0.5) <= 5e+128) {
		tmp = log((y * z)) + fma(log(t), (a + -0.5), -t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(log(t) * a)
	tmp = 0.0
	if (Float64(a - 0.5) <= -2e+21)
		tmp = t_1;
	elseif (Float64(a - 0.5) <= 10.0)
		tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * -0.5))) - t);
	elseif (Float64(a - 0.5) <= 5e+128)
		tmp = Float64(log(Float64(y * z)) + fma(log(t), Float64(a + -0.5), Float64(-t)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+21], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], 10.0], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], 5e+128], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a - 0.5 \leq 5 \cdot 10^{+128}:\\
\;\;\;\;\log \left(y \cdot z\right) + \mathsf{fma}\left(\log t, a + -0.5, -t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 a #s(literal 1/2 binary64)) < -2e21 or 5e128 < (-.f64 a #s(literal 1/2 binary64))

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity44.3%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log33.3%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr33.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    13. Simplified83.2%

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

    if -2e21 < (-.f64 a #s(literal 1/2 binary64)) < 10

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 10 < (-.f64 a #s(literal 1/2 binary64)) < 5e128

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity55.3%

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

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

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

      \[\leadsto \left(\color{blue}{1 \cdot \log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    9. Step-by-step derivation
      1. *-lft-identity44.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \log \left(y \cdot z\right) + \mathsf{fma}\left(\log t, \color{blue}{-0.5 + a}, -t\right) \]
    13. Simplified63.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+21}:\\ \;\;\;\;\log t \cdot a\\ \mathbf{elif}\;a - 0.5 \leq 10:\\ \;\;\;\;\left(\log y + \left(\log z + \log t \cdot -0.5\right)\right) - t\\ \mathbf{elif}\;a - 0.5 \leq 5 \cdot 10^{+128}:\\ \;\;\;\;\log \left(y \cdot z\right) + \mathsf{fma}\left(\log t, a + -0.5, -t\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 a #s(literal 1/2 binary64)) < -2e21 or 5e128 < (-.f64 a #s(literal 1/2 binary64))

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity44.3%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log33.3%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr33.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    13. Simplified83.2%

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

    if -2e21 < (-.f64 a #s(literal 1/2 binary64)) < 10

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 10 < (-.f64 a #s(literal 1/2 binary64)) < 5e128

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity55.3%

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

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

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

      \[\leadsto \left(\color{blue}{1 \cdot \log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    9. Step-by-step derivation
      1. *-lft-identity44.2%

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

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

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

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

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

Alternative 5: 99.6% accurate, 1.0× speedup?

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

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

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

Alternative 6: 68.6% accurate, 1.0× speedup?

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

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

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

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

Alternative 7: 59.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\ t_2 := \log t \cdot a\\ t_3 := \left(\log z + \log y\right) - t\\ \mathbf{if}\;a \leq -700000:\\ \;\;\;\;\log \left(x + y\right) + t\_2\\ \mathbf{elif}\;a \leq -1.1 \cdot 10^{-267}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{-271}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-47}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{+50}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (log (* y (* z (pow t -0.5)))) t))
        (t_2 (* (log t) a))
        (t_3 (- (+ (log z) (log y)) t)))
   (if (<= a -700000.0)
     (+ (log (+ x y)) t_2)
     (if (<= a -1.1e-267)
       t_1
       (if (<= a 3.9e-271)
         t_3
         (if (<= a 1.7e-47) t_1 (if (<= a 1.85e+50) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = log((y * (z * pow(t, -0.5)))) - t;
	double t_2 = log(t) * a;
	double t_3 = (log(z) + log(y)) - t;
	double tmp;
	if (a <= -700000.0) {
		tmp = log((x + y)) + t_2;
	} else if (a <= -1.1e-267) {
		tmp = t_1;
	} else if (a <= 3.9e-271) {
		tmp = t_3;
	} else if (a <= 1.7e-47) {
		tmp = t_1;
	} else if (a <= 1.85e+50) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = log((y * (z * (t ** (-0.5d0))))) - t
    t_2 = log(t) * a
    t_3 = (log(z) + log(y)) - t
    if (a <= (-700000.0d0)) then
        tmp = log((x + y)) + t_2
    else if (a <= (-1.1d-267)) then
        tmp = t_1
    else if (a <= 3.9d-271) then
        tmp = t_3
    else if (a <= 1.7d-47) then
        tmp = t_1
    else if (a <= 1.85d+50) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = Math.log((y * (z * Math.pow(t, -0.5)))) - t;
	double t_2 = Math.log(t) * a;
	double t_3 = (Math.log(z) + Math.log(y)) - t;
	double tmp;
	if (a <= -700000.0) {
		tmp = Math.log((x + y)) + t_2;
	} else if (a <= -1.1e-267) {
		tmp = t_1;
	} else if (a <= 3.9e-271) {
		tmp = t_3;
	} else if (a <= 1.7e-47) {
		tmp = t_1;
	} else if (a <= 1.85e+50) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = math.log((y * (z * math.pow(t, -0.5)))) - t
	t_2 = math.log(t) * a
	t_3 = (math.log(z) + math.log(y)) - t
	tmp = 0
	if a <= -700000.0:
		tmp = math.log((x + y)) + t_2
	elif a <= -1.1e-267:
		tmp = t_1
	elif a <= 3.9e-271:
		tmp = t_3
	elif a <= 1.7e-47:
		tmp = t_1
	elif a <= 1.85e+50:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t)
	t_2 = Float64(log(t) * a)
	t_3 = Float64(Float64(log(z) + log(y)) - t)
	tmp = 0.0
	if (a <= -700000.0)
		tmp = Float64(log(Float64(x + y)) + t_2);
	elseif (a <= -1.1e-267)
		tmp = t_1;
	elseif (a <= 3.9e-271)
		tmp = t_3;
	elseif (a <= 1.7e-47)
		tmp = t_1;
	elseif (a <= 1.85e+50)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = log((y * (z * (t ^ -0.5)))) - t;
	t_2 = log(t) * a;
	t_3 = (log(z) + log(y)) - t;
	tmp = 0.0;
	if (a <= -700000.0)
		tmp = log((x + y)) + t_2;
	elseif (a <= -1.1e-267)
		tmp = t_1;
	elseif (a <= 3.9e-271)
		tmp = t_3;
	elseif (a <= 1.7e-47)
		tmp = t_1;
	elseif (a <= 1.85e+50)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -700000.0], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[a, -1.1e-267], t$95$1, If[LessEqual[a, 3.9e-271], t$95$3, If[LessEqual[a, 1.7e-47], t$95$1, If[LessEqual[a, 1.85e+50], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.1 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 3.9 \cdot 10^{-271}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;a \leq 1.7 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.85 \cdot 10^{+50}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -7e5

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7e5 < a < -1.09999999999999994e-267 or 3.89999999999999997e-271 < a < 1.7000000000000001e-47

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \log \left(y \cdot e^{\color{blue}{\log z + -0.5 \cdot \log t}}\right) - t \]
      4. exp-sum42.6%

        \[\leadsto \log \left(y \cdot \color{blue}{\left(e^{\log z} \cdot e^{-0.5 \cdot \log t}\right)}\right) - t \]
      5. add-exp-log42.7%

        \[\leadsto \log \left(y \cdot \left(\color{blue}{z} \cdot e^{-0.5 \cdot \log t}\right)\right) - t \]
      6. *-commutative42.7%

        \[\leadsto \log \left(y \cdot \left(z \cdot e^{\color{blue}{\log t \cdot -0.5}}\right)\right) - t \]
      7. exp-to-pow42.8%

        \[\leadsto \log \left(y \cdot \left(z \cdot \color{blue}{{t}^{-0.5}}\right)\right) - t \]
    10. Applied egg-rr42.8%

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

    if -1.09999999999999994e-267 < a < 3.89999999999999997e-271 or 1.7000000000000001e-47 < a < 1.85e50

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85e50 < a

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity49.5%

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

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

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

      \[\leadsto \left(\color{blue}{1 \cdot \log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    9. Step-by-step derivation
      1. *-lft-identity37.6%

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    13. Simplified80.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -700000:\\ \;\;\;\;\log \left(x + y\right) + \log t \cdot a\\ \mathbf{elif}\;a \leq -1.1 \cdot 10^{-267}:\\ \;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{-271}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-47}:\\ \;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{+50}:\\ \;\;\;\;\left(\log z + \log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 78.7% accurate, 1.4× speedup?

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

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

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


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

    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. remove-double-neg99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.99999999999999976e163 < t

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity99.8%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log67.5%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr67.5%

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

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

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

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

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

        \[\leadsto \color{blue}{-t} \]
    13. Simplified87.8%

      \[\leadsto \color{blue}{-t} \]
    14. 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} \]
    15. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    16. 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-log87.8%

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

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

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

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

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

Alternative 9: 67.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+18} \lor \neg \left(a \leq 1.6 \cdot 10^{+50}\right):\\
\;\;\;\;\log t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.1e18 or 1.59999999999999991e50 < a

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity45.6%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log35.3%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr35.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    13. Simplified81.3%

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

    if -3.1e18 < a < 1.59999999999999991e50

    1. Initial program 99.5%

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

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

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

Alternative 10: 60.1% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 99.4%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity32.6%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log28.1%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr28.1%

      \[\leadsto \left(\color{blue}{1 \cdot \log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    9. Step-by-step derivation
      1. *-lft-identity28.1%

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

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

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

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

    if 1.7000000000000001e164 < t

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity99.8%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log67.5%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr67.5%

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

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

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

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

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

        \[\leadsto \color{blue}{-t} \]
    13. Simplified87.8%

      \[\leadsto \color{blue}{-t} \]
    14. 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} \]
    15. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    16. 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-log87.8%

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

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

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

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

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

Alternative 11: 74.5% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 99.3%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity0.8%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log0.8%

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

      \[\leadsto \left(\color{blue}{1 \cdot \log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    9. Step-by-step derivation
      1. *-lft-identity0.8%

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

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

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

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

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

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

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

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

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

    if 21000 < 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 74.2%

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

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

Alternative 12: 58.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.85 \cdot 10^{+21} \lor \neg \left(a \leq 1.85 \cdot 10^{+50}\right):\\
\;\;\;\;\log t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.85e21 or 1.85e50 < a

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity45.6%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log35.3%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr35.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    13. Simplified81.3%

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

    if -1.85e21 < a < 1.85e50

    1. Initial program 99.5%

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

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

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

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

Alternative 13: 57.9% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.15 \cdot 10^{+20} \lor \neg \left(a \leq 2.7 \cdot 10^{+50}\right):\\
\;\;\;\;\log t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.15e20 or 2.7e50 < a

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity45.6%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log35.3%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr35.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    13. Simplified81.3%

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

    if -1.15e20 < a < 2.7e50

    1. Initial program 99.5%

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

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

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

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

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

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

Alternative 14: 63.0% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{+19} \lor \neg \left(a \leq 1.72 \cdot 10^{+50}\right):\\
\;\;\;\;\log t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.8e19 or 1.72e50 < a

    1. Initial program 99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity45.6%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log35.3%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr35.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\log t \cdot a} \]
    13. Simplified81.3%

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

    if -5.8e19 < a < 1.72e50

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity52.4%

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

        \[\leadsto \left(1 \cdot \color{blue}{\left(\log z + \log \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
      3. sum-log40.1%

        \[\leadsto \left(1 \cdot \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    8. Applied egg-rr40.1%

      \[\leadsto \left(\color{blue}{1 \cdot \log \left(z \cdot \left(x + y\right)\right)} - t\right) + \left(a - 0.5\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right) \]
    9. Step-by-step derivation
      1. *-lft-identity40.1%

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

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

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

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

        \[\leadsto \color{blue}{-t} \]
    13. Simplified52.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.8 \cdot 10^{+19} \lor \neg \left(a \leq 1.72 \cdot 10^{+50}\right):\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(1 - t\right) + -1\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 39.6% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 600:\\
\;\;\;\;\log y\\

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


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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\log \left(y + x\right)} \]
    11. Taylor expanded in y around inf 7.2%

      \[\leadsto \color{blue}{-1 \cdot \log \left(\frac{1}{y}\right)} \]
    12. Step-by-step derivation
      1. mul-1-neg7.2%

        \[\leadsto \color{blue}{-\log \left(\frac{1}{y}\right)} \]
      2. log-rec7.2%

        \[\leadsto -\color{blue}{\left(-\log y\right)} \]
      3. remove-double-neg7.2%

        \[\leadsto \color{blue}{\log y} \]
    13. Simplified7.2%

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

    if 600 < t

    1. Initial program 99.9%

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

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

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

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

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

      \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
    7. Step-by-step derivation
      1. *-un-lft-identity99.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
    14. 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} \]
    15. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-t\right)} - 1} \]
    16. 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-log73.5%

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

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

        \[\leadsto \left(1 - t\right) + \color{blue}{-1} \]
    17. Simplified73.5%

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

Alternative 16: 37.8% accurate, 62.6× speedup?

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

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

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

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

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

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

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

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
  7. Step-by-step derivation
    1. *-un-lft-identity49.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
  13. Simplified37.9%

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

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

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

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

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

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

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

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

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

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

Alternative 17: 37.8% accurate, 156.5× speedup?

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

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

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

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

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

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

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

    \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log t\right)\right)} \]
  7. Step-by-step derivation
    1. *-un-lft-identity49.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
  13. Simplified37.9%

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

Developer target: 99.6% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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