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

Percentage Accurate: 89.2% → 99.8%
Time: 15.5s
Alternatives: 11
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 11 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, 0.7× speedup?

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

\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Derivation
  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. Step-by-step derivation
    1. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) + \left(x - 1\right) \cdot \log y\right)} - t \]
    2. fma-def88.7%

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{z + \left(-1\right)}, \log \left(1 - y\right), \left(x - 1\right) \cdot \log y\right) - t \]
    4. metadata-eval88.7%

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

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

      \[\leadsto \mathsf{fma}\left(z + -1, \color{blue}{\mathsf{log1p}\left(-y\right)}, \left(x - 1\right) \cdot \log y\right) - t \]
    7. sub-neg99.8%

      \[\leadsto \mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \color{blue}{\left(x + \left(-1\right)\right)} \cdot \log y\right) - t \]
    8. metadata-eval99.8%

      \[\leadsto \mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \left(x + \color{blue}{-1}\right) \cdot \log y\right) - t \]
  3. Simplified99.8%

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

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

Alternative 2: 99.5% accurate, 1.8× speedup?

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

\\
\left(\left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right) - y\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Derivation
  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. Taylor expanded in y around 0 99.3%

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right)}\right) - t \]
    2. mul-1-neg99.3%

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(-0.5 \cdot {y}^{2} + \color{blue}{\left(-y\right)}\right)\right) - t \]
    3. unsub-neg99.3%

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right)}\right) - t \]
    4. *-commutative99.3%

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} - y\right)\right) - t \]
    5. unpow299.3%

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 - y\right)\right) - t \]
    6. associate-*l*99.3%

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} - y\right)\right) - t \]
  4. Simplified99.3%

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

    \[\leadsto \left(\left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right) - y\right) + \log y \cdot \left(-1 + x\right)\right) - t \]

