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

Percentage Accurate: 89.5% → 99.8%
Time: 13.3s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 89.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \mathsf{log1p}\left(\left(-\sqrt{y}\right) \cdot \sqrt{y}\right)\right) - t \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (-
  (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log1p (* (- (sqrt y)) (sqrt y)))))
  t))
double code(double x, double y, double z, double t) {
	return (((x - 1.0) * log(y)) + ((z - 1.0) * log1p((-sqrt(y) * sqrt(y))))) - t;
}
public static double code(double x, double y, double z, double t) {
	return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log1p((-Math.sqrt(y) * Math.sqrt(y))))) - t;
}
def code(x, y, z, t):
	return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log1p((-math.sqrt(y) * math.sqrt(y))))) - t
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log1p(Float64(Float64(-sqrt(y)) * sqrt(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[1 + N[((-N[Sqrt[y], $MachinePrecision]) * N[Sqrt[y], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\\ \mathbf{if}\;t\_1 \leq 110 \lor \neg \left(t\_1 \leq 228\right):\\ \;\;\;\;\mathsf{fma}\left(\log y, x - 1, y\right) - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - 1, y, \frac{\frac{1}{y} - -0.5}{z} \cdot \left(y \cdot y\right)\right) \cdot z - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y))))))
   (if (or (<= t_1 110.0) (not (<= t_1 228.0)))
     (- (fma (log y) (- x 1.0) y) t)
     (-
      (* (fma (- (* -0.5 y) 1.0) y (* (/ (- (/ 1.0 y) -0.5) z) (* y y))) z)
      t))))
