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

Percentage Accurate: 89.3% → 99.8%
Time: 16.0s
Alternatives: 18
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 18 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.3% 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{log1p}\left(-y\right) \cdot \left(z + -1\right) - \mathsf{fma}\left(\log y, 1 - x, t\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- (* (log1p (- y)) (+ z -1.0)) (fma (log y) (- 1.0 x) t)))
double code(double x, double y, double z, double t) {
	return (log1p(-y) * (z + -1.0)) - fma(log(y), (1.0 - x), t);
}
function code(x, y, z, t)
	return Float64(Float64(log1p(Float64(-y)) * Float64(z + -1.0)) - fma(log(y), Float64(1.0 - x), t))
end
code[x_, y_, z_, t_] := N[(N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * N[(1.0 - x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)
\end{array}
Derivation
  1. Initial program 90.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+90.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. +-commutative90.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.9%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.9%

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

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

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.9%

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 1.0× speedup?

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

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

    \[\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.6%

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

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

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

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

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

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

Alternative 3: 99.5% accurate, 1.8× speedup?

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

\\
\left(\log y \cdot \left(-1 + x\right) + \left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right) - y\right)\right) - t
\end{array}
Derivation
  1. Initial program 90.2%

    \[\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.6%

    \[\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 \]
  3. Step-by-step derivation
    1. mul-1-neg99.6%

      \[\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 \]
    2. unsub-neg99.6%

      \[\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 \]
    3. *-commutative99.6%

      \[\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 \]
    4. unpow299.6%

      \[\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 \]
    5. associate-*l*99.6%

      \[\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.6%

    \[\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.6%

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

Alternative 4: 88.2% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 90.5%

      \[\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 89.0%

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

    if -1 < (-.f64 x 1) < -0.99999999999974998

    1. Initial program 53.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 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(-y\right) \cdot \color{blue}{\left(-1 + z\right)} - \log y\right) - t \]
      12. distribute-rgt-in99.2%

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

        \[\leadsto \left(\left(\color{blue}{\left(-\left(-y\right)\right)} + z \cdot \left(-y\right)\right) - \log y\right) - t \]
      14. remove-double-neg99.2%

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

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

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

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

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

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

Alternative 5: 64.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+171}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -5 \cdot 10^{+90}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\

\mathbf{elif}\;x \leq -5000000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -6 \cdot 10^{-43}:\\
\;\;\;\;\left(y - z \cdot y\right) - t\\

\mathbf{elif}\;x \leq -1 \cdot 10^{-66}:\\
\;\;\;\;-\log y\\

\mathbf{elif}\;x \leq 1950000:\\
\;\;\;\;\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -3.4999999999999999e171 or -5.0000000000000004e90 < x < -5e12 or 1.95e6 < x

    1. Initial program 96.0%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+96.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. +-commutative96.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.7%

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

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

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.7%

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

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

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

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

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

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

    if -3.4999999999999999e171 < x < -5.0000000000000004e90

    1. Initial program 86.6%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} - t \]
    6. Step-by-step derivation
      1. associate-*r*72.8%

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

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

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

    if -5e12 < x < -6.00000000000000007e-43

    1. Initial program 99.8%

      \[\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 \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(-1 \cdot y\right)}\right) - t \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \left(z + -1\right)\right)} - t \]
      4. distribute-lft-in55.7%

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

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

        \[\leadsto -1 \cdot \left(y \cdot z + \color{blue}{\left(-y\right)}\right) - t \]
      7. distribute-lft-in55.7%

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

        \[\leadsto \left(-1 \cdot \left(y \cdot z\right) + \color{blue}{\left(-\left(-y\right)\right)}\right) - t \]
      9. remove-double-neg55.7%

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

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

        \[\leadsto \left(y + \color{blue}{\left(-y \cdot z\right)}\right) - t \]
      12. unsub-neg55.7%

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

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

    if -6.00000000000000007e-43 < x < -9.9999999999999998e-67

    1. Initial program 100.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 y around 0 100.0%

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

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

        \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    5. Simplified100.0%

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

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

    if -9.9999999999999998e-67 < x < 1.95e6

    1. Initial program 83.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.5%

      \[\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 \]
    3. Step-by-step derivation
      1. mul-1-neg99.5%

        \[\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 \]
      2. unsub-neg99.5%

        \[\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 \]
      3. *-commutative99.5%

        \[\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 \]
      4. unpow299.5%

        \[\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 \]
      5. associate-*l*99.5%

        \[\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.5%

      \[\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. Taylor expanded in y around inf 71.7%

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

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

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

        \[\leadsto \left(-0.5 \cdot \left(\color{blue}{\left(z + \left(-1\right)\right)} \cdot {y}^{2}\right) + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      4. metadata-eval71.7%

        \[\leadsto \left(-0.5 \cdot \left(\left(z + \color{blue}{-1}\right) \cdot {y}^{2}\right) + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      5. *-commutative71.7%

        \[\leadsto \left(-0.5 \cdot \color{blue}{\left({y}^{2} \cdot \left(z + -1\right)\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      6. associate-*r*71.7%

        \[\leadsto \left(\color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      7. sub-neg71.7%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \left(-\color{blue}{\left(z + \left(-1\right)\right)} \cdot y\right)\right) - t \]
      8. metadata-eval71.7%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \left(-\left(z + \color{blue}{-1}\right) \cdot y\right)\right) - t \]
      9. distribute-rgt-neg-out71.7%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(z + -1\right) \cdot \left(-y\right)}\right) - t \]
      10. *-commutative71.7%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(-y\right) \cdot \left(z + -1\right)}\right) - t \]
      11. distribute-rgt-in71.7%

        \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(-0.5 \cdot {y}^{2} + \left(-y\right)\right)} - t \]
      12. *-commutative71.7%

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} + \left(-y\right)\right) - t \]
      13. unpow271.7%

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 + \left(-y\right)\right) - t \]
      14. sub-neg71.7%

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\left(\left(y \cdot y\right) \cdot -0.5 - y\right)} - t \]
    7. Simplified71.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{+171}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \leq -5 \cdot 10^{+90}:\\ \;\;\;\;z \cdot \left(-y\right) - t\\ \mathbf{elif}\;x \leq -5000000000000:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-43}:\\ \;\;\;\;\left(y - z \cdot y\right) - t\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-66}:\\ \;\;\;\;-\log y\\ \mathbf{elif}\;x \leq 1950000:\\ \;\;\;\;\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x\\ \end{array} \]