Alternative 3: 97.8% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1 \cdot 10^{+19} \lor \neg \left(-1 + x \leq -0.5\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(-y\right) - \log y\right) - t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 x 1) < -1e19 or -0.5 < (-.f64 x 1)

    1. Initial program 93.6%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)\right)} - t \]
    3. Step-by-step derivation
      1. associate-+r+99.2%

        \[\leadsto \color{blue}{\left(\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
      2. sub-neg99.2%

        \[\leadsto \left(\left(-1 \cdot \left(y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      3. metadata-eval99.2%

        \[\leadsto \left(\left(-1 \cdot \left(y \cdot \left(z + \color{blue}{-1}\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      4. associate-*r*99.2%

        \[\leadsto \left(\left(\color{blue}{\left(-1 \cdot y\right) \cdot \left(z + -1\right)} + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      5. sub-neg99.2%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      6. metadata-eval99.2%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z + \color{blue}{-1}\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      7. associate-*r*99.2%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + \color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      8. distribute-rgt-out99.2%

        \[\leadsto \left(\color{blue}{\left(z + -1\right) \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      9. +-commutative99.2%

        \[\leadsto \left(\color{blue}{\left(-1 + z\right)} \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      10. +-commutative99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      11. mul-1-neg99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(-0.5 \cdot {y}^{2} + \color{blue}{\left(-y\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      12. unsub-neg99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      13. *-commutative99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      14. unpow299.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      15. associate-*l*99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    4. Simplified99.2%

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

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

        \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + -1 \cdot \left(y \cdot \left(z - 1\right)\right)\right)} - t \]
      2. mul-1-neg98.3%

        \[\leadsto \left(\log y \cdot \left(x - 1\right) + \color{blue}{\left(-y \cdot \left(z - 1\right)\right)}\right) - t \]
      3. unsub-neg98.3%

        \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) - y \cdot \left(z - 1\right)\right)} - t \]
      4. sub-neg98.3%

        \[\leadsto \left(\log y \cdot \color{blue}{\left(x + \left(-1\right)\right)} - y \cdot \left(z - 1\right)\right) - t \]
      5. metadata-eval98.3%

        \[\leadsto \left(\log y \cdot \left(x + \color{blue}{-1}\right) - y \cdot \left(z - 1\right)\right) - t \]
      6. +-commutative98.3%

        \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z - 1\right)\right) - t \]
      7. sub-neg98.3%

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
      8. metadata-eval98.3%

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
    7. Simplified98.3%

      \[\leadsto \color{blue}{\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right)} - t \]
    8. Taylor expanded in z around inf 98.3%

      \[\leadsto \left(\log y \cdot \left(-1 + x\right) - \color{blue}{y \cdot z}\right) - t \]
    9. Taylor expanded in x around inf 98.0%

      \[\leadsto \left(\color{blue}{x \cdot \log y} - y \cdot z\right) - t \]
    10. Step-by-step derivation
      1. *-commutative98.0%

        \[\leadsto \left(\color{blue}{\log y \cdot x} - y \cdot z\right) - t \]
    11. Simplified98.0%

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

    if -1e19 < (-.f64 x 1) < -0.5

    1. Initial program 83.0%

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

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

        \[\leadsto \color{blue}{\left(\log \left(1 - y\right) \cdot \left(z - 1\right) + -1 \cdot \log y\right)} - t \]
      2. mul-1-neg81.7%

        \[\leadsto \left(\log \left(1 - y\right) \cdot \left(z - 1\right) + \color{blue}{\left(-\log y\right)}\right) - t \]
      3. unsub-neg81.7%

        \[\leadsto \color{blue}{\left(\log \left(1 - y\right) \cdot \left(z - 1\right) - \log y\right)} - t \]
      4. sub-neg81.7%

        \[\leadsto \left(\log \color{blue}{\left(1 + \left(-y\right)\right)} \cdot \left(z - 1\right) - \log y\right) - t \]
      5. mul-1-neg81.7%

        \[\leadsto \left(\log \left(1 + \color{blue}{-1 \cdot y}\right) \cdot \left(z - 1\right) - \log y\right) - t \]
      6. log1p-def98.7%

        \[\leadsto \left(\color{blue}{\mathsf{log1p}\left(-1 \cdot y\right)} \cdot \left(z - 1\right) - \log y\right) - t \]
      7. mul-1-neg98.7%

        \[\leadsto \left(\mathsf{log1p}\left(\color{blue}{-y}\right) \cdot \left(z - 1\right) - \log y\right) - t \]
      8. sub-neg98.7%

        \[\leadsto \left(\mathsf{log1p}\left(-y\right) \cdot \color{blue}{\left(z + \left(-1\right)\right)} - \log y\right) - t \]
      9. metadata-eval98.7%

        \[\leadsto \left(\mathsf{log1p}\left(-y\right) \cdot \left(z + \color{blue}{-1}\right) - \log y\right) - t \]
      10. +-commutative98.7%

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

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

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

        \[\leadsto \left(z \cdot \log \color{blue}{\left(1 + \left(-y\right)\right)} - \log y\right) - t \]
      2. log1p-def98.7%

        \[\leadsto \left(z \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \log y\right) - t \]
    7. Simplified98.7%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \log y + -1 \cdot \left(y \cdot z\right)\right)} - t \]
    9. Step-by-step derivation
      1. neg-mul-197.8%

        \[\leadsto \left(\color{blue}{\left(-\log y\right)} + -1 \cdot \left(y \cdot z\right)\right) - t \]
      2. +-commutative97.8%

        \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot z\right) + \left(-\log y\right)\right)} - t \]
      3. unsub-neg97.8%

        \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot z\right) - \log y\right)} - t \]
      4. *-commutative97.8%

        \[\leadsto \left(-1 \cdot \color{blue}{\left(z \cdot y\right)} - \log y\right) - t \]
      5. neg-mul-197.8%

        \[\leadsto \left(\color{blue}{\left(-z \cdot y\right)} - \log y\right) - t \]
      6. distribute-rgt-neg-in97.8%

        \[\leadsto \left(\color{blue}{z \cdot \left(-y\right)} - \log y\right) - t \]
    10. Simplified97.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;-1 + x \leq -1 \cdot 10^{+19} \lor \neg \left(-1 + x \leq -0.5\right):\\ \;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(-y\right) - \log y\right) - t\\ \end{array} \]

