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

Percentage Accurate: 89.5% → 99.8%
Time: 10.2s
Alternatives: 10
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 10 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: 89.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\mathsf{log1p}\left(\left(-y\right) \cdot y\right) - \mathsf{log1p}\left(y\right)\right)\right) - t
\end{array}
Derivation
  1. Initial program 88.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. Step-by-step derivation
    1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\mathsf{log1p}\left(\color{blue}{\left(-y\right)} \cdot y\right) - \log \left(1 + y\right)\right)\right) - t \]
    11. lower-log1p.f6499.8

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

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

Alternative 2: 84.9% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq 3.5 \cdot 10^{+28}:\\
\;\;\;\;\log y \cdot -1 - t\\

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


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

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

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

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

    if -1.99999999999999988e39 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 155

    1. Initial program 48.6%

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

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

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

      \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left({y}^{2} \cdot \left(z - 1\right)\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites7.7%

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

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

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

        if 155 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 3.5e28

        1. Initial program 73.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--.f6473.6

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

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

          \[\leadsto \log y \cdot -1 - t \]
        7. Step-by-step derivation
          1. Applied rewrites72.6%

            \[\leadsto \log y \cdot -1 - t \]
        8. Recombined 3 regimes into one program.
        9. Add Preprocessing

        Alternative 3: 93.8% accurate, 0.4× speedup?

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

          1. Initial program 93.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. *-lft-identityN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\log y, x - 1, \color{blue}{\mathsf{neg}\left(t\right)}\right) \]
            20. lower-neg.f6493.4

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

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

          if -1.00000000000000004e42 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 3.5e28

          1. Initial program 82.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. Applied rewrites99.6%

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

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

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

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

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

              if 3.5e28 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y))))

              1. Initial program 98.0%

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

                \[\leadsto \color{blue}{x \cdot \log y} - 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.f6498.0

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

                \[\leadsto \color{blue}{\log y \cdot x} - t \]
            4. Recombined 3 regimes into one program.
            5. Final simplification96.7%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right) \leq -1 \cdot 10^{+42}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x - 1, -t\right)\\ \mathbf{elif}\;\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right) \leq 3.5 \cdot 10^{+28}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot y, \mathsf{fma}\left(-0.5, y, -1\right), -\left(\log y + t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x - t\\ \end{array} \]
            6. Add Preprocessing

            Alternative 4: 72.5% accurate, 0.4× speedup?

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

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

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

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

              if -1.99999999999999988e39 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 3.5e28

              1. Initial program 66.7%

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

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

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

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left({y}^{2} \cdot \left(z - 1\right)\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites4.8%

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

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

                    \[\leadsto \left(\mathsf{fma}\left(-0.5, y, -1\right) \cdot z\right) \cdot \color{blue}{y} \]
                4. Recombined 2 regimes into one program.
                5. Final simplification78.8%

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

                Alternative 5: 99.6% accurate, 1.6× speedup?

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

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

                  \[\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. Add Preprocessing

                Alternative 6: 99.5% accurate, 1.7× speedup?

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

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

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

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

                Alternative 7: 99.1% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 8: 88.1% accurate, 1.9× speedup?

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

                  1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 1.74999999999999997e275 < z

                  1. Initial program 2.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. Applied rewrites100.0%

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

                    \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left({y}^{2} \cdot \left(z - 1\right)\right)} \]
                  6. Step-by-step derivation
                    1. Applied rewrites6.1%

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

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

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

                    Alternative 9: 42.1% accurate, 7.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.12 \cdot 10^{+32} \lor \neg \left(t \leq 1.5 \cdot 10^{+21}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(-0.5, y, -1\right) \cdot z\right) \cdot y\\ \end{array} \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (if (or (<= t -1.12e+32) (not (<= t 1.5e+21)))
                       (- t)
                       (* (* (fma -0.5 y -1.0) z) y)))
                    double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if ((t <= -1.12e+32) || !(t <= 1.5e+21)) {
                    		tmp = -t;
                    	} else {
                    		tmp = (fma(-0.5, y, -1.0) * z) * y;
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t)
                    	tmp = 0.0
                    	if ((t <= -1.12e+32) || !(t <= 1.5e+21))
                    		tmp = Float64(-t);
                    	else
                    		tmp = Float64(Float64(fma(-0.5, y, -1.0) * z) * y);
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.12e+32], N[Not[LessEqual[t, 1.5e+21]], $MachinePrecision]], (-t), N[(N[(N[(-0.5 * y + -1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;t \leq -1.12 \cdot 10^{+32} \lor \neg \left(t \leq 1.5 \cdot 10^{+21}\right):\\
                    \;\;\;\;-t\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\mathsf{fma}\left(-0.5, y, -1\right) \cdot z\right) \cdot y\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if t < -1.12000000000000007e32 or 1.5e21 < t

                      1. Initial program 99.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.f6472.6

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

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

                      if -1.12000000000000007e32 < t < 1.5e21

                      1. Initial program 78.0%

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

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

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

                        \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left({y}^{2} \cdot \left(z - 1\right)\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites3.9%

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

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

                            \[\leadsto \left(\mathsf{fma}\left(-0.5, y, -1\right) \cdot z\right) \cdot \color{blue}{y} \]
                        4. Recombined 2 regimes into one program.
                        5. Final simplification46.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.12 \cdot 10^{+32} \lor \neg \left(t \leq 1.5 \cdot 10^{+21}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(-0.5, y, -1\right) \cdot z\right) \cdot y\\ \end{array} \]
                        6. Add Preprocessing

                        Alternative 10: 35.2% accurate, 75.3× speedup?

                        \[\begin{array}{l} \\ -t \end{array} \]
                        (FPCore (x y z t) :precision binary64 (- t))
                        double code(double x, double y, double z, double t) {
                        	return -t;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y, z, t)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: t
                            code = -t
                        end function
                        
                        public static double code(double x, double y, double z, double t) {
                        	return -t;
                        }
                        
                        def code(x, y, z, t):
                        	return -t
                        
                        function code(x, y, z, t)
                        	return Float64(-t)
                        end
                        
                        function tmp = code(x, y, z, t)
                        	tmp = -t;
                        end
                        
                        code[x_, y_, z_, t_] := (-t)
                        
                        \begin{array}{l}
                        
                        \\
                        -t
                        \end{array}
                        
                        Derivation
                        1. Initial program 88.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 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.f6436.7

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

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

                        Reproduce

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