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

Percentage Accurate: 88.5% → 99.6%
Time: 8.9s
Alternatives: 26
Speedup: 1.9×

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 26 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.5% 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.6% accurate, 1.5× speedup?

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

\\
\mathsf{fma}\left(x - 1, \log y, \left(z - 1\right) \cdot \left(\left(\left(\left(-0.25 \cdot y - 0.3333333333333333\right) \cdot y - 0.5\right) \cdot y - 1\right) \cdot y\right) - t\right)
\end{array}
Derivation
  1. Initial program 88.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 \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) - 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(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) - 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(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) - 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(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right) \cdot y\right)\right) - t \]
    4. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\left(x - 1\right) \cdot \log y} + \left(z - 1\right) \cdot \left(\left(\left(\left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) \cdot y - \frac{1}{2}\right) \cdot y - 1\right) \cdot 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 \left(\left(\left(\left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) \cdot y - \frac{1}{2}\right) \cdot y - 1\right) \cdot y\right)\right) - t \]
    6. associate--l+N/A

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

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

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

      \[\leadsto \mathsf{fma}\left(x - 1, \color{blue}{\log y}, \left(z - 1\right) \cdot \left(\left(\left(\left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) \cdot y - \frac{1}{2}\right) \cdot y - 1\right) \cdot y\right) - t\right) \]
    10. lower--.f6499.6

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

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

Alternative 2: 99.6% accurate, 1.6× speedup?

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

