Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2

Percentage Accurate: 88.9% → 99.5%
Time: 12.9s
Alternatives: 18
Speedup: 1.8×

Specification

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 88.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 1.6× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    5. associate-*r*N/A

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

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    8. lift--.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    9. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    10. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    11. lift--.f64N/A

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

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    14. lift-log.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    15. lift--.f6499.5

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
  5. Applied rewrites99.5%

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

Alternative 2: 85.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \log y \cdot x - t\\
t_2 := \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 111:\\
\;\;\;\;\mathsf{fma}\left(1 - z, y, -t\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\left(-\log y\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < -5.00000000000000022e41 or 1.99999999999999983e29 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t)

    1. Initial program 93.9%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \log y} - t \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \log y \cdot \color{blue}{x} - t \]
      2. lower-*.f64N/A

        \[\leadsto \log y \cdot \color{blue}{x} - t \]
      3. lift-log.f6492.7

        \[\leadsto \log y \cdot x - t \]
    5. Applied rewrites92.7%

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

    if -5.00000000000000022e41 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 111

    1. Initial program 73.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      8. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      11. lift--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      14. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      15. lift--.f6499.0

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    5. Applied rewrites99.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
    6. Taylor expanded in t around inf

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, t \cdot \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right) \cdot t\right) \]
      4. associate-/l*N/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
      6. lift-log.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
      8. lift--.f6497.4

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    8. Applied rewrites97.4%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    9. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    10. Step-by-step derivation
      1. lower--.f6497.0

        \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    11. Applied rewrites97.0%

      \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    12. Taylor expanded in t around inf

      \[\leadsto \mathsf{fma}\left(1 - z, y, -1 \cdot t\right) \]
    13. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(1 - z, y, \mathsf{neg}\left(t\right)\right) \]
      2. lower-neg.f6447.3

        \[\leadsto \mathsf{fma}\left(1 - z, y, -t\right) \]
    14. Applied rewrites47.3%

      \[\leadsto \mathsf{fma}\left(1 - z, y, -t\right) \]

    if 111 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 1.99999999999999983e29

    1. Initial program 78.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      8. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      11. lift--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      14. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      15. lift--.f6499.9

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    5. Applied rewrites99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
    6. Taylor expanded in x around 0

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

        \[\leadsto \left(-1 \cdot \log y + y \cdot \left(\left(1 + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) - z\right)\right) - t \]
    8. Applied rewrites94.4%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(z - 1\right) \cdot y, -0.5, 1\right) - z, y, -\log y\right) - \color{blue}{t} \]
    9. Taylor expanded in y around 0

      \[\leadsto -1 \cdot \log y - t \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\log y\right)\right) - t \]
      2. lift-log.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\log y\right)\right) - t \]
      3. lift-neg.f6473.4

        \[\leadsto \left(-\log y\right) - t \]
    11. Applied rewrites73.4%

      \[\leadsto \left(-\log y\right) - t \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 99.5% accurate, 1.7× speedup?

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

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

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

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

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

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

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(-0.5 \cdot y - 1\right) \cdot y\right)\right) - t \]
  5. Applied rewrites99.5%

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