Alternative 6: 99.2% accurate, 1.9× speedup?

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

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

    \[\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.1%

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

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

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

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

Alternative 7: 74.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+171}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -1.62 \cdot 10^{+90}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\

\mathbf{elif}\;x \leq -2.8 \cdot 10^{+14} \lor \neg \left(x \leq 265000\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.4999999999999999e171 or -1.62e90 < x < -2.8e14 or 265000 < x

    1. Initial program 96.0%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+96.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. +-commutative96.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.7%

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

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

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.7%

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

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

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

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

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

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

    if -3.4999999999999999e171 < x < -1.62e90

    1. Initial program 86.6%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} - t \]
    6. Step-by-step derivation
      1. associate-*r*72.8%

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

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

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

    if -2.8e14 < x < 265000

    1. Initial program 86.1%

      \[\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 84.5%

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

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

        \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    5. Simplified82.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{+171}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \leq -1.62 \cdot 10^{+90}:\\ \;\;\;\;z \cdot \left(-y\right) - t\\ \mathbf{elif}\;x \leq -2.8 \cdot 10^{+14} \lor \neg \left(x \leq 265000\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) - \log y\\ \end{array} \]

Alternative 8: 86.1% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.4000000000000001e-31

    1. Initial program 92.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 y around 0 92.0%

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

    if 3.4000000000000001e-31 < y

    1. Initial program 74.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+74.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. +-commutative74.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.9%

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

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

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.9%

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

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

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

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

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

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.6%

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

Alternative 9: 87.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+14} \lor \neg \left(t \leq 240\right):\\
\;\;\;\;\log y \cdot x - t\\

\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7e14 or 240 < t

    1. Initial program 96.2%

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

      \[\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 \]
    3. Step-by-step derivation
      1. mul-1-neg99.9%

        \[\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 \]
      2. unsub-neg99.9%

        \[\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 \]
      3. *-commutative99.9%

        \[\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 \]
      4. unpow299.9%

        \[\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 \]
      5. associate-*l*99.9%

        \[\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.9%

      \[\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. Taylor expanded in x around inf 95.9%

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

    if -7e14 < t < 240

    1. Initial program 84.6%

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

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y} - t \]
    3. Step-by-step derivation
      1. fma-neg82.0%

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

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

        \[\leadsto \mathsf{fma}\left(x + \color{blue}{-1}, \log y, -t\right) \]
    4. Applied egg-rr82.0%

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

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

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