Alternative 4: 95.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1.5 \lor \neg \left(-1 + x \leq -0.9999996\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(-y\right) - \log y\right) - t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 x 1) < -1.5 or -0.99999959999999999 < (-.f64 x 1)

    1. Initial program 93.8%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+93.8%

        \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
      2. fma-def93.8%

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{x + \left(-1\right)}, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
      4. metadata-eval93.8%

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

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

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

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

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

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

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

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

    if -1.5 < (-.f64 x 1) < -0.99999959999999999

    1. Initial program 82.4%

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

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

        \[\leadsto \color{blue}{\left(\log \left(1 - y\right) \cdot \left(z - 1\right) + -1 \cdot \log y\right)} - t \]
      2. mul-1-neg82.4%

        \[\leadsto \left(\log \left(1 - y\right) \cdot \left(z - 1\right) + \color{blue}{\left(-\log y\right)}\right) - t \]
      3. unsub-neg82.4%

        \[\leadsto \color{blue}{\left(\log \left(1 - y\right) \cdot \left(z - 1\right) - \log y\right)} - t \]
      4. sub-neg82.4%

        \[\leadsto \left(\log \color{blue}{\left(1 + \left(-y\right)\right)} \cdot \left(z - 1\right) - \log y\right) - t \]
      5. mul-1-neg82.4%

        \[\leadsto \left(\log \left(1 + \color{blue}{-1 \cdot y}\right) \cdot \left(z - 1\right) - \log y\right) - t \]
      6. log1p-def100.0%

        \[\leadsto \left(\color{blue}{\mathsf{log1p}\left(-1 \cdot y\right)} \cdot \left(z - 1\right) - \log y\right) - t \]
      7. mul-1-neg100.0%

        \[\leadsto \left(\mathsf{log1p}\left(\color{blue}{-y}\right) \cdot \left(z - 1\right) - \log y\right) - t \]
      8. sub-neg100.0%

        \[\leadsto \left(\mathsf{log1p}\left(-y\right) \cdot \color{blue}{\left(z + \left(-1\right)\right)} - \log y\right) - t \]
      9. metadata-eval100.0%

        \[\leadsto \left(\mathsf{log1p}\left(-y\right) \cdot \left(z + \color{blue}{-1}\right) - \log y\right) - t \]
      10. +-commutative100.0%

        \[\leadsto \left(\mathsf{log1p}\left(-y\right) \cdot \color{blue}{\left(-1 + z\right)} - \log y\right) - t \]
    4. Simplified100.0%

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

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

        \[\leadsto \left(z \cdot \log \color{blue}{\left(1 + \left(-y\right)\right)} - \log y\right) - t \]
      2. log1p-def100.0%

        \[\leadsto \left(z \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \log y\right) - t \]
    7. Simplified100.0%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \log y + -1 \cdot \left(y \cdot z\right)\right)} - t \]
    9. Step-by-step derivation
      1. neg-mul-199.0%

        \[\leadsto \left(\color{blue}{\left(-\log y\right)} + -1 \cdot \left(y \cdot z\right)\right) - t \]
      2. +-commutative99.0%

        \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot z\right) + \left(-\log y\right)\right)} - t \]
      3. unsub-neg99.0%

        \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot z\right) - \log y\right)} - t \]
      4. *-commutative99.0%

        \[\leadsto \left(-1 \cdot \color{blue}{\left(z \cdot y\right)} - \log y\right) - t \]
      5. neg-mul-199.0%

        \[\leadsto \left(\color{blue}{\left(-z \cdot y\right)} - \log y\right) - t \]
      6. distribute-rgt-neg-in99.0%

        \[\leadsto \left(\color{blue}{z \cdot \left(-y\right)} - \log y\right) - t \]
    10. Simplified99.0%

      \[\leadsto \color{blue}{\left(z \cdot \left(-y\right) - \log y\right)} - t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;-1 + x \leq -1.5 \lor \neg \left(-1 + x \leq -0.9999996\right):\\ \;\;\;\;\log y \cdot \left(-1 + x\right) - t\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(-y\right) - \log y\right) - t\\ \end{array} \]

Alternative 5: 99.0% accurate, 1.9× speedup?

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

