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

Percentage Accurate: 89.1% → 99.6%
Time: 18.6s
Alternatives: 15
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 15 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 + \left(z + -1\right) \cdot \left(y \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right)\right)\right) - t \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (-
  (+
   (* (+ x -1.0) (log y))
   (*
    (+ z -1.0)
    (* y (fma y (fma y (fma y -0.25 -0.3333333333333333) -0.5) -1.0))))
  t))
double code(double x, double y, double z, double t) {
	return (((x + -1.0) * log(y)) + ((z + -1.0) * (y * fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0)))) - t;
}
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(x + -1.0) * log(y)) + Float64(Float64(z + -1.0) * Float64(y * fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0)))) - 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[(y * N[(y * N[(y * N[(y * -0.25 + -0.3333333333333333), $MachinePrecision] + -0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.6% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;z + -1 \leq 5 \cdot 10^{+147}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x + -1, y\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 z #s(literal 1 binary64)) < -2.0000000000000001e138 or 5.0000000000000002e147 < (-.f64 z #s(literal 1 binary64))

    1. Initial program 65.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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.0000000000000001e138 < (-.f64 z #s(literal 1 binary64)) < 5.0000000000000002e147

      1. Initial program 99.2%

        \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
      2. Add Preprocessing
      3. Taylor expanded in 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\log y, \color{blue}{-1 + x}, y\right) - t \]
      8. Recombined 2 regimes into one program.
      9. Final simplification97.8%

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

      Alternative 4: 99.4% accurate, 1.7× speedup?

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

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

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

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

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

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

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

      Alternative 5: 77.5% accurate, 1.8× speedup?

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

        1. Initial program 98.0%

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

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

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

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

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

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

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

        1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 6: 67.3% accurate, 1.8× speedup?

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

            1. Initial program 98.0%

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

              \[\leadsto \color{blue}{x \cdot \log y} \]
            4. 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.f6475.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 7: 88.9% accurate, 1.9× speedup?

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

                1. Initial program 94.2%

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

                  \[\leadsto \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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 5.00000000000000022e244 < (-.f64 z #s(literal 1 binary64))

                  1. Initial program 28.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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, 1 - z, \log y \cdot \left(-1 + x\right)\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 rewrites88.3%

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

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

                  Alternative 8: 88.8% accurate, 1.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z + -1 \leq 5 \cdot 10^{+244}:\\ \;\;\;\;\left(x + -1\right) \cdot \log y - t\\ \mathbf{else}:\\ \;\;\;\;\left(y - y \cdot z\right) - t\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= (+ z -1.0) 5e+244) (- (* (+ x -1.0) (log y)) t) (- (- y (* y z)) t)))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z + -1.0) <= 5e+244) {
                  		tmp = ((x + -1.0) * log(y)) - t;
                  	} else {
                  		tmp = (y - (y * z)) - 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 ((z + (-1.0d0)) <= 5d+244) then
                          tmp = ((x + (-1.0d0)) * log(y)) - t
                      else
                          tmp = (y - (y * z)) - t
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z + -1.0) <= 5e+244) {
                  		tmp = ((x + -1.0) * Math.log(y)) - t;
                  	} else {
                  		tmp = (y - (y * z)) - t;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if (z + -1.0) <= 5e+244:
                  		tmp = ((x + -1.0) * math.log(y)) - t
                  	else:
                  		tmp = (y - (y * z)) - t
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (Float64(z + -1.0) <= 5e+244)
                  		tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t);
                  	else
                  		tmp = Float64(Float64(y - Float64(y * z)) - t);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if ((z + -1.0) <= 5e+244)
                  		tmp = ((x + -1.0) * log(y)) - t;
                  	else
                  		tmp = (y - (y * z)) - t;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[N[(z + -1.0), $MachinePrecision], 5e+244], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y - N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z + -1 \leq 5 \cdot 10^{+244}:\\
                  \;\;\;\;\left(x + -1\right) \cdot \log y - t\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(y - y \cdot z\right) - t\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (-.f64 z #s(literal 1 binary64)) < 5.00000000000000022e244

                    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

                    if 5.00000000000000022e244 < (-.f64 z #s(literal 1 binary64))

                    1. Initial program 28.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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(y, 1 - z, \log y \cdot \left(-1 + x\right)\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 rewrites88.3%

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

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

                    Alternative 9: 99.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 10: 42.2% accurate, 9.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{+33}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 2.65 \cdot 10^{+60}:\\ \;\;\;\;t + z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (if (<= t -2e+33) (- t) (if (<= t 2.65e+60) (+ t (* z (- y))) (- t))))
                    double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if (t <= -2e+33) {
                    		tmp = -t;
                    	} else if (t <= 2.65e+60) {
                    		tmp = t + (z * -y);
                    	} else {
                    		tmp = -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 (t <= (-2d+33)) then
                            tmp = -t
                        else if (t <= 2.65d+60) then
                            tmp = t + (z * -y)
                        else
                            tmp = -t
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if (t <= -2e+33) {
                    		tmp = -t;
                    	} else if (t <= 2.65e+60) {
                    		tmp = t + (z * -y);
                    	} else {
                    		tmp = -t;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t):
                    	tmp = 0
                    	if t <= -2e+33:
                    		tmp = -t
                    	elif t <= 2.65e+60:
                    		tmp = t + (z * -y)
                    	else:
                    		tmp = -t
                    	return tmp
                    
                    function code(x, y, z, t)
                    	tmp = 0.0
                    	if (t <= -2e+33)
                    		tmp = Float64(-t);
                    	elseif (t <= 2.65e+60)
                    		tmp = Float64(t + Float64(z * Float64(-y)));
                    	else
                    		tmp = Float64(-t);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t)
                    	tmp = 0.0;
                    	if (t <= -2e+33)
                    		tmp = -t;
                    	elseif (t <= 2.65e+60)
                    		tmp = t + (z * -y);
                    	else
                    		tmp = -t;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_] := If[LessEqual[t, -2e+33], (-t), If[LessEqual[t, 2.65e+60], N[(t + N[(z * (-y)), $MachinePrecision]), $MachinePrecision], (-t)]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;t \leq -2 \cdot 10^{+33}:\\
                    \;\;\;\;-t\\
                    
                    \mathbf{elif}\;t \leq 2.65 \cdot 10^{+60}:\\
                    \;\;\;\;t + z \cdot \left(-y\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;-t\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if t < -1.9999999999999999e33 or 2.6499999999999998e60 < t

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

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

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

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

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

                      if -1.9999999999999999e33 < t < 2.6499999999999998e60

                      1. Initial program 85.6%

                        \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                      2. Add Preprocessing
                      3. Taylor expanded in 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.f6418.2

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

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

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

                          \[\leadsto \left(-y\right) \cdot z - t \]
                        2. Step-by-step derivation
                          1. lift--.f64N/A

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right) \cdot z - t} \]
                          2. sub-negN/A

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right) \cdot z + \left(\mathsf{neg}\left(t\right)\right)} \]
                          3. unpow1N/A

                            \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + \left(\mathsf{neg}\left(\color{blue}{{t}^{1}}\right)\right) \]
                          4. metadata-evalN/A

                            \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + \left(\mathsf{neg}\left({t}^{\color{blue}{\left(3 - 2\right)}}\right)\right) \]
                          5. pow-divN/A

                            \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + \left(\mathsf{neg}\left(\color{blue}{\frac{{t}^{3}}{{t}^{2}}}\right)\right) \]
                          6. cube-unmultN/A

                            \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + \left(\mathsf{neg}\left(\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{{t}^{2}}\right)\right) \]
                          7. lift-*.f64N/A

                            \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + \left(\mathsf{neg}\left(\frac{t \cdot \color{blue}{\left(t \cdot t\right)}}{{t}^{2}}\right)\right) \]
                          8. lift-*.f64N/A

                            \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + \left(\mathsf{neg}\left(\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{{t}^{2}}\right)\right) \]
                          9. pow2N/A

                            \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + \left(\mathsf{neg}\left(\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{t \cdot t}}\right)\right) \]
                          10. lift-*.f64N/A

                            \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + \left(\mathsf{neg}\left(\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{t \cdot t}}\right)\right) \]
                          11. distribute-frac-negN/A

                            \[\leadsto \left(\mathsf{neg}\left(y\right)\right) \cdot z + \color{blue}{\frac{\mathsf{neg}\left(t \cdot \left(t \cdot t\right)\right)}{t \cdot t}} \]
                        3. Applied rewrites16.9%

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{+33}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 2.65 \cdot 10^{+60}:\\ \;\;\;\;t + z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 11: 47.0% accurate, 9.8× speedup?

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-1 + z\right) \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(y, -0.5, -1\right)}\right) - t \]
                          2. Final simplification44.0%

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

                          Alternative 12: 46.7% accurate, 18.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(y, 1 - z, \log y \cdot \left(-1 + x\right)\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 rewrites44.0%

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

                            Alternative 13: 46.5% accurate, 20.5× speedup?

                            \[\begin{array}{l} \\ z \cdot \left(-y\right) - 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(z * Float64(-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}
                            
                            \\
                            z \cdot \left(-y\right) - t
                            \end{array}
                            
                            Derivation
                            1. Initial program 91.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 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.f6443.8

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

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

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

                                \[\leadsto \left(-y\right) \cdot z - t \]
                              2. Final simplification43.8%

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

                              Alternative 14: 36.0% 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 91.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 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.f6435.5

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

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

                              Alternative 15: 2.3% accurate, 226.0× 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 t
                              end
                              
                              function tmp = code(x, y, z, t)
                              	tmp = t;
                              end
                              
                              code[x_, y_, z_, t_] := t
                              
                              \begin{array}{l}
                              
                              \\
                              t
                              \end{array}
                              
                              Derivation
                              1. Initial program 91.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 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.f6435.5

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

                                \[\leadsto \color{blue}{-t} \]
                              6. Step-by-step derivation
                                1. Applied rewrites6.6%

                                  \[\leadsto \frac{0 - t \cdot \left(t \cdot t\right)}{\color{blue}{0 + \mathsf{fma}\left(t, t, 0 \cdot t\right)}} \]
                                2. Step-by-step derivation
                                  1. Applied rewrites2.3%

                                    \[\leadsto t \]
                                  2. Add Preprocessing

                                  Reproduce

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