Alternative 10: 78.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{+20}:\\ \;\;\;\;z \cdot \left(-y\right) - t\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{+64}:\\ \;\;\;\;\log y \cdot \left(-1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -2.6e+20)
   (- (* z (- y)) t)
   (if (<= t 1.95e+64)
     (* (log y) (+ -1.0 x))
     (- (* (+ z -1.0) (- (* (* y y) -0.5) y)) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -2.6e+20) {
		tmp = (z * -y) - t;
	} else if (t <= 1.95e+64) {
		tmp = log(y) * (-1.0 + x);
	} else {
		tmp = ((z + -1.0) * (((y * y) * -0.5) - 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 (t <= (-2.6d+20)) then
        tmp = (z * -y) - t
    else if (t <= 1.95d+64) then
        tmp = log(y) * ((-1.0d0) + x)
    else
        tmp = ((z + (-1.0d0)) * (((y * y) * (-0.5d0)) - y)) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -2.6e+20) {
		tmp = (z * -y) - t;
	} else if (t <= 1.95e+64) {
		tmp = Math.log(y) * (-1.0 + x);
	} else {
		tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -2.6e+20:
		tmp = (z * -y) - t
	elif t <= 1.95e+64:
		tmp = math.log(y) * (-1.0 + x)
	else:
		tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -2.6e+20)
		tmp = Float64(Float64(z * Float64(-y)) - t);
	elseif (t <= 1.95e+64)
		tmp = Float64(log(y) * Float64(-1.0 + x));
	else
		tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(Float64(y * y) * -0.5) - y)) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -2.6e+20)
		tmp = (z * -y) - t;
	elseif (t <= 1.95e+64)
		tmp = log(y) * (-1.0 + x);
	else
		tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.6e+20], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 1.95e+64], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+20}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\

\mathbf{elif}\;t \leq 1.95 \cdot 10^{+64}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.6e20

    1. Initial program 98.2%

      \[\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 \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(-1 \cdot y\right)}\right) - t \]
    3. Step-by-step derivation
      1. mul-1-neg99.9%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} - t \]
    6. Step-by-step derivation
      1. associate-*r*78.9%

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

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

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

    if -2.6e20 < t < 1.9499999999999999e64

    1. Initial program 85.3%

      \[\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 82.9%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y} - t \]
    3. Step-by-step derivation
      1. fma-neg83.0%

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

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

        \[\leadsto \mathsf{fma}\left(x + \color{blue}{-1}, \log y, -t\right) \]
    4. Applied egg-rr83.0%

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

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

    if 1.9499999999999999e64 < t

    1. Initial program 95.0%

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

      \[\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 \]
    3. Step-by-step derivation
      1. mul-1-neg99.9%

        \[\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 \]
      2. unsub-neg99.9%

        \[\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 \]
      3. *-commutative99.9%

        \[\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 \]
      4. unpow299.9%

        \[\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 \]
      5. associate-*l*99.9%

        \[\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.9%

      \[\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. Taylor expanded in y around inf 87.1%

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

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

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

        \[\leadsto \left(-0.5 \cdot \left(\color{blue}{\left(z + \left(-1\right)\right)} \cdot {y}^{2}\right) + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      4. metadata-eval87.1%

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

        \[\leadsto \left(-0.5 \cdot \color{blue}{\left({y}^{2} \cdot \left(z + -1\right)\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      6. associate-*r*87.1%

        \[\leadsto \left(\color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      7. sub-neg87.1%

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

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \left(-\left(z + \color{blue}{-1}\right) \cdot y\right)\right) - t \]
      9. distribute-rgt-neg-out87.1%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(z + -1\right) \cdot \left(-y\right)}\right) - t \]
      10. *-commutative87.1%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(-y\right) \cdot \left(z + -1\right)}\right) - t \]
      11. distribute-rgt-in87.1%

        \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(-0.5 \cdot {y}^{2} + \left(-y\right)\right)} - t \]
      12. *-commutative87.1%

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} + \left(-y\right)\right) - t \]
      13. unpow287.1%

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 + \left(-y\right)\right) - t \]
      14. sub-neg87.1%

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\left(\left(y \cdot y\right) \cdot -0.5 - y\right)} - t \]
    7. Simplified87.1%

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

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

