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

Percentage Accurate: 89.1% → 99.8%
Time: 36.2s
Alternatives: 15
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 89.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.4% accurate, 1.8× speedup?

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

\\
\left(\left(y \cdot \left(y \cdot -0.5\right) - y\right) \cdot \left(-1 + z\right) + \left(x + -1\right) \cdot \log y\right) - t
\end{array}
Derivation
  1. Initial program 89.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.7%

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

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

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

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

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

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

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

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

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

Alternative 4: 87.7% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 89.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. +-commutative89.0%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 89.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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 95.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \left(x + -1\right) \cdot \log y\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{-7} \lor \neg \left(t \leq 1.55 \cdot 10^{-38}\right):\\
\;\;\;\;t_1 - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.59999999999999999e-7 or 1.54999999999999991e-38 < t

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

    if -2.59999999999999999e-7 < t < 1.54999999999999991e-38

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.0% accurate, 1.9× speedup?

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

\\
\left(\left(x + -1\right) \cdot \log y - y \cdot \left(-1 + z\right)\right) - t
\end{array}
Derivation
  1. Initial program 89.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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 86.8% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 94.4%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. 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(-1 \cdot y + -0.5 \cdot {y}^{2}\right)}\right) - t \]
    3. Step-by-step derivation
      1. +-commutative99.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 \]
      2. 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 \]
      3. 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 \]
      4. *-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 \]
      5. 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 \]
      6. 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 x around inf 94.0%

      \[\leadsto \color{blue}{x \cdot \log y} - t \]
    6. Step-by-step derivation
      1. *-commutative94.0%

        \[\leadsto \color{blue}{\log y \cdot x} - t \]
    7. Simplified94.0%

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

    if -1 < x < 1

    1. Initial program 84.5%

      \[\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. add-log-exp84.0%

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

        \[\leadsto \log \left(e^{\color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) + \left(x - 1\right) \cdot \log y}}\right) - t \]
      3. exp-sum84.0%

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

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

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

        \[\leadsto \log \left(e^{\color{blue}{\log \left(1 - y\right) \cdot \left(z + -1\right)}} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      7. exp-to-pow84.0%

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

        \[\leadsto \log \left({\color{blue}{\left(1 + \left(-y\right)\right)}}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      9. add-sqr-sqrt0.0%

        \[\leadsto \log \left({\left(1 + \color{blue}{\sqrt{-y} \cdot \sqrt{-y}}\right)}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      10. sqrt-unprod83.5%

        \[\leadsto \log \left({\left(1 + \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      11. sqr-neg83.5%

        \[\leadsto \log \left({\left(1 + \sqrt{\color{blue}{y \cdot y}}\right)}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      12. sqrt-unprod83.5%

        \[\leadsto \log \left({\left(1 + \color{blue}{\sqrt{y} \cdot \sqrt{y}}\right)}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      13. add-sqr-sqrt83.5%

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

        \[\leadsto \log \left({\left(1 + y\right)}^{\left(z + -1\right)} \cdot e^{\color{blue}{\log y \cdot \left(x - 1\right)}}\right) - t \]
      15. exp-to-pow83.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\log \left({y}^{-1}\right)} - t \]
    6. Step-by-step derivation
      1. log-pow82.1%

        \[\leadsto \color{blue}{-1 \cdot \log y} - t \]
      2. mul-1-neg82.1%

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

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

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

Alternative 8: 87.9% accurate, 2.0× speedup?

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

\\
\left(y + \left(x + -1\right) \cdot \log y\right) - t
\end{array}
Derivation
  1. Initial program 89.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.7%

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

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

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

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

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

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

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

    \[\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 0 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 59.4% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;z \leq 1.28 \cdot 10^{+126}:\\
\;\;\;\;\left(-\log y\right) - t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.20000000000000006e223

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

      \[\leadsto \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \color{blue}{\left(-1 \cdot y + -0.5 \cdot {y}^{2}\right)}\right) - t \]
    3. Step-by-step derivation
      1. +-commutative99.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 \]
      2. 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 \]
      3. 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 \]
      4. *-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 \]
      5. 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 \]
      6. 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 z around inf 66.5%

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

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

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

    if -1.20000000000000006e223 < z < 1.27999999999999993e126

    1. Initial program 97.3%

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

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

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

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

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

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

        \[\leadsto \log \left(e^{\color{blue}{\log \left(1 - y\right) \cdot \left(z + -1\right)}} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      7. exp-to-pow55.5%

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

        \[\leadsto \log \left({\color{blue}{\left(1 + \left(-y\right)\right)}}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      9. add-sqr-sqrt0.0%

        \[\leadsto \log \left({\left(1 + \color{blue}{\sqrt{-y} \cdot \sqrt{-y}}\right)}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      10. sqrt-unprod55.1%

        \[\leadsto \log \left({\left(1 + \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      11. sqr-neg55.1%

        \[\leadsto \log \left({\left(1 + \sqrt{\color{blue}{y \cdot y}}\right)}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      12. sqrt-unprod55.1%

        \[\leadsto \log \left({\left(1 + \color{blue}{\sqrt{y} \cdot \sqrt{y}}\right)}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      13. add-sqr-sqrt55.1%

        \[\leadsto \log \left({\left(1 + \color{blue}{y}\right)}^{\left(z + -1\right)} \cdot e^{\left(x - 1\right) \cdot \log y}\right) - t \]
      14. *-commutative55.1%

        \[\leadsto \log \left({\left(1 + y\right)}^{\left(z + -1\right)} \cdot e^{\color{blue}{\log y \cdot \left(x - 1\right)}}\right) - t \]
      15. exp-to-pow55.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\log \left({y}^{-1}\right)} - t \]
    6. Step-by-step derivation
      1. log-pow64.1%

        \[\leadsto \color{blue}{-1 \cdot \log y} - t \]
      2. mul-1-neg64.1%

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

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

    if 1.27999999999999993e126 < z

    1. Initial program 74.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 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+223}:\\ \;\;\;\;z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{+126}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) - y \cdot z\\ \end{array} \]

Alternative 10: 87.7% accurate, 2.0× speedup?

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

\\
\left(x + -1\right) \cdot \log y - t
\end{array}
Derivation
  1. Initial program 89.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. +-commutative89.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 45.8% accurate, 16.5× speedup?

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

\\
\left(-1 + z\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t
\end{array}
Derivation
  1. Initial program 89.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.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 \]
    5. distribute-rgt-in46.4%

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

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

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

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

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

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

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

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

Alternative 12: 45.6% accurate, 19.5× speedup?

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

\\
z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t
\end{array}
Derivation
  1. Initial program 89.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.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 45.5% accurate, 30.7× speedup?

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

\\
y \cdot \left(1 - z\right) - t
\end{array}
Derivation
  1. Initial program 89.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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 45.3% accurate, 35.8× speedup?

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

\\
\left(-t\right) - y \cdot z
\end{array}
Derivation
  1. Initial program 89.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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 34.7% 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 89.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. +-commutative89.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -t \]

Reproduce

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