double code(double x, double y, double z, double t) {
	double t_1 = ((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)));
	double tmp;
	if ((t_1 <= 110.0) || !(t_1 <= 228.0)) {
		tmp = fma(log(y), (x - 1.0), y) - t;
	} else {
		tmp = (fma(((-0.5 * y) - 1.0), y, ((((1.0 / y) - -0.5) / z) * (y * y))) * z) - t;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y))))
	tmp = 0.0
	if ((t_1 <= 110.0) || !(t_1 <= 228.0))
		tmp = Float64(fma(log(y), Float64(x - 1.0), y) - t);
	else
		tmp = Float64(Float64(fma(Float64(Float64(-0.5 * y) - 1.0), y, Float64(Float64(Float64(Float64(1.0 / y) - -0.5) / z) * Float64(y * y))) * z) - t);
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 110.0], N[Not[LessEqual[t$95$1, 228.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision] + y), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * y + N[(N[(N[(N[(1.0 / y), $MachinePrecision] - -0.5), $MachinePrecision] / z), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_1 \leq 110 \lor \neg \left(t\_1 \leq 228\right):\\
\;\;\;\;\mathsf{fma}\left(\log y, x - 1, y\right) - t\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - 1, y, \frac{\frac{1}{y} - -0.5}{z} \cdot \left(y \cdot y\right)\right) \cdot z - t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 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)))) < 110 or 228 < (+.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 90.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. Step-by-step derivation
      1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\mathsf{log1p}\left(\left(-\sqrt{y}\right) \cdot \sqrt{y}\right)}\right) - t \]
    5. 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} \]
    6. Step-by-step derivation
      1. Applied rewrites99.3%

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

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

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

        if 110 < (+.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)))) < 228

        1. Initial program 38.4%

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

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

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

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

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

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

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

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

            Alternative 3: 87.6% accurate, 0.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\\ \mathbf{if}\;t\_1 \leq 110 \lor \neg \left(t\_1 \leq 228\right):\\ \;\;\;\;\mathsf{fma}\left(\log y, x - 1, -t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - 1, y, \frac{\frac{1}{y} - -0.5}{z} \cdot \left(y \cdot y\right)\right) \cdot z - t\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y))))))
               (if (or (<= t_1 110.0) (not (<= t_1 228.0)))
                 (fma (log y) (- x 1.0) (- t))
                 (-
                  (* (fma (- (* -0.5 y) 1.0) y (* (/ (- (/ 1.0 y) -0.5) z) (* y y))) z)
                  t))))
            double code(double x, double y, double z, double t) {
            	double t_1 = ((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)));
            	double tmp;
            	if ((t_1 <= 110.0) || !(t_1 <= 228.0)) {
            		tmp = fma(log(y), (x - 1.0), -t);
            	} else {
            		tmp = (fma(((-0.5 * y) - 1.0), y, ((((1.0 / y) - -0.5) / z) * (y * y))) * z) - t;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t)
            	t_1 = Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y))))
            	tmp = 0.0
            	if ((t_1 <= 110.0) || !(t_1 <= 228.0))
            		tmp = fma(log(y), Float64(x - 1.0), Float64(-t));
            	else
            		tmp = Float64(Float64(fma(Float64(Float64(-0.5 * y) - 1.0), y, Float64(Float64(Float64(Float64(1.0 / y) - -0.5) / z) * Float64(y * y))) * z) - t);
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 110.0], N[Not[LessEqual[t$95$1, 228.0]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision] + (-t)), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * y + N[(N[(N[(N[(1.0 / y), $MachinePrecision] - -0.5), $MachinePrecision] / z), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] - t), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\\
            \mathbf{if}\;t\_1 \leq 110 \lor \neg \left(t\_1 \leq 228\right):\\
            \;\;\;\;\mathsf{fma}\left(\log y, x - 1, -t\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - 1, y, \frac{\frac{1}{y} - -0.5}{z} \cdot \left(y \cdot y\right)\right) \cdot z - t\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 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)))) < 110 or 228 < (+.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 90.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 rewrites89.4%

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

                if 110 < (+.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)))) < 228

                1. Initial program 38.4%

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

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

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

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

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

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

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

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

                    Alternative 4: 99.4% accurate, 1.7× speedup?

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

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

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

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

                      Alternative 5: 95.3% accurate, 1.7× speedup?

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

                        1. Initial program 98.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 rewrites98.3%

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

                          if -2.05e21 < t < 2.49999999999999986e-30

                          1. Initial program 78.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. Step-by-step derivation
                            1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\mathsf{log1p}\left(\left(-\sqrt{y}\right) \cdot \sqrt{y}\right)}\right) - t \]
                          5. 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} \]
                          6. Step-by-step derivation
                            1. Applied rewrites98.8%

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

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

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

                              if 2.49999999999999986e-30 < t

                              1. Initial program 91.2%

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

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

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

                              Alternative 6: 95.6% accurate, 1.8× speedup?

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

                                1. Initial program 94.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 rewrites93.2%

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

                                  if -3.7e6 < x < 1.79999999999999995e-21

                                  1. Initial program 78.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. Step-by-step derivation
                                    1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 7: 95.6% accurate, 1.8× speedup?

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

                                      1. Initial program 94.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 rewrites93.2%

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

                                        if -3.7e6 < x < 1.79999999999999995e-21

                                        1. Initial program 78.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. Step-by-step derivation
                                          1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 8: 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 86.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 rewrites99.4%

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

                                            Alternative 9: 77.9% accurate, 1.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4800000 \lor \neg \left(x \leq 55000000000\right):\\ \;\;\;\;\log y \cdot x - t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-\left(z - 1\right), y, -t\right)\\ \end{array} \end{array} \]
                                            (FPCore (x y z t)
                                             :precision binary64
                                             (if (or (<= x -4800000.0) (not (<= x 55000000000.0)))
                                               (- (* (log y) x) t)
                                               (fma (- (- z 1.0)) y (- t))))
                                            double code(double x, double y, double z, double t) {
                                            	double tmp;
                                            	if ((x <= -4800000.0) || !(x <= 55000000000.0)) {
                                            		tmp = (log(y) * x) - t;
                                            	} else {
                                            		tmp = fma(-(z - 1.0), y, -t);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(x, y, z, t)
                                            	tmp = 0.0
                                            	if ((x <= -4800000.0) || !(x <= 55000000000.0))
                                            		tmp = Float64(Float64(log(y) * x) - t);
                                            	else
                                            		tmp = fma(Float64(-Float64(z - 1.0)), y, Float64(-t));
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4800000.0], N[Not[LessEqual[x, 55000000000.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision], N[((-N[(z - 1.0), $MachinePrecision]) * y + (-t)), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;x \leq -4800000 \lor \neg \left(x \leq 55000000000\right):\\
                                            \;\;\;\;\log y \cdot x - t\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\mathsf{fma}\left(-\left(z - 1\right), y, -t\right)\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if x < -4.8e6 or 5.5e10 < x

                                              1. Initial program 95.2%

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

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

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

                                                if -4.8e6 < x < 5.5e10

                                                1. Initial program 78.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. Step-by-step derivation
                                                  1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  Alternative 10: 67.4% accurate, 1.9× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{+89} \lor \neg \left(x \leq 4.5 \cdot 10^{+37}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-\left(z - 1\right), y, -t\right)\\ \end{array} \end{array} \]
                                                  (FPCore (x y z t)
                                                   :precision binary64
                                                   (if (or (<= x -4.1e+89) (not (<= x 4.5e+37)))
                                                     (* (log y) x)
                                                     (fma (- (- z 1.0)) y (- t))))
                                                  double code(double x, double y, double z, double t) {
                                                  	double tmp;
                                                  	if ((x <= -4.1e+89) || !(x <= 4.5e+37)) {
                                                  		tmp = log(y) * x;
                                                  	} else {
                                                  		tmp = fma(-(z - 1.0), y, -t);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(x, y, z, t)
                                                  	tmp = 0.0
                                                  	if ((x <= -4.1e+89) || !(x <= 4.5e+37))
                                                  		tmp = Float64(log(y) * x);
                                                  	else
                                                  		tmp = fma(Float64(-Float64(z - 1.0)), y, Float64(-t));
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.1e+89], N[Not[LessEqual[x, 4.5e+37]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[((-N[(z - 1.0), $MachinePrecision]) * y + (-t)), $MachinePrecision]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;x \leq -4.1 \cdot 10^{+89} \lor \neg \left(x \leq 4.5 \cdot 10^{+37}\right):\\
                                                  \;\;\;\;\log y \cdot x\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\mathsf{fma}\left(-\left(z - 1\right), y, -t\right)\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if x < -4.09999999999999985e89 or 4.49999999999999962e37 < x

                                                    1. Initial program 96.2%

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

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

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

                                                      if -4.09999999999999985e89 < x < 4.49999999999999962e37

                                                      1. Initial program 80.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. Step-by-step derivation
                                                        1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        Alternative 11: 42.6% accurate, 10.7× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.9 \cdot 10^{+16} \lor \neg \left(t \leq 16500\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;\left(1 - z\right) \cdot y\\ \end{array} \end{array} \]
                                                        (FPCore (x y z t)
                                                         :precision binary64
                                                         (if (or (<= t -3.9e+16) (not (<= t 16500.0))) (- t) (* (- 1.0 z) y)))
                                                        double code(double x, double y, double z, double t) {
                                                        	double tmp;
                                                        	if ((t <= -3.9e+16) || !(t <= 16500.0)) {
                                                        		tmp = -t;
                                                        	} else {
                                                        		tmp = (1.0 - z) * y;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        module fmin_fmax_functions
                                                            implicit none
                                                            private
                                                            public fmax
                                                            public fmin
                                                        
                                                            interface fmax
                                                                module procedure fmax88
                                                                module procedure fmax44
                                                                module procedure fmax84
                                                                module procedure fmax48
                                                            end interface
                                                            interface fmin
                                                                module procedure fmin88
                                                                module procedure fmin44
                                                                module procedure fmin84
                                                                module procedure fmin48
                                                            end interface
                                                        contains
                                                            real(8) function fmax88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmax44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmin44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                            end function
                                                        end module
                                                        
                                                        real(8) function code(x, y, z, t)
                                                        use fmin_fmax_functions
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            real(8), intent (in) :: z
                                                            real(8), intent (in) :: t
                                                            real(8) :: tmp
                                                            if ((t <= (-3.9d+16)) .or. (.not. (t <= 16500.0d0))) then
                                                                tmp = -t
                                                            else
                                                                tmp = (1.0d0 - z) * y
                                                            end if
                                                            code = tmp
                                                        end function
                                                        
                                                        public static double code(double x, double y, double z, double t) {
                                                        	double tmp;
                                                        	if ((t <= -3.9e+16) || !(t <= 16500.0)) {
                                                        		tmp = -t;
                                                        	} else {
                                                        		tmp = (1.0 - z) * y;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(x, y, z, t):
                                                        	tmp = 0
                                                        	if (t <= -3.9e+16) or not (t <= 16500.0):
                                                        		tmp = -t
                                                        	else:
                                                        		tmp = (1.0 - z) * y
                                                        	return tmp
                                                        
                                                        function code(x, y, z, t)
                                                        	tmp = 0.0
                                                        	if ((t <= -3.9e+16) || !(t <= 16500.0))
                                                        		tmp = Float64(-t);
                                                        	else
                                                        		tmp = Float64(Float64(1.0 - z) * y);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        function tmp_2 = code(x, y, z, t)
                                                        	tmp = 0.0;
                                                        	if ((t <= -3.9e+16) || ~((t <= 16500.0)))
                                                        		tmp = -t;
                                                        	else
                                                        		tmp = (1.0 - z) * y;
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.9e+16], N[Not[LessEqual[t, 16500.0]], $MachinePrecision]], (-t), N[(N[(1.0 - z), $MachinePrecision] * y), $MachinePrecision]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;t \leq -3.9 \cdot 10^{+16} \lor \neg \left(t \leq 16500\right):\\
                                                        \;\;\;\;-t\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\left(1 - z\right) \cdot y\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if t < -3.9e16 or 16500 < t

                                                          1. Initial program 94.2%

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

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

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

                                                            if -3.9e16 < t < 16500

                                                            1. Initial program 79.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. Step-by-step derivation
                                                              1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\mathsf{log1p}\left(\left(-\sqrt{y}\right) \cdot \sqrt{y}\right)}\right) - t \]
                                                            5. 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} \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites98.9%

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

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

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

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

                                                              Alternative 12: 42.4% accurate, 11.3× speedup?

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

                                                                1. Initial program 94.2%

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

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

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

                                                                  if -3.9e16 < t < 16500

                                                                  1. Initial program 79.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. Step-by-step derivation
                                                                    1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    Alternative 13: 45.6% accurate, 16.1× speedup?

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

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\mathsf{log1p}\left(\left(-\sqrt{y}\right) \cdot \sqrt{y}\right)}\right) - t \]
                                                                    5. 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} \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites99.4%

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

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

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

                                                                        Alternative 14: 35.4% 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 86.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 rewrites34.8%

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

                                                                          Reproduce

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