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

Percentage Accurate: 89.1% → 99.6%
Time: 14.0s
Alternatives: 13
Speedup: 1.9×

Specification

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

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

Alternative 1: 99.6% accurate, 1.5× speedup?

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

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

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

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

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

Alternative 2: 76.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ t_2 := \left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+130}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 108.5:\\ \;\;\;\;\left(1 - z\right) \cdot y - t\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+35}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (log y) x))
        (t_2 (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y))))))
   (if (<= t_2 -1e+130)
     t_1
     (if (<= t_2 108.5)
       (- (* (- 1.0 z) y) t)
       (if (<= t_2 2e+35) (- (- (log y)) t) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = log(y) * x;
	double t_2 = ((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)));
	double tmp;
	if (t_2 <= -1e+130) {
		tmp = t_1;
	} else if (t_2 <= 108.5) {
		tmp = ((1.0 - z) * y) - t;
	} else if (t_2 <= 2e+35) {
		tmp = -log(y) - t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = log(y) * x
    t_2 = ((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))
    if (t_2 <= (-1d+130)) then
        tmp = t_1
    else if (t_2 <= 108.5d0) then
        tmp = ((1.0d0 - z) * y) - t
    else if (t_2 <= 2d+35) then
        tmp = -log(y) - t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.log(y) * x;
	double t_2 = ((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)));
	double tmp;
	if (t_2 <= -1e+130) {
		tmp = t_1;
	} else if (t_2 <= 108.5) {
		tmp = ((1.0 - z) * y) - t;
	} else if (t_2 <= 2e+35) {
		tmp = -Math.log(y) - t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.log(y) * x
	t_2 = ((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))
	tmp = 0
	if t_2 <= -1e+130:
		tmp = t_1
	elif t_2 <= 108.5:
		tmp = ((1.0 - z) * y) - t
	elif t_2 <= 2e+35:
		tmp = -math.log(y) - t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(log(y) * x)
	t_2 = Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y))))
	tmp = 0.0
	if (t_2 <= -1e+130)
		tmp = t_1;
	elseif (t_2 <= 108.5)
		tmp = Float64(Float64(Float64(1.0 - z) * y) - t);
	elseif (t_2 <= 2e+35)
		tmp = Float64(Float64(-log(y)) - t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = log(y) * x;
	t_2 = ((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)));
	tmp = 0.0;
	if (t_2 <= -1e+130)
		tmp = t_1;
	elseif (t_2 <= 108.5)
		tmp = ((1.0 - z) * y) - t;
	elseif (t_2 <= 2e+35)
		tmp = -log(y) - t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+130], t$95$1, If[LessEqual[t$95$2, 108.5], N[(N[(N[(1.0 - z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 2e+35], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 108.5:\\
\;\;\;\;\left(1 - z\right) \cdot y - t\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+35}:\\
\;\;\;\;\left(-\log y\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < -1.0000000000000001e130 or 1.9999999999999999e35 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y))))

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log y} \cdot x \]
    8. Applied rewrites74.7%

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

    if -1.0000000000000001e130 < (+.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)))) < 108.5

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 108.5 < (+.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.9999999999999999e35

      1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

      Alternative 3: 94.8% accurate, 1.7× speedup?

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

        1. Initial program 96.5%

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

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

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

            \[\leadsto \color{blue}{\log y \cdot x} - t \]
          3. lower-log.f6494.6

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

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

        if -4.9999999999999997e38 < (-.f64 x #s(literal 1 binary64)) < -1

        1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 92.5%

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

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

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

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

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

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

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

        Alternative 4: 95.1% accurate, 1.7× speedup?

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

          1. Initial program 96.8%

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

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

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

              \[\leadsto \color{blue}{\log y \cdot x} - t \]
            3. lower-log.f6495.8

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

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

          if -5.8e20 < t < 1.65e7

          1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 95.1% accurate, 1.7× speedup?

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

            1. Initial program 96.8%

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

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

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

                \[\leadsto \color{blue}{\log y \cdot x} - t \]
              3. lower-log.f6495.8

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

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

            if -5.8e20 < t < 1.65e7

            1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(-y, \color{blue}{z}, \mathsf{fma}\left(\log y, x - 1, y\right)\right) \]
            11. Recombined 2 regimes into one program.
            12. Final simplification97.3%

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

            Alternative 6: 87.1% accurate, 1.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -41 \lor \neg \left(x \leq 1\right):\\ \;\;\;\;\log y \cdot x - t\\ \mathbf{else}:\\ \;\;\;\;\left(-\log y\right) - t\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (if (or (<= x -41.0) (not (<= x 1.0))) (- (* (log y) x) t) (- (- (log y)) t)))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if ((x <= -41.0) || !(x <= 1.0)) {
            		tmp = (log(y) * x) - t;
            	} else {
            		tmp = -log(y) - t;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: tmp
                if ((x <= (-41.0d0)) .or. (.not. (x <= 1.0d0))) then
                    tmp = (log(y) * x) - t
                else
                    tmp = -log(y) - t
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double tmp;
            	if ((x <= -41.0) || !(x <= 1.0)) {
            		tmp = (Math.log(y) * x) - t;
            	} else {
            		tmp = -Math.log(y) - t;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	tmp = 0
            	if (x <= -41.0) or not (x <= 1.0):
            		tmp = (math.log(y) * x) - t
            	else:
            		tmp = -math.log(y) - t
            	return tmp
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if ((x <= -41.0) || !(x <= 1.0))
            		tmp = Float64(Float64(log(y) * x) - t);
            	else
            		tmp = Float64(Float64(-log(y)) - t);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	tmp = 0.0;
            	if ((x <= -41.0) || ~((x <= 1.0)))
            		tmp = (log(y) * x) - t;
            	else
            		tmp = -log(y) - t;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := If[Or[LessEqual[x, -41.0], N[Not[LessEqual[x, 1.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq -41 \lor \neg \left(x \leq 1\right):\\
            \;\;\;\;\log y \cdot x - t\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(-\log y\right) - t\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -41 or 1 < x

              1. Initial program 92.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. *-commutativeN/A

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

                  \[\leadsto \color{blue}{\log y \cdot x} - t \]
                3. lower-log.f6490.0

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

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

              if -41 < x < 1

              1. Initial program 87.9%

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-\log y\right) - t \]
              8. Recombined 2 regimes into one program.
              9. Final simplification87.4%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -41 \lor \neg \left(x \leq 1\right):\\ \;\;\;\;\log y \cdot x - t\\ \mathbf{else}:\\ \;\;\;\;\left(-\log y\right) - t\\ \end{array} \]
              10. Add Preprocessing

              Alternative 7: 99.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 8: 99.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 9: 66.6% accurate, 1.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+34} \lor \neg \left(x \leq 3.1 \cdot 10^{+123}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - z\right) \cdot y - t\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (or (<= x -1.3e+34) (not (<= x 3.1e+123)))
                 (* (log y) x)
                 (- (* (- 1.0 z) y) t)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((x <= -1.3e+34) || !(x <= 3.1e+123)) {
              		tmp = log(y) * x;
              	} else {
              		tmp = ((1.0 - z) * y) - t;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y, z, t)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8) :: tmp
                  if ((x <= (-1.3d+34)) .or. (.not. (x <= 3.1d+123))) then
                      tmp = log(y) * x
                  else
                      tmp = ((1.0d0 - z) * y) - t
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((x <= -1.3e+34) || !(x <= 3.1e+123)) {
              		tmp = Math.log(y) * x;
              	} else {
              		tmp = ((1.0 - z) * y) - t;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	tmp = 0
              	if (x <= -1.3e+34) or not (x <= 3.1e+123):
              		tmp = math.log(y) * x
              	else:
              		tmp = ((1.0 - z) * y) - t
              	return tmp
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if ((x <= -1.3e+34) || !(x <= 3.1e+123))
              		tmp = Float64(log(y) * x);
              	else
              		tmp = Float64(Float64(Float64(1.0 - z) * y) - t);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	tmp = 0.0;
              	if ((x <= -1.3e+34) || ~((x <= 3.1e+123)))
              		tmp = log(y) * x;
              	else
              		tmp = ((1.0 - z) * y) - t;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.3e+34], N[Not[LessEqual[x, 3.1e+123]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(1.0 - z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq -1.3 \cdot 10^{+34} \lor \neg \left(x \leq 3.1 \cdot 10^{+123}\right):\\
              \;\;\;\;\log y \cdot x\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(1 - z\right) \cdot y - t\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -1.29999999999999999e34 or 3.10000000000000006e123 < x

                1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\log y} \cdot x \]
                8. Applied rewrites78.0%

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

                if -1.29999999999999999e34 < x < 3.10000000000000006e123

                1. Initial program 87.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}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(1 - z\right) \cdot \color{blue}{y} - t \]
                8. Recombined 2 regimes into one program.
                9. Final simplification66.8%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+34} \lor \neg \left(x \leq 3.1 \cdot 10^{+123}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(1 - z\right) \cdot y - t\\ \end{array} \]
                10. Add Preprocessing

                Alternative 10: 87.4% accurate, 1.9× speedup?

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

                  1. Initial program 91.0%

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

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

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

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

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

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

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

                  if 2.00000000000000014e-17 < y

                  1. Initial program 75.0%

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{neg}\left(y\right)\right)} \cdot z - t \]
                    5. lower-neg.f6486.3

                      \[\leadsto \mathsf{log1p}\left(\color{blue}{-y}\right) \cdot z - t \]
                  5. Applied rewrites86.3%

                    \[\leadsto \color{blue}{\mathsf{log1p}\left(-y\right) \cdot z} - t \]
                3. Recombined 2 regimes into one program.
                4. Add Preprocessing

                Alternative 11: 46.2% accurate, 18.8× speedup?

                \[\begin{array}{l} \\ \left(1 - z\right) \cdot y - t \end{array} \]
                (FPCore (x y z t) :precision binary64 (- (* (- 1.0 z) y) t))
                double code(double x, double y, double z, double t) {
                	return ((1.0 - z) * y) - t;
                }
                
                real(8) function code(x, y, z, t)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    code = ((1.0d0 - z) * y) - t
                end function
                
                public static double code(double x, double y, double z, double t) {
                	return ((1.0 - z) * y) - t;
                }
                
                def code(x, y, z, t):
                	return ((1.0 - z) * y) - t
                
                function code(x, y, z, t)
                	return Float64(Float64(Float64(1.0 - z) * y) - t)
                end
                
                function tmp = code(x, y, z, t)
                	tmp = ((1.0 - z) * y) - t;
                end
                
                code[x_, y_, z_, t_] := N[(N[(N[(1.0 - z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \left(1 - z\right) \cdot y - t
                \end{array}
                
                Derivation
                1. Initial program 90.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}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 12: 46.0% accurate, 20.5× speedup?

                  \[\begin{array}{l} \\ \left(-z\right) \cdot y - t \end{array} \]
                  (FPCore (x y z t) :precision binary64 (- (* (- z) y) t))
                  double code(double x, double y, double z, double t) {
                  	return (-z * y) - t;
                  }
                  
                  real(8) function code(x, y, z, t)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      code = (-z * y) - t
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	return (-z * y) - t;
                  }
                  
                  def code(x, y, z, t):
                  	return (-z * y) - t
                  
                  function code(x, y, z, t)
                  	return Float64(Float64(Float64(-z) * y) - t)
                  end
                  
                  function tmp = code(x, y, z, t)
                  	tmp = (-z * y) - t;
                  end
                  
                  code[x_, y_, z_, t_] := N[(N[((-z) * y), $MachinePrecision] - t), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \left(-z\right) \cdot y - t
                  \end{array}
                  
                  Derivation
                  1. Initial program 90.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}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 13: 35.6% accurate, 75.3× speedup?

                    \[\begin{array}{l} \\ -t \end{array} \]
                    (FPCore (x y z t) :precision binary64 (- t))
                    double code(double x, double y, double z, double t) {
                    	return -t;
                    }
                    
                    real(8) function code(x, y, z, t)
                        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 90.1%

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

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

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

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

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

                    Reproduce

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