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

Percentage Accurate: 89.4% → 99.8%
Time: 20.9s
Alternatives: 17
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 17 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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.4% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 3: 99.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.6% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 93.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) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    3. 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 \]
    4. 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. mul-1-neg99.7%

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

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

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

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

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

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

        \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z + -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 \]
    5. Simplified99.7%

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

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

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

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

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

    if -4.9999999999999996e22 < (-.f64 x 1) < -0.99999959999999999

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 97.7% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 93.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) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    3. 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 \]
    4. 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. mul-1-neg99.7%

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

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

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

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

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

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

        \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z + -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 \]
    5. Simplified99.7%

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

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

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

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

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

    if -4.9999999999999996e22 < (-.f64 x 1) < -0.99999959999999999

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.1% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 86.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 98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 74.8% accurate, 1.9× speedup?

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

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

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

\mathbf{elif}\;x \leq -1.16 \cdot 10^{+20} \lor \neg \left(x \leq 9.5 \cdot 10^{+18}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.0500000000000001e139 or -2.49999999999999993e58 < x < -1.16e20 or 9.5e18 < x

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

      \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    3. 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 \]
    4. 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. mul-1-neg99.7%

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

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

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

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

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

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

        \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z + -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 \]
    5. Simplified99.7%

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

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    8. Step-by-step derivation
      1. *-commutative79.7%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    9. Simplified79.7%

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

    if -2.0500000000000001e139 < x < -2.49999999999999993e58

    1. Initial program 88.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 \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    3. Taylor expanded in y around 0 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.16e20 < x < 9.5e18

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\left(\log y + \color{blue}{\left(-y\right)}\right)\right) - t \]
    11. Simplified83.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.05 \cdot 10^{+139}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{+58}:\\ \;\;\;\;y \cdot \left(1 - z\right) - t\\ \mathbf{elif}\;x \leq -1.16 \cdot 10^{+20} \lor \neg \left(x \leq 9.5 \cdot 10^{+18}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(y - \log y\right) - t\\ \end{array} \]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 74.7% accurate, 1.9× speedup?

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

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

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

\mathbf{elif}\;x \leq -2.7 \cdot 10^{+20} \lor \neg \left(x \leq 6.2 \cdot 10^{+19}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.7000000000000001e139 or -1.79999999999999999e63 < x < -2.7e20 or 6.2e19 < x

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

      \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    3. 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 \]
    4. 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. mul-1-neg99.7%

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

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

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

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

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

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

        \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z + -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 \]
    5. Simplified99.7%

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

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    8. Step-by-step derivation
      1. *-commutative79.7%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    9. Simplified79.7%

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

    if -1.7000000000000001e139 < x < -1.79999999999999999e63

    1. Initial program 88.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 \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    3. Taylor expanded in y around 0 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7e20 < x < 6.2e19

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \log y} - t \]
    10. Step-by-step derivation
      1. mul-1-neg83.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.7 \cdot 10^{+139}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{+63}:\\ \;\;\;\;y \cdot \left(1 - z\right) - t\\ \mathbf{elif}\;x \leq -2.7 \cdot 10^{+20} \lor \neg \left(x \leq 6.2 \cdot 10^{+19}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(-\log y\right) - t\\ \end{array} \]

Alternative 10: 65.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+139} \lor \neg \left(x \leq -2.3 \cdot 10^{+58} \lor \neg \left(x \leq -1.95 \cdot 10^{+22}\right) \land x \leq 3.5 \cdot 10^{+47}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.7000000000000001e139 or -2.30000000000000002e58 < x < -1.9500000000000001e22 or 3.50000000000000015e47 < x

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

      \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    3. 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 \]
    4. 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. mul-1-neg99.7%

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

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

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

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

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

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

        \[\leadsto \left(\log y \cdot \color{blue}{\left(-1 + x\right)} - y \cdot \left(z + -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 \]
    5. Simplified99.7%

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

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    8. Step-by-step derivation
      1. *-commutative83.5%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    9. Simplified83.5%

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

    if -1.7000000000000001e139 < x < -2.30000000000000002e58 or -1.9500000000000001e22 < x < 3.50000000000000015e47

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

      \[\leadsto \color{blue}{\left(-1 \cdot \left(y \cdot \left(z - 1\right)\right) + \left(-0.5 \cdot \left({y}^{2} \cdot \left(z - 1\right)\right) + \log y \cdot \left(x - 1\right)\right)\right)} - t \]
    3. 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 \]
    4. 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. mul-1-neg99.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.7 \cdot 10^{+139} \lor \neg \left(x \leq -2.3 \cdot 10^{+58} \lor \neg \left(x \leq -1.95 \cdot 10^{+22}\right) \land x \leq 3.5 \cdot 10^{+47}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - z\right) - t\\ \end{array} \]

Alternative 11: 98.9% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 88.9% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

    if 9.5000000000000002e231 < z

    1. Initial program 45.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 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 43.8% accurate, 23.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-44} \lor \neg \left(t \leq 1.1 \cdot 10^{+20}\right):\\
\;\;\;\;-t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.00000000000000039e-44 or 1.1e20 < t

    1. Initial program 95.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+95.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. fma-def95.1%

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000039e-44 < t < 1.1e20

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-44} \lor \neg \left(t \leq 1.1 \cdot 10^{+20}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - z\right)\\ \end{array} \]

Alternative 14: 43.5% accurate, 26.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-44} \lor \neg \left(t \leq 1.1 \cdot 10^{+20}\right):\\
\;\;\;\;-t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.00000000000000039e-44 or 1.1e20 < t

    1. Initial program 95.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+95.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. fma-def95.1%

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000039e-44 < t < 1.1e20

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-y\right)} \cdot z \]
    9. Simplified19.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-44} \lor \neg \left(t \leq 1.1 \cdot 10^{+20}\right):\\ \;\;\;\;-t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \end{array} \]

Alternative 15: 47.3% 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.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 47.1% 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 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 36.8% 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.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -t \]

Reproduce

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