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

Percentage Accurate: 89.8% → 99.6%
Time: 10.0s
Alternatives: 18
Speedup: 1.8×

Specification

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

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

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

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

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 18 alternatives:

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

Initial Program: 89.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.6% accurate, 1.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 89.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) + 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. Applied rewrites99.1%

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

    Alternative 2: 87.6% accurate, 0.3× speedup?

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

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

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

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

        if -9.9999999999999995e32 < (+.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)))) < 152.19999999999999

        1. Initial program 63.5%

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

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

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

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

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

            if 152.19999999999999 < (+.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)))) < 4e4

            1. Initial program 92.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. Applied rewrites92.9%

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

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

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

              Alternative 3: 76.1% accurate, 0.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ t_2 := \left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+81}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 152.2:\\ \;\;\;\;\mathsf{fma}\left(-y, z - 1, -t\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+110}:\\ \;\;\;\;\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_2 (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y))))))
                 (if (<= t_2 -2e+81)
                   t_1
                   (if (<= t_2 152.2)
                     (fma (- y) (- z 1.0) (- t))
                     (if (<= t_2 2e+110) (- (- (log y)) t) t_1)))))
              double code(double x, double y, double z, double t) {
              	double t_1 = log(y) * x;
              	double t_2 = ((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)));
              	double tmp;
              	if (t_2 <= -2e+81) {
              		tmp = t_1;
              	} else if (t_2 <= 152.2) {
              		tmp = fma(-y, (z - 1.0), -t);
              	} else if (t_2 <= 2e+110) {
              		tmp = -log(y) - t;
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t)
              	t_1 = Float64(log(y) * x)
              	t_2 = Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y))))
              	tmp = 0.0
              	if (t_2 <= -2e+81)
              		tmp = t_1;
              	elseif (t_2 <= 152.2)
              		tmp = fma(Float64(-y), Float64(z - 1.0), Float64(-t));
              	elseif (t_2 <= 2e+110)
              		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]}, Block[{t$95$2 = 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$2, -2e+81], t$95$1, If[LessEqual[t$95$2, 152.2], N[((-y) * N[(z - 1.0), $MachinePrecision] + (-t)), $MachinePrecision], If[LessEqual[t$95$2, 2e+110], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \log y \cdot x\\
              t_2 := \left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\\
              \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+81}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;t\_2 \leq 152.2:\\
              \;\;\;\;\mathsf{fma}\left(-y, z - 1, -t\right)\\
              
              \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+110}:\\
              \;\;\;\;\left(-\log y\right) - t\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < -1.99999999999999984e81 or 2e110 < (+.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 96.1%

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

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

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

                  if -1.99999999999999984e81 < (+.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)))) < 152.19999999999999

                  1. Initial program 70.5%

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

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

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

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

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

                      if 152.19999999999999 < (+.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)))) < 2e110

                      1. Initial program 91.1%

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

                        \[\leadsto \color{blue}{\log y \cdot \left(x - 1\right)} - t \]
                      4. Step-by-step derivation
                        1. Applied rewrites90.6%

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

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

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

                        Alternative 4: 93.2% 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 -200000 \lor \neg \left(t\_1 \leq 590\right):\\ \;\;\;\;\log y \cdot \left(x - 1\right) - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z - 1, -\log y\right)\\ \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 -200000.0) (not (<= t_1 590.0)))
                             (- (* (log y) (- x 1.0)) t)
                             (fma (- y) (- z 1.0) (- (log 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 <= -200000.0) || !(t_1 <= 590.0)) {
                        		tmp = (log(y) * (x - 1.0)) - t;
                        	} else {
                        		tmp = fma(-y, (z - 1.0), -log(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 <= -200000.0) || !(t_1 <= 590.0))
                        		tmp = Float64(Float64(log(y) * Float64(x - 1.0)) - t);
                        	else
                        		tmp = fma(Float64(-y), Float64(z - 1.0), Float64(-log(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, -200000.0], N[Not[LessEqual[t$95$1, 590.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-y) * N[(z - 1.0), $MachinePrecision] + (-N[Log[y], $MachinePrecision])), $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 -200000 \lor \neg \left(t\_1 \leq 590\right):\\
                        \;\;\;\;\log y \cdot \left(x - 1\right) - t\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\mathsf{fma}\left(-y, z - 1, -\log y\right)\\
                        
                        
                        \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) < -2e5 or 590 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t)

                          1. Initial program 93.4%

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

                            \[\leadsto \color{blue}{\log y \cdot \left(x - 1\right)} - t \]
                          4. Step-by-step derivation
                            1. Applied rewrites91.1%

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

                            if -2e5 < (-.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) < 590

                            1. Initial program 74.0%

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(-y, z - 1, -\log y\right) \]
                                4. Recombined 2 regimes into one program.
                                5. Final simplification91.9%

                                  \[\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 -200000 \lor \neg \left(\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \leq 590\right):\\ \;\;\;\;\log y \cdot \left(x - 1\right) - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z - 1, -\log y\right)\\ \end{array} \]
                                6. Add Preprocessing

                                Alternative 5: 95.9% accurate, 1.7× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot \left(x - 1\right)\\ \mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 0.26\right):\\ \;\;\;\;t\_1 - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z - 1, t\_1\right)\\ \end{array} \end{array} \]
                                (FPCore (x y z t)
                                 :precision binary64
                                 (let* ((t_1 (* (log y) (- x 1.0))))
                                   (if (or (<= t -800000000.0) (not (<= t 0.26)))
                                     (- t_1 t)
                                     (fma (- y) (- z 1.0) t_1))))
                                double code(double x, double y, double z, double t) {
                                	double t_1 = log(y) * (x - 1.0);
                                	double tmp;
                                	if ((t <= -800000000.0) || !(t <= 0.26)) {
                                		tmp = t_1 - t;
                                	} else {
                                		tmp = fma(-y, (z - 1.0), t_1);
                                	}
                                	return tmp;
                                }
                                
                                function code(x, y, z, t)
                                	t_1 = Float64(log(y) * Float64(x - 1.0))
                                	tmp = 0.0
                                	if ((t <= -800000000.0) || !(t <= 0.26))
                                		tmp = Float64(t_1 - t);
                                	else
                                		tmp = fma(Float64(-y), Float64(z - 1.0), t_1);
                                	end
                                	return tmp
                                end
                                
                                code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -800000000.0], N[Not[LessEqual[t, 0.26]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[((-y) * N[(z - 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_1 := \log y \cdot \left(x - 1\right)\\
                                \mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 0.26\right):\\
                                \;\;\;\;t\_1 - t\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\mathsf{fma}\left(-y, z - 1, t\_1\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if t < -8e8 or 0.26000000000000001 < t

                                  1. Initial program 95.1%

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

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

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

                                    if -8e8 < t < 0.26000000000000001

                                    1. Initial program 83.7%

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

                                      \[\leadsto \color{blue}{\left(-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. Applied rewrites97.8%

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

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

                                          \[\leadsto \mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) \]
                                      4. Recombined 2 regimes into one program.
                                      5. Final simplification96.1%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 0.26\right):\\ \;\;\;\;\log y \cdot \left(x - 1\right) - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right)\\ \end{array} \]
                                      6. Add Preprocessing

                                      Alternative 6: 95.8% accurate, 1.8× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot \left(x - 1\right)\\ \mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 0.26\right):\\ \;\;\;\;t\_1 - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z, t\_1\right)\\ \end{array} \end{array} \]
                                      (FPCore (x y z t)
                                       :precision binary64
                                       (let* ((t_1 (* (log y) (- x 1.0))))
                                         (if (or (<= t -800000000.0) (not (<= t 0.26)))
                                           (- t_1 t)
                                           (fma (- y) z t_1))))
                                      double code(double x, double y, double z, double t) {
                                      	double t_1 = log(y) * (x - 1.0);
                                      	double tmp;
                                      	if ((t <= -800000000.0) || !(t <= 0.26)) {
                                      		tmp = t_1 - t;
                                      	} else {
                                      		tmp = fma(-y, z, t_1);
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(x, y, z, t)
                                      	t_1 = Float64(log(y) * Float64(x - 1.0))
                                      	tmp = 0.0
                                      	if ((t <= -800000000.0) || !(t <= 0.26))
                                      		tmp = Float64(t_1 - t);
                                      	else
                                      		tmp = fma(Float64(-y), z, t_1);
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -800000000.0], N[Not[LessEqual[t, 0.26]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[((-y) * z + t$95$1), $MachinePrecision]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_1 := \log y \cdot \left(x - 1\right)\\
                                      \mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 0.26\right):\\
                                      \;\;\;\;t\_1 - t\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\mathsf{fma}\left(-y, z, t\_1\right)\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if t < -8e8 or 0.26000000000000001 < t

                                        1. Initial program 95.1%

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

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

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

                                          if -8e8 < t < 0.26000000000000001

                                          1. Initial program 83.7%

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

                                            \[\leadsto \color{blue}{\left(-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. Applied rewrites97.8%

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

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

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

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

                                                  \[\leadsto \mathsf{fma}\left(-y, z, \log y \cdot \left(x - 1\right)\right) \]
                                              4. Recombined 2 regimes into one program.
                                              5. Final simplification96.1%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 0.26\right):\\ \;\;\;\;\log y \cdot \left(x - 1\right) - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z, \log y \cdot \left(x - 1\right)\right)\\ \end{array} \]
                                              6. Add Preprocessing

                                              Alternative 7: 95.5% accurate, 1.8× speedup?

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

                                                1. Initial program 92.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. Applied rewrites92.9%

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

                                                  if -1.17999999999999993e-14 < x < 9.2000000000000002e27

                                                  1. Initial program 84.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(-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. Applied rewrites97.9%

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

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

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

                                                      if 9.2000000000000002e27 < x

                                                      1. Initial program 96.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 x around inf

                                                        \[\leadsto \color{blue}{x \cdot \log y} - t \]
                                                      4. Step-by-step derivation
                                                        1. Applied rewrites94.8%

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

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.18 \cdot 10^{-14}:\\ \;\;\;\;\log y \cdot \left(x - 1\right) - t\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{+27}:\\ \;\;\;\;-\left(\mathsf{fma}\left(z - 1, y, \log y\right) + t\right)\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x - t\\ \end{array} \]
                                                      7. Add Preprocessing

                                                      Alternative 8: 66.2% accurate, 1.8× speedup?

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

                                                        1. Initial program 96.8%

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

                                                          \[\leadsto \color{blue}{x \cdot \log y} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites84.1%

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

                                                          if -2.0000000000000001e108 < (-.f64 x #s(literal 1 binary64)) < 9.99999999999999944e71

                                                          1. Initial program 85.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) + 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. Applied rewrites98.9%

                                                              \[\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 \]
                                                            2. Taylor expanded in z around inf

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

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

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

                                                            Alternative 9: 99.2% 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 89.6%

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

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

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

                                                              Alternative 10: 88.7% accurate, 1.9× speedup?

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

                                                                1. Initial program 93.9%

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

                                                                  \[\leadsto \color{blue}{\log y \cdot \left(x - 1\right)} - t \]
                                                                4. Step-by-step derivation
                                                                  1. Applied rewrites92.4%

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

                                                                  if 3.2e174 < z

                                                                  1. Initial program 63.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. Applied rewrites97.2%

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

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

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

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

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

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

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

                                                                        Alternative 11: 88.7% accurate, 2.0× speedup?

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

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

                                                                          Alternative 12: 46.5% accurate, 8.1× speedup?

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

                                                                              \[\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 \]
                                                                            2. Taylor expanded in z around inf

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

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

                                                                              Alternative 13: 43.6% accurate, 10.7× speedup?

                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 110000\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z, y\right)\\ \end{array} \end{array} \]
                                                                              (FPCore (x y z t)
                                                                               :precision binary64
                                                                               (if (or (<= t -800000000.0) (not (<= t 110000.0))) (- t) (fma (- y) z y)))
                                                                              double code(double x, double y, double z, double t) {
                                                                              	double tmp;
                                                                              	if ((t <= -800000000.0) || !(t <= 110000.0)) {
                                                                              		tmp = -t;
                                                                              	} else {
                                                                              		tmp = fma(-y, z, y);
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              function code(x, y, z, t)
                                                                              	tmp = 0.0
                                                                              	if ((t <= -800000000.0) || !(t <= 110000.0))
                                                                              		tmp = Float64(-t);
                                                                              	else
                                                                              		tmp = fma(Float64(-y), z, y);
                                                                              	end
                                                                              	return tmp
                                                                              end
                                                                              
                                                                              code[x_, y_, z_, t_] := If[Or[LessEqual[t, -800000000.0], N[Not[LessEqual[t, 110000.0]], $MachinePrecision]], (-t), N[((-y) * z + y), $MachinePrecision]]
                                                                              
                                                                              \begin{array}{l}
                                                                              
                                                                              \\
                                                                              \begin{array}{l}
                                                                              \mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 110000\right):\\
                                                                              \;\;\;\;-t\\
                                                                              
                                                                              \mathbf{else}:\\
                                                                              \;\;\;\;\mathsf{fma}\left(-y, z, y\right)\\
                                                                              
                                                                              
                                                                              \end{array}
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Split input into 2 regimes
                                                                              2. if t < -8e8 or 1.1e5 < t

                                                                                1. Initial program 95.1%

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

                                                                                  \[\leadsto \color{blue}{-1 \cdot t} \]
                                                                                4. Step-by-step derivation
                                                                                  1. Applied rewrites70.9%

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

                                                                                  if -8e8 < t < 1.1e5

                                                                                  1. Initial program 83.7%

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

                                                                                    \[\leadsto \color{blue}{\left(-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. Applied rewrites97.8%

                                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-y, z - 1, \mathsf{fma}\left(\log y, x - 1, -t\right)\right)} \]
                                                                                    2. Step-by-step derivation
                                                                                      1. Applied rewrites72.4%

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

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

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

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

                                                                                            \[\leadsto \mathsf{fma}\left(-y, z, y\right) \]
                                                                                        4. Recombined 2 regimes into one program.
                                                                                        5. Final simplification45.6%

                                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 110000\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z, y\right)\\ \end{array} \]
                                                                                        6. Add Preprocessing

                                                                                        Alternative 14: 43.3% accurate, 11.3× speedup?

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

                                                                                          1. Initial program 95.1%

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

                                                                                            \[\leadsto \color{blue}{-1 \cdot t} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. Applied rewrites70.9%

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

                                                                                            if -8e8 < t < 1.1e5

                                                                                            1. Initial program 83.7%

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

                                                                                              \[\leadsto \color{blue}{\left(-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. Applied rewrites97.8%

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

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

                                                                                                  \[\leadsto \left(-y\right) \cdot \color{blue}{z} \]
                                                                                              4. Recombined 2 regimes into one program.
                                                                                              5. Final simplification45.4%

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

                                                                                              Alternative 15: 46.3% accurate, 16.1× speedup?

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

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

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

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

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

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

                                                                                                  Alternative 16: 46.1% accurate, 20.5× speedup?

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

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

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

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

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

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

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

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

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

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

                                                                                                          Alternative 17: 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 89.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}{-1 \cdot t} \]
                                                                                                          4. Step-by-step derivation
                                                                                                            1. Applied rewrites37.7%

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

                                                                                                            Alternative 18: 2.9% accurate, 226.0× speedup?

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

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

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

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

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

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

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

                                                                                                                    \[\leadsto y \]
                                                                                                                  3. Step-by-step derivation
                                                                                                                    1. Applied rewrites2.7%

                                                                                                                      \[\leadsto y \]
                                                                                                                    2. Final simplification2.7%

                                                                                                                      \[\leadsto y \]
                                                                                                                    3. Add Preprocessing

                                                                                                                    Reproduce

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