Alternative 11: 85.8% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.9000000000000001e-31

    1. Initial program 92.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 y around 0 92.0%

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

    if 2.9000000000000001e-31 < y

    1. Initial program 74.8%

      \[\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 96.9%

      \[\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 \]
    3. Step-by-step derivation
      1. mul-1-neg96.9%

        \[\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 \]
      2. unsub-neg96.9%

        \[\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 \]
      3. *-commutative96.9%

        \[\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 \]
      4. unpow296.9%

        \[\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 \]
      5. associate-*l*96.9%

        \[\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. Simplified96.9%

      \[\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. Taylor expanded in y around inf 77.5%

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

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

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

        \[\leadsto \left(-0.5 \cdot \left(\color{blue}{\left(z + \left(-1\right)\right)} \cdot {y}^{2}\right) + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      4. metadata-eval77.5%

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

        \[\leadsto \left(-0.5 \cdot \color{blue}{\left({y}^{2} \cdot \left(z + -1\right)\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      6. associate-*r*77.5%

        \[\leadsto \left(\color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      7. sub-neg77.5%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \left(-\color{blue}{\left(z + \left(-1\right)\right)} \cdot y\right)\right) - t \]
      8. metadata-eval77.5%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \left(-\left(z + \color{blue}{-1}\right) \cdot y\right)\right) - t \]
      9. distribute-rgt-neg-out77.5%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(z + -1\right) \cdot \left(-y\right)}\right) - t \]
      10. *-commutative77.5%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(-y\right) \cdot \left(z + -1\right)}\right) - t \]
      11. distribute-rgt-in77.5%

        \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(-0.5 \cdot {y}^{2} + \left(-y\right)\right)} - t \]
      12. *-commutative77.5%

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

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 + \left(-y\right)\right) - t \]
      14. sub-neg77.5%

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

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

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

Alternative 12: 55.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{-21}:\\ \;\;\;\;z \cdot \left(-y\right) - t\\ \mathbf{elif}\;t \leq 30.5:\\ \;\;\;\;-\log y\\ \mathbf{else}:\\ \;\;\;\;\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -5.8e-21)
   (- (* z (- y)) t)
   (if (<= t 30.5) (- (log y)) (- (* (+ z -1.0) (- (* (* y y) -0.5) y)) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.8e-21) {
		tmp = (z * -y) - t;
	} else if (t <= 30.5) {
		tmp = -log(y);
	} else {
		tmp = ((z + -1.0) * (((y * y) * -0.5) - 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 (t <= (-5.8d-21)) then
        tmp = (z * -y) - t
    else if (t <= 30.5d0) then
        tmp = -log(y)
    else
        tmp = ((z + (-1.0d0)) * (((y * y) * (-0.5d0)) - y)) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.8e-21) {
		tmp = (z * -y) - t;
	} else if (t <= 30.5) {
		tmp = -Math.log(y);
	} else {
		tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -5.8e-21:
		tmp = (z * -y) - t
	elif t <= 30.5:
		tmp = -math.log(y)
	else:
		tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -5.8e-21)
		tmp = Float64(Float64(z * Float64(-y)) - t);
	elseif (t <= 30.5)
		tmp = Float64(-log(y));
	else
		tmp = Float64(Float64(Float64(z + -1.0) * Float64(Float64(Float64(y * y) * -0.5) - y)) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -5.8e-21)
		tmp = (z * -y) - t;
	elseif (t <= 30.5)
		tmp = -log(y);
	else
		tmp = ((z + -1.0) * (((y * y) * -0.5) - y)) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.8e-21], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 30.5], (-N[Log[y], $MachinePrecision]), N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-21}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\

