Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.6%
Time: 10.5s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
(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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    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]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t

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 13 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?

\[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
(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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    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]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t

Alternative 1: 99.6% accurate, 1.0× speedup?

\[\left(\log \left(y + x\right) - \left(t - \log z\right)\right) + \left(a - 0.5\right) \cdot \log t \]
(FPCore (x y z t a)
  :precision binary64
  (+ (- (log (+ y x)) (- t (log z))) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
	return (log((y + x)) - (t - log(z))) + ((a - 0.5) * log(t));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    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 + x)) - (t - log(z))) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
	return (Math.log((y + x)) - (t - Math.log(z))) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a):
	return (math.log((y + x)) - (t - math.log(z))) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a)
	return Float64(Float64(log(Float64(y + x)) - Float64(t - log(z))) + Float64(Float64(a - 0.5) * log(t)))
end
function tmp = code(x, y, z, t, a)
	tmp = (log((y + x)) - (t - log(z))) + ((a - 0.5) * log(t));
end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[N[(y + x), $MachinePrecision]], $MachinePrecision] - N[(t - N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\log \left(y + x\right) - \left(t - \log z\right)\right) + \left(a - 0.5\right) \cdot \log t
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. lift--.f64N/A

      \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t \]
    2. lift-+.f64N/A

      \[\leadsto \left(\color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t \]
    3. associate--l+N/A

      \[\leadsto \color{blue}{\left(\log \left(x + y\right) + \left(\log z - t\right)\right)} + \left(a - \frac{1}{2}\right) \cdot \log t \]
    4. add-flipN/A

      \[\leadsto \color{blue}{\left(\log \left(x + y\right) - \left(\mathsf{neg}\left(\left(\log z - t\right)\right)\right)\right)} + \left(a - \frac{1}{2}\right) \cdot \log t \]
    5. sub-negate-revN/A

      \[\leadsto \left(\log \left(x + y\right) - \color{blue}{\left(t - \log z\right)}\right) + \left(a - \frac{1}{2}\right) \cdot \log t \]
    6. lower--.f64N/A

      \[\leadsto \color{blue}{\left(\log \left(x + y\right) - \left(t - \log z\right)\right)} + \left(a - \frac{1}{2}\right) \cdot \log t \]
    7. lift-+.f64N/A

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

      \[\leadsto \left(\log \color{blue}{\left(y + x\right)} - \left(t - \log z\right)\right) + \left(a - \frac{1}{2}\right) \cdot \log t \]
    9. lower-+.f64N/A

      \[\leadsto \left(\log \color{blue}{\left(y + x\right)} - \left(t - \log z\right)\right) + \left(a - \frac{1}{2}\right) \cdot \log t \]
    10. lower--.f6499.6%

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

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

Alternative 2: 98.7% accurate, 0.6× speedup?

\[\begin{array}{l} \mathbf{if}\;t \leq 0.32:\\ \;\;\;\;\log z + \left(\log \left(\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\right) + \log t \cdot \left(a - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\log \left(\mathsf{max}\left(x, y\right)\right) + \log z\right) - t\right) + a \cdot \log t\\ \end{array} \]
(FPCore (x y z t a)
  :precision binary64
  (if (<= t 0.32)
  (+
   (log z)
   (+ (log (+ (fmin x y) (fmax x y))) (* (log t) (- a 0.5))))
  (+ (- (+ (log (fmax x y)) (log z)) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 0.32) {
		tmp = log(z) + (log((fmin(x, y) + fmax(x, y))) + (log(t) * (a - 0.5)));
	} else {
		tmp = ((log(fmax(x, y)) + log(z)) - t) + (a * log(t));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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


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

    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. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\log z + \left(\log \left(x + y\right) + \log t \cdot \left(a - \frac{1}{2}\right)\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \log z + \color{blue}{\left(\log \left(x + y\right) + \log t \cdot \left(a - \frac{1}{2}\right)\right)} \]
      2. lower-log.f64N/A

        \[\leadsto \log z + \left(\color{blue}{\log \left(x + y\right)} + \log t \cdot \left(a - \frac{1}{2}\right)\right) \]
      3. lower-+.f64N/A

        \[\leadsto \log z + \left(\log \left(x + y\right) + \color{blue}{\log t \cdot \left(a - \frac{1}{2}\right)}\right) \]
      4. lower-log.f64N/A

        \[\leadsto \log z + \left(\log \left(x + y\right) + \color{blue}{\log t} \cdot \left(a - \frac{1}{2}\right)\right) \]
      5. lower-+.f64N/A

        \[\leadsto \log z + \left(\log \left(x + y\right) + \log \color{blue}{t} \cdot \left(a - \frac{1}{2}\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \log z + \left(\log \left(x + y\right) + \log t \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right) \]
      7. lower-log.f64N/A

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

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

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

    if 0.32000000000000001 < t

    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. Taylor expanded in t around inf

      \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
    3. Step-by-step derivation
      1. lower-*.f6477.8%

        \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
    4. Applied rewrites77.8%

      \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
    5. Taylor expanded in a around inf

      \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
      2. lower-log.f6475.2%

        \[\leadsto -1 \cdot t + a \cdot \log t \]
    7. Applied rewrites75.2%

      \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
    8. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\left(\left(\log y + \log z\right) - t\right)} + a \cdot \log t \]
    9. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto \left(\left(\log y + \log z\right) - \color{blue}{t}\right) + a \cdot \log t \]
      2. lower-+.f64N/A

        \[\leadsto \left(\left(\log y + \log z\right) - t\right) + a \cdot \log t \]
      3. lower-log.f64N/A

        \[\leadsto \left(\left(\log y + \log z\right) - t\right) + a \cdot \log t \]
      4. lower-log.f6459.4%

        \[\leadsto \left(\left(\log y + \log z\right) - t\right) + a \cdot \log t \]
    10. Applied rewrites59.4%

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

Alternative 3: 97.5% accurate, 0.7× speedup?

\[\begin{array}{l} t_1 := \left(\log \left(\mathsf{max}\left(x, y\right)\right) + \log z\right) - t\\ t_2 := t\_1 + a \cdot \log t\\ \mathbf{if}\;a \leq -1.05:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-33}:\\ \;\;\;\;t\_1 + -0.5 \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
(FPCore (x y z t a)
  :precision binary64
  (let* ((t_1 (- (+ (log (fmax x y)) (log z)) t))
       (t_2 (+ t_1 (* a (log t)))))
  (if (<= a -1.05)
    t_2
    (if (<= a 9.6e-33) (+ t_1 (* -0.5 (log t))) t_2))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (log(fmax(x, y)) + log(z)) - t;
	double t_2 = t_1 + (a * log(t));
	double tmp;
	if (a <= -1.05) {
		tmp = t_2;
	} else if (a <= 9.6e-33) {
		tmp = t_1 + (-0.5 * log(t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (log(fmax(x, y)) + log(z)) - t
    t_2 = t_1 + (a * log(t))
    if (a <= (-1.05d0)) then
        tmp = t_2
    else if (a <= 9.6d-33) then
        tmp = t_1 + ((-0.5d0) * log(t))
    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(fmax(x, y)) + Math.log(z)) - t;
	double t_2 = t_1 + (a * Math.log(t));
	double tmp;
	if (a <= -1.05) {
		tmp = t_2;
	} else if (a <= 9.6e-33) {
		tmp = t_1 + (-0.5 * Math.log(t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (math.log(fmax(x, y)) + math.log(z)) - t
	t_2 = t_1 + (a * math.log(t))
	tmp = 0
	if a <= -1.05:
		tmp = t_2
	elif a <= 9.6e-33:
		tmp = t_1 + (-0.5 * math.log(t))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(log(fmax(x, y)) + log(z)) - t)
	t_2 = Float64(t_1 + Float64(a * log(t)))
	tmp = 0.0
	if (a <= -1.05)
		tmp = t_2;
	elseif (a <= 9.6e-33)
		tmp = Float64(t_1 + Float64(-0.5 * log(t)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (log(max(x, y)) + log(z)) - t;
	t_2 = t_1 + (a * log(t));
	tmp = 0.0;
	if (a <= -1.05)
		tmp = t_2;
	elseif (a <= 9.6e-33)
		tmp = t_1 + (-0.5 * log(t));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[N[Max[x, y], $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.05], t$95$2, If[LessEqual[a, 9.6e-33], N[(t$95$1 + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(\log \left(\mathsf{max}\left(x, y\right)\right) + \log z\right) - t\\
t_2 := t\_1 + a \cdot \log t\\
\mathbf{if}\;a \leq -1.05:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 9.6 \cdot 10^{-33}:\\
\;\;\;\;t\_1 + -0.5 \cdot \log t\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.05 or 9.6e-33 < 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. Taylor expanded in t around inf

      \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
    3. Step-by-step derivation
      1. lower-*.f6477.8%

        \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
    4. Applied rewrites77.8%

      \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
    5. Taylor expanded in a around inf

      \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
      2. lower-log.f6475.2%

        \[\leadsto -1 \cdot t + a \cdot \log t \]
    7. Applied rewrites75.2%

      \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
    8. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\left(\left(\log y + \log z\right) - t\right)} + a \cdot \log t \]
    9. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto \left(\left(\log y + \log z\right) - \color{blue}{t}\right) + a \cdot \log t \]
      2. lower-+.f64N/A

        \[\leadsto \left(\left(\log y + \log z\right) - t\right) + a \cdot \log t \]
      3. lower-log.f64N/A

        \[\leadsto \left(\left(\log y + \log z\right) - t\right) + a \cdot \log t \]
      4. lower-log.f6459.4%

        \[\leadsto \left(\left(\log y + \log z\right) - t\right) + a \cdot \log t \]
    10. Applied rewrites59.4%

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

    if -1.05 < a < 9.6e-33

    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. Taylor expanded in y around 0

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

        \[\leadsto \left(\left(\log x + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    4. Applied rewrites69.0%

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

      \[\leadsto \left(\left(\log x + \log z\right) - t\right) + \color{blue}{\frac{-1}{2}} \cdot \log t \]
    6. Step-by-step derivation
      1. Applied rewrites40.5%

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

        \[\leadsto \left(\color{blue}{\left(\log y + \log z\right)} - t\right) + -0.5 \cdot \log t \]
      3. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \left(\left(\log y + \color{blue}{\log z}\right) - t\right) + \frac{-1}{2} \cdot \log t \]
        2. lower-log.f64N/A

          \[\leadsto \left(\left(\log y + \log \color{blue}{z}\right) - t\right) + \frac{-1}{2} \cdot \log t \]
        3. lower-log.f6441.4%

          \[\leadsto \left(\left(\log y + \log z\right) - t\right) + -0.5 \cdot \log t \]
      4. Applied rewrites41.4%

        \[\leadsto \left(\color{blue}{\left(\log y + \log z\right)} - t\right) + -0.5 \cdot \log t \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 4: 94.8% accurate, 0.3× speedup?

    \[\begin{array}{l} t_1 := \left(\left(\log \left(\mathsf{max}\left(x, y\right)\right) + \log z\right) - t\right) + a \cdot \log t\\ t_2 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\ t_3 := \log t\_2 + \log z\\ \mathbf{if}\;t\_3 \leq -700:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq 750:\\ \;\;\;\;\left(\left(-\log \left(\frac{\frac{1}{z}}{t\_2}\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
    (FPCore (x y z t a)
      :precision binary64
      (let* ((t_1 (+ (- (+ (log (fmax x y)) (log z)) t) (* a (log t))))
           (t_2 (+ (fmin x y) (fmax x y)))
           (t_3 (+ (log t_2) (log z))))
      (if (<= t_3 -700.0)
        t_1
        (if (<= t_3 750.0)
          (- (- (- (log (/ (/ 1.0 z) t_2))) t) (* (- 0.5 a) (log t)))
          t_1))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = ((log(fmax(x, y)) + log(z)) - t) + (a * log(t));
    	double t_2 = fmin(x, y) + fmax(x, y);
    	double t_3 = log(t_2) + log(z);
    	double tmp;
    	if (t_3 <= -700.0) {
    		tmp = t_1;
    	} else if (t_3 <= 750.0) {
    		tmp = (-log(((1.0 / z) / t_2)) - t) - ((0.5 - a) * log(t));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a)
    use fmin_fmax_functions
        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(fmax(x, y)) + log(z)) - t) + (a * log(t))
        t_2 = fmin(x, y) + fmax(x, y)
        t_3 = log(t_2) + log(z)
        if (t_3 <= (-700.0d0)) then
            tmp = t_1
        else if (t_3 <= 750.0d0) then
            tmp = (-log(((1.0d0 / z) / t_2)) - t) - ((0.5d0 - a) * log(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(fmax(x, y)) + Math.log(z)) - t) + (a * Math.log(t));
    	double t_2 = fmin(x, y) + fmax(x, y);
    	double t_3 = Math.log(t_2) + Math.log(z);
    	double tmp;
    	if (t_3 <= -700.0) {
    		tmp = t_1;
    	} else if (t_3 <= 750.0) {
    		tmp = (-Math.log(((1.0 / z) / t_2)) - t) - ((0.5 - a) * Math.log(t));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = ((math.log(fmax(x, y)) + math.log(z)) - t) + (a * math.log(t))
    	t_2 = fmin(x, y) + fmax(x, y)
    	t_3 = math.log(t_2) + math.log(z)
    	tmp = 0
    	if t_3 <= -700.0:
    		tmp = t_1
    	elif t_3 <= 750.0:
    		tmp = (-math.log(((1.0 / z) / t_2)) - t) - ((0.5 - a) * math.log(t))
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(Float64(Float64(log(fmax(x, y)) + log(z)) - t) + Float64(a * log(t)))
    	t_2 = Float64(fmin(x, y) + fmax(x, y))
    	t_3 = Float64(log(t_2) + log(z))
    	tmp = 0.0
    	if (t_3 <= -700.0)
    		tmp = t_1;
    	elseif (t_3 <= 750.0)
    		tmp = Float64(Float64(Float64(-log(Float64(Float64(1.0 / z) / t_2))) - t) - Float64(Float64(0.5 - a) * log(t)));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = ((log(max(x, y)) + log(z)) - t) + (a * log(t));
    	t_2 = min(x, y) + max(x, y);
    	t_3 = log(t_2) + log(z);
    	tmp = 0.0;
    	if (t_3 <= -700.0)
    		tmp = t_1;
    	elseif (t_3 <= 750.0)
    		tmp = (-log(((1.0 / z) / t_2)) - t) - ((0.5 - a) * log(t));
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[Log[N[Max[x, y], $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[t$95$2], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -700.0], t$95$1, If[LessEqual[t$95$3, 750.0], N[(N[((-N[Log[N[(N[(1.0 / z), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision]) - t), $MachinePrecision] - N[(N[(0.5 - a), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
    
    \begin{array}{l}
    t_1 := \left(\left(\log \left(\mathsf{max}\left(x, y\right)\right) + \log z\right) - t\right) + a \cdot \log t\\
    t_2 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\
    t_3 := \log t\_2 + \log z\\
    \mathbf{if}\;t\_3 \leq -700:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_3 \leq 750:\\
    \;\;\;\;\left(\left(-\log \left(\frac{\frac{1}{z}}{t\_2}\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -700 or 750 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z))

      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. Taylor expanded in t around inf

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      3. Step-by-step derivation
        1. lower-*.f6477.8%

          \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
      4. Applied rewrites77.8%

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      5. Taylor expanded in a around inf

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
        2. lower-log.f6475.2%

          \[\leadsto -1 \cdot t + a \cdot \log t \]
      7. Applied rewrites75.2%

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      8. Taylor expanded in x around 0

        \[\leadsto \color{blue}{\left(\left(\log y + \log z\right) - t\right)} + a \cdot \log t \]
      9. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto \left(\left(\log y + \log z\right) - \color{blue}{t}\right) + a \cdot \log t \]
        2. lower-+.f64N/A

          \[\leadsto \left(\left(\log y + \log z\right) - t\right) + a \cdot \log t \]
        3. lower-log.f64N/A

          \[\leadsto \left(\left(\log y + \log z\right) - t\right) + a \cdot \log t \]
        4. lower-log.f6459.4%

          \[\leadsto \left(\left(\log y + \log z\right) - t\right) + a \cdot \log t \]
      10. Applied rewrites59.4%

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

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

      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. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t} \]
        2. lift-*.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} \]
        3. fp-cancel-sign-sub-invN/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
        4. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
        5. lift-+.f64N/A

          \[\leadsto \left(\color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        6. lift-log.f64N/A

          \[\leadsto \left(\left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        7. lift-log.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        8. sum-logN/A

          \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        9. lower-log.f64N/A

          \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        10. *-commutativeN/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        11. lower-*.f64N/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        12. lift-+.f64N/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        13. +-commutativeN/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        14. lower-+.f64N/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        15. lift--.f64N/A

          \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right) \cdot \log t \]
        16. sub-negate-revN/A

          \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
        17. lower-*.f64N/A

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

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

        \[\leadsto \color{blue}{\left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t} \]
      4. Step-by-step derivation
        1. lift-log.f64N/A

          \[\leadsto \left(\color{blue}{\log \left(z \cdot \left(y + x\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        2. lift-*.f64N/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(y + x\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        3. *-commutativeN/A

          \[\leadsto \left(\log \color{blue}{\left(\left(y + x\right) \cdot z\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        4. sum-logN/A

          \[\leadsto \left(\color{blue}{\left(\log \left(y + x\right) + \log z\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        5. lift-+.f64N/A

          \[\leadsto \left(\left(\log \color{blue}{\left(y + x\right)} + \log z\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        6. +-commutativeN/A

          \[\leadsto \left(\left(\log \color{blue}{\left(x + y\right)} + \log z\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        7. lift-+.f64N/A

          \[\leadsto \left(\left(\log \color{blue}{\left(x + y\right)} + \log z\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        8. lift-log.f64N/A

          \[\leadsto \left(\left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        9. lift-log.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        10. add-flipN/A

          \[\leadsto \left(\color{blue}{\left(\log \left(x + y\right) - \left(\mathsf{neg}\left(\log z\right)\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        11. sub-negate-revN/A

          \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\log z\right)\right) - \log \left(x + y\right)\right)\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        12. lower-neg.f64N/A

          \[\leadsto \left(\color{blue}{\left(-\left(\left(\mathsf{neg}\left(\log z\right)\right) - \log \left(x + y\right)\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        13. lift-log.f64N/A

          \[\leadsto \left(\left(-\left(\left(\mathsf{neg}\left(\color{blue}{\log z}\right)\right) - \log \left(x + y\right)\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        14. neg-logN/A

          \[\leadsto \left(\left(-\left(\color{blue}{\log \left(\frac{1}{z}\right)} - \log \left(x + y\right)\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        15. lift-log.f64N/A

          \[\leadsto \left(\left(-\left(\log \left(\frac{1}{z}\right) - \color{blue}{\log \left(x + y\right)}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        16. lift-+.f64N/A

          \[\leadsto \left(\left(-\left(\log \left(\frac{1}{z}\right) - \log \color{blue}{\left(x + y\right)}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        17. +-commutativeN/A

          \[\leadsto \left(\left(-\left(\log \left(\frac{1}{z}\right) - \log \color{blue}{\left(y + x\right)}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        18. lift-+.f64N/A

          \[\leadsto \left(\left(-\left(\log \left(\frac{1}{z}\right) - \log \color{blue}{\left(y + x\right)}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        19. diff-logN/A

          \[\leadsto \left(\left(-\color{blue}{\log \left(\frac{\frac{1}{z}}{y + x}\right)}\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        20. lower-log.f64N/A

          \[\leadsto \left(\left(-\color{blue}{\log \left(\frac{\frac{1}{z}}{y + x}\right)}\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        21. lower-/.f64N/A

          \[\leadsto \left(\left(-\log \color{blue}{\left(\frac{\frac{1}{z}}{y + x}\right)}\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        22. lower-/.f6477.1%

          \[\leadsto \left(\left(-\log \left(\frac{\color{blue}{\frac{1}{z}}}{y + x}\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t \]
        23. lift-+.f64N/A

          \[\leadsto \left(\left(-\log \left(\frac{\frac{1}{z}}{\color{blue}{y + x}}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        24. +-commutativeN/A

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

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

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

    Alternative 5: 94.2% accurate, 0.5× speedup?

    \[\begin{array}{l} t_1 := \log \left(x + y\right) + \log z\\ \mathbf{if}\;t\_1 \leq -700:\\ \;\;\;\;\left(-t\right) + \log t \cdot a\\ \mathbf{elif}\;t\_1 \leq 750:\\ \;\;\;\;\left(\left(-\log \left(\frac{\frac{1}{z}}{x + y}\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right)\\ \end{array} \]
    (FPCore (x y z t a)
      :precision binary64
      (let* ((t_1 (+ (log (+ x y)) (log z))))
      (if (<= t_1 -700.0)
        (+ (- t) (* (log t) a))
        (if (<= t_1 750.0)
          (- (- (- (log (/ (/ 1.0 z) (+ x y)))) t) (* (- 0.5 a) (log t)))
          (+ (- t) (+ (* -0.5 (log t)) (* a (log t))))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = log((x + y)) + log(z);
    	double tmp;
    	if (t_1 <= -700.0) {
    		tmp = -t + (log(t) * a);
    	} else if (t_1 <= 750.0) {
    		tmp = (-log(((1.0 / z) / (x + y))) - t) - ((0.5 - a) * log(t));
    	} else {
    		tmp = -t + ((-0.5 * log(t)) + (a * log(t)));
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8) :: t_1
        real(8) :: tmp
        t_1 = log((x + y)) + log(z)
        if (t_1 <= (-700.0d0)) then
            tmp = -t + (log(t) * a)
        else if (t_1 <= 750.0d0) then
            tmp = (-log(((1.0d0 / z) / (x + y))) - t) - ((0.5d0 - a) * log(t))
        else
            tmp = -t + (((-0.5d0) * log(t)) + (a * log(t)))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a) {
    	double t_1 = Math.log((x + y)) + Math.log(z);
    	double tmp;
    	if (t_1 <= -700.0) {
    		tmp = -t + (Math.log(t) * a);
    	} else if (t_1 <= 750.0) {
    		tmp = (-Math.log(((1.0 / z) / (x + y))) - t) - ((0.5 - a) * Math.log(t));
    	} else {
    		tmp = -t + ((-0.5 * Math.log(t)) + (a * Math.log(t)));
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = math.log((x + y)) + math.log(z)
    	tmp = 0
    	if t_1 <= -700.0:
    		tmp = -t + (math.log(t) * a)
    	elif t_1 <= 750.0:
    		tmp = (-math.log(((1.0 / z) / (x + y))) - t) - ((0.5 - a) * math.log(t))
    	else:
    		tmp = -t + ((-0.5 * math.log(t)) + (a * math.log(t)))
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(log(Float64(x + y)) + log(z))
    	tmp = 0.0
    	if (t_1 <= -700.0)
    		tmp = Float64(Float64(-t) + Float64(log(t) * a));
    	elseif (t_1 <= 750.0)
    		tmp = Float64(Float64(Float64(-log(Float64(Float64(1.0 / z) / Float64(x + y)))) - t) - Float64(Float64(0.5 - a) * log(t)));
    	else
    		tmp = Float64(Float64(-t) + Float64(Float64(-0.5 * log(t)) + Float64(a * log(t))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = log((x + y)) + log(z);
    	tmp = 0.0;
    	if (t_1 <= -700.0)
    		tmp = -t + (log(t) * a);
    	elseif (t_1 <= 750.0)
    		tmp = (-log(((1.0 / z) / (x + y))) - t) - ((0.5 - a) * log(t));
    	else
    		tmp = -t + ((-0.5 * log(t)) + (a * log(t)));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -700.0], N[((-t) + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 750.0], N[(N[((-N[Log[N[(N[(1.0 / z), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) - t), $MachinePrecision] - N[(N[(0.5 - a), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) + N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    t_1 := \log \left(x + y\right) + \log z\\
    \mathbf{if}\;t\_1 \leq -700:\\
    \;\;\;\;\left(-t\right) + \log t \cdot a\\
    
    \mathbf{elif}\;t\_1 \leq 750:\\
    \;\;\;\;\left(\left(-\log \left(\frac{\frac{1}{z}}{x + y}\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -700

      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. Taylor expanded in t around inf

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      3. Step-by-step derivation
        1. lower-*.f6477.8%

          \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
      4. Applied rewrites77.8%

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      5. Taylor expanded in a around inf

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
        2. lower-log.f6475.2%

          \[\leadsto -1 \cdot t + a \cdot \log t \]
      7. Applied rewrites75.2%

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
        2. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
        3. lower-neg.f6475.2%

          \[\leadsto \left(-t\right) + a \cdot \log t \]
        4. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
        5. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
        6. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
      9. Applied rewrites75.2%

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

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

      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. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t} \]
        2. lift-*.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} \]
        3. fp-cancel-sign-sub-invN/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
        4. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
        5. lift-+.f64N/A

          \[\leadsto \left(\color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        6. lift-log.f64N/A

          \[\leadsto \left(\left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        7. lift-log.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        8. sum-logN/A

          \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        9. lower-log.f64N/A

          \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        10. *-commutativeN/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        11. lower-*.f64N/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        12. lift-+.f64N/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        13. +-commutativeN/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        14. lower-+.f64N/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        15. lift--.f64N/A

          \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right) \cdot \log t \]
        16. sub-negate-revN/A

          \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
        17. lower-*.f64N/A

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

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

        \[\leadsto \color{blue}{\left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t} \]
      4. Step-by-step derivation
        1. lift-log.f64N/A

          \[\leadsto \left(\color{blue}{\log \left(z \cdot \left(y + x\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        2. lift-*.f64N/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(y + x\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        3. *-commutativeN/A

          \[\leadsto \left(\log \color{blue}{\left(\left(y + x\right) \cdot z\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        4. sum-logN/A

          \[\leadsto \left(\color{blue}{\left(\log \left(y + x\right) + \log z\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        5. lift-+.f64N/A

          \[\leadsto \left(\left(\log \color{blue}{\left(y + x\right)} + \log z\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        6. +-commutativeN/A

          \[\leadsto \left(\left(\log \color{blue}{\left(x + y\right)} + \log z\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        7. lift-+.f64N/A

          \[\leadsto \left(\left(\log \color{blue}{\left(x + y\right)} + \log z\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        8. lift-log.f64N/A

          \[\leadsto \left(\left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        9. lift-log.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        10. add-flipN/A

          \[\leadsto \left(\color{blue}{\left(\log \left(x + y\right) - \left(\mathsf{neg}\left(\log z\right)\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        11. sub-negate-revN/A

          \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\log z\right)\right) - \log \left(x + y\right)\right)\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        12. lower-neg.f64N/A

          \[\leadsto \left(\color{blue}{\left(-\left(\left(\mathsf{neg}\left(\log z\right)\right) - \log \left(x + y\right)\right)\right)} - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        13. lift-log.f64N/A

          \[\leadsto \left(\left(-\left(\left(\mathsf{neg}\left(\color{blue}{\log z}\right)\right) - \log \left(x + y\right)\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        14. neg-logN/A

          \[\leadsto \left(\left(-\left(\color{blue}{\log \left(\frac{1}{z}\right)} - \log \left(x + y\right)\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        15. lift-log.f64N/A

          \[\leadsto \left(\left(-\left(\log \left(\frac{1}{z}\right) - \color{blue}{\log \left(x + y\right)}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        16. lift-+.f64N/A

          \[\leadsto \left(\left(-\left(\log \left(\frac{1}{z}\right) - \log \color{blue}{\left(x + y\right)}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        17. +-commutativeN/A

          \[\leadsto \left(\left(-\left(\log \left(\frac{1}{z}\right) - \log \color{blue}{\left(y + x\right)}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        18. lift-+.f64N/A

          \[\leadsto \left(\left(-\left(\log \left(\frac{1}{z}\right) - \log \color{blue}{\left(y + x\right)}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        19. diff-logN/A

          \[\leadsto \left(\left(-\color{blue}{\log \left(\frac{\frac{1}{z}}{y + x}\right)}\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        20. lower-log.f64N/A

          \[\leadsto \left(\left(-\color{blue}{\log \left(\frac{\frac{1}{z}}{y + x}\right)}\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        21. lower-/.f64N/A

          \[\leadsto \left(\left(-\log \color{blue}{\left(\frac{\frac{1}{z}}{y + x}\right)}\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        22. lower-/.f6477.1%

          \[\leadsto \left(\left(-\log \left(\frac{\color{blue}{\frac{1}{z}}}{y + x}\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t \]
        23. lift-+.f64N/A

          \[\leadsto \left(\left(-\log \left(\frac{\frac{1}{z}}{\color{blue}{y + x}}\right)\right) - t\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
        24. +-commutativeN/A

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

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

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

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

      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. Taylor expanded in t around inf

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      3. Step-by-step derivation
        1. lower-*.f6477.8%

          \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
      4. Applied rewrites77.8%

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      5. Taylor expanded in a around inf

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
        2. lower-log.f6475.2%

          \[\leadsto -1 \cdot t + a \cdot \log t \]
      7. Applied rewrites75.2%

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
        2. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
        3. lower-neg.f6475.2%

          \[\leadsto \left(-t\right) + a \cdot \log t \]
        4. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
        5. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
        6. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
      9. Applied rewrites75.2%

        \[\leadsto \color{blue}{\left(-t\right) + \log t \cdot a} \]
      10. Taylor expanded in a around 0

        \[\leadsto \left(-t\right) + \color{blue}{\left(\frac{-1}{2} \cdot \log t + a \cdot \log t\right)} \]
      11. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + \color{blue}{a \cdot \log t}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + \color{blue}{a} \cdot \log t\right) \]
        3. lower-log.f64N/A

          \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + a \cdot \log t\right) \]
        4. lower-*.f64N/A

          \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + a \cdot \color{blue}{\log t}\right) \]
        5. lower-log.f6477.8%

          \[\leadsto \left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right) \]
      12. Applied rewrites77.8%

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

    Alternative 6: 94.1% accurate, 0.5× speedup?

    \[\begin{array}{l} t_1 := \log \left(x + y\right) + \log z\\ \mathbf{if}\;t\_1 \leq -750:\\ \;\;\;\;\left(-t\right) + \log t \cdot a\\ \mathbf{elif}\;t\_1 \leq 690:\\ \;\;\;\;\left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right)\\ \end{array} \]
    (FPCore (x y z t a)
      :precision binary64
      (let* ((t_1 (+ (log (+ x y)) (log z))))
      (if (<= t_1 -750.0)
        (+ (- t) (* (log t) a))
        (if (<= t_1 690.0)
          (- (- (log (* z (+ y x))) t) (* (- 0.5 a) (log t)))
          (+ (- t) (+ (* -0.5 (log t)) (* a (log t))))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = log((x + y)) + log(z);
    	double tmp;
    	if (t_1 <= -750.0) {
    		tmp = -t + (log(t) * a);
    	} else if (t_1 <= 690.0) {
    		tmp = (log((z * (y + x))) - t) - ((0.5 - a) * log(t));
    	} else {
    		tmp = -t + ((-0.5 * log(t)) + (a * log(t)));
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8) :: t_1
        real(8) :: tmp
        t_1 = log((x + y)) + log(z)
        if (t_1 <= (-750.0d0)) then
            tmp = -t + (log(t) * a)
        else if (t_1 <= 690.0d0) then
            tmp = (log((z * (y + x))) - t) - ((0.5d0 - a) * log(t))
        else
            tmp = -t + (((-0.5d0) * log(t)) + (a * log(t)))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a) {
    	double t_1 = Math.log((x + y)) + Math.log(z);
    	double tmp;
    	if (t_1 <= -750.0) {
    		tmp = -t + (Math.log(t) * a);
    	} else if (t_1 <= 690.0) {
    		tmp = (Math.log((z * (y + x))) - t) - ((0.5 - a) * Math.log(t));
    	} else {
    		tmp = -t + ((-0.5 * Math.log(t)) + (a * Math.log(t)));
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = math.log((x + y)) + math.log(z)
    	tmp = 0
    	if t_1 <= -750.0:
    		tmp = -t + (math.log(t) * a)
    	elif t_1 <= 690.0:
    		tmp = (math.log((z * (y + x))) - t) - ((0.5 - a) * math.log(t))
    	else:
    		tmp = -t + ((-0.5 * math.log(t)) + (a * math.log(t)))
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(log(Float64(x + y)) + log(z))
    	tmp = 0.0
    	if (t_1 <= -750.0)
    		tmp = Float64(Float64(-t) + Float64(log(t) * a));
    	elseif (t_1 <= 690.0)
    		tmp = Float64(Float64(log(Float64(z * Float64(y + x))) - t) - Float64(Float64(0.5 - a) * log(t)));
    	else
    		tmp = Float64(Float64(-t) + Float64(Float64(-0.5 * log(t)) + Float64(a * log(t))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = log((x + y)) + log(z);
    	tmp = 0.0;
    	if (t_1 <= -750.0)
    		tmp = -t + (log(t) * a);
    	elseif (t_1 <= 690.0)
    		tmp = (log((z * (y + x))) - t) - ((0.5 - a) * log(t));
    	else
    		tmp = -t + ((-0.5 * log(t)) + (a * log(t)));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -750.0], N[((-t) + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 690.0], N[(N[(N[Log[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision] - N[(N[(0.5 - a), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) + N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    t_1 := \log \left(x + y\right) + \log z\\
    \mathbf{if}\;t\_1 \leq -750:\\
    \;\;\;\;\left(-t\right) + \log t \cdot a\\
    
    \mathbf{elif}\;t\_1 \leq 690:\\
    \;\;\;\;\left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(0.5 - a\right) \cdot \log t\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -750

      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. Taylor expanded in t around inf

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      3. Step-by-step derivation
        1. lower-*.f6477.8%

          \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
      4. Applied rewrites77.8%

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      5. Taylor expanded in a around inf

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
        2. lower-log.f6475.2%

          \[\leadsto -1 \cdot t + a \cdot \log t \]
      7. Applied rewrites75.2%

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
        2. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
        3. lower-neg.f6475.2%

          \[\leadsto \left(-t\right) + a \cdot \log t \]
        4. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
        5. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
        6. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
      9. Applied rewrites75.2%

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

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

      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. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t} \]
        2. lift-*.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} \]
        3. fp-cancel-sign-sub-invN/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
        4. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
        5. lift-+.f64N/A

          \[\leadsto \left(\color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        6. lift-log.f64N/A

          \[\leadsto \left(\left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        7. lift-log.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        8. sum-logN/A

          \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        9. lower-log.f64N/A

          \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        10. *-commutativeN/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        11. lower-*.f64N/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        12. lift-+.f64N/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        13. +-commutativeN/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        14. lower-+.f64N/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        15. lift--.f64N/A

          \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right) \cdot \log t \]
        16. sub-negate-revN/A

          \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
        17. lower-*.f64N/A

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

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

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

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

      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. Taylor expanded in t around inf

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      3. Step-by-step derivation
        1. lower-*.f6477.8%

          \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
      4. Applied rewrites77.8%

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      5. Taylor expanded in a around inf

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
        2. lower-log.f6475.2%

          \[\leadsto -1 \cdot t + a \cdot \log t \]
      7. Applied rewrites75.2%

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
        2. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
        3. lower-neg.f6475.2%

          \[\leadsto \left(-t\right) + a \cdot \log t \]
        4. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
        5. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
        6. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
      9. Applied rewrites75.2%

        \[\leadsto \color{blue}{\left(-t\right) + \log t \cdot a} \]
      10. Taylor expanded in a around 0

        \[\leadsto \left(-t\right) + \color{blue}{\left(\frac{-1}{2} \cdot \log t + a \cdot \log t\right)} \]
      11. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + \color{blue}{a \cdot \log t}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + \color{blue}{a} \cdot \log t\right) \]
        3. lower-log.f64N/A

          \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + a \cdot \log t\right) \]
        4. lower-*.f64N/A

          \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + a \cdot \color{blue}{\log t}\right) \]
        5. lower-log.f6477.8%

          \[\leadsto \left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right) \]
      12. Applied rewrites77.8%

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

    Alternative 7: 92.8% accurate, 0.4× speedup?

    \[\begin{array}{l} t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\ \mathbf{if}\;t\_1 \leq -600:\\ \;\;\;\;\left(-t\right) + \log t \cdot a\\ \mathbf{elif}\;t\_1 \leq 1000:\\ \;\;\;\;\left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - 0.5 \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right)\\ \end{array} \]
    (FPCore (x y z t a)
      :precision binary64
      (let* ((t_1
            (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t)))))
      (if (<= t_1 -600.0)
        (+ (- t) (* (log t) a))
        (if (<= t_1 1000.0)
          (- (- (log (* z (+ y x))) t) (* 0.5 (log t)))
          (+ (- t) (+ (* -0.5 (log t)) (* a (log t))))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
    	double tmp;
    	if (t_1 <= -600.0) {
    		tmp = -t + (log(t) * a);
    	} else if (t_1 <= 1000.0) {
    		tmp = (log((z * (y + x))) - t) - (0.5 * log(t));
    	} else {
    		tmp = -t + ((-0.5 * log(t)) + (a * log(t)));
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8) :: t_1
        real(8) :: tmp
        t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
        if (t_1 <= (-600.0d0)) then
            tmp = -t + (log(t) * a)
        else if (t_1 <= 1000.0d0) then
            tmp = (log((z * (y + x))) - t) - (0.5d0 * log(t))
        else
            tmp = -t + (((-0.5d0) * log(t)) + (a * log(t)))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a) {
    	double t_1 = ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
    	double tmp;
    	if (t_1 <= -600.0) {
    		tmp = -t + (Math.log(t) * a);
    	} else if (t_1 <= 1000.0) {
    		tmp = (Math.log((z * (y + x))) - t) - (0.5 * Math.log(t));
    	} else {
    		tmp = -t + ((-0.5 * Math.log(t)) + (a * Math.log(t)));
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
    	tmp = 0
    	if t_1 <= -600.0:
    		tmp = -t + (math.log(t) * a)
    	elif t_1 <= 1000.0:
    		tmp = (math.log((z * (y + x))) - t) - (0.5 * math.log(t))
    	else:
    		tmp = -t + ((-0.5 * math.log(t)) + (a * math.log(t)))
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t)))
    	tmp = 0.0
    	if (t_1 <= -600.0)
    		tmp = Float64(Float64(-t) + Float64(log(t) * a));
    	elseif (t_1 <= 1000.0)
    		tmp = Float64(Float64(log(Float64(z * Float64(y + x))) - t) - Float64(0.5 * log(t)));
    	else
    		tmp = Float64(Float64(-t) + Float64(Float64(-0.5 * log(t)) + Float64(a * log(t))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
    	tmp = 0.0;
    	if (t_1 <= -600.0)
    		tmp = -t + (log(t) * a);
    	elseif (t_1 <= 1000.0)
    		tmp = (log((z * (y + x))) - t) - (0.5 * log(t));
    	else
    		tmp = -t + ((-0.5 * log(t)) + (a * log(t)));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -600.0], N[((-t) + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000.0], N[(N[(N[Log[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision] - N[(0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) + N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\
    \mathbf{if}\;t\_1 \leq -600:\\
    \;\;\;\;\left(-t\right) + \log t \cdot a\\
    
    \mathbf{elif}\;t\_1 \leq 1000:\\
    \;\;\;\;\left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - 0.5 \cdot \log t\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < -600

      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. Taylor expanded in t around inf

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      3. Step-by-step derivation
        1. lower-*.f6477.8%

          \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
      4. Applied rewrites77.8%

        \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
      5. Taylor expanded in a around inf

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
        2. lower-log.f6475.2%

          \[\leadsto -1 \cdot t + a \cdot \log t \]
      7. Applied rewrites75.2%

        \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
        2. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
        3. lower-neg.f6475.2%

          \[\leadsto \left(-t\right) + a \cdot \log t \]
        4. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
        5. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
        6. lower-neg.f64N/A

          \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
      9. Applied rewrites75.2%

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

      if -600 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < 1e3

      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. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t} \]
        2. lift-*.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} \]
        3. fp-cancel-sign-sub-invN/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
        4. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
        5. lift-+.f64N/A

          \[\leadsto \left(\color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        6. lift-log.f64N/A

          \[\leadsto \left(\left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        7. lift-log.f64N/A

          \[\leadsto \left(\left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        8. sum-logN/A

          \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        9. lower-log.f64N/A

          \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        10. *-commutativeN/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        11. lower-*.f64N/A

          \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        12. lift-+.f64N/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        13. +-commutativeN/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        14. lower-+.f64N/A

          \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
        15. lift--.f64N/A

          \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right) \cdot \log t \]
        16. sub-negate-revN/A

          \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
        17. lower-*.f64N/A

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

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

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

        \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \color{blue}{\frac{1}{2}} \cdot \log t \]
      5. Step-by-step derivation
        1. Applied rewrites47.2%

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

        if 1e3 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t)))

        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. Taylor expanded in t around inf

          \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
        3. Step-by-step derivation
          1. lower-*.f6477.8%

            \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
        4. Applied rewrites77.8%

          \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
        5. Taylor expanded in a around inf

          \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
        6. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
          2. lower-log.f6475.2%

            \[\leadsto -1 \cdot t + a \cdot \log t \]
        7. Applied rewrites75.2%

          \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
        8. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
          2. mul-1-negN/A

            \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
          3. lower-neg.f6475.2%

            \[\leadsto \left(-t\right) + a \cdot \log t \]
          4. lower-neg.f64N/A

            \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
          5. lower-neg.f64N/A

            \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
          6. lower-neg.f64N/A

            \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
        9. Applied rewrites75.2%

          \[\leadsto \color{blue}{\left(-t\right) + \log t \cdot a} \]
        10. Taylor expanded in a around 0

          \[\leadsto \left(-t\right) + \color{blue}{\left(\frac{-1}{2} \cdot \log t + a \cdot \log t\right)} \]
        11. Step-by-step derivation
          1. lower-+.f64N/A

            \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + \color{blue}{a \cdot \log t}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + \color{blue}{a} \cdot \log t\right) \]
          3. lower-log.f64N/A

            \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + a \cdot \log t\right) \]
          4. lower-*.f64N/A

            \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + a \cdot \color{blue}{\log t}\right) \]
          5. lower-log.f6477.8%

            \[\leadsto \left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right) \]
        12. Applied rewrites77.8%

          \[\leadsto \left(-t\right) + \color{blue}{\left(-0.5 \cdot \log t + a \cdot \log t\right)} \]
      6. Recombined 3 regimes into one program.
      7. Add Preprocessing

      Alternative 8: 92.5% accurate, 0.4× speedup?

      \[\begin{array}{l} t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\ \mathbf{if}\;t\_1 \leq -600:\\ \;\;\;\;\left(-t\right) + \log t \cdot a\\ \mathbf{elif}\;t\_1 \leq 1000:\\ \;\;\;\;\log \left(z \cdot \left(x + y\right)\right) - 0.5 \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) - \left(0.5 - a\right) \cdot \log t\\ \end{array} \]
      (FPCore (x y z t a)
        :precision binary64
        (let* ((t_1
              (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t)))))
        (if (<= t_1 -600.0)
          (+ (- t) (* (log t) a))
          (if (<= t_1 1000.0)
            (- (log (* z (+ x y))) (* 0.5 (log t)))
            (- (- t) (* (- 0.5 a) (log t)))))))
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
      	double tmp;
      	if (t_1 <= -600.0) {
      		tmp = -t + (log(t) * a);
      	} else if (t_1 <= 1000.0) {
      		tmp = log((z * (x + y))) - (0.5 * log(t));
      	} else {
      		tmp = -t - ((0.5 - a) * log(t));
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: t_1
          real(8) :: tmp
          t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
          if (t_1 <= (-600.0d0)) then
              tmp = -t + (log(t) * a)
          else if (t_1 <= 1000.0d0) then
              tmp = log((z * (x + y))) - (0.5d0 * log(t))
          else
              tmp = -t - ((0.5d0 - a) * log(t))
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double t_1 = ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
      	double tmp;
      	if (t_1 <= -600.0) {
      		tmp = -t + (Math.log(t) * a);
      	} else if (t_1 <= 1000.0) {
      		tmp = Math.log((z * (x + y))) - (0.5 * Math.log(t));
      	} else {
      		tmp = -t - ((0.5 - a) * Math.log(t));
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	t_1 = ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
      	tmp = 0
      	if t_1 <= -600.0:
      		tmp = -t + (math.log(t) * a)
      	elif t_1 <= 1000.0:
      		tmp = math.log((z * (x + y))) - (0.5 * math.log(t))
      	else:
      		tmp = -t - ((0.5 - a) * math.log(t))
      	return tmp
      
      function code(x, y, z, t, a)
      	t_1 = Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t)))
      	tmp = 0.0
      	if (t_1 <= -600.0)
      		tmp = Float64(Float64(-t) + Float64(log(t) * a));
      	elseif (t_1 <= 1000.0)
      		tmp = Float64(log(Float64(z * Float64(x + y))) - Float64(0.5 * log(t)));
      	else
      		tmp = Float64(Float64(-t) - Float64(Float64(0.5 - a) * log(t)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
      	tmp = 0.0;
      	if (t_1 <= -600.0)
      		tmp = -t + (log(t) * a);
      	elseif (t_1 <= 1000.0)
      		tmp = log((z * (x + y))) - (0.5 * log(t));
      	else
      		tmp = -t - ((0.5 - a) * log(t));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -600.0], N[((-t) + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000.0], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) - N[(N[(0.5 - a), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\
      \mathbf{if}\;t\_1 \leq -600:\\
      \;\;\;\;\left(-t\right) + \log t \cdot a\\
      
      \mathbf{elif}\;t\_1 \leq 1000:\\
      \;\;\;\;\log \left(z \cdot \left(x + y\right)\right) - 0.5 \cdot \log t\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(-t\right) - \left(0.5 - a\right) \cdot \log t\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < -600

        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. Taylor expanded in t around inf

          \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
        3. Step-by-step derivation
          1. lower-*.f6477.8%

            \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
        4. Applied rewrites77.8%

          \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
        5. Taylor expanded in a around inf

          \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
        6. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
          2. lower-log.f6475.2%

            \[\leadsto -1 \cdot t + a \cdot \log t \]
        7. Applied rewrites75.2%

          \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
        8. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
          2. mul-1-negN/A

            \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
          3. lower-neg.f6475.2%

            \[\leadsto \left(-t\right) + a \cdot \log t \]
          4. lower-neg.f64N/A

            \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
          5. lower-neg.f64N/A

            \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
          6. lower-neg.f64N/A

            \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
        9. Applied rewrites75.2%

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

        if -600 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < 1e3

        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. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t} \]
          2. lift-*.f64N/A

            \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} \]
          3. fp-cancel-sign-sub-invN/A

            \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
          4. lower--.f64N/A

            \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
          5. lift-+.f64N/A

            \[\leadsto \left(\color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          6. lift-log.f64N/A

            \[\leadsto \left(\left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          7. lift-log.f64N/A

            \[\leadsto \left(\left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          8. sum-logN/A

            \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          9. lower-log.f64N/A

            \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          10. *-commutativeN/A

            \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          11. lower-*.f64N/A

            \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          12. lift-+.f64N/A

            \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          13. +-commutativeN/A

            \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          14. lower-+.f64N/A

            \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
          15. lift--.f64N/A

            \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right) \cdot \log t \]
          16. sub-negate-revN/A

            \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
          17. lower-*.f64N/A

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

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

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

          \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \color{blue}{\frac{1}{2}} \cdot \log t \]
        5. Step-by-step derivation
          1. Applied rewrites47.2%

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

            \[\leadsto \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - 0.5 \cdot \log t \]
          3. Step-by-step derivation
            1. lower-log.f64N/A

              \[\leadsto \log \left(z \cdot \left(x + y\right)\right) - \frac{1}{2} \cdot \log t \]
            2. lower-*.f64N/A

              \[\leadsto \log \left(z \cdot \left(x + y\right)\right) - \frac{1}{2} \cdot \log t \]
            3. lower-+.f6419.9%

              \[\leadsto \log \left(z \cdot \left(x + y\right)\right) - 0.5 \cdot \log t \]
          4. Applied rewrites19.9%

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

          if 1e3 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t)))

          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. Taylor expanded in t around inf

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          3. Step-by-step derivation
            1. lower-*.f6477.8%

              \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
          4. Applied rewrites77.8%

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          5. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{-1 \cdot t + \left(a - \frac{1}{2}\right) \cdot \log t} \]
            2. lift-*.f64N/A

              \[\leadsto -1 \cdot t + \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} \]
            3. fp-cancel-sign-sub-invN/A

              \[\leadsto \color{blue}{-1 \cdot t - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
            4. lift--.f64N/A

              \[\leadsto -1 \cdot t - \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right) \cdot \log t \]
            5. sub-negate-revN/A

              \[\leadsto -1 \cdot t - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
            6. lift--.f64N/A

              \[\leadsto -1 \cdot t - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
            7. lift-*.f64N/A

              \[\leadsto -1 \cdot t - \color{blue}{\left(\frac{1}{2} - a\right) \cdot \log t} \]
            8. lower--.f6477.8%

              \[\leadsto \color{blue}{-1 \cdot t - \left(0.5 - a\right) \cdot \log t} \]
            9. lift-*.f64N/A

              \[\leadsto -1 \cdot \color{blue}{t} - \left(\frac{1}{2} - a\right) \cdot \log t \]
            10. mul-1-negN/A

              \[\leadsto \left(\mathsf{neg}\left(t\right)\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
            11. lower-neg.f6477.8%

              \[\leadsto \left(-t\right) - \left(0.5 - a\right) \cdot \log t \]
          6. Applied rewrites77.8%

            \[\leadsto \color{blue}{\left(-t\right) - \left(0.5 - a\right) \cdot \log t} \]
        6. Recombined 3 regimes into one program.
        7. Add Preprocessing

        Alternative 9: 92.5% accurate, 0.4× speedup?

        \[\begin{array}{l} t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\ \mathbf{if}\;t\_1 \leq -600:\\ \;\;\;\;\left(-t\right) + \log t \cdot a\\ \mathbf{elif}\;t\_1 \leq 1000:\\ \;\;\;\;\log \left(z \cdot \left(x + y\right)\right) - 0.5 \cdot \log t\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right)\\ \end{array} \]
        (FPCore (x y z t a)
          :precision binary64
          (let* ((t_1
                (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t)))))
          (if (<= t_1 -600.0)
            (+ (- t) (* (log t) a))
            (if (<= t_1 1000.0)
              (- (log (* z (+ x y))) (* 0.5 (log t)))
              (+ (- t) (+ (* -0.5 (log t)) (* a (log t))))))))
        double code(double x, double y, double z, double t, double a) {
        	double t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
        	double tmp;
        	if (t_1 <= -600.0) {
        		tmp = -t + (log(t) * a);
        	} else if (t_1 <= 1000.0) {
        		tmp = log((z * (x + y))) - (0.5 * log(t));
        	} else {
        		tmp = -t + ((-0.5 * log(t)) + (a * log(t)));
        	}
        	return tmp;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t, a)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8), intent (in) :: a
            real(8) :: t_1
            real(8) :: tmp
            t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
            if (t_1 <= (-600.0d0)) then
                tmp = -t + (log(t) * a)
            else if (t_1 <= 1000.0d0) then
                tmp = log((z * (x + y))) - (0.5d0 * log(t))
            else
                tmp = -t + (((-0.5d0) * log(t)) + (a * log(t)))
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t, double a) {
        	double t_1 = ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
        	double tmp;
        	if (t_1 <= -600.0) {
        		tmp = -t + (Math.log(t) * a);
        	} else if (t_1 <= 1000.0) {
        		tmp = Math.log((z * (x + y))) - (0.5 * Math.log(t));
        	} else {
        		tmp = -t + ((-0.5 * Math.log(t)) + (a * Math.log(t)));
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a):
        	t_1 = ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
        	tmp = 0
        	if t_1 <= -600.0:
        		tmp = -t + (math.log(t) * a)
        	elif t_1 <= 1000.0:
        		tmp = math.log((z * (x + y))) - (0.5 * math.log(t))
        	else:
        		tmp = -t + ((-0.5 * math.log(t)) + (a * math.log(t)))
        	return tmp
        
        function code(x, y, z, t, a)
        	t_1 = Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t)))
        	tmp = 0.0
        	if (t_1 <= -600.0)
        		tmp = Float64(Float64(-t) + Float64(log(t) * a));
        	elseif (t_1 <= 1000.0)
        		tmp = Float64(log(Float64(z * Float64(x + y))) - Float64(0.5 * log(t)));
        	else
        		tmp = Float64(Float64(-t) + Float64(Float64(-0.5 * log(t)) + Float64(a * log(t))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a)
        	t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
        	tmp = 0.0;
        	if (t_1 <= -600.0)
        		tmp = -t + (log(t) * a);
        	elseif (t_1 <= 1000.0)
        		tmp = log((z * (x + y))) - (0.5 * log(t));
        	else
        		tmp = -t + ((-0.5 * log(t)) + (a * log(t)));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -600.0], N[((-t) + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000.0], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) + N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\
        \mathbf{if}\;t\_1 \leq -600:\\
        \;\;\;\;\left(-t\right) + \log t \cdot a\\
        
        \mathbf{elif}\;t\_1 \leq 1000:\\
        \;\;\;\;\log \left(z \cdot \left(x + y\right)\right) - 0.5 \cdot \log t\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right)\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < -600

          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. Taylor expanded in t around inf

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          3. Step-by-step derivation
            1. lower-*.f6477.8%

              \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
          4. Applied rewrites77.8%

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          5. Taylor expanded in a around inf

            \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
            2. lower-log.f6475.2%

              \[\leadsto -1 \cdot t + a \cdot \log t \]
          7. Applied rewrites75.2%

            \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
          8. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
            2. mul-1-negN/A

              \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
            3. lower-neg.f6475.2%

              \[\leadsto \left(-t\right) + a \cdot \log t \]
            4. lower-neg.f64N/A

              \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
            5. lower-neg.f64N/A

              \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
            6. lower-neg.f64N/A

              \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
          9. Applied rewrites75.2%

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

          if -600 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < 1e3

          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. lift-+.f64N/A

              \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t} \]
            2. lift-*.f64N/A

              \[\leadsto \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} \]
            3. fp-cancel-sign-sub-invN/A

              \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
            4. lower--.f64N/A

              \[\leadsto \color{blue}{\left(\left(\log \left(x + y\right) + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
            5. lift-+.f64N/A

              \[\leadsto \left(\color{blue}{\left(\log \left(x + y\right) + \log z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            6. lift-log.f64N/A

              \[\leadsto \left(\left(\color{blue}{\log \left(x + y\right)} + \log z\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            7. lift-log.f64N/A

              \[\leadsto \left(\left(\log \left(x + y\right) + \color{blue}{\log z}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            8. sum-logN/A

              \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            9. lower-log.f64N/A

              \[\leadsto \left(\color{blue}{\log \left(\left(x + y\right) \cdot z\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            10. *-commutativeN/A

              \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            11. lower-*.f64N/A

              \[\leadsto \left(\log \color{blue}{\left(z \cdot \left(x + y\right)\right)} - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            12. lift-+.f64N/A

              \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(x + y\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            13. +-commutativeN/A

              \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            14. lower-+.f64N/A

              \[\leadsto \left(\log \left(z \cdot \color{blue}{\left(y + x\right)}\right) - t\right) - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t \]
            15. lift--.f64N/A

              \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right) \cdot \log t \]
            16. sub-negate-revN/A

              \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
            17. lower-*.f64N/A

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

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

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

            \[\leadsto \left(\log \left(z \cdot \left(y + x\right)\right) - t\right) - \color{blue}{\frac{1}{2}} \cdot \log t \]
          5. Step-by-step derivation
            1. Applied rewrites47.2%

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

              \[\leadsto \color{blue}{\log \left(z \cdot \left(x + y\right)\right)} - 0.5 \cdot \log t \]
            3. Step-by-step derivation
              1. lower-log.f64N/A

                \[\leadsto \log \left(z \cdot \left(x + y\right)\right) - \frac{1}{2} \cdot \log t \]
              2. lower-*.f64N/A

                \[\leadsto \log \left(z \cdot \left(x + y\right)\right) - \frac{1}{2} \cdot \log t \]
              3. lower-+.f6419.9%

                \[\leadsto \log \left(z \cdot \left(x + y\right)\right) - 0.5 \cdot \log t \]
            4. Applied rewrites19.9%

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

            if 1e3 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t)))

            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. Taylor expanded in t around inf

              \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
            3. Step-by-step derivation
              1. lower-*.f6477.8%

                \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
            4. Applied rewrites77.8%

              \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
            5. Taylor expanded in a around inf

              \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
            6. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
              2. lower-log.f6475.2%

                \[\leadsto -1 \cdot t + a \cdot \log t \]
            7. Applied rewrites75.2%

              \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
            8. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
              2. mul-1-negN/A

                \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
              3. lower-neg.f6475.2%

                \[\leadsto \left(-t\right) + a \cdot \log t \]
              4. lower-neg.f64N/A

                \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
              5. lower-neg.f64N/A

                \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
              6. lower-neg.f64N/A

                \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
            9. Applied rewrites75.2%

              \[\leadsto \color{blue}{\left(-t\right) + \log t \cdot a} \]
            10. Taylor expanded in a around 0

              \[\leadsto \left(-t\right) + \color{blue}{\left(\frac{-1}{2} \cdot \log t + a \cdot \log t\right)} \]
            11. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + \color{blue}{a \cdot \log t}\right) \]
              2. lower-*.f64N/A

                \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + \color{blue}{a} \cdot \log t\right) \]
              3. lower-log.f64N/A

                \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + a \cdot \log t\right) \]
              4. lower-*.f64N/A

                \[\leadsto \left(-t\right) + \left(\frac{-1}{2} \cdot \log t + a \cdot \color{blue}{\log t}\right) \]
              5. lower-log.f6477.8%

                \[\leadsto \left(-t\right) + \left(-0.5 \cdot \log t + a \cdot \log t\right) \]
            12. Applied rewrites77.8%

              \[\leadsto \left(-t\right) + \color{blue}{\left(-0.5 \cdot \log t + a \cdot \log t\right)} \]
          6. Recombined 3 regimes into one program.
          7. Add Preprocessing

          Alternative 10: 77.8% accurate, 2.8× speedup?

          \[\left(-t\right) - \left(0.5 - a\right) \cdot \log t \]
          (FPCore (x y z t a)
            :precision binary64
            (- (- t) (* (- 0.5 a) (log t))))
          double code(double x, double y, double z, double t, double a) {
          	return -t - ((0.5 - a) * log(t));
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          use fmin_fmax_functions
              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 - ((0.5d0 - a) * log(t))
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	return -t - ((0.5 - a) * Math.log(t));
          }
          
          def code(x, y, z, t, a):
          	return -t - ((0.5 - a) * math.log(t))
          
          function code(x, y, z, t, a)
          	return Float64(Float64(-t) - Float64(Float64(0.5 - a) * log(t)))
          end
          
          function tmp = code(x, y, z, t, a)
          	tmp = -t - ((0.5 - a) * log(t));
          end
          
          code[x_, y_, z_, t_, a_] := N[((-t) - N[(N[(0.5 - a), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \left(-t\right) - \left(0.5 - a\right) \cdot \log t
          
          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. Taylor expanded in t around inf

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          3. Step-by-step derivation
            1. lower-*.f6477.8%

              \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
          4. Applied rewrites77.8%

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          5. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{-1 \cdot t + \left(a - \frac{1}{2}\right) \cdot \log t} \]
            2. lift-*.f64N/A

              \[\leadsto -1 \cdot t + \color{blue}{\left(a - \frac{1}{2}\right) \cdot \log t} \]
            3. fp-cancel-sign-sub-invN/A

              \[\leadsto \color{blue}{-1 \cdot t - \left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right) \cdot \log t} \]
            4. lift--.f64N/A

              \[\leadsto -1 \cdot t - \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right) \cdot \log t \]
            5. sub-negate-revN/A

              \[\leadsto -1 \cdot t - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
            6. lift--.f64N/A

              \[\leadsto -1 \cdot t - \color{blue}{\left(\frac{1}{2} - a\right)} \cdot \log t \]
            7. lift-*.f64N/A

              \[\leadsto -1 \cdot t - \color{blue}{\left(\frac{1}{2} - a\right) \cdot \log t} \]
            8. lower--.f6477.8%

              \[\leadsto \color{blue}{-1 \cdot t - \left(0.5 - a\right) \cdot \log t} \]
            9. lift-*.f64N/A

              \[\leadsto -1 \cdot \color{blue}{t} - \left(\frac{1}{2} - a\right) \cdot \log t \]
            10. mul-1-negN/A

              \[\leadsto \left(\mathsf{neg}\left(t\right)\right) - \left(\frac{1}{2} - a\right) \cdot \log t \]
            11. lower-neg.f6477.8%

              \[\leadsto \left(-t\right) - \left(0.5 - a\right) \cdot \log t \]
          6. Applied rewrites77.8%

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

          Alternative 11: 75.2% accurate, 2.9× speedup?

          \[\left(-t\right) + \log t \cdot a \]
          (FPCore (x y z t a)
            :precision binary64
            (+ (- t) (* (log t) a)))
          double code(double x, double y, double z, double t, double a) {
          	return -t + (log(t) * a);
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          use fmin_fmax_functions
              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 + (log(t) * a)
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	return -t + (Math.log(t) * a);
          }
          
          def code(x, y, z, t, a):
          	return -t + (math.log(t) * a)
          
          function code(x, y, z, t, a)
          	return Float64(Float64(-t) + Float64(log(t) * a))
          end
          
          function tmp = code(x, y, z, t, a)
          	tmp = -t + (log(t) * a);
          end
          
          code[x_, y_, z_, t_, a_] := N[((-t) + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
          
          \left(-t\right) + \log t \cdot a
          
          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. Taylor expanded in t around inf

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          3. Step-by-step derivation
            1. lower-*.f6477.8%

              \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
          4. Applied rewrites77.8%

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          5. Taylor expanded in a around inf

            \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
            2. lower-log.f6475.2%

              \[\leadsto -1 \cdot t + a \cdot \log t \]
          7. Applied rewrites75.2%

            \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
          8. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
            2. mul-1-negN/A

              \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
            3. lower-neg.f6475.2%

              \[\leadsto \left(-t\right) + a \cdot \log t \]
            4. lower-neg.f64N/A

              \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
            5. lower-neg.f64N/A

              \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
            6. lower-neg.f64N/A

              \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
          9. Applied rewrites75.2%

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

          Alternative 12: 40.8% accurate, 2.9× speedup?

          \[\left(-t\right) + -0.5 \cdot \log t \]
          (FPCore (x y z t a)
            :precision binary64
            (+ (- t) (* -0.5 (log t))))
          double code(double x, double y, double z, double t, double a) {
          	return -t + (-0.5 * log(t));
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          use fmin_fmax_functions
              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 + ((-0.5d0) * log(t))
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	return -t + (-0.5 * Math.log(t));
          }
          
          def code(x, y, z, t, a):
          	return -t + (-0.5 * math.log(t))
          
          function code(x, y, z, t, a)
          	return Float64(Float64(-t) + Float64(-0.5 * log(t)))
          end
          
          function tmp = code(x, y, z, t, a)
          	tmp = -t + (-0.5 * log(t));
          end
          
          code[x_, y_, z_, t_, a_] := N[((-t) + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \left(-t\right) + -0.5 \cdot \log t
          
          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. Taylor expanded in t around inf

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          3. Step-by-step derivation
            1. lower-*.f6477.8%

              \[\leadsto -1 \cdot \color{blue}{t} + \left(a - 0.5\right) \cdot \log t \]
          4. Applied rewrites77.8%

            \[\leadsto \color{blue}{-1 \cdot t} + \left(a - 0.5\right) \cdot \log t \]
          5. Taylor expanded in a around inf

            \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto -1 \cdot t + a \cdot \color{blue}{\log t} \]
            2. lower-log.f6475.2%

              \[\leadsto -1 \cdot t + a \cdot \log t \]
          7. Applied rewrites75.2%

            \[\leadsto -1 \cdot t + \color{blue}{a \cdot \log t} \]
          8. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto -1 \cdot \color{blue}{t} + a \cdot \log t \]
            2. mul-1-negN/A

              \[\leadsto \left(\mathsf{neg}\left(t\right)\right) + a \cdot \log t \]
            3. lower-neg.f6475.2%

              \[\leadsto \left(-t\right) + a \cdot \log t \]
            4. lower-neg.f64N/A

              \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot \log t\right)\right) \]
            5. lower-neg.f64N/A

              \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(*-commutative, \left(\log t \cdot a\right)\right) \]
            6. lower-neg.f64N/A

              \[\leadsto \left(-t\right) + \mathsf{Rewrite=>}\left(lower-*.f64, \left(\log t \cdot a\right)\right) \]
          9. Applied rewrites75.2%

            \[\leadsto \color{blue}{\left(-t\right) + \log t \cdot a} \]
          10. Taylor expanded in a around 0

            \[\leadsto \left(-t\right) + \color{blue}{\frac{-1}{2} \cdot \log t} \]
          11. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left(-t\right) + \frac{-1}{2} \cdot \color{blue}{\log t} \]
            2. lower-log.f6440.8%

              \[\leadsto \left(-t\right) + -0.5 \cdot \log t \]
          12. Applied rewrites40.8%

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

          Reproduce

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