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

Percentage Accurate: 88.9% → 99.7%
Time: 12.6s
Alternatives: 16
Speedup: 1.8×

Specification

?
\[\begin{array}{l} \\ \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
	return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 88.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.7% accurate, 1.6× speedup?

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

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\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 \]
  5. Applied rewrites99.3%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, y, -0.5\right), 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(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{3}, y, \frac{-1}{2}\right), 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(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{3}, y, \frac{-1}{2}\right), y, -1\right) \cdot y\right)\right)} - t \]
    3. +-commutativeN/A

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

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

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

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

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

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

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

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

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

Alternative 4: 99.5% accurate, 1.7× speedup?

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

\\
\mathsf{fma}\left(\log y, x - 1, \left(\left(z - 1\right) \cdot y\right) \cdot \mathsf{fma}\left(-0.5, y, -1\right)\right) - t
\end{array}
Derivation
  1. Initial program 91.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 86.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x - t\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-67}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(-0.3333333333333333, y, -0.5\right), y, -z\right) \cdot y - t\\ \mathbf{elif}\;x \leq 0.0012:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* (log y) x) t)))
   (if (<= x -4.4e+17)
     t_1
     (if (<= x -2.4e-67)
       (- (* (fma (* z (fma -0.3333333333333333 y -0.5)) y (- z)) y) t)
       (if (<= x 0.0012) (- (- (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 <= -4.4e+17) {
		tmp = t_1;
	} else if (x <= -2.4e-67) {
		tmp = (fma((z * fma(-0.3333333333333333, y, -0.5)), y, -z) * y) - t;
	} else if (x <= 0.0012) {
		tmp = -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 <= -4.4e+17)
		tmp = t_1;
	elseif (x <= -2.4e-67)
		tmp = Float64(Float64(fma(Float64(z * fma(-0.3333333333333333, y, -0.5)), y, Float64(-z)) * y) - t);
	elseif (x <= 0.0012)
		tmp = Float64(Float64(-log(y)) - t);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -4.4e+17], t$95$1, If[LessEqual[x, -2.4e-67], N[(N[(N[(N[(z * N[(-0.3333333333333333 * y + -0.5), $MachinePrecision]), $MachinePrecision] * y + (-z)), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 0.0012], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq 0.0012:\\
\;\;\;\;\left(-\log y\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.4e17 or 0.00119999999999999989 < 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 x around inf

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

        \[\leadsto \color{blue}{\log y \cdot x} - t \]
      2. remove-double-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log y\right)\right)\right)\right)} \cdot x - t \]
      3. log-recN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)}\right)\right) \cdot x - t \]
      4. mul-1-negN/A

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

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)} \cdot x - t \]
      7. log-recN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right) \cdot x - t \]
      8. remove-double-negN/A

        \[\leadsto \color{blue}{\log y} \cdot x - t \]
      9. lower-log.f6493.1

        \[\leadsto \color{blue}{\log y} \cdot x - t \]
    5. Applied rewrites93.1%

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

    if -4.4e17 < x < -2.4e-67

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

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

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

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

        \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
      4. lower--.f6473.5

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot z + y \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{3} \cdot \left(y \cdot z\right)\right)\right)} - t \]
    7. Step-by-step derivation
      1. Applied rewrites95.9%

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

      if -2.4e-67 < x < 0.00119999999999999989

      1. Initial program 90.3%

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

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

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

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)}\right)\right) \cdot \left(x - 1\right) - t \]
        3. mul-1-negN/A

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

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)} \cdot \left(x - 1\right) - t \]
        6. log-recN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right) \cdot \left(x - 1\right) - t \]
        7. remove-double-negN/A

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

          \[\leadsto \color{blue}{\log y} \cdot \left(x - 1\right) - t \]
        9. lower--.f6488.7

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

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

        \[\leadsto -1 \cdot \color{blue}{\log y} - t \]
      7. Step-by-step derivation
        1. Applied rewrites88.7%

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

      Alternative 6: 74.8% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -1.52 \cdot 10^{+19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-67}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(-0.3333333333333333, y, -0.5\right), y, -z\right) \cdot y - t\\ \mathbf{elif}\;x \leq 1.32 \cdot 10^{+23}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (log y) x)))
         (if (<= x -1.52e+19)
           t_1
           (if (<= x -2.4e-67)
             (- (* (fma (* z (fma -0.3333333333333333 y -0.5)) y (- z)) y) t)
             (if (<= x 1.32e+23) (- (- (log y)) t) t_1)))))
      double code(double x, double y, double z, double t) {
      	double t_1 = log(y) * x;
      	double tmp;
      	if (x <= -1.52e+19) {
      		tmp = t_1;
      	} else if (x <= -2.4e-67) {
      		tmp = (fma((z * fma(-0.3333333333333333, y, -0.5)), y, -z) * y) - t;
      	} else if (x <= 1.32e+23) {
      		tmp = -log(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 <= -1.52e+19)
      		tmp = t_1;
      	elseif (x <= -2.4e-67)
      		tmp = Float64(Float64(fma(Float64(z * fma(-0.3333333333333333, y, -0.5)), y, Float64(-z)) * y) - t);
      	elseif (x <= 1.32e+23)
      		tmp = Float64(Float64(-log(y)) - t);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.52e+19], t$95$1, If[LessEqual[x, -2.4e-67], N[(N[(N[(N[(z * N[(-0.3333333333333333 * y + -0.5), $MachinePrecision]), $MachinePrecision] * y + (-z)), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 1.32e+23], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \log y \cdot x\\
      \mathbf{if}\;x \leq -1.52 \cdot 10^{+19}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq -2.4 \cdot 10^{-67}:\\
      \;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(-0.3333333333333333, y, -0.5\right), y, -z\right) \cdot y - t\\
      
      \mathbf{elif}\;x \leq 1.32 \cdot 10^{+23}:\\
      \;\;\;\;\left(-\log y\right) - t\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < -1.52e19 or 1.3199999999999999e23 < x

        1. Initial program 94.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 \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 \color{blue}{\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 \]
          2. lower-*.f64N/A

            \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\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 \]
        5. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\log y \cdot x} \]
          3. lower-log.f6470.5

            \[\leadsto \color{blue}{\log y} \cdot x \]
        10. Applied rewrites70.5%

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

        if -1.52e19 < x < -2.4e-67

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

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

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

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

            \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
          4. lower--.f6473.5

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

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

          \[\leadsto y \cdot \color{blue}{\left(-1 \cdot z + y \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{3} \cdot \left(y \cdot z\right)\right)\right)} - t \]
        7. Step-by-step derivation
          1. Applied rewrites95.9%

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

          if -2.4e-67 < x < 1.3199999999999999e23

          1. Initial program 90.9%

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

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

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

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)}\right)\right) \cdot \left(x - 1\right) - t \]
            3. mul-1-negN/A

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

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

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)} \cdot \left(x - 1\right) - t \]
            6. log-recN/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right) \cdot \left(x - 1\right) - t \]
            7. remove-double-negN/A

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

              \[\leadsto \color{blue}{\log y} \cdot \left(x - 1\right) - t \]
            9. lower--.f6489.4

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

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

            \[\leadsto -1 \cdot \color{blue}{\log y} - t \]
          7. Step-by-step derivation
            1. Applied rewrites87.1%

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

          Alternative 7: 67.1% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x - 1 \leq -1 \cdot 10^{+19} \lor \neg \left(x - 1 \leq 10^{+50}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.25, y, -0.3333333333333333\right), y, -0.5\right) \cdot y - 1\right) \cdot y\right) \cdot z - t\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (or (<= (- x 1.0) -1e+19) (not (<= (- x 1.0) 1e+50)))
             (* (log y) x)
             (-
              (* (* (- (* (fma (fma -0.25 y -0.3333333333333333) y -0.5) y) 1.0) y) z)
              t)))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (((x - 1.0) <= -1e+19) || !((x - 1.0) <= 1e+50)) {
          		tmp = log(y) * x;
          	} else {
          		tmp = ((((fma(fma(-0.25, y, -0.3333333333333333), y, -0.5) * y) - 1.0) * y) * z) - t;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if ((Float64(x - 1.0) <= -1e+19) || !(Float64(x - 1.0) <= 1e+50))
          		tmp = Float64(log(y) * x);
          	else
          		tmp = Float64(Float64(Float64(Float64(Float64(fma(fma(-0.25, y, -0.3333333333333333), y, -0.5) * y) - 1.0) * y) * z) - t);
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x - 1.0), $MachinePrecision], -1e+19], N[Not[LessEqual[N[(x - 1.0), $MachinePrecision], 1e+50]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(-0.25 * y + -0.3333333333333333), $MachinePrecision] * y + -0.5), $MachinePrecision] * y), $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] - t), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x - 1 \leq -1 \cdot 10^{+19} \lor \neg \left(x - 1 \leq 10^{+50}\right):\\
          \;\;\;\;\log y \cdot x\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.25, y, -0.3333333333333333\right), y, -0.5\right) \cdot y - 1\right) \cdot y\right) \cdot z - t\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (-.f64 x #s(literal 1 binary64)) < -1e19 or 1.0000000000000001e50 < (-.f64 x #s(literal 1 binary64))

            1. Initial program 94.9%

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

              \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(y \cdot \left(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 \color{blue}{\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 \]
              2. lower-*.f64N/A

                \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\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 \]
            5. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\log y \cdot x} \]
              3. lower-log.f6471.9

                \[\leadsto \color{blue}{\log y} \cdot x \]
            10. Applied rewrites71.9%

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

            if -1e19 < (-.f64 x #s(literal 1 binary64)) < 1.0000000000000001e50

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

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

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

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

                \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
              4. lower--.f6456.1

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

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

              \[\leadsto \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) \cdot z - t \]
            7. Step-by-step derivation
              1. Applied rewrites66.7%

                \[\leadsto \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.25, y, -0.3333333333333333\right), y, -0.5\right) \cdot y - 1\right) \cdot y\right) \cdot z - t \]
            8. Recombined 2 regimes into one program.
            9. Final simplification68.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;x - 1 \leq -1 \cdot 10^{+19} \lor \neg \left(x - 1 \leq 10^{+50}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.25, y, -0.3333333333333333\right), y, -0.5\right) \cdot y - 1\right) \cdot y\right) \cdot z - t\\ \end{array} \]
            10. Add Preprocessing

            Alternative 8: 89.9% accurate, 1.8× speedup?

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

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

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

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

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

                  \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
                4. lower--.f6440.5

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

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

                \[\leadsto \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) \cdot z - t \]
              7. Step-by-step derivation
                1. Applied rewrites80.0%

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

                if -8.2000000000000006e205 < z < 3.59999999999999986e229

                1. Initial program 96.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. remove-double-negN/A

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

                    \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right)}\right)\right) \cdot \left(x - 1\right) - t \]
                  3. mul-1-negN/A

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

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

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)} \cdot \left(x - 1\right) - t \]
                  6. log-recN/A

                    \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right) \cdot \left(x - 1\right) - t \]
                  7. remove-double-negN/A

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

                    \[\leadsto \color{blue}{\log y} \cdot \left(x - 1\right) - t \]
                  9. lower--.f6495.8

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

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

                if 3.59999999999999986e229 < z

                1. Initial program 55.9%

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

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

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

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

                    \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
                  4. lower--.f6436.5

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

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

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

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

                Alternative 9: 99.2% accurate, 1.8× speedup?

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

                    \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\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 \]
                5. Applied rewrites99.3%

                  \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.25, y, -0.3333333333333333\right), y, -0.5\right), y, -1\right) \cdot y\right)}\right) - t \]
                6. 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} \]
                7. Step-by-step derivation
                  1. +-commutativeN/A

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

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

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

                    \[\leadsto \left(\mathsf{neg}\left(\color{blue}{-1 \cdot \log y}\right)\right) \cdot \left(x - 1\right) + \left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) - t\right) \]
                  5. distribute-rgt-neg-inN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(-1 \cdot \color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}, x - 1, -1 \cdot \left(y \cdot \left(z - 1\right)\right) - t\right) \]
                  9. distribute-rgt-neg-inN/A

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right), x - 1, -1 \cdot \left(y \cdot \left(z - 1\right)\right) - t\right) \]
                  11. remove-double-negN/A

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\log y, x - 1, \color{blue}{\left(-y\right)} \cdot \left(z - 1\right) - t\right) \]
                  19. lower--.f6498.8

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

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

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

                Alternative 10: 47.3% accurate, 6.6× speedup?

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

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

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

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

                    \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
                  4. lower--.f6443.1

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

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

                  \[\leadsto \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) \cdot z - t \]
                7. Step-by-step derivation
                  1. Applied rewrites51.0%

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

                  Alternative 11: 47.3% accurate, 8.1× speedup?

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

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

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

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

                      \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
                    4. lower--.f6443.1

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

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

                    \[\leadsto y \cdot \color{blue}{\left(-1 \cdot z + y \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{3} \cdot \left(y \cdot z\right)\right)\right)} - t \]
                  7. Step-by-step derivation
                    1. Applied rewrites51.0%

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

                    Alternative 12: 47.2% accurate, 8.4× speedup?

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

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

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

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

                        \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
                      4. lower--.f6443.1

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

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

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

                        \[\leadsto \left(z \cdot \mathsf{fma}\left(-0.5, y, -1\right)\right) \cdot \color{blue}{y} - t \]
                      2. Step-by-step derivation
                        1. Applied rewrites50.8%

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

                        Alternative 13: 43.8% accurate, 10.7× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -16500000000 \lor \neg \left(t \leq 7.4 \cdot 10^{-10}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\left(1 - z\right) \cdot y\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (if (or (<= t -16500000000.0) (not (<= t 7.4e-10))) (- t) (* (- 1.0 z) y)))
                        double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if ((t <= -16500000000.0) || !(t <= 7.4e-10)) {
                        		tmp = -t;
                        	} else {
                        		tmp = (1.0 - z) * y;
                        	}
                        	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 <= (-16500000000.0d0)) .or. (.not. (t <= 7.4d-10))) then
                                tmp = -t
                            else
                                tmp = (1.0d0 - z) * y
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if ((t <= -16500000000.0) || !(t <= 7.4e-10)) {
                        		tmp = -t;
                        	} else {
                        		tmp = (1.0 - z) * y;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t):
                        	tmp = 0
                        	if (t <= -16500000000.0) or not (t <= 7.4e-10):
                        		tmp = -t
                        	else:
                        		tmp = (1.0 - z) * y
                        	return tmp
                        
                        function code(x, y, z, t)
                        	tmp = 0.0
                        	if ((t <= -16500000000.0) || !(t <= 7.4e-10))
                        		tmp = Float64(-t);
                        	else
                        		tmp = Float64(Float64(1.0 - z) * y);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t)
                        	tmp = 0.0;
                        	if ((t <= -16500000000.0) || ~((t <= 7.4e-10)))
                        		tmp = -t;
                        	else
                        		tmp = (1.0 - z) * y;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_] := If[Or[LessEqual[t, -16500000000.0], N[Not[LessEqual[t, 7.4e-10]], $MachinePrecision]], (-t), N[(N[(1.0 - z), $MachinePrecision] * y), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;t \leq -16500000000 \lor \neg \left(t \leq 7.4 \cdot 10^{-10}\right):\\
                        \;\;\;\;-t\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\left(1 - z\right) \cdot y\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if t < -1.65e10 or 7.4000000000000003e-10 < t

                          1. Initial program 97.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 t around inf

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

                              \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
                            2. lower-neg.f6476.5

                              \[\leadsto \color{blue}{-t} \]
                          5. Applied rewrites76.5%

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

                          if -1.65e10 < t < 7.4000000000000003e-10

                          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 t around inf

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

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

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

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

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

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

                                \[\leadsto \left(1 - z\right) \cdot y \]
                              3. Step-by-step derivation
                                1. Applied rewrites19.3%

                                  \[\leadsto \left(1 - z\right) \cdot y \]
                              4. Recombined 2 regimes into one program.
                              5. Final simplification49.7%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -16500000000 \lor \neg \left(t \leq 7.4 \cdot 10^{-10}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\left(1 - z\right) \cdot y\\ \end{array} \]
                              6. Add Preprocessing

                              Alternative 14: 47.2% accurate, 11.3× speedup?

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

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

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

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

                                  \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
                                4. lower--.f6443.1

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

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

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

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

                                Alternative 15: 46.9% 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 91.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 z around inf

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

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

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

                                    \[\leadsto \color{blue}{\log \left(1 - y\right)} \cdot z - t \]
                                  4. lower--.f6443.1

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

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

                                  \[\leadsto \left(-1 \cdot y\right) \cdot z - t \]
                                7. Step-by-step derivation
                                  1. Applied rewrites50.6%

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

                                  Alternative 16: 36.3% 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 91.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 t around inf

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

                                      \[\leadsto \color{blue}{\mathsf{neg}\left(t\right)} \]
                                    2. lower-neg.f6442.1

                                      \[\leadsto \color{blue}{-t} \]
                                  5. Applied rewrites42.1%

                                    \[\leadsto \color{blue}{-t} \]
                                  6. Final simplification42.1%

                                    \[\leadsto -t \]
                                  7. Add Preprocessing

                                  Reproduce

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