\\
\left(\log y \cdot \left(-1 + x\right) - z \cdot y\right) - t
\end{array}
Derivation
  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. Taylor expanded in y around 0 99.5%

    \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)\right)} - t \]
  3. Step-by-step derivation
    1. associate-+r+99.5%

      \[\leadsto \color{blue}{\left(\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    2. sub-neg99.5%

      \[\leadsto \left(\left(-1 \cdot \left(y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    3. metadata-eval99.5%

      \[\leadsto \left(\left(-1 \cdot \left(y \cdot \left(z + \color{blue}{-1}\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    4. associate-*r*99.5%

      \[\leadsto \left(\left(\color{blue}{\left(-1 \cdot y\right) \cdot \left(z + -1\right)} + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    5. sub-neg99.5%

      \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    6. metadata-eval99.5%

      \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z + \color{blue}{-1}\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    7. associate-*r*99.5%

      \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + \color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    8. distribute-rgt-out99.5%

      \[\leadsto \left(\color{blue}{\left(z + -1\right) \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    9. +-commutative99.5%

      \[\leadsto \left(\color{blue}{\left(-1 + z\right)} \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    10. +-commutative99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    11. mul-1-neg99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(-0.5 \cdot {y}^{2} + \color{blue}{\left(-y\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    12. unsub-neg99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    13. *-commutative99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    14. unpow299.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    15. associate-*l*99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
  4. Simplified99.5%

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

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

      \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + -1 \cdot \left(y \cdot \left(z - 1\right)\right)\right)} - t \]
    2. mul-1-neg98.6%

      \[\leadsto \left(\log y \cdot \left(x - 1\right) + \color{blue}{\left(-y \cdot \left(z - 1\right)\right)}\right) - t \]
    3. unsub-neg98.6%

      \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) - y \cdot \left(z - 1\right)\right)} - t \]
    4. sub-neg98.6%

      \[\leadsto \left(\log y \cdot \color{blue}{\left(x + \left(-1\right)\right)} - y \cdot \left(z - 1\right)\right) - t \]
    5. metadata-eval98.6%

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

      \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z - 1\right)\right) - t \]
    7. sub-neg98.6%

      \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
    8. metadata-eval98.6%

      \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
  7. Simplified98.6%

    \[\leadsto \color{blue}{\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right)} - t \]
  8. Taylor expanded in z around inf 98.6%

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

    \[\leadsto \left(\log y \cdot \left(-1 + x\right) - z \cdot y\right) - t \]

Alternative 6: 87.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3700000 \lor \neg \left(x \leq 1\right):\\
\;\;\;\;x \cdot \log y - t\\

\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7e6 or 1 < x

    1. Initial program 93.6%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)\right)} - t \]
    3. Step-by-step derivation
      1. associate-+r+99.2%

        \[\leadsto \color{blue}{\left(\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
      2. sub-neg99.2%

        \[\leadsto \left(\left(-1 \cdot \left(y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      3. metadata-eval99.2%

        \[\leadsto \left(\left(-1 \cdot \left(y \cdot \left(z + \color{blue}{-1}\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      4. associate-*r*99.2%

        \[\leadsto \left(\left(\color{blue}{\left(-1 \cdot y\right) \cdot \left(z + -1\right)} + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      5. sub-neg99.2%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      6. metadata-eval99.2%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z + \color{blue}{-1}\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      7. associate-*r*99.2%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + \color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      8. distribute-rgt-out99.2%

        \[\leadsto \left(\color{blue}{\left(z + -1\right) \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      9. +-commutative99.2%

        \[\leadsto \left(\color{blue}{\left(-1 + z\right)} \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      10. +-commutative99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      11. mul-1-neg99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(-0.5 \cdot {y}^{2} + \color{blue}{\left(-y\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      12. unsub-neg99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      13. *-commutative99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      14. unpow299.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      15. associate-*l*99.2%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    4. Simplified99.2%

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

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

        \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + -1 \cdot \left(y \cdot \left(z - 1\right)\right)\right)} - t \]
      2. mul-1-neg98.3%

        \[\leadsto \left(\log y \cdot \left(x - 1\right) + \color{blue}{\left(-y \cdot \left(z - 1\right)\right)}\right) - t \]
      3. unsub-neg98.3%

        \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) - y \cdot \left(z - 1\right)\right)} - t \]
      4. sub-neg98.3%

        \[\leadsto \left(\log y \cdot \color{blue}{\left(x + \left(-1\right)\right)} - y \cdot \left(z - 1\right)\right) - t \]
      5. metadata-eval98.3%

        \[\leadsto \left(\log y \cdot \left(x + \color{blue}{-1}\right) - y \cdot \left(z - 1\right)\right) - t \]
      6. +-commutative98.3%

        \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z - 1\right)\right) - t \]
      7. sub-neg98.3%

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
      8. metadata-eval98.3%

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
    7. Simplified98.3%

      \[\leadsto \color{blue}{\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right)} - t \]
    8. Taylor expanded in x around inf 91.3%

      \[\leadsto \color{blue}{x \cdot \log y} - t \]
    9. Step-by-step derivation
      1. *-commutative91.3%

        \[\leadsto \color{blue}{\log y \cdot x} - t \]
    10. Simplified91.3%

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

    if -3.7e6 < x < 1

    1. Initial program 83.0%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+83.0%

        \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
      2. fma-def83.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x + -1, \log y, \mathsf{fma}\left(z + -1, \log \color{blue}{\left(1 + \left(-y\right)\right)}, -t\right)\right) \]
      9. log1p-def100.0%

        \[\leadsto \mathsf{fma}\left(x + -1, \log y, \mathsf{fma}\left(z + -1, \color{blue}{\mathsf{log1p}\left(-y\right)}, -t\right)\right) \]
    3. Simplified100.0%

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

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

      \[\leadsto \color{blue}{-1 \cdot \log y} - t \]
    6. Step-by-step derivation
      1. neg-mul-180.2%

        \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    7. Simplified80.2%

      \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.2%

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

Alternative 7: 89.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.6 \cdot 10^{+198}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.5999999999999999e198

    1. Initial program 93.2%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+93.2%

        \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
      2. fma-def93.2%

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{x + \left(-1\right)}, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
      4. metadata-eval93.2%

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

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

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

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

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

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

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

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

    if 1.5999999999999999e198 < z

    1. Initial program 51.4%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)\right)} - t \]
    3. Step-by-step derivation
      1. associate-+r+99.8%

        \[\leadsto \color{blue}{\left(\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
      2. sub-neg99.8%

        \[\leadsto \left(\left(-1 \cdot \left(y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      3. metadata-eval99.8%

        \[\leadsto \left(\left(-1 \cdot \left(y \cdot \left(z + \color{blue}{-1}\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      4. associate-*r*99.8%

        \[\leadsto \left(\left(\color{blue}{\left(-1 \cdot y\right) \cdot \left(z + -1\right)} + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      5. sub-neg99.8%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      6. metadata-eval99.8%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z + \color{blue}{-1}\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      7. associate-*r*99.8%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + \color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      8. distribute-rgt-out99.9%

        \[\leadsto \left(\color{blue}{\left(z + -1\right) \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      9. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(-1 + z\right)} \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      10. +-commutative99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      11. mul-1-neg99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(-0.5 \cdot {y}^{2} + \color{blue}{\left(-y\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      12. unsub-neg99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      13. *-commutative99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      14. unpow299.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      15. associate-*l*99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    4. Simplified99.9%

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

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

        \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + -1 \cdot \left(y \cdot \left(z - 1\right)\right)\right)} - t \]
      2. mul-1-neg96.8%

        \[\leadsto \left(\log y \cdot \left(x - 1\right) + \color{blue}{\left(-y \cdot \left(z - 1\right)\right)}\right) - t \]
      3. unsub-neg96.8%

        \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) - y \cdot \left(z - 1\right)\right)} - t \]
      4. sub-neg96.8%

        \[\leadsto \left(\log y \cdot \color{blue}{\left(x + \left(-1\right)\right)} - y \cdot \left(z - 1\right)\right) - t \]
      5. metadata-eval96.8%

        \[\leadsto \left(\log y \cdot \left(x + \color{blue}{-1}\right) - y \cdot \left(z - 1\right)\right) - t \]
      6. +-commutative96.8%

        \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z - 1\right)\right) - t \]
      7. sub-neg96.8%

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
      8. metadata-eval96.8%

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
    7. Simplified96.8%

      \[\leadsto \color{blue}{\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right)} - t \]
    8. Taylor expanded in z around inf 65.7%

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

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot y\right)} - t \]
      2. neg-mul-165.7%

        \[\leadsto \color{blue}{\left(-z \cdot y\right)} - t \]
      3. distribute-rgt-neg-in65.7%

        \[\leadsto \color{blue}{z \cdot \left(-y\right)} - t \]
    10. Simplified65.7%

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

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

Alternative 8: 60.2% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+121} \lor \neg \left(z \leq 1.8 \cdot 10^{+197}\right):\\ \;\;\;\;z \cdot \left(-y\right) - t\\ \mathbf{else}:\\ \;\;\;\;\left(-\log y\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -4e+121) (not (<= z 1.8e+197)))
   (- (* z (- y)) t)
   (- (- (log y)) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -4e+121) || !(z <= 1.8e+197)) {
		tmp = (z * -y) - t;
	} else {
		tmp = -log(y) - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-4d+121)) .or. (.not. (z <= 1.8d+197))) then
        tmp = (z * -y) - t
    else
        tmp = -log(y) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -4e+121) || !(z <= 1.8e+197)) {
		tmp = (z * -y) - t;
	} else {
		tmp = -Math.log(y) - t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -4e+121) or not (z <= 1.8e+197):
		tmp = (z * -y) - t
	else:
		tmp = -math.log(y) - t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -4e+121) || !(z <= 1.8e+197))
		tmp = Float64(Float64(z * Float64(-y)) - t);
	else
		tmp = Float64(Float64(-log(y)) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -4e+121) || ~((z <= 1.8e+197)))
		tmp = (z * -y) - t;
	else
		tmp = -log(y) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4e+121], N[Not[LessEqual[z, 1.8e+197]], $MachinePrecision]], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+121} \lor \neg \left(z \leq 1.8 \cdot 10^{+197}\right):\\
\;\;\;\;z \cdot \left(-y\right) - t\\

\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.00000000000000015e121 or 1.79999999999999991e197 < z

    1. Initial program 64.6%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)\right)} - t \]
    3. Step-by-step derivation
      1. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
      2. sub-neg99.9%

        \[\leadsto \left(\left(-1 \cdot \left(y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      3. metadata-eval99.9%

        \[\leadsto \left(\left(-1 \cdot \left(y \cdot \left(z + \color{blue}{-1}\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      4. associate-*r*99.9%

        \[\leadsto \left(\left(\color{blue}{\left(-1 \cdot y\right) \cdot \left(z + -1\right)} + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      5. sub-neg99.9%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      6. metadata-eval99.9%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z + \color{blue}{-1}\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      7. associate-*r*99.9%

        \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + \color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      8. distribute-rgt-out99.9%

        \[\leadsto \left(\color{blue}{\left(z + -1\right) \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      9. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(-1 + z\right)} \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      10. +-commutative99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      11. mul-1-neg99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(-0.5 \cdot {y}^{2} + \color{blue}{\left(-y\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      12. unsub-neg99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      13. *-commutative99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      14. unpow299.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
      15. associate-*l*99.9%

        \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    4. Simplified99.9%

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

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

        \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + -1 \cdot \left(y \cdot \left(z - 1\right)\right)\right)} - t \]
      2. mul-1-neg97.9%

        \[\leadsto \left(\log y \cdot \left(x - 1\right) + \color{blue}{\left(-y \cdot \left(z - 1\right)\right)}\right) - t \]
      3. unsub-neg97.9%

        \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) - y \cdot \left(z - 1\right)\right)} - t \]
      4. sub-neg97.9%

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

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

        \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z - 1\right)\right) - t \]
      7. sub-neg97.9%

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
      8. metadata-eval97.9%

        \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
    7. Simplified97.9%

      \[\leadsto \color{blue}{\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right)} - t \]
    8. Taylor expanded in z around inf 64.4%

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

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot y\right)} - t \]
      2. neg-mul-164.4%

        \[\leadsto \color{blue}{\left(-z \cdot y\right)} - t \]
      3. distribute-rgt-neg-in64.4%

        \[\leadsto \color{blue}{z \cdot \left(-y\right)} - t \]
    10. Simplified64.4%

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

    if -4.00000000000000015e121 < z < 1.79999999999999991e197

    1. Initial program 97.7%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+97.7%

        \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
      2. fma-def97.7%

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{x + \left(-1\right)}, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
      4. metadata-eval97.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \log y} - t \]
    6. Step-by-step derivation
      1. neg-mul-156.4%

        \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    7. Simplified56.4%

      \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+121} \lor \neg \left(z \leq 1.8 \cdot 10^{+197}\right):\\ \;\;\;\;z \cdot \left(-y\right) - t\\ \mathbf{else}:\\ \;\;\;\;\left(-\log y\right) - t\\ \end{array} \]

Alternative 9: 46.8% accurate, 30.7× speedup?

\[\begin{array}{l} \\ y \cdot \left(1 - z\right) - t \end{array} \]
(FPCore (x y z t) :precision binary64 (- (* y (- 1.0 z)) t))
double code(double x, double y, double z, double t) {
	return (y * (1.0 - z)) - t;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (y * (1.0d0 - z)) - t
end function
public static double code(double x, double y, double z, double t) {
	return (y * (1.0 - z)) - t;
}
def code(x, y, z, t):
	return (y * (1.0 - z)) - t
function code(x, y, z, t)
	return Float64(Float64(y * Float64(1.0 - z)) - t)
end
function tmp = code(x, y, z, t)
	tmp = (y * (1.0 - z)) - t;
end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}

\\
y \cdot \left(1 - z\right) - t
\end{array}
Derivation
  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. Taylor expanded in y around 0 99.5%

    \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)\right)} - t \]
  3. Step-by-step derivation
    1. associate-+r+99.5%

      \[\leadsto \color{blue}{\left(\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    2. sub-neg99.5%

      \[\leadsto \left(\left(-1 \cdot \left(y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    3. metadata-eval99.5%

      \[\leadsto \left(\left(-1 \cdot \left(y \cdot \left(z + \color{blue}{-1}\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    4. associate-*r*99.5%

      \[\leadsto \left(\left(\color{blue}{\left(-1 \cdot y\right) \cdot \left(z + -1\right)} + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    5. sub-neg99.5%

      \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    6. metadata-eval99.5%

      \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z + \color{blue}{-1}\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    7. associate-*r*99.5%

      \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + \color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    8. distribute-rgt-out99.5%

      \[\leadsto \left(\color{blue}{\left(z + -1\right) \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    9. +-commutative99.5%

      \[\leadsto \left(\color{blue}{\left(-1 + z\right)} \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    10. +-commutative99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    11. mul-1-neg99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(-0.5 \cdot {y}^{2} + \color{blue}{\left(-y\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    12. unsub-neg99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    13. *-commutative99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    14. unpow299.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    15. associate-*l*99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
  4. Simplified99.5%

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

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

      \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + -1 \cdot \left(y \cdot \left(z - 1\right)\right)\right)} - t \]
    2. mul-1-neg98.6%

      \[\leadsto \left(\log y \cdot \left(x - 1\right) + \color{blue}{\left(-y \cdot \left(z - 1\right)\right)}\right) - t \]
    3. unsub-neg98.6%

      \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) - y \cdot \left(z - 1\right)\right)} - t \]
    4. sub-neg98.6%

      \[\leadsto \left(\log y \cdot \color{blue}{\left(x + \left(-1\right)\right)} - y \cdot \left(z - 1\right)\right) - t \]
    5. metadata-eval98.6%

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

      \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z - 1\right)\right) - t \]
    7. sub-neg98.6%

      \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
    8. metadata-eval98.6%

      \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
  7. Simplified98.6%

    \[\leadsto \color{blue}{\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right)} - t \]
  8. Taylor expanded in y around inf 45.1%

    \[\leadsto \color{blue}{y \cdot \left(1 - z\right)} - t \]
  9. Final simplification45.1%

    \[\leadsto y \cdot \left(1 - z\right) - t \]

Alternative 10: 46.6% accurate, 35.8× speedup?

\[\begin{array}{l} \\ z \cdot \left(-y\right) - t \end{array} \]
(FPCore (x y z t) :precision binary64 (- (* z (- y)) t))
double code(double x, double y, double z, double t) {
	return (z * -y) - t;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (z * -y) - t
end function
public static double code(double x, double y, double z, double t) {
	return (z * -y) - t;
}
def code(x, y, z, t):
	return (z * -y) - t
function code(x, y, z, t)
	return Float64(Float64(z * Float64(-y)) - t)
end
function tmp = code(x, y, z, t)
	tmp = (z * -y) - t;
end
code[x_, y_, z_, t_] := N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}

\\
z \cdot \left(-y\right) - t
\end{array}
Derivation
  1. Initial program 88.7%

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

    \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)\right)} - t \]
  3. Step-by-step derivation
    1. associate-+r+99.5%

      \[\leadsto \color{blue}{\left(\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    2. sub-neg99.5%

      \[\leadsto \left(\left(-1 \cdot \left(y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    3. metadata-eval99.5%

      \[\leadsto \left(\left(-1 \cdot \left(y \cdot \left(z + \color{blue}{-1}\right)\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    4. associate-*r*99.5%

      \[\leadsto \left(\left(\color{blue}{\left(-1 \cdot y\right) \cdot \left(z + -1\right)} + -0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    5. sub-neg99.5%

      \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    6. metadata-eval99.5%

      \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + -0.5 \cdot \left({y}^{2} \cdot \left(z + \color{blue}{-1}\right)\right)\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    7. associate-*r*99.5%

      \[\leadsto \left(\left(\left(-1 \cdot y\right) \cdot \left(z + -1\right) + \color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    8. distribute-rgt-out99.5%

      \[\leadsto \left(\color{blue}{\left(z + -1\right) \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    9. +-commutative99.5%

      \[\leadsto \left(\color{blue}{\left(-1 + z\right)} \cdot \left(-1 \cdot y + -0.5 \cdot {y}^{2}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    10. +-commutative99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} + -1 \cdot y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    11. mul-1-neg99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(-0.5 \cdot {y}^{2} + \color{blue}{\left(-y\right)}\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    12. unsub-neg99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right)} + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    13. *-commutative99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    14. unpow299.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
    15. associate-*l*99.5%

      \[\leadsto \left(\left(-1 + z\right) \cdot \left(\color{blue}{y \cdot \left(y \cdot -0.5\right)} - y\right) + \left(-0.3333333333333333 \cdot \left({y}^{3} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right) - t \]
  4. Simplified99.5%

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

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

      \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) + -1 \cdot \left(y \cdot \left(z - 1\right)\right)\right)} - t \]
    2. mul-1-neg98.6%

      \[\leadsto \left(\log y \cdot \left(x - 1\right) + \color{blue}{\left(-y \cdot \left(z - 1\right)\right)}\right) - t \]
    3. unsub-neg98.6%

      \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1\right) - y \cdot \left(z - 1\right)\right)} - t \]
    4. sub-neg98.6%

      \[\leadsto \left(\log y \cdot \color{blue}{\left(x + \left(-1\right)\right)} - y \cdot \left(z - 1\right)\right) - t \]
    5. metadata-eval98.6%

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

      \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z - 1\right)\right) - t \]
    7. sub-neg98.6%

      \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
    8. metadata-eval98.6%

      \[\leadsto \left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
  7. Simplified98.6%

    \[\leadsto \color{blue}{\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right)} - t \]
  8. Taylor expanded in z around inf 45.0%

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

      \[\leadsto -1 \cdot \color{blue}{\left(z \cdot y\right)} - t \]
    2. neg-mul-145.0%

      \[\leadsto \color{blue}{\left(-z \cdot y\right)} - t \]
    3. distribute-rgt-neg-in45.0%

      \[\leadsto \color{blue}{z \cdot \left(-y\right)} - t \]
  10. Simplified45.0%

    \[\leadsto \color{blue}{z \cdot \left(-y\right)} - t \]
  11. Final simplification45.0%

    \[\leadsto z \cdot \left(-y\right) - t \]

Alternative 11: 36.2% accurate, 107.5× 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 88.7%

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. fma-def88.7%

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{x + \left(-1\right)}, \log y, \left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) \]
    4. metadata-eval88.7%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot t} \]
  5. Step-by-step derivation
    1. mul-1-neg34.7%

      \[\leadsto \color{blue}{-t} \]
  6. Simplified34.7%

    \[\leadsto \color{blue}{-t} \]
  7. Final simplification34.7%

    \[\leadsto -t \]

Reproduce

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