\mathbf{elif}\;t \leq 30.5:\\
\;\;\;\;-\log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.8e-21

    1. Initial program 97.2%

      \[\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 \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(-1 \cdot y\right)}\right) - t \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} - t \]
    6. Step-by-step derivation
      1. associate-*r*65.1%

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

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

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

    if -5.8e-21 < t < 30.5

    1. Initial program 83.7%

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

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

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

        \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    5. Simplified37.3%

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

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

    if 30.5 < t

    1. Initial program 94.3%

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

      \[\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 \]
    3. Step-by-step derivation
      1. mul-1-neg99.9%

        \[\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 \]
      2. unsub-neg99.9%

        \[\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 \]
      3. *-commutative99.9%

        \[\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 \]
      4. unpow299.9%

        \[\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 \]
      5. associate-*l*99.9%

        \[\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.9%

      \[\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. Taylor expanded in y around inf 80.1%

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

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

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

        \[\leadsto \left(-0.5 \cdot \left(\color{blue}{\left(z + \left(-1\right)\right)} \cdot {y}^{2}\right) + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      4. metadata-eval80.1%

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

        \[\leadsto \left(-0.5 \cdot \color{blue}{\left({y}^{2} \cdot \left(z + -1\right)\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      6. associate-*r*80.1%

        \[\leadsto \left(\color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
      7. sub-neg80.1%

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

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \left(-\left(z + \color{blue}{-1}\right) \cdot y\right)\right) - t \]
      9. distribute-rgt-neg-out80.1%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(z + -1\right) \cdot \left(-y\right)}\right) - t \]
      10. *-commutative80.1%

        \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(-y\right) \cdot \left(z + -1\right)}\right) - t \]
      11. distribute-rgt-in80.1%

        \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(-0.5 \cdot {y}^{2} + \left(-y\right)\right)} - t \]
      12. *-commutative80.1%

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} + \left(-y\right)\right) - t \]
      13. unpow280.1%

        \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 + \left(-y\right)\right) - t \]
      14. sub-neg80.1%

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\left(\left(y \cdot y\right) \cdot -0.5 - y\right)} - t \]
    7. Simplified80.1%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)} - t \]
  3. Recombined 3 regimes into one program.
  4. Final simplification55.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{-21}:\\ \;\;\;\;z \cdot \left(-y\right) - t\\ \mathbf{elif}\;t \leq 30.5:\\ \;\;\;\;-\log y\\ \mathbf{else}:\\ \;\;\;\;\left(z + -1\right) \cdot \left(\left(y \cdot y\right) \cdot -0.5 - y\right) - t\\ \end{array} \]

Alternative 13: 45.7% accurate, 16.5× speedup?

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

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

    \[\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.6%

    \[\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 \]
  3. Step-by-step derivation
    1. mul-1-neg99.6%

      \[\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 \]
    2. unsub-neg99.6%

      \[\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 \]
    3. *-commutative99.6%

      \[\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 \]
    4. unpow299.6%

      \[\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 \]
    5. associate-*l*99.6%

      \[\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.6%

    \[\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. Taylor expanded in y around inf 48.6%

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

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

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

      \[\leadsto \left(-0.5 \cdot \left(\color{blue}{\left(z + \left(-1\right)\right)} \cdot {y}^{2}\right) + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
    4. metadata-eval48.6%

      \[\leadsto \left(-0.5 \cdot \left(\left(z + \color{blue}{-1}\right) \cdot {y}^{2}\right) + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
    5. *-commutative48.6%

      \[\leadsto \left(-0.5 \cdot \color{blue}{\left({y}^{2} \cdot \left(z + -1\right)\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
    6. associate-*r*48.6%

      \[\leadsto \left(\color{blue}{\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right)} + \left(-\left(z - 1\right) \cdot y\right)\right) - t \]
    7. sub-neg48.6%

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

      \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \left(-\left(z + \color{blue}{-1}\right) \cdot y\right)\right) - t \]
    9. distribute-rgt-neg-out48.6%

      \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(z + -1\right) \cdot \left(-y\right)}\right) - t \]
    10. *-commutative48.6%

      \[\leadsto \left(\left(-0.5 \cdot {y}^{2}\right) \cdot \left(z + -1\right) + \color{blue}{\left(-y\right) \cdot \left(z + -1\right)}\right) - t \]
    11. distribute-rgt-in48.6%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(-0.5 \cdot {y}^{2} + \left(-y\right)\right)} - t \]
    12. *-commutative48.6%

      \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{{y}^{2} \cdot -0.5} + \left(-y\right)\right) - t \]
    13. unpow248.6%

      \[\leadsto \left(z + -1\right) \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot -0.5 + \left(-y\right)\right) - t \]
    14. sub-neg48.6%

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

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)} - t \]
  8. Final simplification48.6%

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

