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

Percentage Accurate: 89.0% → 99.8%
Time: 17.2s
Alternatives: 17
Speedup: 2.0×

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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.5% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \left(z + -1\right)\\
\left(\left(x + -1\right) \cdot \log y + \left(-0.5 \cdot \left(y \cdot t_1\right) - t_1\right)\right) - t
\end{array}
\end{array}
Derivation
  1. Initial program 91.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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.2% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 x 1) < -5e4 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. +-commutative93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + -1\right) \cdot \log y - \left(\left(-\color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)}\right) + t\right) \]
      10. distribute-rgt-neg-in89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.5% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

Alternative 6: 95.9% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 99.2% 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 91.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. +-commutative91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 87.2% accurate, 2.0× speedup?

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

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

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


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

    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. Taylor expanded in y around 0 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x < 2.69999999999999999e-16

    1. Initial program 89.3%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{-1 \cdot \log y - t}\right) \]
    5. Step-by-step derivation
      1. mul-1-neg99.2%

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

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

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

        \[\leadsto \color{blue}{\left(-\log \left(1 - y\right)\right)} - \left(t + \log y\right) \]
      2. sub-neg87.6%

        \[\leadsto \left(-\log \color{blue}{\left(1 + \left(-y\right)\right)}\right) - \left(t + \log y\right) \]
      3. neg-mul-187.6%

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

        \[\leadsto \left(-\color{blue}{\mathsf{log1p}\left(-1 \cdot y\right)}\right) - \left(t + \log y\right) \]
      5. neg-mul-187.6%

        \[\leadsto \left(-\mathsf{log1p}\left(\color{blue}{-y}\right)\right) - \left(t + \log y\right) \]
      6. +-commutative87.6%

        \[\leadsto \left(-\mathsf{log1p}\left(-y\right)\right) - \color{blue}{\left(\log y + t\right)} \]
    9. Simplified87.6%

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-y\right)\right) - \left(\log y + t\right)} \]
    10. Taylor expanded in y around 0 87.2%

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

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

        \[\leadsto y + \left(-\color{blue}{\left(\log y + t\right)}\right) \]
      3. unsub-neg87.2%

        \[\leadsto \color{blue}{y - \left(\log y + t\right)} \]
    12. Simplified87.2%

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

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

Alternative 9: 61.4% accurate, 2.0× speedup?

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

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

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

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


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

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999998e119 < z < 1.24999999999999994e123

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{-1 \cdot \log y - t}\right) \]
    5. Step-by-step derivation
      1. mul-1-neg66.1%

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

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

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

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

        \[\leadsto \left(-\log \color{blue}{\left(1 + \left(-y\right)\right)}\right) - \left(t + \log y\right) \]
      3. neg-mul-166.1%

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

        \[\leadsto \left(-\color{blue}{\mathsf{log1p}\left(-1 \cdot y\right)}\right) - \left(t + \log y\right) \]
      5. neg-mul-166.1%

        \[\leadsto \left(-\mathsf{log1p}\left(\color{blue}{-y}\right)\right) - \left(t + \log y\right) \]
      6. +-commutative66.1%

        \[\leadsto \left(-\mathsf{log1p}\left(-y\right)\right) - \color{blue}{\left(\log y + t\right)} \]
    9. Simplified66.1%

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-y\right)\right) - \left(\log y + t\right)} \]
    10. Taylor expanded in y around 0 65.8%

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

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

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

        \[\leadsto \color{blue}{y - \left(\log y + t\right)} \]
    12. Simplified65.8%

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

    if 1.24999999999999994e123 < z

    1. Initial program 56.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+119}:\\ \;\;\;\;z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+123}:\\ \;\;\;\;y - \left(\log y + t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-y\right) - t\\ \end{array} \]

Alternative 10: 89.2% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, z, -t\right)\\


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

    1. Initial program 93.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. +-commutative93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.70000000000000002e229 < z

    1. Initial program 48.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-y, z, -t\right)} \]
    9. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-y, z, -t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.7%

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

Alternative 11: 61.3% accurate, 2.0× speedup?

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

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

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

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


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

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1000000000000001e119 < z < 2.1500000000000001e126

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{-1 \cdot \log y - t}\right) \]
    5. Step-by-step derivation
      1. mul-1-neg66.1%

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

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

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

        \[\leadsto \color{blue}{-\left(t + \log y\right)} \]
      2. distribute-neg-in65.3%

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

        \[\leadsto \color{blue}{\left(-\log y\right) + \left(-t\right)} \]
      4. sub-neg65.3%

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

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

    if 2.1500000000000001e126 < z

    1. Initial program 56.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 46.9% accurate, 16.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 46.9% accurate, 16.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \left(y \cdot \left(y \cdot -0.5\right) + \left(-y\right)\right)} - t \]
    15. fma-udef42.2%

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{fma}\left(y, y \cdot -0.5, -y\right)} - t \]
    16. *-commutative42.2%

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

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

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

Alternative 14: 46.7% accurate, 19.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 43.3% accurate, 26.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-13}:\\
\;\;\;\;-t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.70000000000000011e-13 or 780 < t

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.70000000000000011e-13 < t < 780

    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. Step-by-step derivation
      1. +-commutative87.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{-13}:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 780:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]

Alternative 16: 46.5% 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 91.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. +-commutative91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 35.9% 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 91.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. +-commutative91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -t \]

Reproduce

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