Alternative 4: 88.5% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+285}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+159}:\\ \;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+247}:\\ \;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - z, y, \log y \cdot x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1e+285)
   (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t))
   (if (<= z 8.5e+159)
     (fma (- x 1.0) (log y) (- t))
     (if (<= z 7.8e+247)
       (- (* (* (- (* -0.5 y) 1.0) z) y) t)
       (fma (- 1.0 z) y (* (log y) x))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1e+285) {
		tmp = fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
	} else if (z <= 8.5e+159) {
		tmp = fma((x - 1.0), log(y), -t);
	} else if (z <= 7.8e+247) {
		tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
	} else {
		tmp = fma((1.0 - z), y, (log(y) * x));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1e+285)
		tmp = fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t));
	elseif (z <= 8.5e+159)
		tmp = fma(Float64(x - 1.0), log(y), Float64(-t));
	elseif (z <= 7.8e+247)
		tmp = Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t);
	else
		tmp = fma(Float64(1.0 - z), y, Float64(log(y) * x));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1e+285], N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision], If[LessEqual[z, 8.5e+159], N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision], If[LessEqual[z, 7.8e+247], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision], N[(N[(1.0 - z), $MachinePrecision] * y + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+285}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\

\mathbf{elif}\;z \leq 7.8 \cdot 10^{+247}:\\
\;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - z, y, \log y \cdot x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.9999999999999998e284

    1. Initial program 56.4%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      8. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      11. lift--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      14. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      15. lift--.f6499.5

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    5. Applied rewrites99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
    6. Taylor expanded in t around inf

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, -1 \cdot t\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \mathsf{neg}\left(t\right)\right) \]
      2. lift-neg.f6462.2

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]
    8. Applied rewrites62.2%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]

    if -9.9999999999999998e284 < z < 8.50000000000000076e159

    1. Initial program 93.5%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x - 1, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
      12. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x - 1}, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
      13. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(x - 1, \color{blue}{\log y}, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
      14. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - t}\right) \]
    4. Applied rewrites93.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x - 1, \log y, \log \left(1 - y\right) \cdot \left(z - 1\right) - t\right)} \]
    5. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{-1 \cdot t}\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(x - 1, \log y, \mathsf{neg}\left(t\right)\right) \]
      2. lift-neg.f6492.6

        \[\leadsto \mathsf{fma}\left(x - 1, \log y, -t\right) \]
    7. Applied rewrites92.6%

      \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{-t}\right) \]

    if 8.50000000000000076e159 < z < 7.80000000000000003e247

    1. Initial program 70.1%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      8. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      11. lift--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      14. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      15. lift--.f6499.2

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    5. Applied rewrites99.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
    6. Taylor expanded in x around 0

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

        \[\leadsto \left(-1 \cdot \log y + y \cdot \left(\left(1 + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) - z\right)\right) - t \]
    8. Applied rewrites68.3%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(z - 1\right) \cdot y, -0.5, 1\right) - z, y, -\log y\right) - \color{blue}{t} \]
    9. Taylor expanded in z around inf

      \[\leadsto y \cdot \left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right) - t \]
    10. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

        \[\leadsto \left(\left(\frac{-1}{2} \cdot y - 1\right) \cdot z\right) \cdot y - t \]
      6. lower-*.f6459.3

        \[\leadsto \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t \]
    11. Applied rewrites59.3%

      \[\leadsto \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t \]

    if 7.80000000000000003e247 < z

    1. Initial program 50.4%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      8. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      11. lift--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      14. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      15. lift--.f6499.2

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    5. Applied rewrites99.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
    6. Taylor expanded in t around inf

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, t \cdot \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right) \cdot t\right) \]
      4. associate-/l*N/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
      6. lift-log.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
      8. lift--.f6489.4

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    8. Applied rewrites89.4%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    9. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    10. Step-by-step derivation
      1. lower--.f6488.7

        \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    11. Applied rewrites88.7%

      \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
    12. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(1 - z, y, x \cdot \log y\right) \]
    13. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(1 - z, y, \log y \cdot x\right) \]
      3. lift-log.f6473.9

        \[\leadsto \mathsf{fma}\left(1 - z, y, \log y \cdot x\right) \]
    14. Applied rewrites73.9%

      \[\leadsto \mathsf{fma}\left(1 - z, y, \log y \cdot x\right) \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 5: 73.5% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -9 \cdot 10^{+162}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -2.9 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\

\mathbf{elif}\;x \leq 2.9 \cdot 10^{-14}:\\
\;\;\;\;\left(-\log y\right) - t\\

\mathbf{elif}\;x \leq 1.28 \cdot 10^{+151}:\\
\;\;\;\;\left(-y\right) \cdot z - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -8.99999999999999944e162 or 1.28000000000000006e151 < x

    1. Initial program 98.1%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \log y} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \log y \cdot \color{blue}{x} \]
      2. lower-*.f64N/A

        \[\leadsto \log y \cdot \color{blue}{x} \]
      3. lift-log.f6485.0

        \[\leadsto \log y \cdot x \]
    5. Applied rewrites85.0%

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

    if -8.99999999999999944e162 < x < -2.90000000000000004e-27

    1. Initial program 87.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      8. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      11. lift--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      14. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      15. lift--.f6499.5

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    5. Applied rewrites99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
    6. Taylor expanded in t around inf

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, -1 \cdot t\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \mathsf{neg}\left(t\right)\right) \]
      2. lift-neg.f6448.6

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]
    8. Applied rewrites48.6%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]

    if -2.90000000000000004e-27 < x < 2.9000000000000003e-14

    1. Initial program 84.5%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. associate-*r*N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      8. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      11. lift--.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      14. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      15. lift--.f6499.4

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
    5. Applied rewrites99.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
    6. Taylor expanded in x around 0

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

        \[\leadsto \left(-1 \cdot \log y + y \cdot \left(\left(1 + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) - z\right)\right) - t \]
    8. Applied rewrites99.4%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(z - 1\right) \cdot y, -0.5, 1\right) - z, y, -\log y\right) - \color{blue}{t} \]
    9. Taylor expanded in y around 0

      \[\leadsto -1 \cdot \log y - t \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\log y\right)\right) - t \]
      2. lift-log.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\log y\right)\right) - t \]
      3. lift-neg.f6483.0

        \[\leadsto \left(-\log y\right) - t \]
    11. Applied rewrites83.0%

      \[\leadsto \left(-\log y\right) - t \]

    if 2.9000000000000003e-14 < x < 1.28000000000000006e151

    1. Initial program 87.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z} - 1, \log y \cdot \left(x - 1\right)\right) - t \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(-y, z - \color{blue}{1}, \log y \cdot \left(x - 1\right)\right) - t \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
      7. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
      8. lift--.f6499.2

        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
    5. Applied rewrites99.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right)} - t \]
    6. Taylor expanded in z around inf

      \[\leadsto -1 \cdot \color{blue}{\left(y \cdot z\right)} - t \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot y\right) \cdot z - t \]
      2. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z - t \]
      3. lower-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z - t \]
      4. lift-neg.f6447.8

        \[\leadsto \left(-y\right) \cdot z - t \]
    8. Applied rewrites47.8%

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