Alternative 14: 45.5% accurate, 19.5× speedup?

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

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

    \[\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.6%

    \[\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 \]
  3. Step-by-step derivation
    1. mul-1-neg99.6%

      \[\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 \]
    2. unsub-neg99.6%

      \[\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 \]
    3. *-commutative99.6%

      \[\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 \]
    4. unpow299.6%

      \[\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 \]
    5. associate-*l*99.6%

      \[\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.6%

    \[\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. Taylor expanded in z around inf 48.5%

    \[\leadsto \color{blue}{\left(-0.5 \cdot {y}^{2} - y\right) \cdot z} - t \]
  6. Step-by-step derivation
    1. *-commutative48.5%

      \[\leadsto \color{blue}{z \cdot \left(-0.5 \cdot {y}^{2} - y\right)} - t \]
    2. unpow248.5%

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

    \[\leadsto \color{blue}{z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)} - t \]
  8. Final simplification48.5%

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

Alternative 15: 42.3% accurate, 26.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0006:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 9000:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -0.0006) (- t) (if (<= t 9000.0) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -0.0006) {
		tmp = -t;
	} else if (t <= 9000.0) {
		tmp = z * -y;
	} else {
		tmp = -t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-0.0006d0)) then
        tmp = -t
    else if (t <= 9000.0d0) then
        tmp = z * -y
    else
        tmp = -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -0.0006) {
		tmp = -t;
	} else if (t <= 9000.0) {
		tmp = z * -y;
	} else {
		tmp = -t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -0.0006:
		tmp = -t
	elif t <= 9000.0:
		tmp = z * -y
	else:
		tmp = -t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -0.0006)
		tmp = Float64(-t);
	elseif (t <= 9000.0)
		tmp = Float64(z * Float64(-y));
	else
		tmp = Float64(-t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -0.0006)
		tmp = -t;
	elseif (t <= 9000.0)
		tmp = z * -y;
	else
		tmp = -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -0.0006], (-t), If[LessEqual[t, 9000.0], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0006:\\
\;\;\;\;-t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.99999999999999947e-4 or 9e3 < t

    1. Initial program 97.1%

      \[\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.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.9%

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

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

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t} \]
    6. Simplified70.8%

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

    if -5.99999999999999947e-4 < t < 9e3

    1. Initial program 82.9%

      \[\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 98.3%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} - t \]
    6. Step-by-step derivation
      1. associate-*r*20.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-y\right)} \cdot z \]
      3. *-commutative20.5%

        \[\leadsto \color{blue}{z \cdot \left(-y\right)} \]
    10. Simplified20.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.0006:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 9000:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]

Alternative 16: 45.4% accurate, 30.7× speedup?

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

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

    \[\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.1%

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

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

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

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

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

      \[\leadsto -1 \cdot \left(\left(z + \color{blue}{-1}\right) \cdot y\right) - t \]
    3. *-commutative48.2%

      \[\leadsto -1 \cdot \color{blue}{\left(y \cdot \left(z + -1\right)\right)} - t \]
    4. distribute-lft-in48.2%

      \[\leadsto -1 \cdot \color{blue}{\left(y \cdot z + y \cdot -1\right)} - t \]
    5. *-commutative48.2%

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

      \[\leadsto -1 \cdot \left(y \cdot z + \color{blue}{\left(-y\right)}\right) - t \]
    7. distribute-lft-in48.2%

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

      \[\leadsto \left(-1 \cdot \left(y \cdot z\right) + \color{blue}{\left(-\left(-y\right)\right)}\right) - t \]
    9. remove-double-neg48.2%

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

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

      \[\leadsto \left(y + \color{blue}{\left(-y \cdot z\right)}\right) - t \]
    12. unsub-neg48.2%

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

    \[\leadsto \color{blue}{\left(y - y \cdot z\right)} - t \]
  8. Final simplification48.2%

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

Alternative 17: 45.2% 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 90.2%

    \[\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.1%

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

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

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

    \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} - t \]
  6. Step-by-step derivation
    1. associate-*r*48.1%

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

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

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

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

Alternative 18: 35.0% 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 90.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+90.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. +-commutative90.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.9%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.9%

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

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

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-t} \]
  6. Simplified38.0%

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

    \[\leadsto -t \]

Reproduce

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