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

Percentage Accurate: 89.2% → 99.8%
Time: 15.9s
Alternatives: 23
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 23 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.2% 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.8% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(x - 1, \log y, \mathsf{fma}\left(\mathsf{log1p}\left(-y\right), z - 1, -t\right)\right)
\end{array}
Derivation
  1. Initial program 91.7%

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 75.6% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < -8e51 or 2e19 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y))))

    1. Initial program 94.3%

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

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

        \[\leadsto \color{blue}{x \cdot \log y} \]
      2. lower-log.f6475.6

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

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

    if -8e51 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 2e19

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y + -1 \cdot \log y\right) - t \]
      3. Step-by-step derivation
        1. Applied rewrites84.9%

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

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

      Alternative 3: 75.5% accurate, 0.4× speedup?

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

        1. Initial program 94.3%

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

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

            \[\leadsto \color{blue}{x \cdot \log y} \]
          2. lower-log.f6475.6

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

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

        if -8e51 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 2e19

        1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{-\log y}\right) - t \]
          10. lower-log.f6496.0

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

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

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

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

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

        Alternative 4: 99.6% accurate, 1.5× speedup?

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

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

          \[\leadsto \left(\left(x - 1\right) \cdot \log y + \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. *-commutativeN/A

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

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

            \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\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)} \cdot y\right)\right) - t \]
          4. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 5: 99.6% accurate, 1.6× speedup?

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

          \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 6: 99.6% accurate, 1.6× speedup?

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

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

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

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

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

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

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

        Alternative 7: 99.6% accurate, 1.6× speedup?

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

          \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 95.7% accurate, 1.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot \left(x - 1\right) - t\\ \mathbf{if}\;x - 1 \leq -1.00000000005:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x - 1 \leq -0.999999998:\\ \;\;\;\;\left(-\mathsf{fma}\left(z - 1, y, \log y\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (- (* (log y) (- x 1.0)) t)))
           (if (<= (- x 1.0) -1.00000000005)
             t_1
             (if (<= (- x 1.0) -0.999999998)
               (- (- (fma (- z 1.0) y (log y))) t)
               t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = (log(y) * (x - 1.0)) - t;
        	double tmp;
        	if ((x - 1.0) <= -1.00000000005) {
        		tmp = t_1;
        	} else if ((x - 1.0) <= -0.999999998) {
        		tmp = -fma((z - 1.0), y, log(y)) - t;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(Float64(log(y) * Float64(x - 1.0)) - t)
        	tmp = 0.0
        	if (Float64(x - 1.0) <= -1.00000000005)
        		tmp = t_1;
        	elseif (Float64(x - 1.0) <= -0.999999998)
        		tmp = Float64(Float64(-fma(Float64(z - 1.0), y, log(y))) - t);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[N[(x - 1.0), $MachinePrecision], -1.00000000005], t$95$1, If[LessEqual[N[(x - 1.0), $MachinePrecision], -0.999999998], N[((-N[(N[(z - 1.0), $MachinePrecision] * y + N[Log[y], $MachinePrecision]), $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \log y \cdot \left(x - 1\right) - t\\
        \mathbf{if}\;x - 1 \leq -1.00000000005:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x - 1 \leq -0.999999998:\\
        \;\;\;\;\left(-\mathsf{fma}\left(z - 1, y, \log y\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)) < -1.00000000005 or -0.999999997999999946 < (-.f64 x #s(literal 1 binary64))

          1. Initial program 95.0%

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

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

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

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

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

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

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

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

          1. Initial program 88.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 9: 99.5% accurate, 1.7× speedup?

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

            \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 10: 99.5% accurate, 1.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 11: 95.6% accurate, 1.7× speedup?

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

            1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -1.7499999999999998e-5 < t < 1.00000000000000007e-37

              1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 1.00000000000000007e-37 < t

                1. Initial program 95.6%

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

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

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

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

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

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

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

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

              Alternative 12: 88.7% accurate, 1.8× speedup?

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

                1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 54.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 13: 87.1% accurate, 1.9× speedup?

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

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

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

                        \[\leadsto \color{blue}{x \cdot \log y} - t \]
                      2. lower-log.f6492.7

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

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

                    if -1 < x < 1.8000000000000001e-15

                    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(y + -1 \cdot \log y\right) - t \]
                      3. Step-by-step derivation
                        1. Applied rewrites86.8%

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

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

                      Alternative 14: 99.1% accurate, 1.9× speedup?

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

                        \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 15: 99.1% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 16: 99.0% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 17: 64.5% accurate, 1.9× speedup?

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

                          1. Initial program 96.3%

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

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

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

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

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

                          if -9.7999999999999998e-11 < x < 7.80000000000000028e133

                          1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 18: 88.2% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 19: 88.0% accurate, 2.0× speedup?

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y} - t \]
                            6. Final simplification90.2%

                              \[\leadsto \log y \cdot \left(x - 1\right) - t \]
                            7. Add Preprocessing

                            Alternative 20: 42.8% accurate, 10.7× speedup?

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

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

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

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

                              if -2.30000000000000002e-51 < t < 1.74999999999999997e-6

                              1. Initial program 86.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 21: 42.5% accurate, 11.3× speedup?

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

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

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

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

                                  if -2.30000000000000002e-51 < t < 1.74999999999999997e-6

                                  1. Initial program 86.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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.3 \cdot 10^{-51}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-6}:\\ \;\;\;\;\left(-z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]
                                  10. Add Preprocessing

                                  Alternative 22: 46.4% accurate, 18.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 23: 35.9% 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.7%

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

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

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

                                    Reproduce

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