Alternative 6: 97.2% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, z, \log y \cdot x\right) - t\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.9 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(1 - z, y, \left(-\log y\right) - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.5000000000000004e31 or 2.9000000000000003e-14 < x

    1. Initial program 93.5%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z} - 1, \log y \cdot \left(x - 1\right)\right) - t \]
      5. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(-y, z - \color{blue}{1}, \log y \cdot \left(x - 1\right)\right) - t \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
      7. lift-log.f64N/A

        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
      8. lift--.f6499.3

        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
    5. Applied rewrites99.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right)} - t \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot x\right) - t \]
    7. Step-by-step derivation
      1. Applied rewrites98.0%

        \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot x\right) - t \]
      2. Taylor expanded in z around inf

        \[\leadsto \mathsf{fma}\left(-y, z, \log y \cdot x\right) - t \]
      3. Step-by-step derivation
        1. Applied rewrites98.0%

          \[\leadsto \mathsf{fma}\left(-y, z, \log y \cdot x\right) - t \]

        if -6.5000000000000004e31 < x < 2.9000000000000003e-14

        1. Initial program 84.6%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          5. associate-*r*N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          10. lower-neg.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          11. lift--.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          14. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          15. lift--.f6499.4

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. Applied rewrites99.4%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
        6. Taylor expanded in t around inf

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, t \cdot \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right)\right) \]
        7. Step-by-step derivation
          1. *-commutativeN/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right) \cdot t\right) \]
          4. associate-/l*N/A

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
          6. lift-log.f64N/A

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
          8. lift--.f6498.8

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        8. Applied rewrites98.8%

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        9. Taylor expanded in y around 0

          \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        10. Step-by-step derivation
          1. lower--.f6498.4

            \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        11. Applied rewrites98.4%

          \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        12. Taylor expanded in x around 0

          \[\leadsto \mathsf{fma}\left(1 - z, y, -1 \cdot \log y - t\right) \]
        13. Step-by-step derivation
          1. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(1 - z, y, -1 \cdot \log y - t\right) \]
          2. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\mathsf{neg}\left(\log y\right)\right) - t\right) \]
          3. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\mathsf{neg}\left(\log y\right)\right) - t\right) \]
          4. lift-neg.f6496.5

            \[\leadsto \mathsf{fma}\left(1 - z, y, \left(-\log y\right) - t\right) \]
        14. Applied rewrites96.5%

          \[\leadsto \mathsf{fma}\left(1 - z, y, \left(-\log y\right) - t\right) \]
      4. Recombined 2 regimes into one program.
      5. Add Preprocessing

      Alternative 7: 94.7% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+31}:\\ \;\;\;\;\log y \cdot x - t\\ \mathbf{elif}\;x \leq 0.0265:\\ \;\;\;\;\mathsf{fma}\left(1 - z, y, \left(-\log y\right) - t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= x -6.5e+31)
         (- (* (log y) x) t)
         (if (<= x 0.0265)
           (fma (- 1.0 z) y (- (- (log y)) t))
           (fma (- x 1.0) (log y) (- t)))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (x <= -6.5e+31) {
      		tmp = (log(y) * x) - t;
      	} else if (x <= 0.0265) {
      		tmp = fma((1.0 - z), y, (-log(y) - t));
      	} else {
      		tmp = fma((x - 1.0), log(y), -t);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (x <= -6.5e+31)
      		tmp = Float64(Float64(log(y) * x) - t);
      	elseif (x <= 0.0265)
      		tmp = fma(Float64(1.0 - z), y, Float64(Float64(-log(y)) - t));
      	else
      		tmp = fma(Float64(x - 1.0), log(y), Float64(-t));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[x, -6.5e+31], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 0.0265], N[(N[(1.0 - z), $MachinePrecision] * y + N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]), $MachinePrecision], N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -6.5 \cdot 10^{+31}:\\
      \;\;\;\;\log y \cdot x - t\\
      
      \mathbf{elif}\;x \leq 0.0265:\\
      \;\;\;\;\mathsf{fma}\left(1 - z, y, \left(-\log y\right) - t\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < -6.5000000000000004e31

        1. Initial program 93.8%

          \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
        2. Add Preprocessing
        3. Taylor expanded in x around inf

          \[\leadsto \color{blue}{x \cdot \log y} - t \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \log y \cdot \color{blue}{x} - t \]
          2. lower-*.f64N/A

            \[\leadsto \log y \cdot \color{blue}{x} - t \]
          3. lift-log.f6493.0

            \[\leadsto \log y \cdot x - t \]
        5. Applied rewrites93.0%

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

        if -6.5000000000000004e31 < x < 0.0264999999999999993

        1. Initial program 84.5%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          5. associate-*r*N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          10. lower-neg.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          11. lift--.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          14. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          15. lift--.f6499.4

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. Applied rewrites99.4%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
        6. Taylor expanded in t around inf

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, t \cdot \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right)\right) \]
        7. Step-by-step derivation
          1. *-commutativeN/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right) \cdot t\right) \]
          4. associate-/l*N/A

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
          6. lift-log.f64N/A

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
          8. lift--.f6498.8

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        8. Applied rewrites98.8%

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        9. Taylor expanded in y around 0

          \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        10. Step-by-step derivation
          1. lower--.f6498.5

            \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        11. Applied rewrites98.5%

          \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        12. Taylor expanded in x around 0

          \[\leadsto \mathsf{fma}\left(1 - z, y, -1 \cdot \log y - t\right) \]
        13. Step-by-step derivation
          1. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(1 - z, y, -1 \cdot \log y - t\right) \]
          2. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\mathsf{neg}\left(\log y\right)\right) - t\right) \]
          3. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\mathsf{neg}\left(\log y\right)\right) - t\right) \]
          4. lift-neg.f6496.2

            \[\leadsto \mathsf{fma}\left(1 - z, y, \left(-\log y\right) - t\right) \]
        14. Applied rewrites96.2%

          \[\leadsto \mathsf{fma}\left(1 - z, y, \left(-\log y\right) - t\right) \]

        if 0.0264999999999999993 < x

        1. Initial program 93.8%

          \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(x - 1, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
          12. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{x - 1}, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
          13. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(x - 1, \color{blue}{\log y}, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
          14. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - t}\right) \]
        4. Applied rewrites93.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(x - 1, \log y, \log \left(1 - y\right) \cdot \left(z - 1\right) - t\right)} \]
        5. Taylor expanded in y around 0

          \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{-1 \cdot t}\right) \]
        6. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(x - 1, \log y, \mathsf{neg}\left(t\right)\right) \]
          2. lift-neg.f6493.2

            \[\leadsto \mathsf{fma}\left(x - 1, \log y, -t\right) \]
        7. Applied rewrites93.2%

          \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{-t}\right) \]
      3. Recombined 3 regimes into one program.
      4. Add Preprocessing

      Alternative 8: 88.3% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+285}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+159}:\\ \;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t))))
         (if (<= z -1e+285)
           t_1
           (if (<= z 8.5e+159) (fma (- x 1.0) (log y) (- t)) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
      	double tmp;
      	if (z <= -1e+285) {
      		tmp = t_1;
      	} else if (z <= 8.5e+159) {
      		tmp = fma((x - 1.0), log(y), -t);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t))
      	tmp = 0.0
      	if (z <= -1e+285)
      		tmp = t_1;
      	elseif (z <= 8.5e+159)
      		tmp = fma(Float64(x - 1.0), log(y), Float64(-t));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision]}, If[LessEqual[z, -1e+285], t$95$1, If[LessEqual[z, 8.5e+159], N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\
      \mathbf{if}\;z \leq -1 \cdot 10^{+285}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 8.5 \cdot 10^{+159}:\\
      \;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -9.9999999999999998e284 or 8.50000000000000076e159 < z

        1. Initial program 61.6%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          5. associate-*r*N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          10. lower-neg.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          11. lift--.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          14. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          15. lift--.f6499.3

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. Applied rewrites99.3%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
        6. Taylor expanded in t around inf

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, -1 \cdot t\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \mathsf{neg}\left(t\right)\right) \]
          2. lift-neg.f6463.1

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]
        8. Applied rewrites63.1%

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]

        if -9.9999999999999998e284 < z < 8.50000000000000076e159

        1. Initial program 93.5%

          \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(x - 1, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
          12. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{x - 1}, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
          13. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(x - 1, \color{blue}{\log y}, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
          14. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - t}\right) \]
        4. Applied rewrites93.5%

          \[\leadsto \color{blue}{\mathsf{fma}\left(x - 1, \log y, \log \left(1 - y\right) \cdot \left(z - 1\right) - t\right)} \]
        5. Taylor expanded in y around 0

          \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{-1 \cdot t}\right) \]
        6. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(x - 1, \log y, \mathsf{neg}\left(t\right)\right) \]
          2. lift-neg.f6492.6

            \[\leadsto \mathsf{fma}\left(x - 1, \log y, -t\right) \]
        7. Applied rewrites92.6%

          \[\leadsto \mathsf{fma}\left(x - 1, \log y, \color{blue}{-t}\right) \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 9: 88.3% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+285}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+159}:\\ \;\;\;\;\log y \cdot \left(x - 1\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t))))
         (if (<= z -1e+285)
           t_1
           (if (<= z 8.5e+159) (- (* (log y) (- x 1.0)) t) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
      	double tmp;
      	if (z <= -1e+285) {
      		tmp = t_1;
      	} else if (z <= 8.5e+159) {
      		tmp = (log(y) * (x - 1.0)) - t;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t))
      	tmp = 0.0
      	if (z <= -1e+285)
      		tmp = t_1;
      	elseif (z <= 8.5e+159)
      		tmp = Float64(Float64(log(y) * Float64(x - 1.0)) - t);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision]}, If[LessEqual[z, -1e+285], t$95$1, If[LessEqual[z, 8.5e+159], N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\
      \mathbf{if}\;z \leq -1 \cdot 10^{+285}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 8.5 \cdot 10^{+159}:\\
      \;\;\;\;\log y \cdot \left(x - 1\right) - t\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -9.9999999999999998e284 or 8.50000000000000076e159 < z

        1. Initial program 61.6%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          5. associate-*r*N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          10. lower-neg.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          11. lift--.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          14. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          15. lift--.f6499.3

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. Applied rewrites99.3%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
        6. Taylor expanded in t around inf

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, -1 \cdot t\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \mathsf{neg}\left(t\right)\right) \]
          2. lift-neg.f6463.1

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]
        8. Applied rewrites63.1%

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]

        if -9.9999999999999998e284 < z < 8.50000000000000076e159

        1. Initial program 93.5%

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

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

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

            \[\leadsto \log y \cdot \left(\color{blue}{x} - 1\right) - t \]
          3. lift--.f6492.6

            \[\leadsto \log y \cdot \left(x - \color{blue}{1}\right) - t \]
        5. Applied rewrites92.6%

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

      Alternative 10: 99.1% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (- (fma (- y) (- z 1.0) (* (log y) (- x 1.0))) t))
      double code(double x, double y, double z, double t) {
      	return fma(-y, (z - 1.0), (log(y) * (x - 1.0))) - t;
      }
      
      function code(x, y, z, t)
      	return Float64(fma(Float64(-y), Float64(z - 1.0), Float64(log(y) * Float64(x - 1.0))) - t)
      end
      
      code[x_, y_, z_, t_] := N[(N[((-y) * N[(z - 1.0), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t
      \end{array}
      
      Derivation
      1. Initial program 88.9%

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z} - 1, \log y \cdot \left(x - 1\right)\right) - t \]
        5. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(-y, z - \color{blue}{1}, \log y \cdot \left(x - 1\right)\right) - t \]
        6. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
        7. lift-log.f64N/A

          \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
        8. lift--.f6499.1

          \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
      5. Applied rewrites99.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right)} - t \]
      6. Add Preprocessing

      Alternative 11: 60.5% accurate, 1.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\ \mathbf{if}\;z \leq -7.2 \cdot 10^{+116}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+153}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t))))
         (if (<= z -7.2e+116) t_1 (if (<= z 1.15e+153) (- (- (log y)) t) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
      	double tmp;
      	if (z <= -7.2e+116) {
      		tmp = t_1;
      	} else if (z <= 1.15e+153) {
      		tmp = -log(y) - t;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t))
      	tmp = 0.0
      	if (z <= -7.2e+116)
      		tmp = t_1;
      	elseif (z <= 1.15e+153)
      		tmp = Float64(Float64(-log(y)) - t);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision]}, If[LessEqual[z, -7.2e+116], t$95$1, If[LessEqual[z, 1.15e+153], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\
      \mathbf{if}\;z \leq -7.2 \cdot 10^{+116}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 1.15 \cdot 10^{+153}:\\
      \;\;\;\;\left(-\log y\right) - t\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -7.19999999999999941e116 or 1.1500000000000001e153 < z

        1. Initial program 66.3%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          5. associate-*r*N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          10. lower-neg.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          11. lift--.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          14. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          15. lift--.f6499.1

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. Applied rewrites99.1%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
        6. Taylor expanded in t around inf

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, -1 \cdot t\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \mathsf{neg}\left(t\right)\right) \]
          2. lift-neg.f6461.0

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]
        8. Applied rewrites61.0%

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]

        if -7.19999999999999941e116 < z < 1.1500000000000001e153

        1. Initial program 97.9%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          5. associate-*r*N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          10. lower-neg.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          11. lift--.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          14. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          15. lift--.f6499.6

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. Applied rewrites99.6%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
        6. Taylor expanded in x around 0

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

            \[\leadsto \left(-1 \cdot \log y + y \cdot \left(\left(1 + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) - z\right)\right) - t \]
        8. Applied rewrites62.5%

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(z - 1\right) \cdot y, -0.5, 1\right) - z, y, -\log y\right) - \color{blue}{t} \]
        9. Taylor expanded in y around 0

          \[\leadsto -1 \cdot \log y - t \]
        10. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \left(\mathsf{neg}\left(\log y\right)\right) - t \]
          2. lift-log.f64N/A

            \[\leadsto \left(\mathsf{neg}\left(\log y\right)\right) - t \]
          3. lift-neg.f6460.3

            \[\leadsto \left(-\log y\right) - t \]
        11. Applied rewrites60.3%

          \[\leadsto \left(-\log y\right) - t \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 12: 45.9% accurate, 8.1× speedup?

      \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t)))
      double code(double x, double y, double z, double t) {
      	return fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
      }
      
      function code(x, y, z, t)
      	return fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t))
      end
      
      code[x_, y_, z_, t_] := N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)
      \end{array}
      
      Derivation
      1. Initial program 88.9%

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. associate-*r*N/A

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        8. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        10. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        11. lift--.f64N/A

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        14. lift-log.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        15. lift--.f6499.5

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. Applied rewrites99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
      6. Taylor expanded in t around inf

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, -1 \cdot t\right) \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \mathsf{neg}\left(t\right)\right) \]
        2. lift-neg.f6445.9

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]
      8. Applied rewrites45.9%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right) \]
      9. Add Preprocessing

      Alternative 13: 45.7% accurate, 10.3× speedup?

      \[\begin{array}{l} \\ \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t \end{array} \]
      (FPCore (x y z t) :precision binary64 (- (* (* (- (* -0.5 y) 1.0) z) y) t))
      double code(double x, double y, double z, double t) {
      	return ((((-0.5 * y) - 1.0) * z) * y) - 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)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          code = (((((-0.5d0) * y) - 1.0d0) * z) * y) - t
      end function
      
      public static double code(double x, double y, double z, double t) {
      	return ((((-0.5 * y) - 1.0) * z) * y) - t;
      }
      
      def code(x, y, z, t):
      	return ((((-0.5 * y) - 1.0) * z) * y) - t
      
      function code(x, y, z, t)
      	return Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t)
      end
      
      function tmp = code(x, y, z, t)
      	tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
      end
      
      code[x_, y_, z_, t_] := N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t
      \end{array}
      
      Derivation
      1. Initial program 88.9%

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. associate-*r*N/A

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        8. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        10. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        11. lift--.f64N/A

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        14. lift-log.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        15. lift--.f6499.5

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. Applied rewrites99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
      6. Taylor expanded in x around 0

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

          \[\leadsto \left(-1 \cdot \log y + y \cdot \left(\left(1 + \frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right)\right) - z\right)\right) - t \]
      8. Applied rewrites64.2%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(z - 1\right) \cdot y, -0.5, 1\right) - z, y, -\log y\right) - \color{blue}{t} \]
      9. Taylor expanded in z around inf

        \[\leadsto y \cdot \left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right) - t \]
      10. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

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

          \[\leadsto \left(\left(\frac{-1}{2} \cdot y - 1\right) \cdot z\right) \cdot y - t \]
        6. lower-*.f6445.7

          \[\leadsto \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t \]
      11. Applied rewrites45.7%

        \[\leadsto \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t \]
      12. Add Preprocessing

      Alternative 14: 42.0% accurate, 10.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1860000000:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+44}:\\ \;\;\;\;\left(1 - z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= t -1860000000.0) (- t) (if (<= t 1.1e+44) (* (- 1.0 z) y) (- t))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= -1860000000.0) {
      		tmp = -t;
      	} else if (t <= 1.1e+44) {
      		tmp = (1.0 - z) * y;
      	} else {
      		tmp = -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)
      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) :: tmp
          if (t <= (-1860000000.0d0)) then
              tmp = -t
          else if (t <= 1.1d+44) then
              tmp = (1.0d0 - z) * y
          else
              tmp = -t
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= -1860000000.0) {
      		tmp = -t;
      	} else if (t <= 1.1e+44) {
      		tmp = (1.0 - z) * y;
      	} else {
      		tmp = -t;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if t <= -1860000000.0:
      		tmp = -t
      	elif t <= 1.1e+44:
      		tmp = (1.0 - z) * y
      	else:
      		tmp = -t
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (t <= -1860000000.0)
      		tmp = Float64(-t);
      	elseif (t <= 1.1e+44)
      		tmp = Float64(Float64(1.0 - z) * y);
      	else
      		tmp = Float64(-t);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (t <= -1860000000.0)
      		tmp = -t;
      	elseif (t <= 1.1e+44)
      		tmp = (1.0 - z) * y;
      	else
      		tmp = -t;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[t, -1860000000.0], (-t), If[LessEqual[t, 1.1e+44], N[(N[(1.0 - z), $MachinePrecision] * y), $MachinePrecision], (-t)]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -1860000000:\\
      \;\;\;\;-t\\
      
      \mathbf{elif}\;t \leq 1.1 \cdot 10^{+44}:\\
      \;\;\;\;\left(1 - z\right) \cdot y\\
      
      \mathbf{else}:\\
      \;\;\;\;-t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -1.86e9 or 1.09999999999999998e44 < t

        1. Initial program 95.0%

          \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
        2. Add Preprocessing
        3. Taylor expanded in t around inf

          \[\leadsto \color{blue}{-1 \cdot t} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(t\right) \]
          2. lower-neg.f6470.4

            \[\leadsto -t \]
        5. Applied rewrites70.4%

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

        if -1.86e9 < t < 1.09999999999999998e44

        1. Initial program 83.9%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          5. associate-*r*N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          10. lower-neg.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          11. lift--.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          14. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          15. lift--.f6499.3

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. Applied rewrites99.3%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
        6. Taylor expanded in y around inf

          \[\leadsto {y}^{2} \cdot \color{blue}{\left(\left(\frac{-1}{2} \cdot \left(z - 1\right) + \frac{1}{y}\right) - \frac{z}{y}\right)} \]
        7. Step-by-step derivation
          1. *-commutativeN/A

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

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

            \[\leadsto \left(\frac{-1}{2} \cdot \left(z - 1\right) + \left(\frac{1}{y} - \frac{z}{y}\right)\right) \cdot {y}^{2} \]
          4. div-subN/A

            \[\leadsto \left(\frac{-1}{2} \cdot \left(z - 1\right) + \frac{1 - z}{y}\right) \cdot {y}^{2} \]
          5. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, z - 1, \frac{1 - z}{y}\right) \cdot {y}^{2} \]
          6. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, z - 1, \frac{1 - z}{y}\right) \cdot {y}^{2} \]
          7. lower-/.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, z - 1, \frac{1 - z}{y}\right) \cdot {y}^{2} \]
          8. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, z - 1, \frac{1 - z}{y}\right) \cdot {y}^{2} \]
          9. unpow2N/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, z - 1, \frac{1 - z}{y}\right) \cdot \left(y \cdot y\right) \]
          10. lower-*.f6410.2

            \[\leadsto \mathsf{fma}\left(-0.5, z - 1, \frac{1 - z}{y}\right) \cdot \left(y \cdot y\right) \]
        8. Applied rewrites10.2%

          \[\leadsto \mathsf{fma}\left(-0.5, z - 1, \frac{1 - z}{y}\right) \cdot \color{blue}{\left(y \cdot y\right)} \]
        9. Taylor expanded in y around 0

          \[\leadsto y \cdot \left(1 - \color{blue}{z}\right) \]
        10. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left(1 - z\right) \cdot y \]
          2. lower-*.f64N/A

            \[\leadsto \left(1 - z\right) \cdot y \]
          3. lift--.f6418.4

            \[\leadsto \left(1 - z\right) \cdot y \]
        11. Applied rewrites18.4%

          \[\leadsto \left(1 - z\right) \cdot y \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 15: 41.8% accurate, 11.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1860000000:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+44}:\\ \;\;\;\;\left(-z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= t -1860000000.0) (- t) (if (<= t 1.1e+44) (* (- z) y) (- t))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= -1860000000.0) {
      		tmp = -t;
      	} else if (t <= 1.1e+44) {
      		tmp = -z * y;
      	} else {
      		tmp = -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)
      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) :: tmp
          if (t <= (-1860000000.0d0)) then
              tmp = -t
          else if (t <= 1.1d+44) then
              tmp = -z * y
          else
              tmp = -t
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= -1860000000.0) {
      		tmp = -t;
      	} else if (t <= 1.1e+44) {
      		tmp = -z * y;
      	} else {
      		tmp = -t;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if t <= -1860000000.0:
      		tmp = -t
      	elif t <= 1.1e+44:
      		tmp = -z * y
      	else:
      		tmp = -t
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (t <= -1860000000.0)
      		tmp = Float64(-t);
      	elseif (t <= 1.1e+44)
      		tmp = Float64(Float64(-z) * y);
      	else
      		tmp = Float64(-t);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (t <= -1860000000.0)
      		tmp = -t;
      	elseif (t <= 1.1e+44)
      		tmp = -z * y;
      	else
      		tmp = -t;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[t, -1860000000.0], (-t), If[LessEqual[t, 1.1e+44], N[((-z) * y), $MachinePrecision], (-t)]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -1860000000:\\
      \;\;\;\;-t\\
      
      \mathbf{elif}\;t \leq 1.1 \cdot 10^{+44}:\\
      \;\;\;\;\left(-z\right) \cdot y\\
      
      \mathbf{else}:\\
      \;\;\;\;-t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -1.86e9 or 1.09999999999999998e44 < t

        1. Initial program 95.0%

          \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
        2. Add Preprocessing
        3. Taylor expanded in t around inf

          \[\leadsto \color{blue}{-1 \cdot t} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(t\right) \]
          2. lower-neg.f6470.4

            \[\leadsto -t \]
        5. Applied rewrites70.4%

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

        if -1.86e9 < t < 1.09999999999999998e44

        1. Initial program 83.9%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          5. associate-*r*N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          8. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          10. lower-neg.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          11. lift--.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          14. lift-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
          15. lift--.f6499.3

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. Applied rewrites99.3%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
        6. Taylor expanded in z around inf

          \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right)} \]
        7. Step-by-step derivation
          1. *-commutativeN/A

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

            \[\leadsto \left(z \cdot \left(\frac{-1}{2} \cdot y - 1\right)\right) \cdot y \]
          3. *-commutativeN/A

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

            \[\leadsto \left(\left(\frac{-1}{2} \cdot y - 1\right) \cdot z\right) \cdot y \]
          5. lower--.f64N/A

            \[\leadsto \left(\left(\frac{-1}{2} \cdot y - 1\right) \cdot z\right) \cdot y \]
          6. lift-*.f6418.2

            \[\leadsto \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y \]
        8. Applied rewrites18.2%

          \[\leadsto \left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot \color{blue}{y} \]
        9. Taylor expanded in y around 0

          \[\leadsto \left(-1 \cdot z\right) \cdot y \]
        10. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \left(\mathsf{neg}\left(z\right)\right) \cdot y \]
          2. lower-neg.f6417.9

            \[\leadsto \left(-z\right) \cdot y \]
        11. Applied rewrites17.9%

          \[\leadsto \left(-z\right) \cdot y \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 16: 45.6% accurate, 18.8× speedup?

      \[\begin{array}{l} \\ \mathsf{fma}\left(1 - z, y, -t\right) \end{array} \]
      (FPCore (x y z t) :precision binary64 (fma (- 1.0 z) y (- t)))
      double code(double x, double y, double z, double t) {
      	return fma((1.0 - z), y, -t);
      }
      
      function code(x, y, z, t)
      	return fma(Float64(1.0 - z), y, Float64(-t))
      end
      
      code[x_, y_, z_, t_] := N[(N[(1.0 - z), $MachinePrecision] * y + (-t)), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \mathsf{fma}\left(1 - z, y, -t\right)
      \end{array}
      
      Derivation
      1. Initial program 88.9%

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot \left(z - 1\right)\right) + -1 \cdot \left(z - 1\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        5. associate-*r*N/A

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        8. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -1 \cdot \left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, \mathsf{neg}\left(\left(z - 1\right)\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        10. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        11. lift--.f64N/A

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        14. lift-log.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
        15. lift--.f6499.5

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right) \]
      5. Applied rewrites99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)} \]
      6. Taylor expanded in t around inf

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, t \cdot \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right)\right) \]
      7. Step-by-step derivation
        1. *-commutativeN/A

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\frac{\log y \cdot \left(x - 1\right)}{t} - 1\right) \cdot t\right) \]
        4. associate-/l*N/A

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        6. lift-log.f64N/A

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
        8. lift--.f6487.8

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
      8. Applied rewrites87.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
      9. Taylor expanded in y around 0

        \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
      10. Step-by-step derivation
        1. lower--.f6487.5

          \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
      11. Applied rewrites87.5%

        \[\leadsto \mathsf{fma}\left(1 - z, y, \left(\log y \cdot \frac{x - 1}{t} - 1\right) \cdot t\right) \]
      12. Taylor expanded in t around inf

        \[\leadsto \mathsf{fma}\left(1 - z, y, -1 \cdot t\right) \]
      13. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(1 - z, y, \mathsf{neg}\left(t\right)\right) \]
        2. lower-neg.f6445.6

          \[\leadsto \mathsf{fma}\left(1 - z, y, -t\right) \]
      14. Applied rewrites45.6%

        \[\leadsto \mathsf{fma}\left(1 - z, y, -t\right) \]
      15. Add Preprocessing

      Alternative 17: 45.5% accurate, 20.5× speedup?

      \[\begin{array}{l} \\ \left(-y\right) \cdot z - t \end{array} \]
      (FPCore (x y z t) :precision binary64 (- (* (- y) z) t))
      double code(double x, double y, double z, double t) {
      	return (-y * z) - 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)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          code = (-y * z) - t
      end function
      
      public static double code(double x, double y, double z, double t) {
      	return (-y * z) - t;
      }
      
      def code(x, y, z, t):
      	return (-y * z) - t
      
      function code(x, y, z, t)
      	return Float64(Float64(Float64(-y) * z) - t)
      end
      
      function tmp = code(x, y, z, t)
      	tmp = (-y * z) - t;
      end
      
      code[x_, y_, z_, t_] := N[(N[((-y) * z), $MachinePrecision] - t), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \left(-y\right) \cdot z - t
      \end{array}
      
      Derivation
      1. Initial program 88.9%

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z} - 1, \log y \cdot \left(x - 1\right)\right) - t \]
        5. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(-y, z - \color{blue}{1}, \log y \cdot \left(x - 1\right)\right) - t \]
        6. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
        7. lift-log.f64N/A

          \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
        8. lift--.f6499.1

          \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t \]
      5. Applied rewrites99.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right)} - t \]
      6. Taylor expanded in z around inf

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot z\right)} - t \]
      7. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \left(-1 \cdot y\right) \cdot z - t \]
        2. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z - t \]
        3. lower-*.f64N/A

          \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z - t \]
        4. lift-neg.f6445.5

          \[\leadsto \left(-y\right) \cdot z - t \]
      8. Applied rewrites45.5%

        \[\leadsto \left(-y\right) \cdot \color{blue}{z} - t \]
      9. Add Preprocessing

      Alternative 18: 34.9% accurate, 75.3× speedup?

      \[\begin{array}{l} \\ -t \end{array} \]
      (FPCore (x y z t) :precision binary64 (- t))
      double code(double x, double y, double z, double t) {
      	return -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)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          code = -t
      end function
      
      public static double code(double x, double y, double z, double t) {
      	return -t;
      }
      
      def code(x, y, z, t):
      	return -t
      
      function code(x, y, z, t)
      	return Float64(-t)
      end
      
      function tmp = code(x, y, z, t)
      	tmp = -t;
      end
      
      code[x_, y_, z_, t_] := (-t)
      
      \begin{array}{l}
      
      \\
      -t
      \end{array}
      
      Derivation
      1. Initial program 88.9%

        \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
      2. Add Preprocessing
      3. Taylor expanded in t around inf

        \[\leadsto \color{blue}{-1 \cdot t} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(t\right) \]
        2. lower-neg.f6434.9

          \[\leadsto -t \]
      5. Applied rewrites34.9%

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

      Reproduce

      ?
      herbie shell --seed 2025089 
      (FPCore (x y z t)
        :name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"
        :precision binary64
        (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))