\\
\mathsf{fma}\left(x - 1, \log y, \left(z - 1\right) \cdot \left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y - 1\right) \cdot y\right) - t\right)
\end{array}
Derivation
  1. Initial program 88.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 \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) - 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(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) - 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(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) - 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(y \cdot \left(y \cdot \left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) - \frac{1}{2}\right) - 1\right) \cdot y\right)\right) - t \]
    4. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\left(x - 1\right) \cdot \log y} + \left(z - 1\right) \cdot \left(\left(\left(\left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) \cdot y - \frac{1}{2}\right) \cdot y - 1\right) \cdot 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 \left(\left(\left(\left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) \cdot y - \frac{1}{2}\right) \cdot y - 1\right) \cdot y\right)\right) - t \]
    6. associate--l+N/A

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

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

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

      \[\leadsto \mathsf{fma}\left(x - 1, \color{blue}{\log y}, \left(z - 1\right) \cdot \left(\left(\left(\left(\frac{-1}{4} \cdot y - \frac{1}{3}\right) \cdot y - \frac{1}{2}\right) \cdot y - 1\right) \cdot y\right) - t\right) \]
    10. lower--.f6499.6

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

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

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

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

    Alternative 3: 99.5% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, 1\right) - z, 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) 1.0) z) 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), 1.0) - z), y, ((log(y) * (x - 1.0)) - t));
    }
    
    function code(x, y, z, t)
    	return fma(Float64(fma(Float64(-0.5 * y), Float64(z - 1.0), 1.0) - z), y, Float64(Float64(log(y) * Float64(x - 1.0)) - t))
    end
    
    code[x_, y_, z_, t_] := N[(N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + 1.0), $MachinePrecision] - z), $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, 1\right) - z, y, \log y \cdot \left(x - 1\right) - t\right)
    \end{array}
    
    Derivation
    1. Initial program 88.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.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 y around 0

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

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

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

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

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

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

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

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

    Alternative 4: 99.5% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -\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 (- (- 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, -(z - 1.0)), y, ((log(y) * (x - 1.0)) - t));
    }
    
    function code(x, y, z, t)
    	return fma(fma(Float64(-0.5 * y), z, 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] * z + (-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, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)
    \end{array}
    
    Derivation
    1. Initial program 88.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.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 z around inf

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

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

      Alternative 5: 99.4% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \mathsf{fma}\left(\left(-0.5 \cdot y - 1\right) \cdot z, y, \log y \cdot \left(x - 1\right) - t\right) \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (fma (* (- (* -0.5 y) 1.0) z) y (- (* (log y) (- x 1.0)) t)))
      double code(double x, double y, double z, double t) {
      	return fma((((-0.5 * y) - 1.0) * z), y, ((log(y) * (x - 1.0)) - t));
      }
      
      function code(x, y, z, t)
      	return fma(Float64(Float64(Float64(-0.5 * y) - 1.0) * z), y, Float64(Float64(log(y) * Float64(x - 1.0)) - t))
      end
      
      code[x_, y_, z_, t_] := N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y + N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \mathsf{fma}\left(\left(-0.5 \cdot y - 1\right) \cdot z, y, \log y \cdot \left(x - 1\right) - t\right)
      \end{array}
      
      Derivation
      1. Initial program 88.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.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 z around inf

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

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

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

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

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

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

      Alternative 6: 98.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 -9000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(1 - z, y, -\log y\right) - t\\ \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 -9000000.0)
           t_1
           (if (<= x 2.2e-6) (- (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 <= -9000000.0) {
      		tmp = t_1;
      	} else if (x <= 2.2e-6) {
      		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 <= -9000000.0)
      		tmp = t_1;
      	elseif (x <= 2.2e-6)
      		tmp = Float64(fma(Float64(1.0 - z), y, 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, -9000000.0], t$95$1, If[LessEqual[x, 2.2e-6], N[(N[(N[(1.0 - z), $MachinePrecision] * y + (-N[Log[y], $MachinePrecision])), $MachinePrecision] - t), $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 -9000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq 2.2 \cdot 10^{-6}:\\
      \;\;\;\;\mathsf{fma}\left(1 - z, y, -\log y\right) - t\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -9e6 or 2.2000000000000001e-6 < 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. 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.4

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

          \[\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 \mathsf{fma}\left(-y, z, \log y \cdot \left(x - 1\right)\right) - t \]
        7. Step-by-step derivation
          1. Applied rewrites99.4%

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

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

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

            if -9e6 < x < 2.2000000000000001e-6

            1. Initial program 83.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.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 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.9

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

              \[\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 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} \]
            10. 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 \]
            11. Applied rewrites98.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} \]
            12. Taylor expanded in y around 0

              \[\leadsto \mathsf{fma}\left(1 - z, y, -\log y\right) - t \]
            13. Step-by-step derivation
              1. Applied rewrites97.8%

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

            Alternative 7: 95.2% accurate, 1.8× speedup?

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

              1. Initial program 93.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 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.8

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

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

              if -1.55e7 < x < 1.5e13

              1. Initial program 83.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.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 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.8

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

                \[\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 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} \]
              10. 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 \]
              11. Applied rewrites97.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} \]
              12. Taylor expanded in y around 0

                \[\leadsto \mathsf{fma}\left(1 - z, y, -\log y\right) - t \]
              13. Step-by-step derivation
                1. Applied rewrites96.9%

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

                if 1.5e13 < x

                1. Initial program 94.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}{\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--.f6494.0

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

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

              Alternative 8: 95.1% accurate, 1.8× speedup?

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

                1. Initial program 93.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 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.8

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

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

                if -1.55e7 < x < 1.5e13

                1. Initial program 83.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(-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.0

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

                  \[\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 \mathsf{fma}\left(-y, z, \log y \cdot \left(x - 1\right)\right) - t \]
                7. Step-by-step derivation
                  1. Applied rewrites98.9%

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

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

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

                      \[\leadsto \mathsf{fma}\left(-y, z, -\log y\right) - t \]
                    3. lift-log.f6496.7

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

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

                  if 1.5e13 < x

                  1. Initial program 94.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}{\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--.f6494.0

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

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

                Alternative 9: 75.5% accurate, 1.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -9 \cdot 10^{+70}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-22}:\\ \;\;\;\;\left(y - \log y\right) - t\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+67}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -\left(z - 1\right)\right), y, -t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (let* ((t_1 (* (log y) x)))
                   (if (<= x -9e+70)
                     t_1
                     (if (<= x 6.6e-22)
                       (- (- y (log y)) t)
                       (if (<= x 1.3e+67)
                         (fma (fma (* -0.5 y) z (- (- z 1.0))) y (- t))
                         t_1)))))
                double code(double x, double y, double z, double t) {
                	double t_1 = log(y) * x;
                	double tmp;
                	if (x <= -9e+70) {
                		tmp = t_1;
                	} else if (x <= 6.6e-22) {
                		tmp = (y - log(y)) - t;
                	} else if (x <= 1.3e+67) {
                		tmp = fma(fma((-0.5 * y), z, -(z - 1.0)), y, -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+70)
                		tmp = t_1;
                	elseif (x <= 6.6e-22)
                		tmp = Float64(Float64(y - log(y)) - t);
                	elseif (x <= 1.3e+67)
                		tmp = fma(fma(Float64(-0.5 * y), z, Float64(-Float64(z - 1.0))), y, Float64(-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+70], t$95$1, If[LessEqual[x, 6.6e-22], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 1.3e+67], N[(N[(N[(-0.5 * y), $MachinePrecision] * z + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision], t$95$1]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \log y \cdot x\\
                \mathbf{if}\;x \leq -9 \cdot 10^{+70}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;x \leq 6.6 \cdot 10^{-22}:\\
                \;\;\;\;\left(y - \log y\right) - t\\
                
                \mathbf{elif}\;x \leq 1.3 \cdot 10^{+67}:\\
                \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -\left(z - 1\right)\right), y, -t\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if x < -8.9999999999999999e70 or 1.3e67 < x

                  1. Initial program 96.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 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.f6476.6

                      \[\leadsto \log y \cdot x \]
                  5. Applied rewrites76.6%

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

                  if -8.9999999999999999e70 < x < 6.6000000000000002e-22

                  1. Initial program 83.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(-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 0

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

                      \[\leadsto \left(\log y \cdot \left(x - 1\right) + y\right) - t \]
                    2. lower-fma.f64N/A

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

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

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

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

                    \[\leadsto \left(y + -1 \cdot \color{blue}{\log y}\right) - t \]
                  10. Step-by-step derivation
                    1. fp-cancel-sign-sub-invN/A

                      \[\leadsto \left(y - \left(\mathsf{neg}\left(-1\right)\right) \cdot \log y\right) - t \]
                    2. metadata-evalN/A

                      \[\leadsto \left(y - 1 \cdot \log y\right) - t \]
                    3. log-pow-revN/A

                      \[\leadsto \left(y - \log \left({y}^{1}\right)\right) - t \]
                    4. unpow1N/A

                      \[\leadsto \left(y - \log y\right) - t \]
                    5. lower--.f64N/A

                      \[\leadsto \left(y - \log y\right) - t \]
                    6. lift-log.f6477.5

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

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

                  if 6.6000000000000002e-22 < x < 1.3e67

                  1. Initial program 86.2%

                    \[\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 z around inf

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -\left(z - 1\right)\right), y, -t\right) \]
                  8. Recombined 3 regimes into one program.
                  9. Add Preprocessing

                  Alternative 10: 75.4% accurate, 1.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -9 \cdot 10^{+70}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-22}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+67}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -\left(z - 1\right)\right), y, -t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (let* ((t_1 (* (log y) x)))
                     (if (<= x -9e+70)
                       t_1
                       (if (<= x 6.6e-22)
                         (- (- (log y)) t)
                         (if (<= x 1.3e+67)
                           (fma (fma (* -0.5 y) z (- (- z 1.0))) y (- t))
                           t_1)))))
                  double code(double x, double y, double z, double t) {
                  	double t_1 = log(y) * x;
                  	double tmp;
                  	if (x <= -9e+70) {
                  		tmp = t_1;
                  	} else if (x <= 6.6e-22) {
                  		tmp = -log(y) - t;
                  	} else if (x <= 1.3e+67) {
                  		tmp = fma(fma((-0.5 * y), z, -(z - 1.0)), y, -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+70)
                  		tmp = t_1;
                  	elseif (x <= 6.6e-22)
                  		tmp = Float64(Float64(-log(y)) - t);
                  	elseif (x <= 1.3e+67)
                  		tmp = fma(fma(Float64(-0.5 * y), z, Float64(-Float64(z - 1.0))), y, Float64(-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+70], t$95$1, If[LessEqual[x, 6.6e-22], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], If[LessEqual[x, 1.3e+67], N[(N[(N[(-0.5 * y), $MachinePrecision] * z + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision], t$95$1]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := \log y \cdot x\\
                  \mathbf{if}\;x \leq -9 \cdot 10^{+70}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;x \leq 6.6 \cdot 10^{-22}:\\
                  \;\;\;\;\left(-\log y\right) - t\\
                  
                  \mathbf{elif}\;x \leq 1.3 \cdot 10^{+67}:\\
                  \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -\left(z - 1\right)\right), y, -t\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if x < -8.9999999999999999e70 or 1.3e67 < x

                    1. Initial program 96.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 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.f6476.6

                        \[\leadsto \log y \cdot x \]
                    5. Applied rewrites76.6%

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

                    if -8.9999999999999999e70 < x < 6.6000000000000002e-22

                    1. Initial program 83.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.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 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.7

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

                      \[\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 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} \]
                    10. 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 \]
                    11. 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} \]
                    12. Taylor expanded in y around 0

                      \[\leadsto -1 \cdot \log y - t \]
                    13. 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.f6477.4

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

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

                    if 6.6000000000000002e-22 < x < 1.3e67

                    1. Initial program 86.2%

                      \[\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 z around inf

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -\left(z - 1\right)\right), y, -t\right) \]
                    8. Recombined 3 regimes into one program.
                    9. Add Preprocessing

                    Alternative 11: 61.2% accurate, 1.8× speedup?

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

                      1. Initial program 67.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(-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--.f6498.6

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

                        \[\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.f6462.6

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

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

                      if -1.00000000000000004e121 < (-.f64 z #s(literal 1 binary64)) < 1.0000000000000001e178

                      1. Initial program 97.2%

                        \[\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 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-*.f645.1

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

                        \[\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 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} \]
                      10. 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 \]
                      11. Applied rewrites62.9%

                        \[\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} \]
                      12. Taylor expanded in y around 0

                        \[\leadsto -1 \cdot \log y - t \]
                      13. 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.f6459.9

                          \[\leadsto \left(-\log y\right) - t \]
                      14. Applied rewrites59.9%

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

                      if 1.0000000000000001e178 < (-.f64 z #s(literal 1 binary64))

                      1. Initial program 60.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.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 z around inf

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -z\right), y, -t\right) \]
                        7. Applied rewrites67.3%

                          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -z\right), y, -t\right) \]
                      8. Recombined 3 regimes into one program.
                      9. Add Preprocessing

                      Alternative 12: 86.5% accurate, 1.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x - t\\ \mathbf{if}\;x \leq -9000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-6}:\\ \;\;\;\;\left(y - \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)))
                         (if (<= x -9000000.0) t_1 (if (<= x 2.2e-6) (- (- y (log y)) t) t_1))))
                      double code(double x, double y, double z, double t) {
                      	double t_1 = (log(y) * x) - t;
                      	double tmp;
                      	if (x <= -9000000.0) {
                      		tmp = t_1;
                      	} else if (x <= 2.2e-6) {
                      		tmp = (y - log(y)) - t;
                      	} else {
                      		tmp = t_1;
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y, z, t)
                      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) :: t_1
                          real(8) :: tmp
                          t_1 = (log(y) * x) - t
                          if (x <= (-9000000.0d0)) then
                              tmp = t_1
                          else if (x <= 2.2d-6) then
                              tmp = (y - log(y)) - t
                          else
                              tmp = t_1
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t) {
                      	double t_1 = (Math.log(y) * x) - t;
                      	double tmp;
                      	if (x <= -9000000.0) {
                      		tmp = t_1;
                      	} else if (x <= 2.2e-6) {
                      		tmp = (y - Math.log(y)) - t;
                      	} else {
                      		tmp = t_1;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t):
                      	t_1 = (math.log(y) * x) - t
                      	tmp = 0
                      	if x <= -9000000.0:
                      		tmp = t_1
                      	elif x <= 2.2e-6:
                      		tmp = (y - math.log(y)) - t
                      	else:
                      		tmp = t_1
                      	return tmp
                      
                      function code(x, y, z, t)
                      	t_1 = Float64(Float64(log(y) * x) - t)
                      	tmp = 0.0
                      	if (x <= -9000000.0)
                      		tmp = t_1;
                      	elseif (x <= 2.2e-6)
                      		tmp = Float64(Float64(y - log(y)) - t);
                      	else
                      		tmp = t_1;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t)
                      	t_1 = (log(y) * x) - t;
                      	tmp = 0.0;
                      	if (x <= -9000000.0)
                      		tmp = t_1;
                      	elseif (x <= 2.2e-6)
                      		tmp = (y - log(y)) - t;
                      	else
                      		tmp = t_1;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -9000000.0], t$95$1, If[LessEqual[x, 2.2e-6], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \log y \cdot x - t\\
                      \mathbf{if}\;x \leq -9000000:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;x \leq 2.2 \cdot 10^{-6}:\\
                      \;\;\;\;\left(y - \log y\right) - t\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if x < -9e6 or 2.2000000000000001e-6 < 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. 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.4

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

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

                        if -9e6 < x < 2.2000000000000001e-6

                        1. Initial program 83.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(-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.0

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

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

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

                            \[\leadsto \left(\log y \cdot \left(x - 1\right) + y\right) - t \]
                          2. lower-fma.f64N/A

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

                            \[\leadsto \mathsf{fma}\left(\log y, x - 1, y\right) - t \]
                          4. lift--.f6482.0

                            \[\leadsto \mathsf{fma}\left(\log y, x - 1, y\right) - t \]
                        8. Applied rewrites82.0%

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

                          \[\leadsto \left(y + -1 \cdot \color{blue}{\log y}\right) - t \]
                        10. Step-by-step derivation
                          1. fp-cancel-sign-sub-invN/A

                            \[\leadsto \left(y - \left(\mathsf{neg}\left(-1\right)\right) \cdot \log y\right) - t \]
                          2. metadata-evalN/A

                            \[\leadsto \left(y - 1 \cdot \log y\right) - t \]
                          3. log-pow-revN/A

                            \[\leadsto \left(y - \log \left({y}^{1}\right)\right) - t \]
                          4. unpow1N/A

                            \[\leadsto \left(y - \log y\right) - t \]
                          5. lower--.f64N/A

                            \[\leadsto \left(y - \log y\right) - t \]
                          6. lift-log.f6480.8

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

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

                      Alternative 13: 99.2% accurate, 1.9× speedup?

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

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

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

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

                      Alternative 14: 99.1% accurate, 1.9× speedup?

                      \[\begin{array}{l} \\ \mathsf{fma}\left(-y, z, \log y \cdot \left(x - 1\right)\right) - t \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (- (fma (- y) z (* (log y) (- x 1.0))) t))
                      double code(double x, double y, double z, double t) {
                      	return fma(-y, z, (log(y) * (x - 1.0))) - t;
                      }
                      
                      function code(x, y, z, t)
                      	return Float64(fma(Float64(-y), z, Float64(log(y) * Float64(x - 1.0))) - t)
                      end
                      
                      code[x_, y_, z_, t_] := N[(N[((-y) * z + N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      \mathsf{fma}\left(-y, z, \log y \cdot \left(x - 1\right)\right) - t
                      \end{array}
                      
                      Derivation
                      1. Initial program 88.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.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 \mathsf{fma}\left(-y, z, \log y \cdot \left(x - 1\right)\right) - t \]
                      7. Step-by-step derivation
                        1. Applied rewrites99.1%

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

                        Alternative 15: 87.5% accurate, 2.0× speedup?

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

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

                            \[\leadsto \left(\log y \cdot \left(x - 1\right) + y\right) - t \]
                          2. lower-fma.f64N/A

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

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

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

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

                        Alternative 16: 87.4% accurate, 2.0× speedup?

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

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

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

                        Alternative 17: 47.0% accurate, 8.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 18: 47.0% accurate, 9.0× speedup?

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

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

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

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

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

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

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

                            Alternative 19: 46.9% accurate, 10.3× speedup?

                            \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -z\right), y, -t\right) \end{array} \]
                            (FPCore (x y z t) :precision binary64 (fma (fma (* -0.5 y) z (- z)) y (- t)))
                            double code(double x, double y, double z, double t) {
                            	return fma(fma((-0.5 * y), z, -z), y, -t);
                            }
                            
                            function code(x, y, z, t)
                            	return fma(fma(Float64(-0.5 * y), z, Float64(-z)), y, Float64(-t))
                            end
                            
                            code[x_, y_, z_, t_] := N[(N[(N[(-0.5 * y), $MachinePrecision] * z + (-z)), $MachinePrecision] * y + (-t)), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, -z\right), y, -t\right)
                            \end{array}
                            
                            Derivation
                            1. Initial program 88.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.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 z around inf

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

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

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

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

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

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

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

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

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

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

                              Alternative 20: 43.5% accurate, 10.7× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -11000000:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 1920000:\\ \;\;\;\;\mathsf{fma}\left(-y, z, y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
                              (FPCore (x y z t)
                               :precision binary64
                               (if (<= t -11000000.0) (- t) (if (<= t 1920000.0) (fma (- y) z y) (- t))))
                              double code(double x, double y, double z, double t) {
                              	double tmp;
                              	if (t <= -11000000.0) {
                              		tmp = -t;
                              	} else if (t <= 1920000.0) {
                              		tmp = fma(-y, z, y);
                              	} else {
                              		tmp = -t;
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t)
                              	tmp = 0.0
                              	if (t <= -11000000.0)
                              		tmp = Float64(-t);
                              	elseif (t <= 1920000.0)
                              		tmp = fma(Float64(-y), z, y);
                              	else
                              		tmp = Float64(-t);
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_, t_] := If[LessEqual[t, -11000000.0], (-t), If[LessEqual[t, 1920000.0], N[((-y) * z + y), $MachinePrecision], (-t)]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;t \leq -11000000:\\
                              \;\;\;\;-t\\
                              
                              \mathbf{elif}\;t \leq 1920000:\\
                              \;\;\;\;\mathsf{fma}\left(-y, z, y\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;-t\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if t < -1.1e7 or 1.92e6 < t

                                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 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.f6469.7

                                    \[\leadsto -t \]
                                5. Applied rewrites69.7%

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

                                if -1.1e7 < t < 1.92e6

                                1. Initial program 83.7%

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

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

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

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

                                  \[\leadsto \left(1 - z\right) \cdot y \]
                                12. Taylor expanded in z around 0

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

                                    \[\leadsto -1 \cdot \left(y \cdot z\right) + y \]
                                  2. associate-*r*N/A

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

                                    \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + y \]
                                  4. lower-fma.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(y\right), z, y\right) \]
                                  5. lower-neg.f6418.6

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

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

                              Alternative 21: 43.2% accurate, 11.3× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -11000000:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 1920000:\\ \;\;\;\;\left(-z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
                              (FPCore (x y z t)
                               :precision binary64
                               (if (<= t -11000000.0) (- t) (if (<= t 1920000.0) (* (- z) y) (- t))))
                              double code(double x, double y, double z, double t) {
                              	double tmp;
                              	if (t <= -11000000.0) {
                              		tmp = -t;
                              	} else if (t <= 1920000.0) {
                              		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 <= (-11000000.0d0)) then
                                      tmp = -t
                                  else if (t <= 1920000.0d0) 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 <= -11000000.0) {
                              		tmp = -t;
                              	} else if (t <= 1920000.0) {
                              		tmp = -z * y;
                              	} else {
                              		tmp = -t;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z, t):
                              	tmp = 0
                              	if t <= -11000000.0:
                              		tmp = -t
                              	elif t <= 1920000.0:
                              		tmp = -z * y
                              	else:
                              		tmp = -t
                              	return tmp
                              
                              function code(x, y, z, t)
                              	tmp = 0.0
                              	if (t <= -11000000.0)
                              		tmp = Float64(-t);
                              	elseif (t <= 1920000.0)
                              		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 <= -11000000.0)
                              		tmp = -t;
                              	elseif (t <= 1920000.0)
                              		tmp = -z * y;
                              	else
                              		tmp = -t;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_, t_] := If[LessEqual[t, -11000000.0], (-t), If[LessEqual[t, 1920000.0], N[((-z) * y), $MachinePrecision], (-t)]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;t \leq -11000000:\\
                              \;\;\;\;-t\\
                              
                              \mathbf{elif}\;t \leq 1920000:\\
                              \;\;\;\;\left(-z\right) \cdot y\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;-t\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if t < -1.1e7 or 1.92e6 < t

                                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 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.f6469.7

                                    \[\leadsto -t \]
                                5. Applied rewrites69.7%

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

                                if -1.1e7 < t < 1.92e6

                                1. Initial program 83.7%

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

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

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

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

                                  \[\leadsto \left(1 - z\right) \cdot y \]
                                12. Taylor expanded in z around inf

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

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

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

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

                              Alternative 22: 46.8% 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.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.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 z around inf

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(1 - z, y, -t\right) \]
                                6. Step-by-step derivation
                                  1. lift--.f6446.8

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

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

                                Alternative 23: 46.6% 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.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.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.f6446.6

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

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

                                Alternative 24: 35.8% accurate, 56.5× speedup?

                                \[\begin{array}{l} \\ y - t \end{array} \]
                                (FPCore (x y z t) :precision binary64 (- y t))
                                double code(double x, double y, double z, double t) {
                                	return 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 = y - t
                                end function
                                
                                public static double code(double x, double y, double z, double t) {
                                	return y - t;
                                }
                                
                                def code(x, y, z, t):
                                	return y - t
                                
                                function code(x, y, z, t)
                                	return Float64(y - t)
                                end
                                
                                function tmp = code(x, y, z, t)
                                	tmp = y - t;
                                end
                                
                                code[x_, y_, z_, t_] := N[(y - t), $MachinePrecision]
                                
                                \begin{array}{l}
                                
                                \\
                                y - t
                                \end{array}
                                
                                Derivation
                                1. Initial program 88.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.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 0

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

                                    \[\leadsto \left(\log y \cdot \left(x - 1\right) + y\right) - t \]
                                  2. lower-fma.f64N/A

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

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

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

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

                                  \[\leadsto y - t \]
                                10. Step-by-step derivation
                                  1. Applied rewrites35.8%

                                    \[\leadsto y - t \]
                                  2. Add Preprocessing

                                  Alternative 25: 35.6% 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.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 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.f6435.6

                                      \[\leadsto -t \]
                                  5. Applied rewrites35.6%

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

                                  Alternative 26: 2.9% accurate, 226.0× speedup?

                                  \[\begin{array}{l} \\ y \end{array} \]
                                  (FPCore (x y z t) :precision binary64 y)
                                  double code(double x, double y, double z, double t) {
                                  	return y;
                                  }
                                  
                                  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
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t) {
                                  	return y;
                                  }
                                  
                                  def code(x, y, z, t):
                                  	return y
                                  
                                  function code(x, y, z, t)
                                  	return y
                                  end
                                  
                                  function tmp = code(x, y, z, t)
                                  	tmp = y;
                                  end
                                  
                                  code[x_, y_, z_, t_] := y
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  y
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 88.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.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 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-*.f648.1

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

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

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

                                    \[\leadsto \left(1 - z\right) \cdot y \]
                                  12. Taylor expanded in z around 0

                                    \[\leadsto y \]
                                  13. Step-by-step derivation
                                    1. Applied rewrites2.9%

                                      \[\leadsto y \]
                                    2. Add Preprocessing

                                    Reproduce

                                    ?
                                    herbie shell --seed 2025088 
                                    (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))